summaryrefslogtreecommitdiff
path: root/test/vpn-disconnect
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-11-12 14:07:23 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-11-23 12:58:50 +0200
commitdb54a482b1190562e17627d42b5edd28c169a3d6 (patch)
tree39acd75514b3ce23016803cc792378146ff7da9a /test/vpn-disconnect
parent6ed9559f6914a32fd90c17c097251f2bd5e01ef0 (diff)
downloadconnman-db54a482b1190562e17627d42b5edd28c169a3d6.tar.gz
connman-db54a482b1190562e17627d42b5edd28c169a3d6.tar.bz2
connman-db54a482b1190562e17627d42b5edd28c169a3d6.zip
test: New VPN test script that connect to connman-vpnd
Diffstat (limited to 'test/vpn-disconnect')
-rwxr-xr-xtest/vpn-disconnect24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/vpn-disconnect b/test/vpn-disconnect
new file mode 100755
index 00000000..d7a49ba9
--- /dev/null
+++ b/test/vpn-disconnect
@@ -0,0 +1,24 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+if (len(sys.argv) < 1):
+ print "Usage: %s <VPN connection id>" % (sys.argv[0])
+ sys.exit(1)
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object("net.connman.vpn", "/"),
+ "net.connman.vpn.Manager")
+
+connections = manager.GetConnections()
+
+path = "/net/connman/vpn/connection/" + sys.argv[1]
+
+print "Attempting to disconnect VPN %s" % (path)
+
+connection = dbus.Interface(bus.get_object("net.connman.vpn", path),
+ "net.connman.vpn.Connection")
+
+connection.Disconnect()