unit tests fail if https_proxy is set

Bug #1698222 reported by David Britton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
boto
New
Unknown
python-boto (Ubuntu)
Fix Committed
High
David Britton

Bug Description

https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac/autopkgtest-artful/artful/amd64/p/python-boto/20170531_165016_ad9d3@/log.gz

Python-boto unit tests don't like *_proxy env vars set during execution. They do not reach out to the network, but different codepaths are taken when a proxy is detected, and the mocks get destroyed in that case.

A lot of failures of the form:

======================================================================
FAIL: test_head_bucket_other (tests.unit.s3.test_connection.TestHeadBucket)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/autopkgtest.JJMfC2/autopkgtest_tmp/tests/unit/s3/test_connection.py", line 331, in test_head_bucket_other
    self.assertEqual(err.status, 405)
AssertionError: 403 != 405
-------------------- >> begin captured logging << --------------------
boto: DEBUG: Using access key provided by client.
boto: DEBUG: Using secret key provided by client.
boto: DEBUG: path=/
boto: DEBUG: auth_path=/you-broke-it/
boto: DEBUG: Method: HEAD
boto: DEBUG: Path: https://you-broke-it.s3.amazonaws.com/
boto: DEBUG: Data:
boto: DEBUG: Headers: {}
boto: DEBUG: Host: you-broke-it.s3.amazonaws.com
boto: DEBUG: Port: 443
boto: DEBUG: Params: {}
boto: DEBUG: establishing HTTPS connection: host=you-broke-it.s3.amazonaws.com, kwargs={'port': 443, 'timeout': 70}
boto: DEBUG: Proxy connection: CONNECT you-broke-it.s3.amazonaws.com:443 HTTP/1.0

boto: DEBUG: Token: None
boto: DEBUG: StringToSign:
HEAD

Wed, 31 May 2017 16:49:14 GMT
/you-broke-it/
boto: DEBUG: Signature:
AWS aws_access_key_id:Sy9u+sHaYcVAlgRndJo4iOD3mCY=
boto: DEBUG: Final headers: {'Date': 'Wed, 31 May 2017 16:49:14 GMT', 'Content-Length': '0', 'Authorization': u'AWS aws_access_key_id:Sy9u+sHaYcVAlgRndJo4iOD3mCY=', 'User-Agent': 'Boto/2.44.0 Python/2.7.13 Linux/4.10.0-21-generic'}
boto: DEBUG: Response headers: [('x-amz-id-2', 'R8k7qp47lyMqK4+O5bc5vLcFHbwHB64IifV0XEyEdJSNC7q1FGe3o/7LkUGjkR3eYBjDwyE8Oz8='), ('server', 'AmazonS3'), ('transfer-encoding', 'chunked'), ('x-amz-request-id', 'E92141CA21DA2EEC'), ('date', 'Wed, 31 May 2017 16:49:14 GMT'), ('content-type', 'application/xml')]
--------------------- >> end captured logging << ---------------------

Tags: patch
David Britton (dpb)
Changed in python-boto (Ubuntu):
importance: Undecided → High
assignee: nobody → David Britton (davidpbritton)
status: New → In Progress
summary: - proposed-migration autopkgtest failure for boto 2.44.0
+ unit tests fail if https_proxy is set
Changed in boto:
status: Unknown → New
Revision history for this message
David Britton (dpb) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "1698222.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Brian Murray (brian-murray) wrote :

Thanks for working on this, there is a typo in the changelog entry of the word "running" that might be worth fixing.

Revision history for this message
David Britton (dpb) wrote :

Brian -- thanks! I'm getting a sponser on the git merge request I put in over here:

https://bugs.launchpad.net/ubuntu/+source/python-boto/+bug/1698222

Revision history for this message
Robie Basak (racb) wrote :

David fixed the typo before submitting the MP, and I've sponsored using the git tooling. Thanks!

We're deliberately leaving the bug open as the upload is just a workaround; the real fix would be to stop the boto testsuite breaking when the env vars are set, which should probably be fixed upstream.

Changed in python-boto (Ubuntu):
status: In Progress → Fix Committed
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.