Fix API version test skip logic

API tests must be evaluated by min and max
versions, however, we've multiple places
where we don't seem to evaluate the min_version;
this leads to incorrect behavior when test
runners set a different min_version in their
test configuration.

We can also consolidate the decorators and
callables that we have. We attempted this in
the recent past [1], however, we replaced the
callables with calling a decorator method, which
resulted in many tests not being skipped.

This bugfix is currently necessary to get
tests working against stable/ussuri and
stable/train branches.

[1] I0c35aff993e67c1ef44c27580f8c2c829a6275f7
Change-Id: I2eceb1d5fe42b1b779e115a0144a5d9639d3753f
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
This commit is contained in:
Goutham Pacha Ravi 2021-05-27 19:57:55 -07:00
parent 0031ba1138
commit a0acf25969
56 changed files with 153 additions and 163 deletions

View File

@ -149,7 +149,7 @@ class AdminActionsTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('49a576eb-733a-4299-aa6f-918fe7c67a6a')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.22")
@utils.skip_if_microversion_not_supported("2.22")
def test_reset_share_task_state(self):
for task_state in self.task_states:
self.shares_v2_client.reset_task_state(self.sh["id"], task_state)

View File

@ -144,7 +144,7 @@ class AdminActionsNegativeTest(base.BaseSharesMixedTest):
@decorators.idempotent_id('d662457c-2b84-4f13-aee7-5ffafe2552f1')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.22")
@utils.skip_if_microversion_not_supported("2.22")
def test_reset_task_state_invalid_state(self):
self.assertRaises(
lib_exc.BadRequest, self.admin_client.reset_task_state,
@ -169,7 +169,7 @@ class AdminActionsAPIOnlyNegativeTest(base.BaseSharesMixedTest):
@decorators.idempotent_id('aba8638c-bfed-4c3e-994b-5309fcd912b2')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@utils.skip_if_microversion_lt("2.22")
@utils.skip_if_microversion_not_supported("2.22")
def test_reset_task_state_share_not_found(self):
self.assertRaises(
lib_exc.NotFound, self.admin_client.reset_task_state,

View File

@ -29,7 +29,7 @@ class ExportLocationsNegativeTest(base.BaseSharesMixedTest):
@classmethod
def skip_checks(cls):
super(ExportLocationsNegativeTest, cls).skip_checks()
utils.check_skip_if_microversion_lt("2.9")
utils.check_skip_if_microversion_not_supported("2.9")
@classmethod
def resource_setup(cls):
@ -120,7 +120,7 @@ class ExportLocationsAPIOnlyNegativeTest(base.BaseSharesAdminTest):
@classmethod
def skip_checks(cls):
super(ExportLocationsAPIOnlyNegativeTest, cls).skip_checks()
utils.check_skip_if_microversion_lt("2.9")
utils.check_skip_if_microversion_not_supported("2.9")
@decorators.idempotent_id('4b5b4e89-0c80-4383-b272-62d5e0419d9a')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)

View File

@ -366,7 +366,7 @@ class MigrationCancelNFSTest(MigrationBase):
@decorators.idempotent_id('d39dfa1b-6e91-4efc-84f1-76f878b51f2a')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
@ddt.data(True, False)
def test_migration_cancel(self, force_host_assisted):
self._check_migration_enabled(force_host_assisted)
@ -404,7 +404,7 @@ class MigrationCancelNFSTest(MigrationBase):
@decorators.idempotent_id('640dce56-2084-488d-8dea-456840ff397e')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
@testtools.skipUnless(
CONF.share.run_snapshot_tests, 'Snapshot tests are disabled.')
@testtools.skipUnless(
@ -440,7 +440,7 @@ class MigrationOppositeDriverModesNFSTest(MigrationBase):
@decorators.idempotent_id('d8cce50d-e8da-4fbc-8f94-0827bf277b6c')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
@ddt.data(True, False)
def test_migration_opposite_driver_modes(self, force_host_assisted):
self._check_migration_enabled(force_host_assisted)
@ -508,7 +508,7 @@ class MigrationTwoPhaseNFSTest(MigrationBase):
@decorators.idempotent_id('e6cf0e4d-bdf3-49c1-b6ba-56d1ad6c81d2')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
@ddt.data(True, False)
def test_migration_2phase(self, force_host_assisted):
self._check_migration_enabled(force_host_assisted)
@ -560,7 +560,7 @@ class MigrationWithShareExtendingNFSTest(MigrationBase):
@decorators.idempotent_id('0e3d75e0-385a-4f7a-889f-2a3db79db8c2')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
@testtools.skipUnless(
CONF.share.run_extend_tests, 'Extend share tests are disabled.')
@ddt.data(True, False)
@ -574,7 +574,7 @@ class MigrationWithShareShrinkingNFSTest(MigrationBase):
@decorators.idempotent_id('58c72e51-d217-48bc-8155-5a010912312e')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
@testtools.skipUnless(
CONF.share.run_shrink_tests, 'Shrink share tests are disabled.')
@ddt.data(True, False)
@ -588,7 +588,7 @@ class MigrationOfShareWithSnapshotNFSTest(MigrationBase):
@decorators.idempotent_id('a95eb701-626a-4175-967b-4880d3716857')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
@testtools.skipUnless(
CONF.share.run_snapshot_tests, 'Snapshot tests are disabled.')
@testtools.skipUnless(
@ -630,7 +630,7 @@ class MigrationWithDifferentSnapshotSupportNFSTest(MigrationBase):
@decorators.idempotent_id('a18b3637-2070-4a1b-acd9-c392eb7963b5')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
@testtools.skipUnless(CONF.share.run_snapshot_tests,
'Snapshot tests are disabled.')
@ddt.data(True, False)
@ -643,7 +643,7 @@ class MigrationWithDifferentSnapshotSupportNFSTest(MigrationBase):
@decorators.idempotent_id('59313673-6576-4163-ab96-41bafcdad63a')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
@testtools.skipUnless(CONF.share.run_snapshot_tests,
'Snapshot tests are disabled.')
@ddt.data(True, False)

View File

@ -83,7 +83,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('8aa1f2a0-bc44-4df5-a556-161590e594a3')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.22")
@utils.skip_if_microversion_not_supported("2.22")
def test_migration_cancel_invalid(self):
self.assertRaises(
lib_exc.BadRequest, self.shares_v2_client.migration_cancel,
@ -91,7 +91,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('6d0dfb2e-51a0-4cb7-8c69-6135a49c6057')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.22")
@utils.skip_if_microversion_not_supported("2.22")
def test_migration_get_progress_None(self):
self.shares_v2_client.reset_task_state(self.share["id"], None)
waiters.wait_for_resource_status(
@ -103,7 +103,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('2ab1fc82-bc13-4c99-8324-c6b23530e8a4')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.22")
@utils.skip_if_microversion_not_supported("2.22")
def test_migration_complete_invalid(self):
self.assertRaises(
lib_exc.BadRequest, self.shares_v2_client.migration_complete,
@ -111,7 +111,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('8ef562b4-7704-4a78-973f-9bf8d2b6f6a6')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.22")
@utils.skip_if_microversion_not_supported("2.22")
def test_migration_cancel_not_found(self):
self.assertRaises(
lib_exc.NotFound, self.shares_v2_client.migration_cancel,
@ -119,7 +119,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('044c792b-63e0-42c3-9f44-dc2280e2af08')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.22")
@utils.skip_if_microversion_not_supported("2.22")
def test_migration_get_progress_not_found(self):
self.assertRaises(
lib_exc.NotFound, self.shares_v2_client.migration_get_progress,
@ -127,7 +127,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('a509871a-3f3a-4618-bb60-9661732dd371')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.22")
@utils.skip_if_microversion_not_supported("2.22")
def test_migration_complete_not_found(self):
self.assertRaises(
lib_exc.NotFound, self.shares_v2_client.migration_complete,
@ -135,7 +135,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('6276bea6-6939-4569-930f-218d99c0fa56')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_migrate_share_with_snapshot(self):
@ -150,7 +150,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('78670c24-c4ee-45b5-b166-2d053c333144')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
@ddt.data(True, False)
def test_migrate_share_same_host(self, specified):
new_share_type_id = None
@ -168,7 +168,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('af17204f-ffab-4ba8-8cb6-032e49216f67')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
def test_migrate_share_host_invalid(self):
self.assertRaises(
lib_exc.NotFound, self.shares_v2_client.migrate_share,
@ -176,7 +176,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('0558e9c4-0416-41d2-b28a-803d4b81521a')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
@ddt.data({'writable': False, 'preserve_metadata': False,
'preserve_snapshots': False, 'nondisruptive': True},
{'writable': False, 'preserve_metadata': False,
@ -198,7 +198,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('ee57024c-d00e-4def-8eec-cbc62bae327f')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
def test_migrate_share_change_type_no_valid_host(self):
if not CONF.share.multitenancy_enabled:
new_share_network_id = self.create_share_network(
@ -217,7 +217,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('e2bd0cca-c091-4785-a9dc-7f42d2bb95a5')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
def test_migrate_share_not_found(self):
self.assertRaises(
lib_exc.NotFound, self.shares_v2_client.migrate_share,
@ -225,7 +225,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('86b427a7-27c0-4cd5-8f52-9688b339980b')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
def test_migrate_share_not_available(self):
self.shares_client.reset_state(self.share['id'],
constants.STATUS_ERROR)
@ -242,7 +242,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('e8f1e491-697a-4941-bf51-4d37f0a93fa5')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
def test_migrate_share_invalid_share_network(self):
self.assertRaises(
lib_exc.BadRequest, self.shares_v2_client.migrate_share,
@ -251,7 +251,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('be262d44-2ca2-4b9c-be3a-5a6a98ed871b')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
def test_migrate_share_invalid_share_type(self):
self.assertRaises(
lib_exc.BadRequest, self.shares_v2_client.migrate_share,
@ -260,7 +260,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('16c72693-6f9e-4cb4-a166-c60accd3479b')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
def test_migrate_share_opposite_type_share_network_invalid(self):
extra_specs = utils.get_configured_extra_specs(
@ -286,7 +286,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('1f529b09-e404-4f0e-9423-bb4b117b5522')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.48")
@utils.skip_if_microversion_not_supported("2.48")
def test_share_type_azs_share_migrate_unsupported_az(self):
extra_specs = self.add_extra_specs_to_dict({
'availability_zones': 'non-existent az'})
@ -302,13 +302,13 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@testtools.skipUnless(CONF.share.run_driver_assisted_migration_tests,
"Driver-assisted migration tests are disabled.")
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
def test_create_snapshot_during_share_migration(self):
self._test_share_actions_during_share_migration('create_snapshot', [])
@decorators.idempotent_id('20121039-bb11-45d8-9972-d2daff7a779c')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
@ddt.data(('extend_share', [CONF.share.share_size + 2]),
('shrink_share', [CONF.share.share_size]))
@ddt.unpack
@ -326,7 +326,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('6e83fc25-4e3e-49a7-93e8-db4e6b355a91')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
def test_add_access_rule_during_migration(self):
access_type = "ip"
access_to = "50.50.50.50"

View File

@ -136,7 +136,7 @@ class SharesAdminQuotasTest(base.BaseSharesAdminTest):
@ddt.unpack
@decorators.idempotent_id('836e1725-2853-4d54-b281-8173773d8527')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@utils.skip_if_microversion_lt("2.39")
@utils.skip_if_microversion_not_supported("2.39")
def test_show_share_type_quotas(self, share_type_key, is_st_public):
# Check if the used microversion supports 'share_replica' and
# 'replica_gigabytes' quotas
@ -305,7 +305,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
@ddt.unpack
@decorators.idempotent_id('155ea3de-b3b5-4aa0-be8b-eebcc19ce874')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@utils.skip_if_microversion_lt("2.39")
@utils.skip_if_microversion_not_supported("2.39")
def test_update_share_type_quota(self, share_type_key, is_st_public):
# Check if the used microversion supports 'share_replica' and
# 'replica_gigabytes' quotas
@ -548,7 +548,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
@ddt.unpack
@decorators.idempotent_id('15e57302-5a14-4be4-8720-95b639c2bfad')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@utils.skip_if_microversion_lt("2.39")
@utils.skip_if_microversion_not_supported("2.39")
def test_reset_share_type_quotas(self, share_type_key, is_st_public):
share_type = self._create_share_type(is_public=is_st_public)
quota_keys = ['shares', 'snapshots', 'gigabytes', 'snapshot_gigabytes']
@ -767,7 +767,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
@ddt.data(11, -1)
@decorators.idempotent_id('315cb76f-920d-4cb9-ac7d-16be8e95e1b2')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@utils.skip_if_microversion_lt("2.39")
@utils.skip_if_microversion_not_supported("2.39")
def test_update_share_type_quotas_bigger_than_project_quota(self, st_q):
share_type = self._create_share_type()
@ -783,7 +783,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('c95be1eb-6331-4c37-9fac-ed6c36270457')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@utils.skip_if_microversion_lt("2.39")
@utils.skip_if_microversion_not_supported("2.39")
def test_set_share_type_quota_bigger_than_users_quota(self):
share_type = self._create_share_type()
@ -805,7 +805,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('4687eb25-17b3-4995-ace2-62f8bda29c57')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.39")
@utils.skip_if_microversion_not_supported("2.39")
def test_quotas_usages(self):
# Create share types
st_1, st_2 = (self._create_share_type()
@ -900,7 +900,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(
CONF.share.run_share_group_tests, 'Share Group tests disabled.')
@utils.skip_if_microversion_lt(SHARE_GROUPS_MICROVERSION)
@utils.skip_if_microversion_not_supported(SHARE_GROUPS_MICROVERSION)
def test_share_group_quotas_usages(self):
# Set quotas for project (3 SG, 1 SGS) and user (2 SG, 1 SGS)
self.update_quotas(self.tenant_id,

View File

@ -285,7 +285,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
@ddt.data('show', 'reset', 'update')
@decorators.idempotent_id('cf45eb7d-7330-4b2d-8214-e4149eb4a398')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@utils.skip_if_microversion_lt("2.39")
@utils.skip_if_microversion_not_supported("2.39")
def test_share_type_quotas_using_nonexistent_share_type(self, op):
kwargs = {"share_type": "fake_nonexistent_share_type"}
@ -301,7 +301,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
@ddt.data('id', 'name')
@decorators.idempotent_id('2ba641a1-100b-417e-80e2-d3f717fd3c7c')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@utils.skip_if_microversion_lt("2.39")
@utils.skip_if_microversion_not_supported("2.39")
def test_try_update_share_type_quota_for_share_networks(self, key):
share_type = self._create_share_type()
tenant_quotas = self.client.show_quotas(self.tenant_id)
@ -316,7 +316,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
@ddt.data('share_groups', 'share_group_snapshots')
@decorators.idempotent_id('5eb6ce15-1172-4bcb-9c7b-91543bf714e8')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@utils.skip_if_microversion_lt(SHARE_GROUPS_MICROVERSION)
@utils.skip_if_microversion_not_supported(SHARE_GROUPS_MICROVERSION)
def test_try_update_share_type_quota_for_share_groups(self, quota_name):
share_type = self._create_share_type()
tenant_quotas = self.client.show_quotas(self.tenant_id)
@ -366,7 +366,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
@ddt.data('show', 'reset', 'update')
@decorators.idempotent_id('acc609c2-f314-4540-984c-33e93d048f6c')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@utils.skip_if_microversion_lt("2.38")
@utils.skip_if_microversion_not_supported("2.38")
def test_share_type_quotas_using_too_old_microversion(self, op):
share_type = self._create_share_type()
kwargs = {"version": "2.38", "share_type": share_type["name"]}
@ -382,7 +382,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
@ddt.data('show', 'reset', 'update')
@decorators.idempotent_id('719768d1-d313-40e9-9127-c5777840ecbd')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@utils.skip_if_microversion_lt("2.39")
@utils.skip_if_microversion_not_supported("2.39")
def test_quotas_providing_share_type_and_user_id(self, op):
share_type = self._create_share_type()
kwargs = {"share_type": share_type["name"], "user_id": self.user_id}
@ -398,7 +398,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
@ddt.data(11, -1)
@decorators.idempotent_id('82256511-aa46-4b99-a6e5-8b400534e96d')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@utils.skip_if_microversion_lt("2.39")
@utils.skip_if_microversion_not_supported("2.39")
def test_update_share_type_quotas_bigger_than_project_quota(self, st_q):
share_type = self._create_share_type()
self.update_quotas(self.tenant_id, shares=10)
@ -446,7 +446,8 @@ class ReplicaQuotasNegativeTest(rep_neg_test.ReplicationNegativeBase):
if not CONF.share.run_quota_tests:
msg = "Quota tests are disabled."
raise cls.skipException(msg)
utils.check_skip_if_microversion_lt(SHARE_REPLICA_QUOTAS_MICROVERSION)
utils.check_skip_if_microversion_not_supported(
SHARE_REPLICA_QUOTAS_MICROVERSION)
def _modify_quotas_for_test(self, quota_key, new_limit):
kwargs = {quota_key: new_limit}

View File

@ -38,7 +38,8 @@ class ReplicationAdminTest(base.BaseSharesMixedTest):
if not CONF.share.run_replication_tests:
raise cls.skipException('Replication tests are disabled.')
utils.check_skip_if_microversion_lt(_MIN_SUPPORTED_MICROVERSION)
utils.check_skip_if_microversion_not_supported(
_MIN_SUPPORTED_MICROVERSION)
@classmethod
def resource_setup(cls):
@ -90,7 +91,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest):
LATEST_MICROVERSION]))
def test_promote_out_of_sync_share_replica(self, version):
"""Test promote 'out_of_sync' share replica to active state."""
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
if (self.replication_type
not in constants.REPLICATION_PROMOTION_CHOICES):
msg = "Option backend_replication_type should be one of (%s)!"
@ -153,7 +154,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest):
LATEST_MICROVERSION]))
def test_force_delete_share_replica(self, version):
"""Test force deleting a replica that is in 'error_deleting' status."""
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
replica = self.create_share_replica(self.share['id'],
self.replica_zone,
cleanup_in_class=False,
@ -176,7 +177,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest):
LATEST_MICROVERSION]))
def test_reset_share_replica_status(self, version):
"""Test resetting a replica's 'status' attribute."""
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
replica = self.create_share_replica(self.share['id'],
self.replica_zone,
cleanup_in_class=False,
@ -197,7 +198,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest):
LATEST_MICROVERSION]))
def test_reset_share_replica_state(self, version):
"""Test resetting a replica's 'replica_state' attribute."""
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
replica = self.create_share_replica(self.share['id'],
self.replica_zone,
cleanup_in_class=False,
@ -218,7 +219,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest):
LATEST_MICROVERSION]))
def test_resync_share_replica(self, version):
"""Test resyncing a replica."""
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
replica = self.create_share_replica(self.share['id'],
self.replica_zone,
cleanup_in_class=False,

View File

@ -37,7 +37,8 @@ class ReplicationActionsAdminTest(base.BaseSharesMixedTest):
raise cls.skipException(
'Only for driver_handles_share_servers = False driver mode.')
utils.check_skip_if_microversion_lt(_MIN_SUPPORTED_MICROVERSION)
utils.check_skip_if_microversion_not_supported(
_MIN_SUPPORTED_MICROVERSION)
@classmethod
def resource_setup(cls):

View File

@ -40,7 +40,7 @@ class ShareGroupTypesTest(base.BaseSharesAdminTest):
if not CONF.share.run_share_group_tests:
raise cls.skipException('Share Group tests disabled.')
utils.check_skip_if_microversion_lt(
utils.check_skip_if_microversion_not_supported(
constants.MIN_SHARE_GROUP_MICROVERSION)
@classmethod
@ -65,7 +65,7 @@ class ShareGroupTypesTest(base.BaseSharesAdminTest):
constants.SHARE_GROUPS_GRADUATION_VERSION])))
@ddt.unpack
def test_create_get_delete_share_group_type(self, st_key, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
name = data_utils.rand_name("tempest-manila")
# Create share group type
@ -151,7 +151,7 @@ class ShareGroupTypesTest(base.BaseSharesAdminTest):
constants.SHARE_GROUPS_GRADUATION_VERSION,
LATEST_MICROVERSION]))
def test_update_single_share_group_type_spec(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
name = data_utils.rand_name("tempest-manila")
group_specs = {'key1': 'value1', 'key2': 'value2'}
@ -207,7 +207,7 @@ class ShareGroupTypesTest(base.BaseSharesAdminTest):
constants.SHARE_GROUPS_GRADUATION_VERSION,
LATEST_MICROVERSION]))
def test_delete_single_share_group_type_spec_min(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
name = data_utils.rand_name("tempest-manila")
group_specs = {'key1': 'value1', 'key2': 'value2'}
@ -237,7 +237,7 @@ class ShareGroupTypesTest(base.BaseSharesAdminTest):
constants.SHARE_GROUPS_GRADUATION_VERSION,
LATEST_MICROVERSION]))
def test_private_share_group_type_access(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
name = data_utils.rand_name("tempest-manila")
group_specs = {"key1": "value1", "key2": "value2"}
project_id = self.shares_v2_client.tenant_id
@ -297,7 +297,7 @@ class ShareGroupTypesTest(base.BaseSharesAdminTest):
@ddt.data(*utils.deduplicate(('2.45', '2.46', LATEST_MICROVERSION)))
def test_share_group_type_create_show_list_with_is_default_key(self,
version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
name = data_utils.rand_name("tempest-manila")
# Create share group type

View File

@ -31,7 +31,7 @@ class ShareGroupTypesAdminNegativeTest(base.BaseSharesMixedTest):
if not CONF.share.run_share_group_tests:
raise cls.skipException('Share Group tests disabled.')
utils.check_skip_if_microversion_lt(
utils.check_skip_if_microversion_not_supported(
constants.MIN_SHARE_GROUP_MICROVERSION)
@classmethod

View File

@ -38,7 +38,7 @@ class ShareGroupsTest(base.BaseSharesAdminTest):
if not CONF.share.run_share_group_tests:
raise cls.skipException('Share Group tests disabled.')
utils.check_skip_if_microversion_lt(
utils.check_skip_if_microversion_not_supported(
constants.MIN_SHARE_GROUP_MICROVERSION)
@classmethod
@ -67,7 +67,7 @@ class ShareGroupsTest(base.BaseSharesAdminTest):
constants.SHARE_GROUPS_GRADUATION_VERSION,
LATEST_MICROVERSION]))
def test_create_share_group_with_single_share_type_min(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
share_group = self.create_share_group(
share_group_type_id=self.sg_type_id,
cleanup_in_class=False,
@ -142,7 +142,7 @@ class ShareGroupsTest(base.BaseSharesAdminTest):
constants.SHARE_GROUPS_GRADUATION_VERSION,
LATEST_MICROVERSION]))
def test_default_share_group_type_applied(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
try:
default_type = self.shares_v2_client.get_default_share_group_type(
version=version

View File

@ -34,7 +34,7 @@ class ShareGroupsNegativeTest(base.BaseSharesAdminTest):
if not CONF.share.run_share_group_tests:
raise cls.skipException('Share Group tests disabled.')
utils.check_skip_if_microversion_lt(
utils.check_skip_if_microversion_not_supported(
constants.MIN_SHARE_GROUP_MICROVERSION)
@decorators.idempotent_id('b90537b7-634d-4fca-b451-770fbcca7927')

View File

@ -70,7 +70,7 @@ class ShareInstancesTest(base.BaseSharesAdminTest):
@ddt.data('2.3', '2.9', '2.10', '2.30', '2.54')
def test_get_share_instance(self, version):
"""Test that we get the proper keys back for the instance."""
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
share_instances = self.shares_v2_client.get_instances_of_share(
self.share['id'], version=version,
@ -105,7 +105,7 @@ class ShareInstancesTest(base.BaseSharesAdminTest):
@ddt.data('path', 'id')
@decorators.idempotent_id('c27b415d-341c-42f0-a269-2c94f69fbee1')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.35")
@utils.skip_if_microversion_not_supported("2.35")
def test_list_share_instances_with_export_location_path_and_id(
self, export_location_type):
share_instances_except = (

View File

@ -49,7 +49,7 @@ class ShareInstancesNegativeTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('ce0d045c-e418-42fa-86e4-ead493fc0663')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.35")
@utils.skip_if_microversion_not_supported("2.35")
@ddt.data('path', 'id')
def test_list_share_instances_with_export_location_not_exist(
self, export_location_type):

View File

@ -37,7 +37,7 @@ class ManageShareServersTest(base.BaseSharesAdminTest):
if not CONF.share.run_manage_unmanage_tests:
raise cls.skipException('Manage/unmanage tests are disabled.')
utils.check_skip_if_microversion_lt('2.49')
utils.check_skip_if_microversion_not_supported('2.49')
@classmethod
def resource_setup(cls):

View File

@ -42,7 +42,7 @@ class ManageShareServersNegativeTest(base.BaseSharesAdminTest):
if not CONF.share.run_manage_unmanage_tests:
raise cls.skipException('Manage/unmanage tests are disabled.')
utils.check_skip_if_microversion_lt('2.49')
utils.check_skip_if_microversion_not_supported('2.49')
@classmethod
def resource_setup(cls):

View File

@ -40,7 +40,7 @@ class MigrationShareServerBase(base.BaseSharesAdminTest):
if not CONF.share.run_share_server_migration_tests:
raise cls.skipException(
'Share server migration tests are disabled.')
utils.check_skip_if_microversion_lt('2.57')
utils.check_skip_if_microversion_not_supported('2.57')
@classmethod
def resource_setup(cls):

View File

@ -34,7 +34,7 @@ class ShareSnapshotInstancesTest(base.BaseSharesAdminTest):
if not CONF.share.run_snapshot_tests:
raise cls.skipException('Snapshot tests are disabled.')
utils.check_skip_if_microversion_lt("2.19")
utils.check_skip_if_microversion_not_supported("2.19")
@classmethod
def resource_setup(cls):

View File

@ -32,7 +32,7 @@ class SnapshotInstancesNegativeTest(base.BaseSharesMixedTest):
if not CONF.share.run_snapshot_tests:
raise cls.skipException('Snapshot tests are disabled.')
utils.check_skip_if_microversion_lt('2.19')
utils.check_skip_if_microversion_not_supported('2.19')
@classmethod
def resource_setup(cls):
@ -86,7 +86,7 @@ class SnapshotInstancesNegativeNoResourceTest(base.BaseSharesMixedTest):
if not CONF.share.run_snapshot_tests:
raise cls.skipException('Snapshot tests are disabled.')
utils.check_skip_if_microversion_lt('2.19')
utils.check_skip_if_microversion_not_supported('2.19')
@classmethod
def resource_setup(cls):

View File

@ -73,7 +73,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data('2.0', '2.6', '2.7', '2.40', '2.41')
def test_share_type_create_get(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
name = data_utils.rand_name("tempest-manila")
description = None
@ -102,7 +102,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
# Check that backwards compatibility didn't break
self.assertDictMatch(get["volume_type"], get["share_type"])
@utils.skip_if_microversion_lt("2.50")
@utils.skip_if_microversion_not_supported("2.50")
@decorators.idempotent_id('a9af19e1-e789-4c4f-a39b-dd8df6ed00b1')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data(
@ -151,7 +151,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
st_is_public,
updated_st["share_type"]["share_type_access:is_public"])
@utils.skip_if_microversion_lt("2.50")
@utils.skip_if_microversion_not_supported("2.50")
@decorators.idempotent_id('9019dc61-b2b1-472d-9b15-a3986439d4c3')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data(
@ -186,7 +186,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data('2.0', '2.6', '2.7', '2.40', '2.41')
def test_share_type_create_list(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
name = data_utils.rand_name("tempest-manila")
description = None
@ -300,7 +300,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data(*utils.deduplicate(('2.45', '2.46', LATEST_MICROVERSION)))
def test_share_type_create_show_list_with_is_default_key(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
name = data_utils.rand_name("tempest-manila")
extra_specs = self.add_extra_specs_to_dict()

View File

@ -128,7 +128,7 @@ class ExtraSpecsWriteAdminTest(base.BaseSharesAdminTest):
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data(*utils.deduplicate(['2.24', LATEST_MICROVERSION]))
def test_delete_snapshot_support_extra_spec(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
# Delete one extra spec for share type
self.shares_v2_client.delete_share_type_extra_spec(
self.st_id, 'snapshot_support', version=version)

View File

@ -336,7 +336,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@ddt.data('2.0', '2.23')
def test_try_delete_required_spec_snapshot_support_version(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
st = self._create_share_type()
# Try delete extra spec 'snapshot_support'
self.assertRaises(

View File

@ -243,7 +243,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
for share in shares:
self.assertEqual(filters['host'], share['host'])
@utils.skip_if_microversion_lt("2.35")
@utils.skip_if_microversion_not_supported("2.35")
@ddt.data(('path', True), ('id', True), ('path', False), ('id', False))
@ddt.unpack
@decorators.idempotent_id('a27e5e3f-451f-4200-af38-99a562ccbe86')

View File

@ -38,7 +38,7 @@ class SnapshotExportLocationsTest(base.BaseSharesMixedTest):
if not CONF.share.run_mount_snapshot_tests:
raise cls.skipException('Mountable snapshots tests are disabled.')
utils.check_skip_if_microversion_lt("2.32")
utils.check_skip_if_microversion_not_supported("2.32")
@classmethod
def setup_clients(cls):

View File

@ -34,7 +34,7 @@ class SnapshotExportLocationsNegativeTest(base.BaseSharesMixedTest):
if not CONF.share.run_mount_snapshot_tests:
raise cls.skipException('Mountable snapshots tests are disabled.')
utils.check_skip_if_microversion_lt("2.32")
utils.check_skip_if_microversion_not_supported("2.32")
@classmethod
def setup_clients(cls):
@ -129,7 +129,7 @@ class SnapshotExportLocationsAPIOnlyNegativeTest(base.BaseSharesMixedTest):
if not CONF.share.run_mount_snapshot_tests:
raise cls.skipException('Mountable snapshots tests are disabled.')
utils.check_skip_if_microversion_lt('2.32')
utils.check_skip_if_microversion_not_supported('2.32')
@classmethod
def setup_clients(cls):

View File

@ -46,7 +46,7 @@ class ManageNFSSnapshotTest(base.BaseSharesAdminTest):
message = "%s tests are disabled" % cls.protocol
raise cls.skipException(message)
utils.check_skip_if_microversion_lt('2.12')
utils.check_skip_if_microversion_not_supported('2.12')
utils.skip_if_manage_not_supported_for_version()
@classmethod
@ -145,7 +145,7 @@ class ManageNFSSnapshotTest(base.BaseSharesAdminTest):
utils.skip_if_manage_not_supported_for_version(version)
# Skip in case specified version is not supported
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
snap_name = data_utils.rand_name("tempest-snapshot-name")
snap_desc = data_utils.rand_name("tempest-snapshot-description")

View File

@ -33,7 +33,7 @@ class ManageNFSSnapshotNegativeTest(base.BaseSharesAdminTest):
protocol = 'nfs'
@classmethod
@utils.skip_if_microversion_lt("2.12")
@utils.skip_if_microversion_not_supported("2.12")
@testtools.skipUnless(
CONF.share.run_manage_unmanage_snapshot_tests,
"Manage/unmanage snapshot tests are disabled.")

View File

@ -45,7 +45,7 @@ class UserMessageTest(base.BaseSharesAdminTest):
@classmethod
def skip_checks(cls):
super(UserMessageTest, cls).skip_checks()
utils.check_skip_if_microversion_lt(MICROVERSION)
utils.check_skip_if_microversion_not_supported(MICROVERSION)
def setUp(self):
super(UserMessageTest, self).setUp()

View File

@ -29,7 +29,7 @@ class UserMessageNegativeTest(base.BaseSharesMixedTest):
@classmethod
def skip_checks(cls):
super(UserMessageNegativeTest, cls).skip_checks()
utils.check_skip_if_microversion_lt(MICROVERSION)
utils.check_skip_if_microversion_not_supported(MICROVERSION)
def setUp(self):
super(UserMessageNegativeTest, self).setUp()

View File

@ -94,10 +94,6 @@ class handle_cleanup_exceptions(object):
return True # Suppress error if any
skip_if_microversion_not_supported = utils.skip_if_microversion_not_supported
skip_if_microversion_lt = utils.skip_if_microversion_lt
class BaseSharesTest(test.BaseTestCase):
"""Base test case class for all Manila API tests."""

View File

@ -48,7 +48,7 @@ class AccessRulesMetadataTest(base.BaseSharesMixedTest):
cls.message = "Rule tests are disabled"
raise cls.skipException(cls.message)
utils.check_skip_if_microversion_lt(
utils.check_skip_if_microversion_not_supported(
constants.MIN_SHARE_ACCESS_METADATA_MICROVERSION)
@classmethod

View File

@ -49,7 +49,7 @@ class AccessesMetadataNegativeTest(base.BaseSharesMixedTest):
cls.message = "Rule tests are disabled"
raise cls.skipException(cls.message)
utils.check_skip_if_microversion_lt(
utils.check_skip_if_microversion_not_supported(
constants.MIN_SHARE_ACCESS_METADATA_MICROVERSION)
@classmethod

View File

@ -99,7 +99,7 @@ class SharesQuotasTest(base.BaseSharesTest):
@decorators.idempotent_id('795614f6-4a18-47d5-b817-0b294e9d4c48')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_show_quotas_detail(self, microversion, with_user):
utils.skip_if_microversion_not_supported(microversion)
utils.check_skip_if_microversion_not_supported(microversion)
quota_args = {"tenant_id": self.tenant_id, "version": microversion, }
keys = ['gigabytes', 'snapshot_gigabytes', 'shares',
'snapshots', 'share_networks']

View File

@ -40,7 +40,8 @@ class ReplicationTest(base.BaseSharesMixedTest):
if not CONF.share.run_replication_tests:
raise cls.skipException('Replication tests are disabled.')
utils.check_skip_if_microversion_lt(_MIN_SUPPORTED_MICROVERSION)
utils.check_skip_if_microversion_not_supported(
_MIN_SUPPORTED_MICROVERSION)
@classmethod
def resource_setup(cls):
@ -380,7 +381,8 @@ class ReplicationActionsTest(base.BaseSharesMixedTest):
if not CONF.share.run_replication_tests:
raise cls.skipException('Replication tests are disabled.')
utils.check_skip_if_microversion_lt(_MIN_SUPPORTED_MICROVERSION)
utils.check_skip_if_microversion_not_supported(
_MIN_SUPPORTED_MICROVERSION)
@classmethod
def resource_setup(cls):

View File

@ -125,7 +125,7 @@ class ReplicationExportLocationsTest(base.BaseSharesMixedTest):
@ddt.data(*utils.deduplicate(['2.46', '2.47', LATEST_MICROVERSION]))
def test_replicated_share_export_locations(self, version):
"""Test behavior changes in the share export locations API at 2.47"""
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
share, replica, primary_replica_exports, replica_exports = (
self._create_share_and_replica_get_exports()
)
@ -146,7 +146,7 @@ class ReplicationExportLocationsTest(base.BaseSharesMixedTest):
(constants.REPLICATION_STYLE_READABLE, constants.REPLICATION_STYLE_DR),
'Promotion of secondary not supported in writable replication style.')
def test_replicated_share_export_locations_with_promotion(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
share, replica, primary_replica_exports, replica_exports = (
self._create_share_and_replica_get_exports(cleanup_replica=False)
)

View File

@ -37,7 +37,8 @@ class ReplicationNegativeBase(base.BaseSharesMixedTest):
if not CONF.share.run_replication_tests:
raise cls.skipException('Replication tests are disabled.')
utils.check_skip_if_microversion_lt(_MIN_SUPPORTED_MICROVERSION)
utils.check_skip_if_microversion_not_supported(
_MIN_SUPPORTED_MICROVERSION)
@classmethod
def resource_setup(cls):
@ -207,7 +208,7 @@ class ReplicationNegativeTest(ReplicationNegativeBase):
CONF.share.run_driver_assisted_migration_tests,
"Share migration tests are disabled.")
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
def test_migration_of_replicated_share(self):
pools = self.admin_client.list_pools(detail=True)['pools']
hosts = [p['name'] for p in pools]
@ -226,7 +227,7 @@ class ReplicationNegativeTest(ReplicationNegativeBase):
@decorators.idempotent_id('bf01bcfc-57cb-4e56-957f-8aa9f1b9be1b')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.48")
@utils.skip_if_microversion_not_supported("2.48")
def test_try_add_replica_share_type_azs_unsupported_az(self):
self.admin_shares_v2_client.update_share_type_extra_spec(
self.share_type['id'], 'availability_zones', 'non-existent az')
@ -242,7 +243,7 @@ class ReplicationNegativeTest(ReplicationNegativeBase):
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
@utils.skip_if_microversion_lt("2.51")
@utils.skip_if_microversion_not_supported("2.51")
def test_try_add_replica_nonexistent_subnet(self):
# Create a new share network only for a specific az
data = self.generate_share_network_data()
@ -268,7 +269,8 @@ class ReplicationAPIOnlyNegativeTest(base.BaseSharesTest):
if not CONF.share.run_replication_tests:
raise cls.skipException('Replication tests are disabled.')
utils.check_skip_if_microversion_lt(_MIN_SUPPORTED_MICROVERSION)
utils.check_skip_if_microversion_not_supported(
_MIN_SUPPORTED_MICROVERSION)
@decorators.idempotent_id('72395c9b-4432-4a8b-84b4-60303e6bc962')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)

View File

@ -38,7 +38,8 @@ class ReplicationSnapshotTest(base.BaseSharesMixedTest):
if not CONF.share.run_snapshot_tests:
raise cls.skipException('Snapshot tests disabled.')
utils.check_skip_if_microversion_lt(_MIN_SUPPORTED_MICROVERSION)
utils.check_skip_if_microversion_not_supported(
_MIN_SUPPORTED_MICROVERSION)
@classmethod
def resource_setup(cls):

View File

@ -595,7 +595,7 @@ class ShareRulesTest(base.BaseSharesMixedTest):
@ddt.data(*utils.deduplicate(
['1.0', '2.9', '2.27', '2.28', '2.45', LATEST_MICROVERSION]))
def test_list_access_rules(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
if (utils.is_microversion_lt(version, '2.13') and
CONF.share.enable_cephx_rules_for_protocols):
msg = ("API version %s does not support cephx access type, need "

View File

@ -48,7 +48,7 @@ class SecurityServiceListMixin(object):
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data(*utils.deduplicate(['1.0', '2.42', '2.44', LATEST_MICROVERSION]))
def test_list_security_services_with_detail(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
with_ou = True if utils.is_microversion_ge(version, '2.44') else False
if utils.is_microversion_ge(version, '2.0'):
listed = self.shares_v2_client.list_security_services(
@ -171,7 +171,7 @@ class SecurityServicesTest(base.BaseSharesMixedTest,
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data(*utils.deduplicate(['1.0', '2.43', '2.44', LATEST_MICROVERSION]))
def test_get_security_service(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
with_ou = True if utils.is_microversion_ge(version, '2.44') else False
data = self.generate_security_service_data(set_ou=with_ou)

View File

@ -38,7 +38,7 @@ class ShareGroupActionsTest(base.BaseSharesMixedTest):
if not CONF.share.run_share_group_tests:
raise cls.skipException('Share Group tests disabled.')
utils.check_skip_if_microversion_lt(
utils.check_skip_if_microversion_not_supported(
constants.MIN_SHARE_GROUP_MICROVERSION)
@classmethod
@ -111,7 +111,7 @@ class ShareGroupActionsTest(base.BaseSharesMixedTest):
constants.SHARE_GROUPS_GRADUATION_VERSION,
LATEST_MICROVERSION]))
def test_get_share_group(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
# Get share group
share_group = self.shares_v2_client.get_share_group(
@ -166,7 +166,7 @@ class ShareGroupActionsTest(base.BaseSharesMixedTest):
constants.SHARE_GROUPS_GRADUATION_VERSION,
LATEST_MICROVERSION]))
def test_list_share_groups(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
# List share groups
share_groups = self.shares_v2_client.list_share_groups(
@ -198,7 +198,7 @@ class ShareGroupActionsTest(base.BaseSharesMixedTest):
constants.SHARE_GROUPS_GRADUATION_VERSION,
LATEST_MICROVERSION]))
def test_list_share_groups_with_detail_min(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
params = None
if utils.is_microversion_ge(version, '2.36'):
params = {'name~': 'tempest', 'description~': 'tempest'}
@ -259,7 +259,7 @@ class ShareGroupActionsTest(base.BaseSharesMixedTest):
constants.SHARE_GROUPS_GRADUATION_VERSION,
LATEST_MICROVERSION]))
def test_get_share_group_snapshot(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
# Get share group snapshot
sg_snapshot = self.shares_v2_client.get_share_group_snapshot(
@ -317,7 +317,7 @@ class ShareGroupActionsTest(base.BaseSharesMixedTest):
LATEST_MICROVERSION]))
def test_create_share_group_from_populated_share_group_snapshot(self,
version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
sg_snapshot = self.shares_v2_client.get_share_group_snapshot(
self.sg_snapshot['id'],
@ -382,7 +382,7 @@ class ShareGroupRenameTest(base.BaseSharesMixedTest):
if not CONF.share.run_share_group_tests:
raise cls.skipException('Share Group tests disabled.')
utils.check_skip_if_microversion_lt(
utils.check_skip_if_microversion_not_supported(
constants.MIN_SHARE_GROUP_MICROVERSION)
@classmethod
@ -422,7 +422,7 @@ class ShareGroupRenameTest(base.BaseSharesMixedTest):
constants.SHARE_GROUPS_GRADUATION_VERSION,
LATEST_MICROVERSION]))
def test_update_share_group(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
# Get share_group
share_group = self.shares_v2_client.get_share_group(
@ -463,7 +463,7 @@ class ShareGroupRenameTest(base.BaseSharesMixedTest):
constants.SHARE_GROUPS_GRADUATION_VERSION,
LATEST_MICROVERSION]))
def test_create_update_read_share_group_with_unicode(self, version):
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
value1 = u'ಠ_ಠ'
value2 = u'ಠ_ರೃ'

View File

@ -36,7 +36,7 @@ class ShareGroupsTest(base.BaseSharesMixedTest):
if not CONF.share.run_share_group_tests:
raise cls.skipException('Share Group tests disabled.')
utils.check_skip_if_microversion_lt(
utils.check_skip_if_microversion_not_supported(
constants.MIN_SHARE_GROUP_MICROVERSION)
@classmethod
@ -196,7 +196,7 @@ class ShareGroupsTest(base.BaseSharesMixedTest):
new_share_group['share_network_id'],
msg)
@utils.skip_if_microversion_lt("2.34")
@utils.skip_if_microversion_not_supported("2.34")
@decorators.idempotent_id('14fd6d88-87ff-4af2-ad17-f95dbd8dcd61')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(

View File

@ -35,7 +35,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
if not CONF.share.run_share_group_tests:
raise cls.skipException('Share Group tests disabled.')
utils.check_skip_if_microversion_lt(
utils.check_skip_if_microversion_not_supported(
constants.MIN_SHARE_GROUP_MICROVERSION)
@classmethod
@ -290,7 +290,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
share_type_ids=[self.share_type_id],
version=constants.MIN_SHARE_GROUP_MICROVERSION)
@utils.skip_if_microversion_lt("2.34")
@utils.skip_if_microversion_not_supported("2.34")
@decorators.idempotent_id('64527564-9cd6-42db-8897-910f4fc1a151')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_create_sg_and_share_with_different_azs(self):

View File

@ -31,7 +31,7 @@ class ShareNetworkSubnetsTest(base.BaseSharesMixedTest):
@classmethod
def skip_checks(cls):
super(ShareNetworkSubnetsTest, cls).skip_checks()
utils.check_skip_if_microversion_lt("2.51")
utils.check_skip_if_microversion_not_supported("2.51")
@classmethod
def resource_setup(cls):

View File

@ -35,7 +35,7 @@ class ShareNetworkSubnetsNegativeTest(base.BaseSharesAdminTest):
@classmethod
def skip_checks(cls):
super(ShareNetworkSubnetsNegativeTest, cls).skip_checks()
utils.check_skip_if_microversion_lt("2.51")
utils.check_skip_if_microversion_not_supported("2.51")
@classmethod
def resource_setup(cls):

View File

@ -111,7 +111,7 @@ class ShareNetworkListMixin(object):
@decorators.idempotent_id('bff1356e-70aa-4bbe-b398-cb4dadd8fcb1')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@utils.skip_if_microversion_lt("2.36")
@utils.skip_if_microversion_not_supported("2.36")
def test_list_share_networks_like_filter(self):
valid_filter_opts = {
'name': 'sn_with_ldap_ss',
@ -300,7 +300,7 @@ class ShareNetworksTest(base.BaseSharesMixedTest, ShareNetworkListMixin):
@testtools.skipUnless(CONF.share.multitenancy_enabled,
"Only for multitenancy.")
@testtools.skipUnless(CONF.service_available.neutron, "Only with neutron.")
@utils.skip_if_microversion_lt("2.18")
@utils.skip_if_microversion_not_supported("2.18")
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_gateway_with_neutron(self):
subnet_client = self.subnets_client
@ -324,7 +324,7 @@ class ShareNetworksTest(base.BaseSharesMixedTest, ShareNetworkListMixin):
@testtools.skipUnless(CONF.share.multitenancy_enabled,
"Only for multitenancy.")
@testtools.skipUnless(CONF.service_available.neutron, "Only with neutron.")
@utils.skip_if_microversion_lt("2.20")
@utils.skip_if_microversion_not_supported("2.20")
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_mtu_with_neutron(self):
network_client = self.networks_client

View File

@ -156,7 +156,7 @@ class ShareNetworksNegativeTest(base.BaseSharesMixedTest):
self.assertEqual(0, len(share_networks))
@utils.skip_if_microversion_lt("2.51")
@utils.skip_if_microversion_not_supported("2.51")
@decorators.idempotent_id('8a995305-ede9-4002-a9cd-f24ff4d71f63')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_delete_share_network_contains_more_than_one_subnet(self):
@ -185,7 +185,7 @@ class ShareNetworksNegativeTest(base.BaseSharesMixedTest):
default_subnet = share_network['share_network_subnets'][0]
self.assertIsNone(default_subnet['availability_zone'])
@utils.skip_if_microversion_lt("2.51")
@utils.skip_if_microversion_not_supported("2.51")
@decorators.idempotent_id('d84c3c5c-5913-42d4-9a66-0d5a78295adb')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_create_share_network_inexistent_az(self):

View File

@ -80,7 +80,7 @@ class ShareTypesNegativeTest(base.BaseSharesMixedTest):
self.st['id'],
self.shares_client.tenant_id)
@utils.skip_if_microversion_lt("2.50")
@utils.skip_if_microversion_not_supported("2.50")
@decorators.idempotent_id('4a22945c-8988-43a1-88c9-eb86e6abcd8e')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@ddt.data(
@ -101,7 +101,7 @@ class ShareTypesNegativeTest(base.BaseSharesMixedTest):
st_id, st_name, st_is_public, st_description,
version)
@utils.skip_if_microversion_lt("2.50")
@utils.skip_if_microversion_not_supported("2.50")
@decorators.idempotent_id('7193465a-ed8e-44d5-9ca9-4e8a3c5958e0')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@ddt.data('2.50', LATEST_MICROVERSION)

View File

@ -369,7 +369,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
@decorators.idempotent_id('f446e8cb-5bef-45ac-8b87-f4136f44ca69')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.36")
@utils.skip_if_microversion_not_supported("2.36")
def test_list_shares_with_detail_filter_by_existed_description(self):
# list shares by description, at least one share is expected
params = {"description": self.share_desc}
@ -378,7 +378,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
@decorators.idempotent_id('1276b97b-cf46-4953-973f-f995985a1ce4')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.36")
@utils.skip_if_microversion_not_supported("2.36")
def test_list_shares_with_detail_filter_by_inexact_name(self):
# list shares by name, at least one share is expected
params = {"name~": 'tempest-share'}
@ -428,7 +428,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
@decorators.idempotent_id('0019afa2-fae2-417f-a7e0-2af665a966b0')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.42")
@utils.skip_if_microversion_not_supported("2.42")
def test_list_shares_with_detail_with_count(self):
# list shares by name, at least one share is expected
params = {"with_count": 'true'}
@ -446,7 +446,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
if version is None:
snapshot = self.shares_client.get_snapshot(self.snap["id"])
else:
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
snapshot = self.shares_v2_client.get_snapshot(
self.snap["id"], version=version)
@ -523,7 +523,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
if version is None:
snaps = self.shares_client.list_snapshots_with_detail()
else:
utils.skip_if_microversion_not_supported(version)
utils.check_skip_if_microversion_not_supported(version)
snaps = self.shares_v2_client.list_snapshots_with_detail(
version=version, params=params)

View File

@ -186,7 +186,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest):
@decorators.idempotent_id('ffc3dc76-2f92-4308-a125-1d3905ed72ba')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_lt("2.35")
@utils.skip_if_microversion_not_supported("2.35")
@ddt.data('path', 'id')
def test_list_shares_with_export_location_not_exist(
self, export_location_type):

View File

@ -68,7 +68,7 @@ class SharesFromSnapshotAcrossPools(base.BaseSharesMixedTest):
raise cls.skipException(
'Create share from snapshot in another pool or az tests are '
'disabled.')
utils.check_skip_if_microversion_lt("2.54")
utils.check_skip_if_microversion_not_supported("2.54")
@decorators.idempotent_id('6f1fa7d0-94f2-4373-8730-b0986781cc88')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)

View File

@ -21,6 +21,7 @@ from testtools import testcase as tc
from manila_tempest_tests import share_exceptions
from manila_tempest_tests.tests.api import base
from manila_tempest_tests import utils
CONF = config.CONF
@ -283,7 +284,7 @@ class SharesAPIOnlyNegativeTest(base.BaseSharesMixedTest):
self.assertRaises(lib_exc.NotFound,
self.shares_client.delete_share, '')
@base.skip_if_microversion_lt("2.61")
@utils.skip_if_microversion_not_supported("2.61")
@decorators.idempotent_id('b8097d56-067e-4d7c-8401-31bc7021fe86')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_create_share_size_greater_than_specified_in_share_type(self):
@ -293,7 +294,7 @@ class SharesAPIOnlyNegativeTest(base.BaseSharesMixedTest):
size=int(CONF.share.share_size) + 5,
share_type_id=self.share_type_min_2_max_5_id)
@base.skip_if_microversion_lt("2.61")
@utils.skip_if_microversion_not_supported("2.61")
@decorators.idempotent_id('b8097d56-067e-4d7c-8401-31bc7021fe87')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_create_share_size_less_than_specified_in_share_type(self):

View File

@ -80,7 +80,7 @@ class ShareSnapshotIpRulesForNFSTest(BaseShareSnapshotRulesTest):
msg = "IP rule tests for %s protocol are disabled." % cls.protocol
raise cls.skipException(msg)
utils.check_skip_if_microversion_lt('2.32')
utils.check_skip_if_microversion_not_supported('2.32')
@classmethod
def resource_setup(cls):
@ -108,7 +108,7 @@ class ShareSnapshotUserRulesForCIFSTest(BaseShareSnapshotRulesTest):
msg = ("User rule tests for %s protocol are "
"disabled." % cls.protocol)
raise cls.skipException(msg)
utils.check_skip_if_microversion_lt('2.32')
utils.check_skip_if_microversion_not_supported('2.32')
@classmethod
def resource_setup(cls):

View File

@ -44,7 +44,7 @@ class SnapshotIpRulesForNFSNegativeTest(
msg = "IP rule tests for %s protocol are disabled." % cls.protocol
raise cls.skipException(msg)
utils.check_skip_if_microversion_lt('2.32')
utils.check_skip_if_microversion_not_supported('2.32')
@classmethod
def resource_setup(cls):

View File

@ -133,7 +133,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
@decorators.idempotent_id('15d42949-545e-4ad8-b06e-bb2556c54375')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@utils.skip_if_microversion_lt("2.29")
@utils.skip_if_microversion_not_supported("2.29")
@testtools.skipUnless(CONF.share.run_host_assisted_migration_tests or
CONF.share.run_driver_assisted_migration_tests,
"Share migration tests are disabled.")
@ -340,7 +340,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
@decorators.idempotent_id('c98e6876-3a4f-40e8-8b4f-023c94c242c3')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@utils.skip_if_microversion_lt("2.32")
@utils.skip_if_microversion_not_supported("2.32")
@testtools.skipUnless(CONF.share.run_mount_snapshot_tests,
'Mountable snapshots tests are disabled.')
@testtools.skipUnless(CONF.share.run_snapshot_tests,

View File

@ -95,23 +95,8 @@ def skip_if_microversion_not_supported(microversion):
return lambda f: f
def skip_if_microversion_lt(microversion):
"""Decorator for tests that are microversion-specific."""
if is_microversion_lt(CONF.share.max_api_microversion, microversion):
reason = ("Skipped. Test requires microversion greater than or "
"equal to '%s'." % microversion)
return testtools.skip(reason)
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):
"""Callable method for tests that are microversion-specific."""
if not is_microversion_supported(microversion):
reason = ("Skipped. Test requires microversion '%s'." % microversion)
raise testtools.TestCase.skipException(reason)