summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-07-29 22:04:49 -0700
committerMarcel Holtmann <marcel@holtmann.org>2010-07-29 22:04:49 -0700
commit1fd3f334bf70e38c1d0481028b51bab02e2cec59 (patch)
tree7fefec3142e6e945688aeeed5637c3f7e9e6ee37 /test
parente52b36681d1a84274a05eef552b9c717c65a5e57 (diff)
downloadconnman-1fd3f334bf70e38c1d0481028b51bab02e2cec59.tar.gz
connman-1fd3f334bf70e38c1d0481028b51bab02e2cec59.tar.bz2
connman-1fd3f334bf70e38c1d0481028b51bab02e2cec59.zip
Add test script for retrieving proxy auto-configuration
Diffstat (limited to 'test')
-rwxr-xr-xtest/get-proxy-autoconfig36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/get-proxy-autoconfig b/test/get-proxy-autoconfig
new file mode 100755
index 00000000..25e0dd00
--- /dev/null
+++ b/test/get-proxy-autoconfig
@@ -0,0 +1,36 @@
+#!/usr/bin/python
+
+import dbus
+import urllib
+
+def get_pac(url):
+ conn = urllib.urlopen(url, proxies={})
+ data = conn.read()
+ print data
+ conn.close()
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.moblin.connman', '/'),
+ 'org.moblin.connman.Manager')
+
+services = manager.GetServices()
+
+for entry in services:
+ path = entry[0]
+ properties = entry[1]
+
+ proxy = properties["Proxy"]
+
+ if "Method" in proxy:
+ print "[ %s ]" % (path)
+
+ method = proxy["Method"]
+ print "Method = %s" % (method)
+
+ if method in ["auto-config"]:
+ url = proxy["URL"]
+ print "URL = %s" % (url)
+
+ print
+ get_pac(url)