summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-01-04 16:36:10 +0100
committerMarcel Holtmann <marcel@holtmann.org>2009-01-04 16:36:10 +0100
commitc16fbb9f4c69084d43cbacba834ba2b4b2cc4b17 (patch)
treec43f069eff20faab93da17a1aa1babe0aa2a3bd1 /test
parentc7799147ac67fe1670bf05e7ccb6beae80c0e300 (diff)
downloadconnman-c16fbb9f4c69084d43cbacba834ba2b4b2cc4b17.tar.gz
connman-c16fbb9f4c69084d43cbacba834ba2b4b2cc4b17.tar.bz2
connman-c16fbb9f4c69084d43cbacba834ba2b4b2cc4b17.zip
Add script to debug element details
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am4
-rwxr-xr-xtest/debug-connman41
2 files changed, 43 insertions, 2 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index 7b4c12ba..11f19fd7 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -3,7 +3,7 @@ EXTRA_DIST = get-state list-profiles list-connections select-connection \
list-devices enable-device disable-device start-scanning \
list-networks select-network disable-network create-network \
set-passphrase set-address set-policy test-manager \
- connect-network disconnect-network \
- simple-agent show-introspection test-compat monitor-connman
+ connect-network disconnect-network simple-agent \
+ show-introspection test-compat monitor-connman debug-connman
MAINTAINERCLEANFILES = Makefile.in
diff --git a/test/debug-connman b/test/debug-connman
new file mode 100755
index 00000000..8d7cbb71
--- /dev/null
+++ b/test/debug-connman
@@ -0,0 +1,41 @@
+#!/usr/bin/python
+
+import gobject
+
+import dbus
+import dbus.mainloop.glib
+
+def element_signal(path, member):
+ if member == "ElementAdded":
+ action = "Add "
+ elif member == "ElementRemoved":
+ action = "Remove"
+ elif member == "ElementUpdated":
+ action = "Update"
+ else:
+ return
+ print "%s [ %s ]" % (action, path)
+
+if __name__ == '__main__':
+ dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+
+ bus = dbus.SystemBus()
+
+ bus.add_signal_receiver(element_signal,
+ bus_name="org.moblin.connman",
+ signal_name = "ElementAdded",
+ path_keyword="path",
+ member_keyword="member")
+ bus.add_signal_receiver(element_signal,
+ bus_name="org.moblin.connman",
+ signal_name = "ElementRemoved",
+ path_keyword="path",
+ member_keyword="member")
+ bus.add_signal_receiver(element_signal,
+ bus_name="org.moblin.connman",
+ signal_name = "ElementUpdated",
+ path_keyword="path",
+ member_keyword="member")
+
+ mainloop = gobject.MainLoop()
+ mainloop.run()