aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>2016-04-07 10:32:05 (GMT)
committerJouni Malinen <j@w1.fi>2016-04-24 21:05:34 (GMT)
commitaa713e71e9bc6f6951391680eabfc2da9b72a32e (patch)
treebe70441c55ae7dcda0f4b0831a1a1360b940b011
parentfc30cc10ace5f07f30dce84253ca55105c327a99 (diff)
downloadhostap-aa713e71e9bc6f6951391680eabfc2da9b72a32e.zip
hostap-aa713e71e9bc6f6951391680eabfc2da9b72a32e.tar.gz
hostap-aa713e71e9bc6f6951391680eabfc2da9b72a32e.tar.bz2
tests: Don't use proxy in urllib.urlopen()
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>
-rw-r--r--tests/hwsim/test_ap_wps.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py
index 4f178a4..db12257 100644
--- a/tests/hwsim/test_ap_wps.py
+++ b/tests/hwsim/test_ap_wps.py
@@ -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")