---
 Makefile.am            |    3 ++-
 test/provision-service |   28 ++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletions(-)
 create mode 100755 test/provision-service

diff --git a/Makefile.am b/Makefile.am
index 144fcc5..87b4299 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -183,7 +183,8 @@ test_scripts = test/get-state test/list-profiles 
test/list-services \
                test/test-counter test/set-ipv4-method test/set-ipv6-method \
                test/set-nameservers test/set-domains test/find-service \
                test/get-services test/get-proxy-autoconfig test/set-proxy \
-               test/enable-tethering test/disable-tethering test/backtrace
+               test/enable-tethering test/disable-tethering test/backtrace \
+               test/provision-service
 
 if TEST
 testdir = $(pkglibdir)/test
diff --git a/test/provision-service b/test/provision-service
new file mode 100755
index 0000000..a44b862
--- /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)
-- 
1.7.0.4


_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to