fix gate failure rabbitmq auth rejected and oslo policy mock

Change-Id: Ie867a54207795894090907ef0b2868b4a9bf9990
This commit is contained in:
Eric Kao 2017-10-04 12:28:07 -07:00
parent 9c20850fa1
commit 1335688b5f
2 changed files with 13 additions and 4 deletions

View File

@ -106,16 +106,22 @@ class PolicyTestCase(base.TestCase):
result = policy.enforce(self.context, action, self.target)
self.assertTrue(result)
@mock.patch.object(oslo_policy._checks.HttpCheck, '__call__',
return_value=True)
@mock.patch.object(
oslo_policy._checks.HttpCheck, '__call__',
new_callable=lambda *args, **kwargs: (lambda *args, **kwargs: True))
# Note: since 2017/10/4 we get a type error without wrapping the True with
# TWO lambdas (only in py27 not py35)
def test_enforce_http_true(self, mock_httpcheck):
action = "example:get_http"
target = {}
result = policy.enforce(self.context, action, target)
self.assertTrue(result)
@mock.patch.object(oslo_policy._checks.HttpCheck, '__call__',
return_value=False)
@mock.patch.object(
oslo_policy._checks.HttpCheck, '__call__',
new_callable=lambda *args, **kwargs: (lambda *args, **kwargs: False))
# Note: since 2017/10/4 we get a type error without wrapping the False with
# TWO lambdas (only in py27 not py35)
def test_enforce_http_false(self, mock_httpcheck):
action = "example:get_http"
target = {}

View File

@ -63,6 +63,9 @@ function configure_congress {
iniset $CONGRESS_CONF DEFAULT datasource_sync_period 30
iniset $CONGRESS_CONF DEFAULT replicated_policy_engine "$CONGRESS_REPLICATED"
if [ "$CONGRESS_MULTIPROCESS_DEPLOYMENT" == "True" ]; then
iniset $CONGRESS_CONF DEFAULT transport_url rabbit://$RABBIT_USERID:$RABBIT_PASSWORD@$RABBIT_HOST:5672
fi
# if [ "$CONGRESS_MULTIPROCESS_DEPLOYMENT" == "False" ]; then
# iniset $CONGRESS_CONF DEFAULT transport_url $CONGRESS_TRANSPORT_URL
# fi