broken test in Py 3.6: SAMLGenerationTests.test_sign_assertion_exc

Bug #1751551 reported by Thomas Goirand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Undecided
wangxiyuan

Bug Description

While building Keystone in Debian Sid + Python 3.6, I get the below stack dump. Obviously, this is a broken test, not a broken code. Notice the final . (ie: dot) after "status 1" that is the cause of the test failure.

Everything else seems to pass in my environment.

keystone.tests.unit.test_v3_federation.SAMLGenerationTests.test_sign_assertion_exc
----------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/usr/lib/python3/dist-packages/mock/mock.py", line 1305, in patched'
    b' return func(*args, **keywargs)'
    b' File "/home/zigo/sources/openstack/queens/services/keystone/build-area/keystone-13.0.0~rc1/keystone/tests/unit/test_v3_federation.py", line 4049, in test_sign_assertion_exc'
    b' self.assertEqual(expected_log, logger_fixture.output)'
    b' File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 411, in assertEqual'
    b' self.assertThat(observed, matcher, message)'
    b' File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 498, in assertThat'
    b' raise mismatch_error'
    b'testtools.matchers._impl.MismatchError: !=:'
    b"reference = '''\\"
    b"Error when signing assertion, reason: Command 'xmlsec1' returned non-zero exit status 1 keystone.tests.unit.test_v3_federation.SAMLGenerationTests.test_sign_assertion_exc-1"
    b"'''"
    b"actual = '''\\"
    b"Error when signing assertion, reason: Command 'xmlsec1' returned non-zero exit status 1. keystone.tests.unit.test_v3_federation.SAMLGenerationTests.test_sign_assertion_exc-1"
    b"'''"
    b''
    b''

Revision history for this message
Colleen Murphy (krinkle) wrote :

Confirmed on opensuse Tumbleweed which also uses python 3.6.

Changed in keystone:
status: New → Confirmed
Colleen Murphy (krinkle)
tags: added: office-hours
Revision history for this message
wangxiyuan (wangxiyuan) wrote :

Because subprocess.CalledProcessError is different between py3.5 and py3.6

Changed in keystone:
assignee: nobody → wangxiyuan (wangxiyuan)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

Changed in keystone:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/553712
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=4a1df081fd3868a75bfabe8099025069eb42248f
Submitter: Zuul
Branch: master

commit 4a1df081fd3868a75bfabe8099025069eb42248f
Author: wangxiyuan <email address hidden>
Date: Fri Mar 16 16:07:09 2018 +0800

    Fix assert test error under py3.6

    The function __str__ of class subprocess.CalledProcessError
    is different between py3.6 and lower python version.

            py3.6: Command '%s' returned non-zero exit status %d.
    lower version: Command '%s' returned non-zero exit status %d

    There is a . in py3.6.

    This patch fix the assert error under py3.6

    Change-Id: I19ae5711ed7440791583940fa4a8fb770dcdc933
    Closes-bug: #1751551

Changed in keystone:
status: In Progress → Fix Released
Revision history for this message
Thomas Goirand (thomas-goirand) wrote :

Could we get this backported?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/554152

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystone 14.0.0.0b1

This issue was fixed in the openstack/keystone 14.0.0.0b1 development milestone.

Changed in keystone:
milestone: none → rocky-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (stable/queens)

Reviewed: https://review.openstack.org/554152
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=e1f92efd412c2368806abb2f29c57175235b0f07
Submitter: Zuul
Branch: stable/queens

commit e1f92efd412c2368806abb2f29c57175235b0f07
Author: wangxiyuan <email address hidden>
Date: Fri Mar 16 16:07:09 2018 +0800

    Fix assert test error under py3.6

    The function __str__ of class subprocess.CalledProcessError
    is different between py3.6 and lower python version.

            py3.6: Command '%s' returned non-zero exit status %d.
    lower version: Command '%s' returned non-zero exit status %d

    There is a . in py3.6.

    This patch fix the assert error under py3.6

    Change-Id: I19ae5711ed7440791583940fa4a8fb770dcdc933
    Closes-bug: #1751551
    (cherry picked from commit 4a1df081fd3868a75bfabe8099025069eb42248f)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystone 13.0.1

This issue was fixed in the openstack/keystone 13.0.1 release.

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.