test: Add unified test for mesh node example app
PATCH v2 1/1 test: Add unified test for mesh node example app
This adds one script, test-mesh, to replace three test-join, example-onoff-server and example-onoff-client.
This is menu driven test that allows provisioning (join) and/or connecting existing (attach) nodes.
--- test/agent.py | 14 +- test/example-onoff-client | 288 ---------------- test/example-onoff-server | 365 -------------------- test/test-mesh | 706 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 717 insertions(+), 656 deletions(-) delete mode 100644 test/example-onoff-client delete mode 100644 test/example-onoff-server create mode 100755 test/test-mesh
test/agent.py +11 -3
@@ -1,9 +1,16 @@ -#!/usr/bin/python +#!/usr/bin/python3 import sys import dbus import dbus.service -import dbus.mainloop.glib + +try: + from termcolor import colored, cprint + set_green = lambda x: colored(x, 'green', attrs=['bold']) + set_cyan = lambda x: colored(x, 'cyan', attrs=['bold']) +except ImportError: + set_green = lambda x: x + set_cyan = lambda x: x AGENT_IFACE = 'org.bluez.mesh.ProvisionAgent1' AGENT_PATH = "/mesh/test/agent"
@@ -37,4 +44,5 @@ class Agent(dbus.service.Object): @dbus.service.method(AGENT_IFACE, in_signature="su", out_signature="") def DisplayNumeric(self, type, value): - print("DisplayNumeric type=", type, " number=", value) + print(set_cyan('DisplayNumeric ('), type, + set_cyan(') number ='), set_green(value))
test/example-onoff-client deleted +0 -288
288 lines not on this page · raw message
test/example-onoff-server deleted +0 -365
365 lines not on this page · raw message
test/test-mesh new file +706 -0
706 lines not on this page · raw message
Signature · 1 line
2.17.2