Improve Share Migration tempest tests
Improve coverage by adding tests that validate the share-type
change while also changing the driver mode.
Closes-bug: #1620800
Change-Id: I924c34aa69591754b437d75f43db91d77e73fb07
diff --git a/manila_tempest_tests/utils.py b/manila_tempest_tests/utils.py
index 277130e..5c93443 100644
--- a/manila_tempest_tests/utils.py
+++ b/manila_tempest_tests/utils.py
@@ -115,3 +115,36 @@
None)
return selected_pool
+
+
+def get_configured_extra_specs(variation=None):
+ """Retrieve essential extra specs according to configuration in tempest.
+
+ :param variation: can assume possible values: None to be as configured in
+ tempest; 'opposite_driver_modes' for as configured in tempest but
+ inverse driver mode; 'invalid' for inverse as configured in tempest,
+ ideal for negative tests.
+ :return: dict containing essential extra specs.
+ """
+
+ extra_specs = {'storage_protocol': CONF.share.capability_storage_protocol}
+
+ if variation == 'invalid':
+ extra_specs['driver_handles_share_servers'] = (
+ not CONF.share.multitenancy_enabled)
+ extra_specs['snapshot_support'] = (
+ not CONF.share.capability_snapshot_support)
+
+ elif variation == 'opposite_driver_modes':
+ extra_specs['driver_handles_share_servers'] = (
+ not CONF.share.multitenancy_enabled)
+ extra_specs['snapshot_support'] = (
+ CONF.share.capability_snapshot_support)
+
+ else:
+ extra_specs['driver_handles_share_servers'] = (
+ CONF.share.multitenancy_enabled)
+ extra_specs['snapshot_support'] = (
+ CONF.share.capability_snapshot_support)
+
+ return extra_specs