Fix rbac_rule_validation test being incorrectly skipped
Unit tests should not be skipped. Currently, however, the test
test_invalid_policy_rule_throws_parsing_exception is being skipped,
because after strict_policy_check was introduced [0], a skip
exception is thrown (when strict_policy_check is False, which it
is by default), instead of an "actual" exception.
Thus, the test was being skipped incorrectly.
This patch fixes that by overriding strict_policy_check in
the test to be True.
[0] https://review.openstack.org/#/c/449340/
Change-Id: I95b4150ebaf729ff8d0e1569ba591b8275779aa8
diff --git a/patrole_tempest_plugin/tests/unit/test_rbac_rule_validation.py b/patrole_tempest_plugin/tests/unit/test_rbac_rule_validation.py
index 38b5fea..78d8e66 100644
--- a/patrole_tempest_plugin/tests/unit/test_rbac_rule_validation.py
+++ b/patrole_tempest_plugin/tests/unit/test_rbac_rule_validation.py
@@ -274,6 +274,11 @@
def test_invalid_policy_rule_throws_parsing_exception(
self, mock_rbac_policy_parser):
"""Test that invalid policy action causes test to be skipped."""
+ CONF.set_override('strict_policy_check', True, group='rbac',
+ enforce_type=True)
+ self.addCleanup(CONF.clear_override, 'strict_policy_check',
+ group='rbac')
+
mock_rbac_policy_parser.RbacPolicyParser.return_value.allowed.\
side_effect = rbac_exceptions.RbacParsingException