Unit tests failing with oslo.policy 0.12.0

Bug #1505374 reported by Brant Knudson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Critical
Brant Knudson
OpenStack Shared File Systems Service (Manila)
Fix Released
Critical
Valeriy Ponomaryov

Bug Description

oslo.policy 0.12.0 was released recently, and this caused a couple keystone unit tests to fail. The new release has a change to use requests rather than urllib, and keystone's unit tests were assuming that oslo.policy was implemented using urllib (by mocking the response).

failing tests:

 keystone.tests.unit.test_policy.PolicyTestCase.test_enforce_http_true
 keystone.tests.unit.test_policy.PolicyTestCase.test_enforce_http_false

Keystone doesn't need to test these internal implementation details of oslo.policy, let's just assume it works as designed and they have their own tests.

Brant Knudson (blk-u)
Changed in keystone:
assignee: nobody → Brant Knudson (blk-u)
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/233800

Changed in keystone:
status: New → In Progress
Changed in manila:
milestone: none → mitaka-1
importance: Undecided → Critical
Changed in manila:
assignee: nobody → Valeriy Ponomaryov (vponomaryov)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.openstack.org/233685
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=9c99814ce5943bd4c33bf3650b832666e31b3411
Submitter: Jenkins
Branch: master

commit 9c99814ce5943bd4c33bf3650b832666e31b3411
Author: Gaurang Tapase <email address hidden>
Date: Mon Oct 12 20:47:19 2015 +0530

    Fix usage of dependencies

    Manila is broken is threee places, so fix them:
    1) test 'test_misc' with WebOb 1.5

    WebOb 1.5 was released at 2015-10-11. With this new version,
    webob.exc.WSGIHTTPException() constructor now fails with a KeyError
    when the HTTP status code is 0.

    test_exceptions_raise() of test_misc tries to instantiate all
    exceptions of manila.exception. The problem is that
    ConvertedException uses a default HTTP status code of 0.

    Modify the default HTTP status code of ConvertedException to 400 to
    fix the unit tests.

    2) Add dependency for 'testresources' that is required by migration
    tests.

    3) Remove 2 unit tests related to testing of oslo.policy lib
    functionality that should not be tested in Manila. It started failing
    because under-the-hood behaviour was changed in new realese 0.12.0

    Closes-Bug: #1505153
    Closes-Bug: #1505374

    Change-Id: I0f28f3c3fb2c7eec1bafc3a617344990f86810cf

Changed in manila:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/234288

Thierry Carrez (ttx)
Changed in manila:
milestone: mitaka-1 → liberty-rc3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/liberty)

Reviewed: https://review.openstack.org/234288
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=f1eded1fbcaf309e1c9a4be3f8a14bd25daa3e46
Submitter: Jenkins
Branch: stable/liberty

commit f1eded1fbcaf309e1c9a4be3f8a14bd25daa3e46
Author: Gaurang Tapase <email address hidden>
Date: Mon Oct 12 20:47:19 2015 +0530

    Fix usage of dependencies

    Manila is broken is threee places, so fix them:
    1) test 'test_misc' with WebOb 1.5

    WebOb 1.5 was released at 2015-10-11. With this new version,
    webob.exc.WSGIHTTPException() constructor now fails with a KeyError
    when the HTTP status code is 0.

    test_exceptions_raise() of test_misc tries to instantiate all
    exceptions of manila.exception. The problem is that
    ConvertedException uses a default HTTP status code of 0.

    Modify the default HTTP status code of ConvertedException to 400 to
    fix the unit tests.

    2) Add dependency for 'testresources' that is required by migration
    tests.

    3) Remove 2 unit tests related to testing of oslo.policy lib
    functionality that should not be tested in Manila. It started failing
    because under-the-hood behaviour was changed in new realese 0.12.0

    Closes-Bug: #1505153
    Closes-Bug: #1505374

    (cherry picked from commit 9c99814ce5943bd4c33bf3650b832666e31b3411)

    -- squashed with another change to get tests to pass on stable/liberty --

    Fix broken unit tests

    With release of six module version 1.10.0 several our unit tests
    started to fail because of usage of not strict constructions.

    Changes:
    1) Manila unit test
    "manila.tests.share.test_api.ShareAPITestCase.test_extend_quota_error"
    used str for int substitution. So, use int data for int substitution.

    2) Module 'manila.share.drivers.hp.hp_3par_mediator' was using
    LOG.exception function when no traceback were exist it led to
    AttributeError on py34. So, replace all usages of 'LOG.exception'
    with 'LOG.error' where no raised exceptions exist.

    Change-Id: Ic5b37bfb9d939d03f6ff68bc53d134bf9e5f996e
    Closes-Bug: #1503969
    (cherry picked from commit f38b8d4efd1f68f4ea29747f7377e0936f61d89c)

    --

    Change-Id: I0f28f3c3fb2c7eec1bafc3a617344990f86810cf

tags: added: in-stable-liberty
Thierry Carrez (ttx)
Changed in manila:
status: Fix Committed → Fix Released
Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/233800
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=6016d017004acaae288312b196ef07ea98e9962d
Submitter: Jenkins
Branch: master

commit 6016d017004acaae288312b196ef07ea98e9962d
Author: Brant Knudson <email address hidden>
Date: Mon Oct 12 15:12:45 2015 -0500

    Remove oslo.policy implementation tests from keystone

    oslo.policy 0.12.0 contains a change to use requests to do the http
    check rather than urllib. This change caused keystone tests to fail
    because the keystone tests were mocking urllib, making assumptions
    about how oslo.policy is implemented. Keystone doesn't need to test
    internal features of oslo.policy, so these tests are removed.

    Change-Id: I9d6e4950b9fe75cbb94100c8effdcec002642027
    Closes-Bug: 1505374

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in manila:
milestone: liberty-rc3 → 1.0.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (master)

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

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

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/235374

Brant Knudson (blk-u)
tags: added: liberty-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on keystone (stable/liberty)

Change abandoned by Brant Knudson (<email address hidden>) on branch: stable/liberty
Review: https://review.openstack.org/235374
Reason: Squashed into https://review.openstack.org/#/c/235229/

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

Reviewed: https://review.openstack.org/235229
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=2d198d7fe032c31400566d37d10bc8594e578907
Submitter: Jenkins
Branch: stable/liberty

commit 2d198d7fe032c31400566d37d10bc8594e578907
Author: Thierry Carrez <email address hidden>
Date: Thu Oct 15 12:15:45 2015 +0200

    Switch to post-versioning

    This combines 2 commits in order to pass the gate.

    No longer mention next version on setup.cfg on stable branch.

    Remove oslo.policy implementation tests from keystone

    oslo.policy 0.12.0 contains a change to use requests to do the http
    check rather than urllib. This change caused keystone tests to fail
    because the keystone tests were mocking urllib, making assumptions
    about how oslo.policy is implemented. Keystone doesn't need to test
    internal features of oslo.policy, so these tests are removed.

    Closes-Bug: 1505374
    (cherry picked from commit 6016d017004acaae288312b196ef07ea98e9962d)

    Change-Id: I75c44e88eb851a3b92a6d7d379d9a55e417703d6

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)
Download full text (11.9 KiB)

Reviewed: https://review.openstack.org/235328
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=ec94d6929ea8e1b4ce10dc91cd4954ece808668c
Submitter: Jenkins
Branch: master

commit f1eded1fbcaf309e1c9a4be3f8a14bd25daa3e46
Author: Gaurang Tapase <email address hidden>
Date: Mon Oct 12 20:47:19 2015 +0530

    Fix usage of dependencies

    Manila is broken is threee places, so fix them:
    1) test 'test_misc' with WebOb 1.5

    WebOb 1.5 was released at 2015-10-11. With this new version,
    webob.exc.WSGIHTTPException() constructor now fails with a KeyError
    when the HTTP status code is 0.

    test_exceptions_raise() of test_misc tries to instantiate all
    exceptions of manila.exception. The problem is that
    ConvertedException uses a default HTTP status code of 0.

    Modify the default HTTP status code of ConvertedException to 400 to
    fix the unit tests.

    2) Add dependency for 'testresources' that is required by migration
    tests.

    3) Remove 2 unit tests related to testing of oslo.policy lib
    functionality that should not be tested in Manila. It started failing
    because under-the-hood behaviour was changed in new realese 0.12.0

    Closes-Bug: #1505153
    Closes-Bug: #1505374

    (cherry picked from commit 9c99814ce5943bd4c33bf3650b832666e31b3411)

    -- squashed with another change to get tests to pass on stable/liberty --

    Fix broken unit tests

    With release of six module version 1.10.0 several our unit tests
    started to fail because of usage of not strict constructions.

    Changes:
    1) Manila unit test
    "manila.tests.share.test_api.ShareAPITestCase.test_extend_quota_error"
    used str for int substitution. So, use int data for int substitution.

    2) Module 'manila.share.drivers.hp.hp_3par_mediator' was using
    LOG.exception function when no traceback were exist it led to
    AttributeError on py34. So, replace all usages of 'LOG.exception'
    with 'LOG.error' where no raised exceptions exist.

    Change-Id: Ic5b37bfb9d939d03f6ff68bc53d134bf9e5f996e
    Closes-Bug: #1503969
    (cherry picked from commit f38b8d4efd1f68f4ea29747f7377e0936f61d89c)

    --

    Change-Id: I0f28f3c3fb2c7eec1bafc3a617344990f86810cf

commit 151b691bb2d4baa436913924df60b8c197f91463
Author: Valeriy Ponomaryov <email address hidden>
Date: Thu Oct 1 12:42:05 2015 +0300

    Fix display of availability-zone for manila-manage command

    Commands "manila-manage service list" and "manila-manage host list"
    were displaying availability zone instance instead of its name.

    Such bug appeared after implementation of Availability zone model.
    So, fix it by providing 'name' field of availability zone model.

    Change-Id: I14c3451380df01853183aed265344b1783c95939
    Closes-Bug: #1499677

commit 77455a5ac6be828e8dfd3e75566eaff2823595d4
Author: Csaba Henk <email address hidden>
Date: Wed Sep 30 14:57:00 2015 +0200

    glusterfs_native: use dynamic-auth option if available

    With dynamic-auth restarting the volume is not necessary
    in deny_access.

    Change-Id: Ic25af1795c279b34370...

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on manila (stable/liberty)

Change abandoned by Ben Swartzlander (<email address hidden>) on branch: stable/liberty
Review: https://review.openstack.org/232535

Changed in keystone:
milestone: none → mitaka-1
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/keystone 9.0.0.0b1

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

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/manila 2.0.0.0b1

This issue was fixed in the openstack/manila 2.0.0.0b1 development milestone.

Changed in keystone:
status: Fix Committed → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/keystone 8.0.1

This issue was fixed in the openstack/keystone 8.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.