From 03556de2e4798fd592f6f35c8845eb72c9ead693 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 9 Dec 2008 18:45:52 +0100 Subject: [PATCH] Add test script for network creation --- test/Makefile.am | 5 +++-- test/create-network | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100755 test/create-network 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] }); -- 2.7.4