policy concurrency issue in unittests

Bug #1362468 reported by Valeriy Ponomaryov on 2014-08-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Manila
Critical
Valeriy Ponomaryov

Bug Description

After merge of following commit: https://github.com/stackforge/manila/commit/4f17b8d837ebad4ef2e8ae5fe95ea968c7b8b587

appears unstable error:

2014-08-28 06:30:32.934 | FAIL: manila.tests.api.v1.test_share_networks.ShareNetworkAPITest.test_action_add_security_service_conflict
2014-08-28 06:30:32.934 | tags: worker-1
2014-08-28 06:30:32.934 | ----------------------------------------------------------------------
2014-08-28 06:30:32.934 | Traceback (most recent call last):
2014-08-28 06:30:32.934 | File "/home/jenkins/workspace/gate-manila-python27/.tox/py27/local/lib/python2.7/site-packages/mock.py", line 1201, in patched
2014-08-28 06:30:32.935 | return func(*args, **keywargs)
2014-08-28 06:30:32.935 | File "manila/tests/api/v1/test_share_networks.py", line 314, in test_action_add_security_service_conflict
2014-08-28 06:30:32.935 | body)
2014-08-28 06:30:32.935 | File "/home/jenkins/workspace/gate-manila-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 410, in assertRaises
2014-08-28 06:30:32.935 | self.assertThat(our_callable, matcher)
2014-08-28 06:30:32.935 | File "/home/jenkins/workspace/gate-manila-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 421, in assertThat
2014-08-28 06:30:32.935 | mismatch_error = self._matchHelper(matchee, matcher, message, verbose)
2014-08-28 06:30:32.935 | File "/home/jenkins/workspace/gate-manila-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 471, in _matchHelper
2014-08-28 06:30:32.935 | mismatch = matcher.match(matchee)
2014-08-28 06:30:32.935 | File "/home/jenkins/workspace/gate-manila-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 108, in match
2014-08-28 06:30:32.935 | mismatch = self.exception_matcher.match(exc_info)
2014-08-28 06:30:32.935 | File "/home/jenkins/workspace/gate-manila-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_higherorder.py", line 62, in match
2014-08-28 06:30:32.936 | mismatch = matcher.match(matchee)
2014-08-28 06:30:32.936 | File "/home/jenkins/workspace/gate-manila-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 402, in match
2014-08-28 06:30:32.936 | reraise(*matchee)
2014-08-28 06:30:32.936 | File "/home/jenkins/workspace/gate-manila-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 101, in match
2014-08-28 06:30:32.936 | result = matchee()
2014-08-28 06:30:32.936 | File "/home/jenkins/workspace/gate-manila-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 932, in __call__
2014-08-28 06:30:32.936 | return self._callable_object(*self._args, **self._kwargs)
2014-08-28 06:30:32.936 | File "manila/api/v1/share_networks.py", line 239, in action
2014-08-28 06:30:32.936 | return _actions[action](req, id, data)
2014-08-28 06:30:32.936 | File "manila/api/v1/share_networks.py", line 247, in _add_security_service
2014-08-28 06:30:32.936 | policy.check_policy(context, RESOURCE_NAME, 'add_security_service')
2014-08-28 06:30:32.937 | File "manila/policy.py", line 105, in check_policy
2014-08-28 06:30:32.937 | enforce(context, _action, target)
2014-08-28 06:30:32.937 | File "manila/policy.py", line 68, in enforce
2014-08-28 06:30:32.937 | return _ENFORCER.enforce(action, target, context, **extra)
2014-08-28 06:30:32.937 | File "manila/openstack/common/policy.py", line 307, in enforce
2014-08-28 06:30:32.937 | raise exc(*args, **kwargs)
2014-08-28 06:30:32.937 | PolicyNotAuthorized: Policy doesn't allow share_network:add_security_service to be performed.

Changed in manila:
importance: Undecided → Critical
assignee: nobody → Valeriy Ponomaryov (vponomaryov)
status: New → In Progress

Reviewed: https://review.openstack.org/117461
Committed: https://git.openstack.org/cgit/stackforge/manila/commit/?id=140d594c042de324fb5ab3c187cf1564c9733140
Submitter: Jenkins
Branch: master

commit 140d594c042de324fb5ab3c187cf1564c9733140
Author: vponomaryov <email address hidden>
Date: Thu Aug 28 12:19:11 2014 +0300

    Fix concurrent policy issue in unittest

    After merge of following commit: 4f17b8d837ebad4ef2e8ae5fe95ea968c7b8b587
    appears unstable error when we get denial from policy check.
    'Fix' mocks policy.check_policy method and tests that it was called.
    We do not test policy actions in related unittest suite located in
    'manila.tests.api.v1.test_share_networks' module, and should not.

    Change-Id: I8885fa622e603c2e1882709d427e2fd1b532197c
    Closes-Bug: #1362468

Changed in manila:
status: In Progress → Fix Committed
Changed in manila:
status: Fix Committed → Fix Released
Changed in manila:
milestone: none → juno-3
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers