diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2010-07-29 22:04:49 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-07-29 22:04:49 -0700 |
commit | 1fd3f334bf70e38c1d0481028b51bab02e2cec59 (patch) | |
tree | 7fefec3142e6e945688aeeed5637c3f7e9e6ee37 | |
parent | e52b36681d1a84274a05eef552b9c717c65a5e57 (diff) | |
download | connman-1fd3f334bf70e38c1d0481028b51bab02e2cec59.tar.gz connman-1fd3f334bf70e38c1d0481028b51bab02e2cec59.tar.bz2 connman-1fd3f334bf70e38c1d0481028b51bab02e2cec59.zip |
Add test script for retrieving proxy auto-configuration
-rw-r--r-- | Makefile.am | 2 | ||||
-rwxr-xr-x | test/get-proxy-autoconfig | 36 |
2 files changed, 37 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index 35392843..9b466445 100644 --- a/Makefile.am +++ b/Makefile.am @@ -173,7 +173,7 @@ test_scripts = test/get-state test/list-profiles test/list-services \ test/connect-vpn test/disconnect-vpn test/list-providers \ test/monitor-manager test/test-counter test/set-ip-method \ test/set-nameservers test/set-domains test/find-service \ - test/get-services \ + test/get-services test/get-proxy-autoconfig \ test/enable-tethering test/disable-tethering if TEST 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) |