Unit test failures due to changes in python 2.7.9+

Bug #1404227 reported by James Page
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Medium
James Page
python-glanceclient (Ubuntu)
Fix Released
Medium
Unassigned
Trusty
Fix Released
Medium
Unassigned

Bug Description

py27 develop-inst-nodeps: /home/jamespage/src/upstream/python-glanceclient
py27 runtests: PYTHONHASHSEED='0'
py27 runtests: commands[0] | python setup.py testr --testr-args=
running testr
running=${PYTHON:-python} -m subunit.run discover -t ./ ./tests --list
running=${PYTHON:-python} -m subunit.run discover -t ./ ./tests --load-list /tmp/tmpGu1hxe
running=${PYTHON:-python} -m subunit.run discover -t ./ ./tests --load-list /tmp/tmpGCgXRW
running=${PYTHON:-python} -m subunit.run discover -t ./ ./tests --load-list /tmp/tmp8DbbtX
running=${PYTHON:-python} -m subunit.run discover -t ./ ./tests --load-list /tmp/tmp7jX961
======================================================================
FAIL: tests.test_ssl.TestVerifiedHTTPSConnection.test_ssl_broken_key_file
tags: worker-1
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_ssl.py", line 272, in test_ssl_broken_key_file
    cert_file=cert_file, cacert=cacert)
  File "/home/jamespage/src/upstream/python-glanceclient/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 420, in assertRaises
    self.assertThat(our_callable, matcher)
  File "/home/jamespage/src/upstream/python-glanceclient/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 431, in assertThat
    mismatch_error = self._matchHelper(matchee, matcher, message, verbose)
  File "/home/jamespage/src/upstream/python-glanceclient/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 481, in _matchHelper
    mismatch = matcher.match(matchee)
  File "/home/jamespage/src/upstream/python-glanceclient/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 108, in match
    mismatch = self.exception_matcher.match(exc_info)
  File "/home/jamespage/src/upstream/python-glanceclient/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_higherorder.py", line 62, in match
    mismatch = matcher.match(matchee)
  File "/home/jamespage/src/upstream/python-glanceclient/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 412, in match
    reraise(*matchee)
  File "/home/jamespage/src/upstream/python-glanceclient/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 101, in match
    result = matchee()
  File "/home/jamespage/src/upstream/python-glanceclient/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 965, in __call__
    return self._callable_object(*self._args, **self._kwargs)
  File "glanceclient/common/https.py", line 156, in __init__
    cert_file=cert_file)
  File "/usr/lib/python2.7/httplib.py", line 1198, in __init__
    context.load_cert_chain(cert_file, key_file)
IOError: [Errno 2] No such file or directory
======================================================================
FAIL: tests.test_ssl.TestVerifiedHTTPSConnection.test_ssl_init_bad_cert
tags: worker-0
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_ssl.py", line 129, in test_ssl_init_bad_cert
    cacert=cacert)
  File "glanceclient/common/https.py", line 156, in __init__
    cert_file=cert_file)
  File "/usr/lib/python2.7/httplib.py", line 1198, in __init__
    context.load_cert_chain(cert_file, key_file)
IOError: [Errno 2] No such file or directory
======================================================================
FAIL: tests.test_ssl.TestVerifiedHTTPSConnection.test_ssl_init_bad_key
tags: worker-0
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_ssl.py", line 115, in test_ssl_init_bad_key
    cacert=cacert)
  File "glanceclient/common/https.py", line 156, in __init__
    cert_file=cert_file)
  File "/usr/lib/python2.7/httplib.py", line 1198, in __init__
    context.load_cert_chain(cert_file, key_file)
SSLError: [SSL] PEM lib (_ssl.c:2525)
======================================================================
FAIL: tests.test_ssl.TestVerifiedHTTPSConnection.test_ssl_init_cert_no_key
tags: worker-0
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_ssl.py", line 86, in Schema is not a valid JSON object.
No metadata definition namespace passed via stdin or --file argument.
Schema is not a valid JSON object.
Schema is not a valid JSON object.
Property MyProperty not found in object MyObject.
Schema is not a valid JSON object.
Schema is not a valid JSON object.
test_ssl_init_cert_no_key
    cacert=cacert)
  File "glanceclient/common/https.py", line 156, in __init__
    cert_file=cert_file)
  File "/usr/lib/python2.7/httplib.py", line 1198, in __init__
    context.load_cert_chain(cert_file, key_file)
SSLError: [SSL] PEM lib (_ssl.c:2525)
======================================================================
FAIL: tests.test_ssl.TestVerifiedHTTPSConnection.test_ssl_init_key_no_cert
tags: worker-2
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_ssl.py", line 104, in test_ssl_init_key_no_cert
    self.fail('Failed to init VerifiedHTTPSConnection.')
  File "/home/jamespage/src/upstream/python-glanceclient/.tox/py27/local/lib/python2.7/site-packages/unittest2/case.py", line 666, in fail
    raise self.failureException(msg)
AssertionError: Failed to init VerifiedHTTPSConnection.
======================================================================
FAIL: tests.test_ssl.TestVerifiedHTTPSConnection.test_ssl_init_bad_ca
tags: worker-3
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_ssl.py", line 143, in test_ssl_init_bad_ca
    cacert=cacert)
  File "glanceclient/common/https.py", line 156, in __init__
    cert_file=cert_file)
  File "/usr/lib/python2.7/httplib.py", line 1198, in __init__
    context.load_cert_chain(cert_file, key_file)
SSLError: [SSL] PEM lib (_ssl.c:2525)
Ran 326 tests in 1.520s (+0.566s)
FAILED (id=3, failures=6 (+6))
error: testr failed (1)

Revision history for this message
James Page (james-page) wrote :
Revision history for this message
Louis Taylor (kragniz) wrote :

Gerrit didn't link the patch: https://review.openstack.org/#/c/143075

Changed in python-glanceclient:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → James Page (james-page)
Ian Cordasco (icordasc)
Changed in python-glanceclient:
milestone: none → v0.16.0
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.openstack.org/143075
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=b96f6130265797489e684a4bc123a7a1f5118d2c
Submitter: Jenkins
Branch: master

commit b96f6130265797489e684a4bc123a7a1f5118d2c
Author: James Page <email address hidden>
Date: Fri Dec 19 12:49:17 2014 +0000

    Update HTTPS certificate handling for pep-0476

    This pep (included in python 2.7.9) changes the behaviour of SSL
    certificate chain handling to be more py3 like.

    Include required new exception behaviour in the list of
    exceptions to translate under py2.

    https://github.com/python/peps/blob/master/pep-0476.txt

    Closes-Bug: 1404227

    Change-Id: I7da1a13d1ec861a07fd96684d0431508a214a2c8

Changed in python-glanceclient:
status: In Progress → Fix Committed
Changed in python-glanceclient:
status: Fix Committed → Fix Released
Changed in python-glanceclient (Ubuntu):
assignee: nobody → Corey Bryant (corey.bryant)
assignee: Corey Bryant (corey.bryant) → nobody
Revision history for this message
Corey Bryant (corey.bryant) wrote : Re: Unit test failures due to changes in python 2.7.9

[Description]
Rebuilding python-glanceclient with python2.7.12 for trusty is resulting in failures such as:

FAIL: tests.test_ssl.TestVerifiedHTTPSConnection.test_ssl_init_bad_key
tags: worker-0
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/tests/test_ssl.py", line 82, in test_ssl_init_bad_key
    cacert=cacert)
  File "/<<PKGBUILDDIR>>/glanceclient/common/http.py", line 329, in __init__
    cert_file=cert_file)
  File "/usr/lib/python2.7/httplib.py", line 1264, in __init__
    context.load_cert_chain(cert_file, key_file)
SSLError: [SSL] PEM lib (_ssl.c:2603)

See: https://launchpadlibrarian.net/303235421/buildlog_ubuntu-trusty-i386.python-glanceclient_1%3A0.12.0-0ubuntu1.1_BUILDING.txt.gz

The fix includes partial backports from upstream's kilo-eol tag to update HTTPS certificate handling for pep-0476 (https://github.com/python/peps/blob/master/pep-0476.txt). The fix is backward compatible with the current version of python2.7 in trusty.

[Test Case]
Building python-glanceclient will run unit tests that will fail with Python2.7.12 without this patch.

[Regression Potential]
Fairly low. The patches aren't straight cherry-picks from upstream but they are partial cherry-picks from upstream's kilo-eol tag.

summary: - Unit test failures due to changes in python 2.7.9
+ Unit test failures due to changes in python 2.7.9+
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello James, or anyone else affected,

Accepted python-glanceclient into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-glanceclient/1:0.12.0-0ubuntu1.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in python-glanceclient (Ubuntu Trusty):
status: New → Fix Committed
tags: added: verification-needed
Changed in python-glanceclient (Ubuntu):
status: New → Fix Released
Mathew Hodson (mhodson)
Changed in python-glanceclient (Ubuntu):
importance: Undecided → Medium
Changed in python-glanceclient (Ubuntu Trusty):
importance: Undecided → Medium
Revision history for this message
Matthias Klose (doko) wrote :

I validated the python-glanceclient packages which the python2.7 2.7.12 proposed for trusty-updates (this is not a validation about the update in -proposed).

Revision history for this message
Corey Bryant (corey.bryant) wrote :

I've tagged this as verification-done as I've regression tested this successfully on trusty-proposed.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-glanceclient - 1:0.12.0-0ubuntu1.2

---------------
python-glanceclient (1:0.12.0-0ubuntu1.2) trusty; urgency=medium

  * d/p/Update-HTTPS-certificate-handling-for-pep-0476.patch: Partial
    cherry-picks from upstream to update HTTPS certificate handling for
    pep-0476 (LP: #1404227).

 -- Corey Bryant <email address hidden> Mon, 23 Jan 2017 15:58:25 -0500

Changed in python-glanceclient (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for python-glanceclient has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.