[PATCH v3 06/42] test: Renamed old VPN scripts

Jukka Rissanen jukka.rissanen at linux.intel.com
Wed Nov 7 03:48:32 PST 2012


Renamed connect-vpn to connect-provider and
disconnect-vpn to remove-provider

In order to not confuse the user, change the name of the old
vpn connect/disconnect script. Now the name of the script
reflects the name of the manager dbus api.
The connect-provider will use the old ConnectProvider
manager dbus interface instead of directly connecting
to connman-vpnd.
---
 Makefile.am           |  2 +-
 test/connect-provider | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++
 test/connect-vpn      | 73 ---------------------------------------------------
 test/disconnect-vpn   | 21 ---------------
 test/remove-provider  | 19 ++++++++++++++
 5 files changed, 93 insertions(+), 95 deletions(-)
 create mode 100755 test/connect-provider
 delete mode 100755 test/connect-vpn
 delete mode 100755 test/disconnect-vpn
 create mode 100755 test/remove-provider

diff --git a/Makefile.am b/Makefile.am
index eddb644..f104616 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -300,7 +300,7 @@ test_scripts = test/get-state test/list-services \
 		test/monitor-services test/test-clock \
 		test/simple-agent test/show-introspection test/test-compat \
 		test/test-manager test/test-connman test/monitor-connman \
-		test/connect-vpn test/disconnect-vpn \
+		test/connect-provider test/remove-provider \
 		test/test-counter test/set-ipv4-method test/set-ipv6-method \
 		test/get-services test/get-proxy-autoconfig test/set-proxy \
 		test/enable-tethering test/disable-tethering test/backtrace \
diff --git a/test/connect-provider b/test/connect-provider
new file mode 100755
index 0000000..15128c8
--- /dev/null
+++ b/test/connect-provider
@@ -0,0 +1,73 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+if (len(sys.argv) < 4):
+	print "Usage: %s <type> ... " % (sys.argv[0])
+	print "  type: openconnect"
+	print "      <name> <host> <domain> <cookie> [servercert]"
+	print "  type: openvpn"
+	print "      <name> <host> <domain> [<cafile> <certfile> <keyfile>]"
+	print "  type: pptp"
+	print "      <name> <host> <domain> <user> <password>"
+	print "  type: l2tp"
+	print "      <name> <host> <domain> <user> <password>"
+	sys.exit(1)
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object("net.connman", "/"),
+					"net.connman.Manager")
+
+print "Attempting to connect service %s" % (sys.argv[3])
+
+if sys.argv[1] == "openconnect":
+	if (len(sys.argv) > 6):
+		path = manager.ConnectProvider(({ "Type": "openconnect",
+					"Name": sys.argv[2],
+					"Host": sys.argv[3],
+					"VPN.Domain": sys.argv[4],
+					"OpenConnect.Cookie": sys.argv[5],
+					"OpenConnect.ServerCert": 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":
+	if (len(sys.argv) < 6):
+		path = manager.ConnectProvider(({ "Type": "openvpn",
+						  "Name": sys.argv[2],
+						  "Host": sys.argv[3],
+						  "VPN.Domain": sys.argv[4] }))
+	else:
+		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]}))
+
+elif sys.argv[1] == "pptp":
+	path = manager.ConnectProvider(({ "Type": "pptp",
+					"Name": sys.argv[2],
+					"Host": sys.argv[3],
+					"VPN.Domain": sys.argv[4],
+					"PPTP.User": sys.argv[5],
+					"PPTP.Password": sys.argv[6]}))
+elif sys.argv[1] == "l2tp":
+	path = manager.ConnectProvider(({ "Type": "l2tp",
+					"Name": sys.argv[2],
+					"Host": sys.argv[3],
+					"VPN.Domain": sys.argv[4],
+					"L2TP.User": sys.argv[5],
+					"L2TP.Password": sys.argv[6]}))
+
+else:
+	print "Unknown VPN type"
+	sys.exit(1)
+
+print "VPN service path is %s" %(path)
diff --git a/test/connect-vpn b/test/connect-vpn
deleted file mode 100755
index 15128c8..0000000
--- a/test/connect-vpn
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/python
-
-import sys
-import dbus
-
-if (len(sys.argv) < 4):
-	print "Usage: %s <type> ... " % (sys.argv[0])
-	print "  type: openconnect"
-	print "      <name> <host> <domain> <cookie> [servercert]"
-	print "  type: openvpn"
-	print "      <name> <host> <domain> [<cafile> <certfile> <keyfile>]"
-	print "  type: pptp"
-	print "      <name> <host> <domain> <user> <password>"
-	print "  type: l2tp"
-	print "      <name> <host> <domain> <user> <password>"
-	sys.exit(1)
-
-bus = dbus.SystemBus()
-
-manager = dbus.Interface(bus.get_object("net.connman", "/"),
-					"net.connman.Manager")
-
-print "Attempting to connect service %s" % (sys.argv[3])
-
-if sys.argv[1] == "openconnect":
-	if (len(sys.argv) > 6):
-		path = manager.ConnectProvider(({ "Type": "openconnect",
-					"Name": sys.argv[2],
-					"Host": sys.argv[3],
-					"VPN.Domain": sys.argv[4],
-					"OpenConnect.Cookie": sys.argv[5],
-					"OpenConnect.ServerCert": 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":
-	if (len(sys.argv) < 6):
-		path = manager.ConnectProvider(({ "Type": "openvpn",
-						  "Name": sys.argv[2],
-						  "Host": sys.argv[3],
-						  "VPN.Domain": sys.argv[4] }))
-	else:
-		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]}))
-
-elif sys.argv[1] == "pptp":
-	path = manager.ConnectProvider(({ "Type": "pptp",
-					"Name": sys.argv[2],
-					"Host": sys.argv[3],
-					"VPN.Domain": sys.argv[4],
-					"PPTP.User": sys.argv[5],
-					"PPTP.Password": sys.argv[6]}))
-elif sys.argv[1] == "l2tp":
-	path = manager.ConnectProvider(({ "Type": "l2tp",
-					"Name": sys.argv[2],
-					"Host": sys.argv[3],
-					"VPN.Domain": sys.argv[4],
-					"L2TP.User": sys.argv[5],
-					"L2TP.Password": sys.argv[6]}))
-
-else:
-	print "Unknown VPN type"
-	sys.exit(1)
-
-print "VPN service path is %s" %(path)
diff --git a/test/disconnect-vpn b/test/disconnect-vpn
deleted file mode 100755
index 9a6620c..0000000
--- a/test/disconnect-vpn
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/python
-
-import sys
-import dbus
-
-if (len(sys.argv) < 2):
-	print "Usage: %s <VPN service path> " % (sys.argv[0])
-	sys.exit(1)
-
-bus = dbus.SystemBus()
-
-manager = dbus.Interface(bus.get_object("net.connman", "/"),
-					"net.connman.Manager")
-
-path = "" + sys.argv[1]
-
-print "remove path is %s" %(path)
-
-manager.RemoveProvider(sys.argv[1])
-
-
diff --git a/test/remove-provider b/test/remove-provider
new file mode 100755
index 0000000..39f8de7
--- /dev/null
+++ b/test/remove-provider
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+if (len(sys.argv) < 2):
+	print "Usage: %s <VPN service path> " % (sys.argv[0])
+	sys.exit(1)
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object("net.connman", "/"),
+					"net.connman.Manager")
+
+path = "" + sys.argv[1]
+
+print "remove path is %s" %(path)
+
+manager.RemoveProvider(sys.argv[1])
-- 
1.7.11.4




More information about the connman mailing list