diff options
author | Mohamed Abbas <mohamed.abbas@intel.com> | 2009-12-08 11:53:12 -0800 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-12-09 00:41:13 +0100 |
commit | 5357ba7ffc7236b1d38bf375eff84ad980323981 (patch) | |
tree | c9fbbf03e1f9ed5637e75a7574433db19931e3af | |
parent | 27b121c316da5974d3f7f6beea3f414729ebb6d5 (diff) | |
download | connman-5357ba7ffc7236b1d38bf375eff84ad980323981.tar.gz connman-5357ba7ffc7236b1d38bf375eff84ad980323981.tar.bz2 connman-5357ba7ffc7236b1d38bf375eff84ad980323981.zip |
Add new test scripts to support VPN connections
-rw-r--r-- | Makefile.am | 3 | ||||
-rwxr-xr-x | test/connect-vpn | 29 | ||||
-rwxr-xr-x | test/disconnect-vpn | 22 | ||||
-rwxr-xr-x | test/list-providers | 27 |
4 files changed, 80 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index 59de0021..c0236b47 100644 --- a/Makefile.am +++ b/Makefile.am @@ -128,7 +128,8 @@ test_scripts = test/get-state test/list-profiles test/list-services \ test/set-passphrase test/set-address test/test-profile \ test/simple-agent test/show-introspection test/test-compat \ test/test-manager test/test-connman test/monitor-connman \ - test/debug-connman + test/debug-connman test/connect-vpn \ + test/disconnect-vpn test/list-providers if TEST testdir = $(pkglibdir)/test diff --git a/test/connect-vpn b/test/connect-vpn new file mode 100755 index 00000000..c9cbd89d --- /dev/null +++ b/test/connect-vpn @@ -0,0 +1,29 @@ +#!/usr/bin/python + +import sys +import dbus + +if (len(sys.argv) < 4): + print "Usage: %s <name> <host> <cookie> [cafile]" % (sys.argv[0]) + sys.exit(1) + +bus = dbus.SystemBus() + +manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"), + "org.moblin.connman.Manager") + +print "Attempting to connect service %s" % (sys.argv[1]) + +if (len(sys.argv) > 4): + path = manager.ConnectProvider(({ "Type": "openconnect", "Name": sys.argv[1], + "OpenConnect.Host": sys.argv[2], + "OpenConnect.Cookie": sys.argv[3], + "OpenConnect.CACert": sys.argv[4], + "VPN.Domain": "intel.com"})) +else: + path = manager.ConnectProvider(({ "Type": "openconnect", "Name": sys.argv[1], + "OpenConnect.Host": sys.argv[2], + "OpenConnect.Cookie": sys.argv[3], + "VPN.Domain": "intel.com"})) + +print "Provider path is %s" %(path) diff --git a/test/disconnect-vpn b/test/disconnect-vpn new file mode 100755 index 00000000..2367f13f --- /dev/null +++ b/test/disconnect-vpn @@ -0,0 +1,22 @@ +#!/usr/bin/python + +import sys +import dbus + +if (len(sys.argv) < 2): + print "Usage: %s <provider name> " % (sys.argv[0]) + sys.exit(1) + +bus = dbus.SystemBus() + +manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"), + "org.moblin.connman.Manager") + +path = "" + sys.argv[1] + +print "remove path is %s" %(path) + +manager.RemoveProvider(sys.argv[1]) + +print "remove path is %s" %(path) + diff --git a/test/list-providers b/test/list-providers new file mode 100755 index 00000000..d808fa03 --- /dev/null +++ b/test/list-providers @@ -0,0 +1,27 @@ +#!/usr/bin/python + +import dbus + +bus = dbus.SystemBus() + +manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"), + "org.moblin.connman.Manager") + +properties = manager.GetProperties() + +for path in properties["Providers"]: + service = dbus.Interface(bus.get_object("org.moblin.connman", path), + "org.moblin.connman.Provider") + + properties = service.GetProperties() + + print "[ %s ]" % (path) + + for key in properties.keys(): + if key in ["Strength"]: + val = int(properties[key]) + else: + val = str(properties[key]) + print " %s = %s" % (key, val) + + print |