From: Marcel Holtmann Date: Tue, 9 Dec 2008 17:45:52 +0000 (+0100) Subject: Add test script for network creation X-Git-Tag: 0.2~31 X-Git-Url: http://git.maemo.org/git/?p=connman;a=commitdiff_plain;h=03556de2e4798fd592f6f35c8845eb72c9ead693 Add test script for network creation --- diff --git a/test/Makefile.am b/test/Makefile.am index 9bf9ecf..1e38eff 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,7 +1,8 @@ EXTRA_DIST = get-state list-profiles list-connections \ list-devices enable-device disable-device start-scanning \ - list-networks select-network disable-network set-passphrase \ - simple-agent show-introspection test-manager test-compat + list-networks select-network disable-network create-network \ + set-passphrase simple-agent show-introspection \ + test-manager test-compat MAINTAINERCLEANFILES = Makefile.in diff --git a/test/create-network b/test/create-network new file mode 100755 index 0000000..32c8ab3 --- /dev/null +++ b/test/create-network @@ -0,0 +1,26 @@ +#!/usr/bin/python + +import sys +import dbus + +if (len(sys.argv) < 2): + print "Usage: %s " % (sys.argv[0]) + sys.exit(1) + +bus = dbus.SystemBus() + +manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"), + "org.moblin.connman.Manager") + +properties = manager.GetProperties() + +for path in properties["Devices"]: + device = dbus.Interface(bus.get_object("org.moblin.connman", path), + "org.moblin.connman.Device") + + properties = device.GetProperties() + + if (properties["Type"] != "wifi" and properties["Type"] != "wimax"): + continue; + + path = device.CreateNetwork({ "WiFi.SSID": sys.argv[1] });