Skip to contentSkip to conversation

test: Add unified test for mesh node example app

PATCH Superseded Inga Stotland 1 participant 1 message Mar 8, 2019 Bluetooth drivers

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 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             |  10 +-
 test/example-onoff-client | 288 ----------------
 test/example-onoff-server | 365 --------------------
 test/test-mesh            | 703 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 711 insertions(+), 655 deletions(-)
 delete mode 100644 test/example-onoff-client
 delete mode 100644 test/example-onoff-server
 create mode 100755 test/test-mesh
test/agent.py +8 -2
index 22c92f952..bd78b6000 100755
@@ -3,7 +3,12 @@
 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'])
+except ImportError:
+  set_green = lambda x: x
 
 AGENT_IFACE = 'org.bluez.mesh.ProvisionAgent1'
 AGENT_PATH = "/mesh/test/agent"
@@ -37,4 +42,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="), 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 +703 -0

703 lines not on this page · raw message

Signature · 1 line
2.17.2