WSGI unittest fails if HTTP_PROXY if set

Bug #1356665 reported by Angus Lees
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Angus Lees
Icehouse
Fix Released
Undecided
Unassigned

Bug Description

urllib2.urlopen uses $http_proxy/$HTTP_PROXY environment variables by
default. If set (and pointing to a remote host), then the WSGI tests
that spin up a local server and connect to it using
http://127.0.0.1:$port/ instead connect to $port *on the proxy*,
and (hopefully) fail.

We shouldn't follow HTTP_PROXY when trying to connect to test servers.

Changed in neutron:
assignee: nobody → Angus Lees (gus)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/110853
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=6d7b2e007cf477a7f212312bad4ce0cbe8032d1a
Submitter: Jenkins
Branch: master

commit 6d7b2e007cf477a7f212312bad4ce0cbe8032d1a
Author: Angus Lees <email address hidden>
Date: Thu Jul 31 15:27:18 2014 +1000

    Ignore http_proxy while connecting to test WSGI server

    urllib2.urlopen uses $http_proxy/$HTTP_PROXY environment variables by
    default. If set (and pointing to a remote host), then the WSGI tests
    that spin up a local server and connect to it using
    http://127.0.0.1:$port/ instead connect to $port *on the proxy*,
    and (hopefully) fail.

    This change uses urllib2 in a way that ignores proxy settings.

    Change-Id: I4d94fcc06925d0c947345a07ae20352e1898e46d
    Closes-Bug: #1356665

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → juno-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-3 → 2014.2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/166272

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/icehouse)

Reviewed: https://review.openstack.org/166272
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=877df583da4bd4e4a26122d0d18f2eab53f737a4
Submitter: Jenkins
Branch: stable/icehouse

commit 877df583da4bd4e4a26122d0d18f2eab53f737a4
Author: Angus Lees <email address hidden>
Date: Thu Jul 31 15:27:18 2014 +1000

    Ignore http_proxy while connecting to test WSGI server

    urllib2.urlopen uses $http_proxy/$HTTP_PROXY environment variables by
    default. If set (and pointing to a remote host), then the WSGI tests
    that spin up a local server and connect to it using
    http://127.0.0.1:$port/ instead connect to $port *on the proxy*,
    and (hopefully) fail.

    This change uses urllib2 in a way that ignores proxy settings.

    Closes-Bug: #1356665
    (cherry picked from commit 6d7b2e007cf477a7f212312bad4ce0cbe8032d1a)

    Conflicts:
     neutron/tests/unit/test_wsgi.py

    Change-Id: I4d94fcc06925d0c947345a07ae20352e1898e46d

tags: added: in-stable-icehouse
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.