run_tests.sh & testr causing HTTPError: (407, 'Proxy Authentication Required')

Bug #1556864 reported by Venkata Mahesh Jonnalagadda
38
This bug affects 7 people
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Medium
Federico Ressi

Bug Description

I have setup devstack (stable/kilo) with enabled services - keystone, horizon, nova, neutron, glance, rabbitmq on Ubuntu 14.04

And installed latest tempest (master branch)

Successfully generated tempest.conf using tox.

Modified & configured tempest.conf accordingly. Have a look @ http://paste.openstack.org/show/490125/

I set environment variables as below for http proxy -

export http_proxy="http://one.proxy.com:8080"
export https_proxy="https://one.proxy.com:8080"
export no_proxy="localhost,127.0.0.1,10.0.1.0/24"
export HTTP_PROXY="http://one.proxy.com:8080"
export HTTPS_PROXY="https://one.proxy.com:8080"
export NO_PROXY="localhost,127.0.0.1,10.0.1.0/24"

I set environment variables as below for tempest -

export TEMPEST_ROOT_DIR="/root/tempest/"
export OS_TOP_LEVEL="/root/tempest/"
export OS_TEST_PATH="/root/tempest/tempest/test_discover"

When I executed "./run_tests.sh" or "testr run --parallel", it ended with below error -

tempest.tests.test_list_tests.TestTestList.test_testr_list_tests_no_errors
--------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "/root/tempest/tempest/tests/test_list_tests.py", line 35, in test_testr_list_tests_no_errors
        "error on import %s" % ids)
      File "/root/tempest/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 362, in assertEqual
        self.assertThat(observed, matcher, message)
      File "/root/tempest/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 447, in assertThat
        raise mismatch_error
    testtools.matchers._impl.MismatchError: 0 != 3: test discovery failed, one or more files cause an error on import running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
    OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
    OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
    OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \
    ${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_PATH:-./tempest/test_discover} --list
    --- import errors ---
    Failed to call load_tests:
    Traceback (most recent call last):
      File "/root/tempest/.venv/local/lib/python2.7/site-packages/unittest2/loader.py", line 147, in loadTestsFromModule
        return load_tests(self, tests, pattern)
      File "/root/tempest/tempest/scenario/utils.py", line 170, in load_tests_input_scenario_utils
        scenario_utils = InputScenarioUtils()
      File "/root/tempest/tempest/lib/common/utils/misc.py", line 30, in getinstance
        instances[cls] = cls()
      File "/root/tempest/tempest/scenario/utils.py", line 109, in __init__
        network_resources=network_resources)
      File "/root/tempest/tempest/common/credentials_factory.py", line 161, in get_credentials_provider
        'identity_admin', fill_in=True, identity_version=identity_version)
      File "/root/tempest/tempest/common/credentials_factory.py", line 275, in get_configured_credentials
        identity_version=identity_version, **params)
      File "/root/tempest/tempest/common/credentials_factory.py", line 304, in get_credentials
        **params)
      File "/root/tempest/tempest/lib/auth.py", line 535, in get_credentials
        creds = auth_provider.fill_credentials()
      File "/root/tempest/tempest/lib/auth.py", line 82, in fill_credentials
        auth_data = self.get_auth()
      File "/root/tempest/tempest/lib/auth.py", line 102, in get_auth
        self.set_auth()
      File "/root/tempest/tempest/lib/auth.py", line 111, in set_auth
        self.cache = self._get_auth()
      File "/root/tempest/tempest/lib/auth.py", line 243, in _get_auth
        token, auth_data = auth_func(**auth_params)
      File "/root/tempest/tempest/lib/services/identity/v2/token_client.py", line 104, in get_token
        body = self.auth(user, password, tenant)
      File "/root/tempest/tempest/lib/services/identity/v2/token_client.py", line 54, in auth
        resp, body = self.post(self.auth_url, body=body)
      File "/root/tempest/tempest/lib/common/rest_client.py", line 259, in post
        return self.request('POST', url, extra_headers, headers, body)
      File "/root/tempest/tempest/lib/services/identity/v2/token_client.py", line 89, in request
        headers=headers, body=body)
      File "/root/tempest/tempest/lib/common/rest_client.py", line 559, in raw_request
        headers=headers, body=body)
      File "/root/tempest/tempest/lib/common/http.py", line 25, in request
        return super(ClosingHttp, self).request(*args, **new_kwargs)
      File "/root/tempest/.venv/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1609, in request
        (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
      File "/root/tempest/.venv/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1351, in _request
        (response, content) = self._conn_request(conn, request_uri, method, body, headers)
      File "/root/tempest/.venv/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1272, in _conn_request
        conn.connect()
      File "/root/tempest/.venv/local/lib/python2.7/site-packages/httplib2/__init__.py", line 916, in connect
        self.sock.connect((self.host, self.port) + sa[2:])
      File "/root/tempest/.venv/local/lib/python2.7/site-packages/httplib2/socks.py", line 424, in connect
        self.__negotiatehttp(destpair[0], destpair[1])
      File "/root/tempest/.venv/local/lib/python2.7/site-packages/httplib2/socks.py", line 390, in __negotiatehttp
        raise HTTPError((statuscode, statusline[2]))
    HTTPError: (407, 'Proxy Authentication Required')

description: updated
summary: - testr run causing ImportError: Start directory is not importable
+ run_tests.sh causing HTTPError: (407, 'Proxy Authentication Required')
description: updated
summary: - run_tests.sh causing HTTPError: (407, 'Proxy Authentication Required')
+ run_tests.sh & testr causing HTTPError: (407, 'Proxy Authentication
+ Required')
description: updated
Revision history for this message
Jordan Pittier (jordan-pittier) wrote :

Problem is, urllib3 doesn't honor the proxy configuration.

Changed in tempest:
status: New → Confirmed
Revision history for this message
Venkata Mahesh Jonnalagadda (vj884x) wrote :

How this bug is a duplicate of bug #1594868 ?
I raised bug #1556864 on 2016-03-14, which I found this issue at early stage and raised this bug.
Now, latest bug #1594868 raised on 2016-06-21 becomes DUPLICATE not earlier one!

Kindly, make bug #1594868 as duplicate and fix the issue as a part of bug #1556864

Thanks.

Revision history for this message
Venkata Mahesh Jonnalagadda (vj884x) wrote :

FYI: I made bug #1594868 as duplicate. Thanks.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

Fix proposed to branch: master
Review: https://review.openstack.org/364414

Changed in tempest:
assignee: nobody → Matthew Treinish (treinish)
status: Confirmed → In Progress
Changed in tempest:
importance: Undecided → Medium
Revision history for this message
Venkata Mahesh Jonnalagadda (vj884x) wrote :

Nice progress..

Changed in tempest:
assignee: Matthew Treinish (treinish) → Antoine Eiche (lewo-c)
Changed in tempest:
assignee: Antoine Eiche (lewo-c) → Matthew Treinish (treinish)
Revision history for this message
chandan kumar (chkumar246) wrote :

Unassigning this bug as there is no activity from last 6 months. If you are still want to work on this bug, feel free to assign yourself.

Changed in tempest:
assignee: Matthew Treinish (treinish) → nobody
Revision history for this message
Martin Kopec (mkopec) wrote :

Moving back to confirmed as nobody is working on this at the moment.

Changed in tempest:
status: In Progress → Confirmed
Changed in tempest:
status: Confirmed → In Progress
assignee: nobody → Matthew Treinish (treinish)
Changed in tempest:
assignee: Matthew Treinish (treinish) → Ken'ichi Ohmichi (oomichi)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/364414
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=74514400a2042ea8362c40a166e014b47b838f7d
Submitter: Zuul
Branch: master

commit 74514400a2042ea8362c40a166e014b47b838f7d
Author: Matthew Treinish <email address hidden>
Date: Thu Sep 1 11:44:57 2016 -0400

    Add config options to set proxy_url

    As part of the migration from httblib2 -> urllib3 we lost support for
    handling the env vars for setting an http proxy. This wasn't ever an
    explicit feature in tempest, but instead was an artifact of our
    library choice for doing http. However as people relied on this
    functionality and it is a useful feature having tempest support this
    explicitly will make sure we don't accidentally drop support for it in
    the future. This commit adds a new config options to specify and
    proxy_url to replace the lost functionality.

    Change-Id: Id8f6422a323f8bfdb10527f55c0cb046622b88bf
    Closes-Bug: #1556864

Changed in tempest:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tempest 17.1.0

This issue was fixed in the openstack/tempest 17.1.0 release.

Revision history for this message
Federico Ressi (fressi-redhat) wrote :

Release patch doesn't actually fix the bug as http(s)_proxy is still ignored. I proposed a new fix for it:
https://review.openstack.org/#/c/554944/2

Changed in tempest:
assignee: Ken'ichi Ohmichi (oomichi) → Federico Ressi (fressi-redhat)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tempest (master)

Change abandoned by Federico Ressi (<email address hidden>) on branch: master
Review: https://review.openstack.org/554944
Reason: This change has been split and reduced to below one:
https://review.openstack.org/#/c/559069/

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.