summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2010-11-03 15:07:05 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2010-11-03 15:07:05 +0100
commitfe13268d0f225ccbdf2a507cc7ee75db28b443bd (patch)
tree3ca9e7ef3ac16b73f0be770747dc2fc6281db0d8 /test
parent10409fdd1143e43ac2a15777672d2e36655e4bff (diff)
downloadconnman-fe13268d0f225ccbdf2a507cc7ee75db28b443bd.tar.gz
connman-fe13268d0f225ccbdf2a507cc7ee75db28b443bd.tar.bz2
connman-fe13268d0f225ccbdf2a507cc7ee75db28b443bd.zip
connect-vpn: Add OpenVPN support
Diffstat (limited to 'test')
-rwxr-xr-xtest/connect-vpn42
1 files changed, 30 insertions, 12 deletions
diff --git a/test/connect-vpn b/test/connect-vpn
index 22f13709..1575804e 100755
--- a/test/connect-vpn
+++ b/test/connect-vpn
@@ -4,7 +4,11 @@ import sys
import dbus
if (len(sys.argv) < 4):
- print "Usage: %s <name> <host> <cookie> [cafile]" % (sys.argv[0])
+ print "Usage: %s <type> ... " % (sys.argv[0])
+ print " type: openconnect"
+ print " <name> <host> <domain> <cookie> [cafile]"
+ print " type: openvpn"
+ print " <name> <host> <domain> <cafile> <certfile> <keyfile>"
sys.exit(1)
bus = dbus.SystemBus()
@@ -12,18 +16,32 @@ 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])
+print "Attempting to connect service %s" % (sys.argv[3])
-if (len(sys.argv) > 4):
- path = manager.ConnectProvider(({ "Type": "openconnect", "Name": sys.argv[1],
- "Host": sys.argv[2],
- "OpenConnect.Cookie": sys.argv[3],
- "OpenConnect.CACert": sys.argv[4],
- "VPN.Domain": "intel.com"}))
+if sys.argv[1] == "openconnect":
+ if (len(sys.argv) > 5):
+ path = manager.ConnectProvider(({ "Type": "openconnect",
+ "Name": sys.argv[2],
+ "Host": sys.argv[3],
+ "VPN.Domain": sys.argv[4],
+ "OpenConnect.Cookie": sys.argv[5],
+ "OpenConnect.CACert": sys.argv[6]}))
+ else:
+ path = manager.ConnectProvider(({ "Type": "openconnect",
+ "Name": sys.argv[2],
+ "Host": sys.argv[3],
+ "VPN.Domain": sys.argv[4],
+ "OpenConnect.Cookie": sys.argv[5]}))
+elif sys.argv[1] == "openvpn":
+ path = manager.ConnectProvider(({ "Type": "openvpn",
+ "Name": sys.argv[2],
+ "Host": sys.argv[3],
+ "VPN.Domain": sys.argv[4],
+ "OpenVPN.CACert": sys.argv[5],
+ "OpenVPN.Cert": sys.argv[6],
+ "OpenVPN.Key": sys.argv[7]}))
else:
- path = manager.ConnectProvider(({ "Type": "openconnect", "Name": sys.argv[1],
- "Host": sys.argv[2],
- "OpenConnect.Cookie": sys.argv[3],
- "VPN.Domain": "intel.com"}))
+ print "Unknown VPN type"
+ sys.exit(1)
print "VPN service path is %s" %(path)