← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1852354] Re: TestTasksDeserializer class not using FakePolicyEnforcer

 

Reviewed:  https://review.opendev.org/693952
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=7c85bdcf837da06463dbea0cd5171b1f5b3e726d
Submitter: Zuul
Branch:    master

commit 7c85bdcf837da06463dbea0cd5171b1f5b3e726d
Author: Brian Rosmaita <rosmaita.fossdev@xxxxxxxxx>
Date:   Tue Nov 12 18:58:23 2019 -0500

    Use FakePolicyEnforcer for deserialization tests
    
    The tasks unit tests that test the RequestDeserializer
    are using the real policy engine.  They should be using
    a mock because we're testing the deserialization, not the
    policies.
    
    Closes-bug: #1852354
    
    Change-Id: I35bdacd154b2c8d18ce268a5e6e8aba710e41108


** Changed in: glance
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1852354

Title:
  TestTasksDeserializer class not using FakePolicyEnforcer

Status in Glance:
  Fix Released

Bug description:
  This was uncovered by a patch implementing policy-in-code for Glance:
  https://review.opendev.org/#/c/693129/

  The TestTasksDeserializer class creates a
  glance.v2.tasks.RequestDeserializer but doesn't pass it a
  policy_enforcer.  As a result, RequestDeserializer uses a real policy
  enforcer.  The default policy in code that's checked by the
  RequestDeserializer is "tasks_api_access: role:admin", and with that
  policy in place, all the unit test requests fail.  Need to pass the
  unit test class the FakePolicyEnforcer so that the deserialization can
  be tested.

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1852354/+subscriptions


References