summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-10-07 14:36:57 +0200
committerMarcel Holtmann <marcel@holtmann.org>2008-10-07 14:36:57 +0200
commit6ca9fc9115f323d7358b146096994c7f2ba344b5 (patch)
tree51ac89b94c28e4943e7bd9480622abb446bbd429 /test
parent371e8bd67cbeb37695f5b69d964a11bf0cc963b2 (diff)
downloadconnman-6ca9fc9115f323d7358b146096994c7f2ba344b5.tar.gz
connman-6ca9fc9115f323d7358b146096994c7f2ba344b5.tar.bz2
connman-6ca9fc9115f323d7358b146096994c7f2ba344b5.zip
Add scripts for enabling/disabling devices
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am2
-rwxr-xr-xtest/disable-device23
-rwxr-xr-xtest/enable-device23
3 files changed, 47 insertions, 1 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index bcc9e5d2..fe11939d 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,7 +1,7 @@
EXTRA_DIST = list-profiles list-elements monitor-elements monitor-state \
get-state select-network disable-network monitor-networks \
- start-scanning simple-agent \
+ enable-device disable-device start-scanning simple-agent \
show-introspection test-compat test-supplicant
MAINTAINERCLEANFILES = Makefile.in
diff --git a/test/disable-device b/test/disable-device
new file mode 100755
index 00000000..ac55e77a
--- /dev/null
+++ b/test/disable-device
@@ -0,0 +1,23 @@
+#!/usr/bin/python
+
+import dbus
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.moblin.connman', "/"),
+ 'org.moblin.connman.Manager')
+
+elements = manager.ListElements()
+
+for path in elements:
+ element = dbus.Interface(bus.get_object('org.moblin.connman', path),
+ 'org.moblin.connman.Element')
+
+ properties = element.GetProperties()
+
+ if (properties["Type"] != "device"):
+ continue
+
+ print "[ %s ]" % (path)
+
+ element.Disable()
diff --git a/test/enable-device b/test/enable-device
new file mode 100755
index 00000000..55bd1f19
--- /dev/null
+++ b/test/enable-device
@@ -0,0 +1,23 @@
+#!/usr/bin/python
+
+import dbus
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.moblin.connman', "/"),
+ 'org.moblin.connman.Manager')
+
+elements = manager.ListElements()
+
+for path in elements:
+ element = dbus.Interface(bus.get_object('org.moblin.connman', path),
+ 'org.moblin.connman.Element')
+
+ properties = element.GetProperties()
+
+ if (properties["Type"] != "device"):
+ continue
+
+ print "[ %s ]" % (path)
+
+ element.Enable()