py27 unit test failure: ImageMetaProps has a system dependent hash signature.

Bug #1681946 reported by Steven Webster
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Dane Fichter

Bug Description

Description
===========

Running the Nova py27 unit tests on CentOS will result in the following failures:

nova.tests.unit.objects.test_objects.TestObjectVersions.test_versions
nova.tests.unit.notifications.objects.test_notification.TestNotificationObjectVersions.test_versions

With a traceback similar to the following:

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "nova/tests/unit/objects/test_objects.py", line 1216, in test_versions
        'Some objects have changed; please make sure the '
      File "/src/nova/.tox/py27/lib/python2.7/site-packages/testtools/testcase.py", line 411, in assertEqual
        self.assertThat(observed, matcher, message)
      File "/src/nova/.tox/py27/lib/python2.7/site-packages/testtools/testcase.py", line 498, in assertThat
        raise mismatch_error
    testtools.matchers._impl.MismatchError: !=:
    reference = {'ImageMetaProps': '1.18-3e5975251f5843e817de68ac83274c27'}
    actual = {'ImageMetaProps': '1.18-d62a383b8cfa1779cb98014a3bf91581'}
    : Some objects have changed; please make sure the versions have been bumped, and then update their hashes here.

This was introduced as part of the following change:

https://review.openstack.org/#/c/351232/

The ImageSignatureHashType and ImageSignatureKeyType now use cursive's signature_utils to generate a hash. The problem is that these values can be different depending on the underlying capabilities of the system.
For example:

Ubuntu Xenial:

>>> signature_utils.SignatureKeyType.REGISTERED_TYPES.keys()
['RSA-PSS', 'ECC_SECP521R1', 'ECC_SECT409R1', 'ECC_SECT409K1', 'ECC_SECT571R1', 'ECC_SECP384R1', 'ECC_SECT571K1', 'DSA']

CentOS 7.3.1611:

>>> signature_utils.SignatureKeyType.REGISTERED_TYPES.keys()
['RSA-PSS', 'ECC_SECP521R1', 'ECC_SECP384R1', 'DSA']

For this reason, the values can't be reliably compared with the hardcoded hash result in nova/tests/unit/objects/test_objects.py

Steps to reproduce
==================
1. tox -e py27 on a CentOs (7) system. Other systems may suffer the same failures.

Expected result
===============
Unit tests pass

Actual result
=============
Unit tests failed

Environment
===========
1. Latest devstack, stock CentOS 7 VM, latest Nova

Logs & Configs
==============
https://pastebin.com/1rqJaTPs
http://eavesdrop.openstack.org/irclogs/%23openstack-nova/%23openstack-nova.2017-04-11.log.html#t2017-04-11T20:38:56

Revision history for this message
Matt Riedemann (mriedem) wrote :

This was the change:

https://review.openstack.org/#/c/351232/16/nova/objects/fields.py@430

We should probably go back to hard-coding the superset of possible expected values rather than rely on cursive building this list based on what the host supports.

Changed in nova:
status: New → Triaged
importance: Undecided → High
tags: added: cursive unified-objects
Revision history for this message
Dane Fichter (dane-fichter) wrote :

Agreed. I'll take care of this today.

Changed in nova:
assignee: nobody → Dane Fichter (dane-fichter)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: Triaged → In Progress
Changed in nova:
assignee: Dane Fichter (dane-fichter) → Kaitlin Farr (kaitlin-farr)
Changed in nova:
assignee: Kaitlin Farr (kaitlin-farr) → Clark Boylan (cboylan)
Matt Riedemann (mriedem)
Changed in nova:
assignee: Clark Boylan (cboylan) → Dane Fichter (dane-fichter)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/456204
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=d015b9804213f7a2dbde0f54256f665098007c6f
Submitter: Jenkins
Branch: master

commit d015b9804213f7a2dbde0f54256f665098007c6f
Author: dane-fichter <email address hidden>
Date: Tue Mar 28 02:43:39 2017 -0700

    Remove backend dependency for key types

    This change moves the ImageMetaProp's SignatureKeyType
    tuple from a dynamically loaded object to a static tuple,
    removing the dependency on the OpenSSL backend, which
    can vary from OS to OS.

    Depends-On: Idbda49587f3b62a0870d10817291205bde0e821e
    Change-Id: Id5191e575191d3beaa24435e98a3852dddcfe3bf
    Closes-Bug: #1681946

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

This issue was fixed in the openstack/nova 16.0.0.0b1 development milestone.

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.