Cleanup access rule test skip conditions
There are some generic access rules test cases under:
- tests.api.test_rules.ShareRulesTest
- tests.api.test_access_rules_metadata.AccessRulesMetadataTest
- tests.api.test_access_rules_metadata_negative.AccessesMetadataNegativeTest
These test cases don't care about what protocol is being
tested and what access rule is being applied. However,
they were doing the wrong thing of requesting a share of
an unsupported protocol if a wrong configuration is presented
via the configuration options enable_*_rules_for_protocols.
There's also an infructuous test skip for cephfs tests
added with the shares v1 client even when there are
no shares created within the
tests.api.test_rules_negative.ShareRulesNegativeTest class
that we can get rid of.
Change-Id: I8b94d0dcf2e4ab1d82d9d1ec4d4934c65d095e32
Closes-Bug: #1879486
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
diff --git a/manila_tempest_tests/tests/api/base.py b/manila_tempest_tests/tests/api/base.py
index 2ed43c7..671ccf3 100644
--- a/manila_tempest_tests/tests/api/base.py
+++ b/manila_tempest_tests/tests/api/base.py
@@ -799,14 +799,15 @@
status_attr="replica_state")
return replica
- def _get_access_rule_data_from_config(self):
+ @classmethod
+ def _get_access_rule_data_from_config(cls):
"""Get the first available access type/to combination from config.
This method opportunistically picks the first configured protocol
to create the share. Do not use this method in tests where you need
to test depth and breadth in the access types and access recipients.
"""
- protocol = self.shares_v2_client.share_protocol
+ protocol = cls.shares_v2_client.share_protocol
if protocol in CONF.share.enable_ip_rules_for_protocols:
access_type = "ip"
@@ -822,7 +823,7 @@
access_to = "eve"
else:
message = "Unrecognized protocol and access rules configuration."
- raise self.skipException(message)
+ raise cls.skipException(message)
return access_type, access_to