Move all conditions skipped under "skip_checks" method
Manila tempest plugin class structure should be compatible
with tempest project as manila tempest plugin is a plugin
of tempest.
In some cases incompatibility can cause problems.
For example: using "check_uuid" tool for generating UUIDs
for tests does not work properly in manila, Because some
classes are wrapped with conditions skipped.
I suggest to use "skip_checks" method that been used to
evaluate config before tests methods and skip them based
on these checks.
This patch moves all conditions under this method.
Two new functions been added to "skip_checks" method
in order to skip by microversions and reduce a duplicated
code:
- "check_skip_with_microversion"
- "check_skip_with_microversion_not_supported"
Change-Id: Id0a15dbfbd3d85d7773c26e252f4cc4d906cf377
diff --git a/manila_tempest_tests/utils.py b/manila_tempest_tests/utils.py
index 357bbaa..2ea623d 100644
--- a/manila_tempest_tests/utils.py
+++ b/manila_tempest_tests/utils.py
@@ -92,6 +92,19 @@
return lambda f: f
+def check_skip_if_microversion_lt(microversion):
+ if is_microversion_lt(CONF.share.max_api_microversion, microversion):
+ reason = ("Skipped. Test requires microversion greater than or "
+ "equal to '%s'." % microversion)
+ raise testtools.TestCase.skipException(reason)
+
+
+def check_skip_if_microversion_not_supported(microversion):
+ if not is_microversion_supported(microversion):
+ reason = ("Skipped. Test requires microversion '%s'." % microversion)
+ raise testtools.TestCase.skipException(reason)
+
+
def rand_ip(network=False):
"""This uses the TEST-NET-3 range of reserved IP addresses.