]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Don't use proxy in urllib.urlopen()
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Thu, 7 Apr 2016 10:32:05 +0000 (13:32 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 24 Apr 2016 21:05:34 +0000 (00:05 +0300)
Some environments define default system wide HTTP proxy. Using default
system configuration may result in a failure to open some HTTP URLs. Fix
this by ensuring that no proxies are used.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
tests/hwsim/test_ap_wps.py

index 4f178a4e11e17c50a49f079b2e9a73722ef6a03e..db12257058ac17ad6df1c3678e7507d1a2c093cb 100644 (file)
@@ -2696,7 +2696,7 @@ def ssdp_get_location(uuid):
     return location
 
 def upnp_get_urls(location):
-    conn = urllib.urlopen(location)
+    conn = urllib.urlopen(location, proxies={})
     tree = ET.parse(conn)
     root = tree.getroot()
     urn = '{urn:schemas-upnp-org:device-1-0}'
@@ -2748,10 +2748,11 @@ def test_ap_wps_upnp(dev, apdev):
     location = ssdp_get_location(ap_uuid)
     urls = upnp_get_urls(location)
 
-    conn = urllib.urlopen(urls['scpd_url'])
+    conn = urllib.urlopen(urls['scpd_url'], proxies={})
     scpd = conn.read()
 
-    conn = urllib.urlopen(urlparse.urljoin(location, "unknown.html"))
+    conn = urllib.urlopen(urlparse.urljoin(location, "unknown.html"),
+                          proxies={})
     if conn.getcode() != 404:
         raise Exception("Unexpected HTTP response to GET unknown URL")