summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHenri Bragge <henri.bragge@ixonos.com>2011-04-05 17:00:35 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2011-04-11 12:02:43 +0200
commit7cea7b2f67282b3df8aedc5e5ed0d91e61c271a6 (patch)
tree2e1b1a1ed080086e3702a017e4487b79abe0fbb4 /test
parenta3bc04c995176b9c3e04b4f317389bd67ee278ca (diff)
downloadconnman-7cea7b2f67282b3df8aedc5e5ed0d91e61c271a6.tar.gz
connman-7cea7b2f67282b3df8aedc5e5ed0d91e61c271a6.tar.bz2
connman-7cea7b2f67282b3df8aedc5e5ed0d91e61c271a6.zip
test: Add script to test manager.ProvisionService method
Diffstat (limited to 'test')
-rwxr-xr-xtest/provision-service28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/provision-service b/test/provision-service
new file mode 100755
index 00000000..a44b8622
--- /dev/null
+++ b/test/provision-service
@@ -0,0 +1,28 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+if (len(sys.argv) < 3):
+ print "Usage: %s <ssid> [key=value] ..." % (sys.argv[0])
+ sys.exit(1)
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object("net.connman", "/"),
+ "net.connman.Manager")
+
+config = unicode("", "utf-8")
+config += "[service_%s]\n" %(sys.argv[1])
+
+for arg in sys.argv:
+ keyval = arg.split("=", 1)
+ if (len(keyval) >= 2):
+ config += arg
+ config += '\n'
+
+config = config.rstrip()
+
+manager.ProvisionService(config);
+
+print "Sent configuration:\n%s" %(config)