← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1116263] Re: quantum.policy unit tests fail

 

** Changed in: quantum
       Status: Fix Committed => Fix Released

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

Title:
  quantum.policy unit tests fail

Status in OpenStack Quantum (virtual network service):
  Fix Released

Bug description:
  Tests  from tests/unit/test_policy.py fail:

  test_default_not_found (quantum.tests.unit.test_policy.DefaultPolicyTestCase) ... ERROR
  test_not_found_policy_calls_default (quantum.tests.unit.test_policy.DefaultPolicyTestCase) ... ERROR
  test_policy_called (quantum.tests.unit.test_policy.DefaultPolicyTestCase) ... ERROR
  test_modified_policy_reloads (quantum.tests.unit.test_policy.PolicyFileTestCase) ... ERROR
  test_check_bad_action_noraise (quantum.tests.unit.test_policy.PolicyTestCase) ... ERROR
  test_early_AND_enforcement (quantum.tests.unit.test_policy.PolicyTestCase) ... ERROR
  test_early_OR_enforcement (quantum.tests.unit.test_policy.PolicyTestCase) ... ERROR
  test_enforce_bad_action_throws (quantum.tests.unit.test_policy.PolicyTestCase) ... ERROR
  test_enforce_good_action (quantum.tests.unit.test_policy.PolicyTestCase) ... ERROR
  test_enforce_http_false (quantum.tests.unit.test_policy.PolicyTestCase) ... ERROR
  test_enforce_http_true (quantum.tests.unit.test_policy.PolicyTestCase) ... ERROR
  test_enforce_nonexistent_action_throws (quantum.tests.unit.test_policy.PolicyTestCase) ... ERROR
  test_ignore_case_role_check (quantum.tests.unit.test_policy.PolicyTestCase) ... ERROR
  test_templatized_enforcement (quantum.tests.unit.test_policy.PolicyTestCase) ... ERROR
  test_enforce_adminonly_attribute_create (quantum.tests.unit.test_policy.QuantumPolicyTestCase) ... ERROR
  test_enforce_adminonly_attribute_nonadminctx_returns_403 (quantum.tests.unit.test_policy.QuantumPolicyTestCase) ... ERROR
  test_enforce_adminonly_attribute_update (quantum.tests.unit.test_policy.QuantumPolicyTestCase) ... ERROR
  test_enforce_parentresource_owner (quantum.tests.unit.test_policy.QuantumPolicyTestCase) ... ERROR
  test_enforce_regularuser_on_read (quantum.tests.unit.test_policy.QuantumPolicyTestCase) ... ERROR
  test_nonadmin_read_on_private_fails (quantum.tests.unit.test_policy.QuantumPolicyTestCase) ... ERROR
  test_nonadmin_read_on_shared_succeeds (quantum.tests.unit.test_policy.QuantumPolicyTestCase) ... ERROR
  test_nonadmin_write_on_private_fails (quantum.tests.unit.test_policy.QuantumPolicyTestCase) ... ERROR
  test_nonadmin_write_on_shared_fails (quantum.tests.unit.test_policy.QuantumPolicyTestCase) ... ERROR

  All errors look like:

  ======================================================================
  ERROR: test_default_not_found (quantum.tests.unit.test_policy.DefaultPolicyTestCase)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/home/jenkins/ababilov/quantum/quantum/tests/unit/test_policy.py", line 186, in setUp
      policy.init()
    File "/home/jenkins/ababilov/quantum/quantum/policy.py", line 47, in init
      _POLICY_PATH = utils.find_config_file({}, cfg.CONF.policy_file)
    File "/home/jenkins/ababilov/quantum/quantum/openstack/common/cfg.py", line 1152, in __getattr__
      return self._get(name)
    File "/home/jenkins/ababilov/quantum/quantum/openstack/common/cfg.py", line 1456, in _get
      value = self._substitute(self._do_get(name, group))
    File "/home/jenkins/ababilov/quantum/quantum/openstack/common/cfg.py", line 1472, in _do_get
      info = self._get_opt_info(name, group)
    File "/home/jenkins/ababilov/quantum/quantum/openstack/common/cfg.py", line 1572, in _get_opt_info
      raise NoSuchOptError(opt_name, group)
  NoSuchOptError: no such option: policy_file

  quantum/policy.py tries to use CONF.policy_file option that is
  normally set in quantum.common.config module during its
  initialization. Since quantum.common.config is not imported in unit
  test environment, policy_file option is absent.

  Possible fix: import quantum.common.config in quantum/policy.py.

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