diff --git a/manila_tempest_tests/tests/api/admin/test_admin_actions.py b/manila_tempest_tests/tests/api/admin/test_admin_actions.py index ac862d410e..3df0ae4788 100644 --- a/manila_tempest_tests/tests/api/admin/test_admin_actions.py +++ b/manila_tempest_tests/tests/api/admin/test_admin_actions.py @@ -14,8 +14,8 @@ # under the License. from tempest import config -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -39,13 +39,13 @@ class AdminActionsTest(base.BaseSharesAdminTest): if CONF.share.run_snapshot_tests: cls.sn = cls.create_snapshot_wait_for_active(cls.sh["id"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_reset_share_state(self): for status in self.states: self.shares_v2_client.reset_state(self.sh["id"], status=status) self.shares_v2_client.wait_for_share_status(self.sh["id"], status) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_reset_share_instance_state(self): id = self.sh_instance["id"] for status in self.states: @@ -53,7 +53,7 @@ class AdminActionsTest(base.BaseSharesAdminTest): id, s_type="share_instances", status=status) self.shares_v2_client.wait_for_share_instance_status(id, status) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_reset_snapshot_state_to_error(self): @@ -63,7 +63,7 @@ class AdminActionsTest(base.BaseSharesAdminTest): self.shares_v2_client.wait_for_snapshot_status( self.sn["id"], status) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_force_delete_share(self): share = self.create_share() @@ -78,7 +78,7 @@ class AdminActionsTest(base.BaseSharesAdminTest): self.shares_v2_client.force_delete(share["id"]) self.shares_v2_client.wait_for_resource_deletion(share_id=share["id"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_force_delete_share_instance(self): share = self.create_share(cleanup_in_class=False) instances = self.shares_v2_client.get_instances_of_share(share["id"]) @@ -101,7 +101,7 @@ class AdminActionsTest(base.BaseSharesAdminTest): self.shares_v2_client.wait_for_resource_deletion( share_instance_id=instance["id"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_force_delete_snapshot(self): @@ -119,7 +119,7 @@ class AdminActionsTest(base.BaseSharesAdminTest): self.shares_v2_client.force_delete(sn["id"], s_type="snapshots") self.shares_v2_client.wait_for_resource_deletion(snapshot_id=sn["id"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_lt("2.22") def test_reset_share_task_state(self): for task_state in self.task_states: diff --git a/manila_tempest_tests/tests/api/admin/test_admin_actions_negative.py b/manila_tempest_tests/tests/api/admin/test_admin_actions_negative.py index 735c65dbf2..ea05327d1b 100644 --- a/manila_tempest_tests/tests/api/admin/test_admin_actions_negative.py +++ b/manila_tempest_tests/tests/api/admin/test_admin_actions_negative.py @@ -16,8 +16,8 @@ import ddt from tempest import config from tempest.lib import exceptions as lib_exc -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -39,13 +39,13 @@ class AdminActionsNegativeTest(base.BaseSharesMixedTest): cls.sn = cls.create_snapshot_wait_for_active( cls.sh["id"], client=cls.admin_client) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_reset_share_state_to_unacceptable_state(self): self.assertRaises(lib_exc.BadRequest, self.admin_client.reset_state, self.sh["id"], status="fake") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_reset_share_instance_state_to_unacceptable_state(self): self.assertRaises( lib_exc.BadRequest, @@ -55,7 +55,7 @@ class AdminActionsNegativeTest(base.BaseSharesMixedTest): status="fake" ) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_reset_snapshot_state_to_unacceptable_state(self): @@ -63,21 +63,21 @@ class AdminActionsNegativeTest(base.BaseSharesMixedTest): self.admin_client.reset_state, self.sn["id"], s_type="snapshots", status="fake") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_try_reset_share_state_with_member(self): # Even if member from another tenant, it should be unauthorized self.assertRaises(lib_exc.Forbidden, self.member_client.reset_state, self.sh["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_try_reset_share_instance_state_with_member(self): # Even if member from another tenant, it should be unauthorized self.assertRaises(lib_exc.Forbidden, self.member_client.reset_state, self.sh_instance["id"], s_type="share_instances") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_try_reset_snapshot_state_with_member(self): @@ -86,21 +86,21 @@ class AdminActionsNegativeTest(base.BaseSharesMixedTest): self.member_client.reset_state, self.sn["id"], s_type="snapshots") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_try_force_delete_share_with_member(self): # If a non-admin tries to do force_delete, it should be unauthorized self.assertRaises(lib_exc.Forbidden, self.member_client.force_delete, self.sh["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_try_force_delete_share_instance_with_member(self): # If a non-admin tries to do force_delete, it should be unauthorized self.assertRaises(lib_exc.Forbidden, self.member_client.force_delete, self.sh_instance["id"], s_type="share_instances") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_try_force_delete_snapshot_with_member(self): @@ -109,14 +109,14 @@ class AdminActionsNegativeTest(base.BaseSharesMixedTest): self.member_client.force_delete, self.sn["id"], s_type="snapshots") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_try_get_share_instance_with_member(self): # If a non-admin tries to get instance, it should be unauthorized self.assertRaises(lib_exc.Forbidden, self.member_client.get_share_instance, self.sh_instance["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_try_get_instances_of_share_with_member(self): # If a non-admin tries to list instances of given share, it should be # unauthorized @@ -124,7 +124,7 @@ class AdminActionsNegativeTest(base.BaseSharesMixedTest): self.member_client.get_instances_of_share, self.sh['id']) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_lt("2.22") def test_reset_task_state_invalid_state(self): self.assertRaises( @@ -141,20 +141,20 @@ class AdminActionsAPIOnlyNegativeTest(base.BaseSharesMixedTest): cls.admin_client = cls.admin_shares_v2_client cls.member_client = cls.shares_v2_client - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_list_share_instance_with_member(self): # If a non-admin tries to list instances, it should be unauthorized self.assertRaises(lib_exc.Forbidden, self.member_client.list_share_instances) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) @base.skip_if_microversion_lt("2.22") def test_reset_task_state_share_not_found(self): self.assertRaises( lib_exc.NotFound, self.admin_client.reset_task_state, 'fake_share', 'migration_error') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_force_delete_nonexistent_snapshot(self): @@ -163,36 +163,36 @@ class AdminActionsAPIOnlyNegativeTest(base.BaseSharesMixedTest): "fake", s_type="snapshots") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_force_delete_nonexistent_share(self): self.assertRaises(lib_exc.NotFound, self.admin_client.force_delete, "fake") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_force_delete_nonexistent_share_instance(self): self.assertRaises(lib_exc.NotFound, self.admin_client.force_delete, "fake", s_type="share_instances") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_reset_nonexistent_share_state(self): self.assertRaises(lib_exc.NotFound, self.admin_client.reset_state, "fake") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_reset_nonexistent_share_instance_state(self): self.assertRaises(lib_exc.NotFound, self.admin_client.reset_state, "fake", s_type="share_instances") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_reset_nonexistent_snapshot_state(self): self.assertRaises(lib_exc.NotFound, self.admin_client.reset_state, "fake", s_type="snapshots") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) @ddt.data('migrate_share', 'migration_complete', 'reset_task_state', 'migration_get_progress', 'migration_cancel') def test_migration_API_invalid_microversion(self, method_name): diff --git a/manila_tempest_tests/tests/api/admin/test_consistency_group_actions.py b/manila_tempest_tests/tests/api/admin/test_consistency_group_actions.py index d427e1cbae..b9d349ca53 100644 --- a/manila_tempest_tests/tests/api/admin/test_consistency_group_actions.py +++ b/manila_tempest_tests/tests/api/admin/test_consistency_group_actions.py @@ -15,8 +15,8 @@ from tempest import config from tempest.lib.common.utils import data_utils -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -46,7 +46,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesAdminTest): cls.consistency_group = cls.shares_v2_client.get_consistency_group( cls.consistency_group['id']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_create_cg_from_cgsnapshot_with_multiple_share_types_v2_4(self): # Create cgsnapshot cgsnapshot = self.create_cgsnapshot_wait_for_active( @@ -68,7 +68,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesAdminTest): 'Expected share types of %s, but got %s.' % ( expected_types, actual_types)) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_create_cg_from_multi_typed_populated_cgsnapshot_v2_4(self): share_name = data_utils.rand_name("tempest-share-name") share_desc = data_utils.rand_name("tempest-share-description") diff --git a/manila_tempest_tests/tests/api/admin/test_consistency_groups.py b/manila_tempest_tests/tests/api/admin/test_consistency_groups.py index 87b7f511a0..efa2471555 100644 --- a/manila_tempest_tests/tests/api/admin/test_consistency_groups.py +++ b/manila_tempest_tests/tests/api/admin/test_consistency_groups.py @@ -15,8 +15,8 @@ from tempest import config from tempest.lib.common.utils import data_utils -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -42,7 +42,7 @@ class ConsistencyGroupsTest(base.BaseSharesAdminTest): share_type = cls.create_share_type(name, extra_specs=extra_specs) cls.share_type2 = share_type['share_type'] - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_create_cg_with_multiple_share_types_v2_4(self): # Create a consistency group consistency_group = self.create_consistency_group( @@ -67,7 +67,7 @@ class ConsistencyGroupsTest(base.BaseSharesAdminTest): expected_share_types, actual_share_types)) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipIf( not CONF.share.multitenancy_enabled, "Only for multitenancy.") def test_create_cg_from_cgsnapshot_verify_share_server_information(self): diff --git a/manila_tempest_tests/tests/api/admin/test_consistency_groups_negative.py b/manila_tempest_tests/tests/api/admin/test_consistency_groups_negative.py index 7524b4b5f9..0a0d0f4dcd 100644 --- a/manila_tempest_tests/tests/api/admin/test_consistency_groups_negative.py +++ b/manila_tempest_tests/tests/api/admin/test_consistency_groups_negative.py @@ -16,8 +16,8 @@ from tempest import config from tempest.lib.common.utils import data_utils from tempest.lib import exceptions -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -59,14 +59,14 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesAdminTest): name=cls.cgsnap_name, description=cls.cgsnap_desc) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_delete_share_type_in_use_by_cg(self): # Attempt delete of share type self.assertRaises(exceptions.BadRequest, self.shares_client.delete_share_type, self.share_type['id']) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_create_share_of_unsupported_type_in_cg_v2_4(self): # Attempt to create share of default type in the cg self.assertRaises(exceptions.BadRequest, @@ -75,7 +75,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesAdminTest): consistency_group_id=self.consistency_group['id'], version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_create_share_in_cg_that_is_not_available_v2_4(self): consistency_group = self.create_consistency_group( cleanup_in_class=False, version='2.4') @@ -117,7 +117,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesAdminTest): cleanup_in_class=False, version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_create_cgsnapshot_of_cg_that_is_not_available_v2_4(self): consistency_group = self.create_consistency_group( cleanup_in_class=False, version='2.4') @@ -156,7 +156,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesAdminTest): cleanup_in_class=False, version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_create_cgsnapshot_of_cg_with_share_in_error_state_v2_4(self): consistency_group = self.create_consistency_group(version='2.4') share_name = data_utils.rand_name("tempest-share-name") @@ -176,7 +176,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesAdminTest): cleanup_in_class=False, version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_delete_cgsnapshot_not_in_available_or_error_v2_4(self): cgsnapshot = self.create_cgsnapshot_wait_for_active( self.consistency_group['id'], @@ -209,7 +209,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesAdminTest): cgsnapshot['id'], version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_delete_cg_not_in_available_or_error_v2_4(self): consistency_group = self.create_consistency_group( cleanup_in_class=False, version='2.4') @@ -236,7 +236,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesAdminTest): consistency_group['id'], version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_create_cg_with_conflicting_share_types_v2_4(self): # Create conflicting share types name = data_utils.rand_name("tempest-manila") @@ -256,7 +256,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesAdminTest): cleanup_in_class=False, version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_create_cg_with_multi_tenant_share_type_and_no_share_network_v2_4( self): # Create multi tenant share type @@ -280,7 +280,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesAdminTest): self.assertRaises(exceptions.BadRequest, create_cg) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_update_cg_share_types(self): consistency_group = self.create_consistency_group( cleanup_in_class=False, version='2.4') diff --git a/manila_tempest_tests/tests/api/admin/test_export_locations.py b/manila_tempest_tests/tests/api/admin/test_export_locations.py index 97db8194ff..381717833c 100644 --- a/manila_tempest_tests/tests/api/admin/test_export_locations.py +++ b/manila_tempest_tests/tests/api/admin/test_export_locations.py @@ -18,7 +18,7 @@ from oslo_utils import timeutils from oslo_utils import uuidutils import six from tempest import config -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base from manila_tempest_tests import utils @@ -100,7 +100,7 @@ class ExportLocationsTest(base.BaseSharesMixedTest): # it making assertion that it has proper date value. timeutils.parse_strtime(time) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @utils.skip_if_microversion_not_supported('2.13') def test_list_share_export_locations(self): export_locations = self.admin_client.list_share_export_locations( @@ -109,7 +109,7 @@ class ExportLocationsTest(base.BaseSharesMixedTest): self._verify_export_location_structure(export_locations, version='2.13') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @utils.skip_if_microversion_not_supported('2.14') def test_list_share_export_locations_with_preferred_flag(self): export_locations = self.admin_client.list_share_export_locations( @@ -118,7 +118,7 @@ class ExportLocationsTest(base.BaseSharesMixedTest): self._verify_export_location_structure(export_locations, version='2.14') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_get_share_export_location(self): export_locations = self.admin_client.list_share_export_locations( self.share['id']) @@ -128,14 +128,14 @@ class ExportLocationsTest(base.BaseSharesMixedTest): self.share['id'], export_location['id']) self._verify_export_location_structure(el, format='detail') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_share_export_locations_by_member(self): export_locations = self.member_client.list_share_export_locations( self.share['id']) self._verify_export_location_structure(export_locations, role='member') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_get_share_export_location_by_member(self): export_locations = self.admin_client.list_share_export_locations( self.share['id']) @@ -148,7 +148,7 @@ class ExportLocationsTest(base.BaseSharesMixedTest): self._verify_export_location_structure(el, role='member', format='detail') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @utils.skip_if_microversion_not_supported('2.13') def test_list_share_instance_export_locations(self): for share_instance in self.share_instances: @@ -158,7 +158,7 @@ class ExportLocationsTest(base.BaseSharesMixedTest): self._verify_export_location_structure(export_locations, version='2.13') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @utils.skip_if_microversion_not_supported('2.14') def test_list_share_instance_export_locations_with_preferred_flag(self): for share_instance in self.share_instances: @@ -168,7 +168,7 @@ class ExportLocationsTest(base.BaseSharesMixedTest): self._verify_export_location_structure(export_locations, version='2.14') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_get_share_instance_export_location(self): for share_instance in self.share_instances: export_locations = ( @@ -179,7 +179,7 @@ class ExportLocationsTest(base.BaseSharesMixedTest): share_instance['id'], el['id']) self._verify_export_location_structure(el, format='detail') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_share_contains_all_export_locations_of_all_share_instances(self): share_export_locations = self.admin_client.list_share_export_locations( self.share['id']) diff --git a/manila_tempest_tests/tests/api/admin/test_export_locations_negative.py b/manila_tempest_tests/tests/api/admin/test_export_locations_negative.py index 341743b7f0..4ad4721931 100644 --- a/manila_tempest_tests/tests/api/admin/test_export_locations_negative.py +++ b/manila_tempest_tests/tests/api/admin/test_export_locations_negative.py @@ -15,7 +15,7 @@ from tempest import config from tempest.lib import exceptions as lib_exc -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -35,7 +35,7 @@ class ExportLocationsNegativeTest(base.BaseSharesMixedTest): cls.share_instances = cls.admin_client.get_instances_of_share( cls.share['id']) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_get_inexistent_share_export_location(self): self.assertRaises( lib_exc.NotFound, @@ -44,7 +44,7 @@ class ExportLocationsNegativeTest(base.BaseSharesMixedTest): "fake-inexistent-share-instance-id", ) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_get_inexistent_share_instance_export_location(self): for share_instance in self.share_instances: self.assertRaises( @@ -54,7 +54,7 @@ class ExportLocationsNegativeTest(base.BaseSharesMixedTest): "fake-inexistent-share-instance-id", ) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_list_share_instance_export_locations_by_member(self): for share_instance in self.share_instances: self.assertRaises( @@ -63,7 +63,7 @@ class ExportLocationsNegativeTest(base.BaseSharesMixedTest): "fake-inexistent-share-instance-id", ) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_get_share_instance_export_location_by_member(self): for share_instance in self.share_instances: export_locations = ( @@ -80,7 +80,7 @@ class ExportLocationsNegativeTest(base.BaseSharesMixedTest): @base.skip_if_microversion_not_supported("2.9") class ExportLocationsAPIOnlyNegativeTest(base.BaseSharesAdminTest): - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_get_export_locations_by_nonexistent_share(self): self.assertRaises( lib_exc.NotFound, @@ -88,7 +88,7 @@ class ExportLocationsAPIOnlyNegativeTest(base.BaseSharesAdminTest): "fake-inexistent-share-id", ) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_get_export_locations_by_nonexistent_share_instance(self): self.assertRaises( lib_exc.NotFound, diff --git a/manila_tempest_tests/tests/api/admin/test_migration.py b/manila_tempest_tests/tests/api/admin/test_migration.py index 27ceb8b8bd..dc58a162e1 100644 --- a/manila_tempest_tests/tests/api/admin/test_migration.py +++ b/manila_tempest_tests/tests/api/admin/test_migration.py @@ -17,7 +17,7 @@ import ddt from tempest import config from tempest.lib.common.utils import data_utils -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.common import constants from manila_tempest_tests.tests.api import base @@ -74,7 +74,7 @@ class MigrationNFSTest(base.BaseSharesAdminTest): extra_specs=utils.get_configured_extra_specs( variation='opposite_driver_modes')) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @base.skip_if_microversion_lt("2.22") @ddt.data(True, False) def test_migration_cancel(self, force_host_assisted): @@ -111,7 +111,7 @@ class MigrationNFSTest(base.BaseSharesAdminTest): dest_pool, share, constants.TASK_STATE_MIGRATION_CANCELLED, complete=False) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @base.skip_if_microversion_lt("2.22") @ddt.data(True, False) def test_migration_opposite_driver_modes(self, force_host_assisted): @@ -171,7 +171,7 @@ class MigrationNFSTest(base.BaseSharesAdminTest): complete=True, share_network_id=new_share_network_id, share_type_id=new_share_type_id) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @base.skip_if_microversion_lt("2.22") @ddt.data(True, False) def test_migration_2phase(self, force_host_assisted): diff --git a/manila_tempest_tests/tests/api/admin/test_migration_negative.py b/manila_tempest_tests/tests/api/admin/test_migration_negative.py index d806ed6373..59d97f4000 100644 --- a/manila_tempest_tests/tests/api/admin/test_migration_negative.py +++ b/manila_tempest_tests/tests/api/admin/test_migration_negative.py @@ -18,8 +18,8 @@ import ddt from tempest import config from tempest.lib.common.utils import data_utils from tempest.lib import exceptions as lib_exc -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.common import constants from manila_tempest_tests import share_exceptions @@ -75,14 +75,14 @@ class MigrationTest(base.BaseSharesAdminTest): cleanup_in_class=True, extra_specs=utils.get_configured_extra_specs(variation='invalid')) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_lt("2.22") def test_migration_cancel_invalid(self): self.assertRaises( lib_exc.BadRequest, self.shares_v2_client.migration_cancel, self.share['id']) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_lt("2.22") def test_migration_get_progress_None(self): self.shares_v2_client.reset_task_state(self.share["id"], None) @@ -92,35 +92,35 @@ class MigrationTest(base.BaseSharesAdminTest): lib_exc.BadRequest, self.shares_v2_client.migration_get_progress, self.share['id']) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_lt("2.22") def test_migration_complete_invalid(self): self.assertRaises( lib_exc.BadRequest, self.shares_v2_client.migration_complete, self.share['id']) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_lt("2.22") def test_migration_cancel_not_found(self): self.assertRaises( lib_exc.NotFound, self.shares_v2_client.migration_cancel, 'invalid_share_id') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_lt("2.22") def test_migration_get_progress_not_found(self): self.assertRaises( lib_exc.NotFound, self.shares_v2_client.migration_get_progress, 'invalid_share_id') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_lt("2.22") def test_migration_complete_not_found(self): self.assertRaises( lib_exc.NotFound, self.shares_v2_client.migration_complete, 'invalid_share_id') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_lt("2.22") @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") @@ -132,21 +132,21 @@ class MigrationTest(base.BaseSharesAdminTest): self.shares_client.delete_snapshot(snap['id']) self.shares_client.wait_for_resource_deletion(snapshot_id=snap["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_lt("2.22") def test_migrate_share_same_host(self): self.assertRaises( lib_exc.BadRequest, self.shares_v2_client.migrate_share, self.share['id'], self.share['host']) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_lt("2.22") def test_migrate_share_host_invalid(self): self.assertRaises( lib_exc.NotFound, self.shares_v2_client.migrate_share, self.share['id'], 'invalid_host') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_lt("2.22") def test_migrate_share_host_assisted_not_allowed(self): self.shares_v2_client.migrate_share( @@ -157,7 +157,7 @@ class MigrationTest(base.BaseSharesAdminTest): self.share['id'], self.dest_pool, constants.TASK_STATE_MIGRATION_ERROR) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_lt("2.22") def test_migrate_share_change_type_no_valid_host(self): if not CONF.share.multitenancy_enabled: @@ -175,14 +175,14 @@ class MigrationTest(base.BaseSharesAdminTest): self.share['id'], self.dest_pool, constants.TASK_STATE_MIGRATION_ERROR) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_lt("2.22") def test_migrate_share_not_found(self): self.assertRaises( lib_exc.NotFound, self.shares_v2_client.migrate_share, 'invalid_share_id', self.dest_pool) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_lt("2.22") def test_migrate_share_not_available(self): self.shares_client.reset_state(self.share['id'], @@ -197,7 +197,7 @@ class MigrationTest(base.BaseSharesAdminTest): self.shares_client.wait_for_share_status(self.share['id'], constants.STATUS_AVAILABLE) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_lt("2.22") def test_migrate_share_invalid_share_network(self): self.assertRaises( @@ -205,7 +205,7 @@ class MigrationTest(base.BaseSharesAdminTest): self.share['id'], self.dest_pool, new_share_network_id='invalid_net_id') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_lt("2.22") def test_migrate_share_invalid_share_type(self): self.assertRaises( @@ -213,7 +213,7 @@ class MigrationTest(base.BaseSharesAdminTest): self.share['id'], self.dest_pool, new_share_type_id='invalid_type_id') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_lt("2.22") def test_migrate_share_opposite_type_share_network_invalid(self): diff --git a/manila_tempest_tests/tests/api/admin/test_multi_backend.py b/manila_tempest_tests/tests/api/admin/test_multi_backend.py index 20659b1693..8b7e078318 100644 --- a/manila_tempest_tests/tests/api/admin/test_multi_backend.py +++ b/manila_tempest_tests/tests/api/admin/test_multi_backend.py @@ -15,7 +15,7 @@ from tempest import config from tempest.lib.common.utils import data_utils -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -56,14 +56,14 @@ class ShareMultiBackendTest(base.BaseSharesAdminTest): # Create shares using precreated share types cls.shares = cls.create_shares(share_data_list) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_share_backend_name_reporting(self): # Share's 'host' should be like "hostname@backend_name" for share in self.shares: get = self.shares_client.get_share(share['id']) self.assertTrue(len(get["host"].split("@")) == 2) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_share_share_type(self): # Share type should be the same as provided with share creation for i in [0, 1]: @@ -71,7 +71,7 @@ class ShareMultiBackendTest(base.BaseSharesAdminTest): version="2.5") self.assertEqual(self.sts[i]["name"], get["share_type"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_share_share_type_v_2_6(self): # Share type should be the same as provided with share creation for i in [0, 1]: @@ -80,7 +80,7 @@ class ShareMultiBackendTest(base.BaseSharesAdminTest): self.assertEqual(self.sts[i]["id"], get["share_type"]) self.assertEqual(self.sts[i]["name"], get["share_type_name"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_share_backend_name_distinction(self): # Different share backends should have different host records if CONF.share.backend_names[0] == CONF.share.backend_names[1]: diff --git a/manila_tempest_tests/tests/api/admin/test_quotas.py b/manila_tempest_tests/tests/api/admin/test_quotas.py index ff6f0e2e8a..fec32f3d94 100644 --- a/manila_tempest_tests/tests/api/admin/test_quotas.py +++ b/manila_tempest_tests/tests/api/admin/test_quotas.py @@ -14,7 +14,7 @@ # under the License. from tempest import config -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -32,7 +32,7 @@ class SharesAdminQuotasTest(base.BaseSharesAdminTest): cls.user_id = cls.shares_v2_client.user_id cls.tenant_id = cls.shares_v2_client.tenant_id - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_default_quotas(self): quotas = self.shares_v2_client.default_quotas(self.tenant_id) self.assertGreater(int(quotas["gigabytes"]), -2) @@ -41,7 +41,7 @@ class SharesAdminQuotasTest(base.BaseSharesAdminTest): self.assertGreater(int(quotas["snapshots"]), -2) self.assertGreater(int(quotas["share_networks"]), -2) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_show_quotas(self): quotas = self.shares_v2_client.show_quotas(self.tenant_id) self.assertGreater(int(quotas["gigabytes"]), -2) @@ -50,7 +50,7 @@ class SharesAdminQuotasTest(base.BaseSharesAdminTest): self.assertGreater(int(quotas["snapshots"]), -2) self.assertGreater(int(quotas["share_networks"]), -2) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_show_quotas_for_user(self): quotas = self.shares_v2_client.show_quotas( self.tenant_id, self.user_id) @@ -80,7 +80,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.tenant_id = self.client.tenant_id self.user_id = self.client.user_id - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_update_tenant_quota_shares(self): # get current quotas quotas = self.client.show_quotas(self.tenant_id) @@ -90,7 +90,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): updated = self.client.update_quotas(self.tenant_id, shares=new_quota) self.assertEqual(new_quota, int(updated["shares"])) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_update_user_quota_shares(self): # get current quotas quotas = self.client.show_quotas(self.tenant_id, self.user_id) @@ -101,7 +101,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.tenant_id, self.user_id, shares=new_quota) self.assertEqual(new_quota, int(updated["shares"])) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_update_tenant_quota_snapshots(self): # get current quotas quotas = self.client.show_quotas(self.tenant_id) @@ -112,7 +112,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.tenant_id, snapshots=new_quota) self.assertEqual(new_quota, int(updated["snapshots"])) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_update_user_quota_snapshots(self): # get current quotas quotas = self.client.show_quotas(self.tenant_id, self.user_id) @@ -123,7 +123,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.tenant_id, self.user_id, snapshots=new_quota) self.assertEqual(new_quota, int(updated["snapshots"])) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_update_tenant_quota_gigabytes(self): # get current quotas custom = self.client.show_quotas(self.tenant_id) @@ -136,7 +136,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.tenant_id, gigabytes=gigabytes) self.assertEqual(gigabytes, int(updated["gigabytes"])) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_update_tenant_quota_snapshot_gigabytes(self): # get current quotas custom = self.client.show_quotas(self.tenant_id) @@ -151,7 +151,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.assertEqual(snapshot_gigabytes, int(updated["snapshot_gigabytes"])) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_update_user_quota_gigabytes(self): # get current quotas custom = self.client.show_quotas(self.tenant_id, self.user_id) @@ -164,7 +164,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.tenant_id, self.user_id, gigabytes=gigabytes) self.assertEqual(gigabytes, int(updated["gigabytes"])) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_update_user_quota_snapshot_gigabytes(self): # get current quotas custom = self.client.show_quotas(self.tenant_id, self.user_id) @@ -179,7 +179,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.assertEqual(snapshot_gigabytes, int(updated["snapshot_gigabytes"])) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_update_tenant_quota_share_networks(self): # get current quotas quotas = self.client.show_quotas(self.tenant_id) @@ -190,7 +190,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.tenant_id, share_networks=new_quota) self.assertEqual(new_quota, int(updated["share_networks"])) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_update_user_quota_share_networks(self): # get current quotas quotas = self.client.show_quotas( @@ -203,7 +203,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): share_networks=new_quota) self.assertEqual(new_quota, int(updated["share_networks"])) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_reset_tenant_quotas(self): # get default_quotas default = self.client.default_quotas(self.tenant_id) @@ -244,7 +244,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.assertEqual(int(default["share_networks"]), int(reseted["share_networks"])) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_unlimited_quota_for_shares(self): self.client.update_quotas(self.tenant_id, shares=-1) @@ -252,7 +252,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.assertEqual(-1, quotas.get('shares')) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_unlimited_user_quota_for_shares(self): self.client.update_quotas( self.tenant_id, self.user_id, shares=-1) @@ -261,7 +261,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.assertEqual(-1, quotas.get('shares')) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_unlimited_quota_for_snapshots(self): self.client.update_quotas(self.tenant_id, snapshots=-1) @@ -269,7 +269,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.assertEqual(-1, quotas.get('snapshots')) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_unlimited_user_quota_for_snapshots(self): self.client.update_quotas( self.tenant_id, self.user_id, snapshots=-1) @@ -278,7 +278,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.assertEqual(-1, quotas.get('snapshots')) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_unlimited_quota_for_gigabytes(self): self.client.update_quotas(self.tenant_id, gigabytes=-1) @@ -286,7 +286,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.assertEqual(-1, quotas.get('gigabytes')) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_unlimited_quota_for_snapshot_gigabytes(self): self.client.update_quotas( self.tenant_id, snapshot_gigabytes=-1) @@ -295,7 +295,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.assertEqual(-1, quotas.get('snapshot_gigabytes')) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_unlimited_user_quota_for_gigabytes(self): self.client.update_quotas( self.tenant_id, self.user_id, gigabytes=-1) @@ -304,7 +304,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.assertEqual(-1, quotas.get('gigabytes')) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_unlimited_user_quota_for_snapshot_gigabytes(self): self.client.update_quotas( self.tenant_id, self.user_id, snapshot_gigabytes=-1) @@ -313,7 +313,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.assertEqual(-1, quotas.get('snapshot_gigabytes')) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_unlimited_quota_for_share_networks(self): self.client.update_quotas(self.tenant_id, share_networks=-1) @@ -321,7 +321,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.assertEqual(-1, quotas.get('share_networks')) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_unlimited_user_quota_for_share_networks(self): self.client.update_quotas( self.tenant_id, self.user_id, share_networks=-1) diff --git a/manila_tempest_tests/tests/api/admin/test_quotas_negative.py b/manila_tempest_tests/tests/api/admin/test_quotas_negative.py index f8e371935c..a740e85461 100644 --- a/manila_tempest_tests/tests/api/admin/test_quotas_negative.py +++ b/manila_tempest_tests/tests/api/admin/test_quotas_negative.py @@ -15,7 +15,7 @@ from tempest import config from tempest.lib import exceptions as lib_exc -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -35,18 +35,18 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): cls.user_id = cls.shares_client.user_id cls.tenant_id = cls.shares_client.tenant_id - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_get_quotas_with_empty_tenant_id(self): self.assertRaises(lib_exc.NotFound, self.shares_client.show_quotas, "") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_reset_quotas_with_empty_tenant_id(self): client = self.get_client_with_isolated_creds() self.assertRaises(lib_exc.NotFound, client.reset_quotas, "") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_update_shares_quota_with_wrong_data(self): # -1 is acceptable value as unlimited client = self.get_client_with_isolated_creds() @@ -55,7 +55,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client.tenant_id, shares=-2) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_update_snapshots_quota_with_wrong_data(self): # -1 is acceptable value as unlimited client = self.get_client_with_isolated_creds() @@ -64,7 +64,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client.tenant_id, snapshots=-2) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_update_gigabytes_quota_with_wrong_data(self): # -1 is acceptable value as unlimited client = self.get_client_with_isolated_creds() @@ -73,7 +73,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client.tenant_id, gigabytes=-2) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_update_snapshot_gigabytes_quota_with_wrong_data(self): # -1 is acceptable value as unlimited client = self.get_client_with_isolated_creds() @@ -82,7 +82,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client.tenant_id, snapshot_gigabytes=-2) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_update_share_networks_quota_with_wrong_data(self): # -1 is acceptable value as unlimited client = self.get_client_with_isolated_creds() @@ -91,7 +91,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client.tenant_id, share_networks=-2) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_create_share_with_size_bigger_than_quota(self): quotas = self.shares_client.show_quotas( self.shares_client.tenant_id) @@ -102,7 +102,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): self.create_share, size=overquota) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_set_user_quota_shares_bigger_than_tenant_quota(self): client = self.get_client_with_isolated_creds() @@ -117,7 +117,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client.user_id, shares=bigger_value) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_set_user_quota_snaps_bigger_than_tenant_quota(self): client = self.get_client_with_isolated_creds() @@ -132,7 +132,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client.user_id, snapshots=bigger_value) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_set_user_quota_gigabytes_bigger_than_tenant_quota(self): client = self.get_client_with_isolated_creds() @@ -147,7 +147,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client.user_id, gigabytes=bigger_value) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_set_user_quota_snap_gigabytes_bigger_than_tenant_quota(self): client = self.get_client_with_isolated_creds() @@ -162,7 +162,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client.user_id, snapshot_gigabytes=bigger_value) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_set_user_quota_share_networks_bigger_than_tenant_quota(self): client = self.get_client_with_isolated_creds() diff --git a/manila_tempest_tests/tests/api/admin/test_replication.py b/manila_tempest_tests/tests/api/admin/test_replication.py index ff2f3c6cce..38546e3f93 100644 --- a/manila_tempest_tests/tests/api/admin/test_replication.py +++ b/manila_tempest_tests/tests/api/admin/test_replication.py @@ -15,8 +15,8 @@ from tempest import config from tempest.lib.common.utils import data_utils -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.common import constants from manila_tempest_tests import share_exceptions @@ -68,7 +68,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest): return [replica['id'] for replica in replica_list if replica['replica_state'] == r_state] - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_promote_out_of_sync_share_replica(self): """Test promote 'out_of_sync' share replica to active state.""" if (self.replication_type @@ -120,7 +120,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest): replica_list, constants.REPLICATION_STATE_ACTIVE) self.assertEqual(1, len(new_active_replicas)) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_force_delete_share_replica(self): """Test force deleting a replica that is in 'error_deleting' status.""" replica = self.create_share_replica(self.share['id'], @@ -134,7 +134,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest): self.admin_client.force_delete_share_replica(replica['id']) self.admin_client.wait_for_resource_deletion(replica_id=replica['id']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_reset_share_replica_status(self): """Test resetting a replica's 'status' attribute.""" replica = self.create_share_replica(self.share['id'], @@ -146,7 +146,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest): self.admin_client.wait_for_share_replica_status( replica['id'], constants.STATUS_ERROR) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_reset_share_replica_state(self): """Test resetting a replica's 'replica_state' attribute.""" replica = self.create_share_replica(self.share['id'], @@ -158,7 +158,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest): self.admin_client.wait_for_share_replica_status( replica['id'], constants.STATUS_ERROR, status_attr='replica_state') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_resync_share_replica(self): """Test resyncing a replica.""" replica = self.create_share_replica(self.share['id'], diff --git a/manila_tempest_tests/tests/api/admin/test_replication_actions.py b/manila_tempest_tests/tests/api/admin/test_replication_actions.py index 41bfa86389..377bb4139f 100644 --- a/manila_tempest_tests/tests/api/admin/test_replication_actions.py +++ b/manila_tempest_tests/tests/api/admin/test_replication_actions.py @@ -13,8 +13,8 @@ from tempest import config from tempest.lib.common.utils import data_utils from tempest.lib import exceptions as lib_exc -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.common import constants from manila_tempest_tests import share_exceptions @@ -65,7 +65,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest): cls.replica = cls.admin_client.list_share_replicas( share_id=cls.share['id'])[0] - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_extend_tests, 'Extend share tests are disabled.') def test_extend_replicated_share(self): @@ -77,7 +77,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest): share = self.admin_client.get_share(self.share["id"]) self.assertEqual(new_size, int(share["size"])) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_shrink_tests, 'Shrink share tests are disabled.') def test_shrink_replicated_share(self): @@ -88,7 +88,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest): shrink_share = self.admin_client.get_share(self.share["id"]) self.assertEqual(new_size, int(shrink_share["size"])) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @testtools.skipUnless(CONF.share.run_manage_unmanage_tests, 'Manage/Unmanage Tests are disabled.') def test_manage_share_for_replication_type(self): @@ -123,7 +123,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest): self.create_share_replica(managed_share['id'], self.replica_zone, cleanup=True, client=self.admin_client) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_manage_unmanage_tests, 'Manage/Unmanage Tests are disabled.') def test_unmanage_replicated_share_with_replica(self): @@ -136,7 +136,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest): self.admin_client.unmanage_share, share_id=self.share['id']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @testtools.skipUnless(CONF.share.run_manage_unmanage_tests, 'Manage/Unmanage Tests are disabled.') def test_unmanage_replicated_share_with_no_replica(self): @@ -148,7 +148,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest): self.admin_client.unmanage_share(share['id']) self.admin_client.wait_for_resource_deletion(share_id=share['id']) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_manage_unmanage_snapshot_tests, 'Manage/Unmanage Snapshot Tests are disabled.') def test_manage_replicated_share_snapshot(self): @@ -163,7 +163,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest): provider_location="127.0.0.1:/fake_provider_location/" "manila_share_9dc61f49_fbc8_48d7_9337_2f9593d9") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_manage_unmanage_snapshot_tests, 'Manage/Unmanage Snapshot Tests are disabled.') def test_unmanage_replicated_share_snapshot(self): diff --git a/manila_tempest_tests/tests/api/admin/test_scheduler_stats.py b/manila_tempest_tests/tests/api/admin/test_scheduler_stats.py index 7e1449aa3c..d77b7eaee4 100644 --- a/manila_tempest_tests/tests/api/admin/test_scheduler_stats.py +++ b/manila_tempest_tests/tests/api/admin/test_scheduler_stats.py @@ -13,7 +13,7 @@ # under the License. from tempest import config -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -22,7 +22,7 @@ CONF = config.CONF class SchedulerStatsAdminTest(base.BaseSharesAdminTest): - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_pool_list(self): # List pools @@ -35,7 +35,7 @@ class SchedulerStatsAdminTest(base.BaseSharesAdminTest): actual_keys = set(pool.keys()) self.assertTrue(actual_keys.issuperset(required_keys)) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_pool_list_with_filters(self): # List pools @@ -64,7 +64,7 @@ class SchedulerStatsAdminTest(base.BaseSharesAdminTest): for k, v in search_opts.items(): self.assertEqual(v[1:-1], filtered_pool_list[0][k]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_pool_list_with_filters_negative(self): # Build search opts for a non-existent pool @@ -80,7 +80,7 @@ class SchedulerStatsAdminTest(base.BaseSharesAdminTest): # Ensure we got no pools self.assertEmpty(pool_list) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_pool_list_detail(self): # List pools @@ -93,7 +93,7 @@ class SchedulerStatsAdminTest(base.BaseSharesAdminTest): actual_keys = set(pool.keys()) self.assertTrue(actual_keys.issuperset(required_keys)) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_pool_list_detail_with_filters(self): # List pools @@ -122,7 +122,7 @@ class SchedulerStatsAdminTest(base.BaseSharesAdminTest): for k, v in search_opts.items(): self.assertEqual(v[1:-1], filtered_pool_list[0][k]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_pool_list_detail_with_filters_negative(self): # Build search opts for a non-existent pool diff --git a/manila_tempest_tests/tests/api/admin/test_security_services.py b/manila_tempest_tests/tests/api/admin/test_security_services.py index 6ba04be274..3b29e2655b 100644 --- a/manila_tempest_tests/tests/api/admin/test_security_services.py +++ b/manila_tempest_tests/tests/api/admin/test_security_services.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base from manila_tempest_tests.tests.api import test_security_services @@ -46,7 +46,7 @@ class SecurityServiceAdminTest( 'kerberos', **ss_kerberos_data) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_list_security_services_all_tenants(self): listed = self.shares_client.list_security_services( params={'all_tenants': 1}) @@ -57,7 +57,7 @@ class SecurityServiceAdminTest( keys = ["name", "id", "status", "type", ] [self.assertIn(key, s_s.keys()) for s_s in listed for key in keys] - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_list_security_services_invalid_filters(self): listed = self.shares_client.list_security_services( params={'fake_opt': 'some_value'}) diff --git a/manila_tempest_tests/tests/api/admin/test_services.py b/manila_tempest_tests/tests/api/admin/test_services.py index f2d4175d97..bda4bb42af 100644 --- a/manila_tempest_tests/tests/api/admin/test_services.py +++ b/manila_tempest_tests/tests/api/admin/test_services.py @@ -14,7 +14,7 @@ # under the License. import ddt -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -26,7 +26,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest): super(ServicesAdminTest, self).setUp() self.services = self.shares_client.list_services() - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) @ddt.data('shares_client', 'shares_v2_client') def test_list_services(self, client_name): services = getattr(self, client_name).list_services() @@ -35,7 +35,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest): for service in services: self.assertIsNotNone(service['id']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) @ddt.data('shares_client', 'shares_v2_client') def test_get_services_by_host_name(self, client_name): host = self.services[0]["host"] @@ -45,7 +45,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest): for service in services: self.assertEqual(host, service["host"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) @ddt.data('shares_client', 'shares_v2_client') def test_get_services_by_binary_name(self, client_name): binary = self.services[0]["binary"] @@ -55,7 +55,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest): for service in services: self.assertEqual(binary, service["binary"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) @ddt.data('shares_client', 'shares_v2_client') def test_get_services_by_availability_zone(self, client_name): zone = self.services[0]["zone"] @@ -65,7 +65,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest): for service in services: self.assertEqual(zone, service["zone"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) @ddt.data('shares_client', 'shares_v2_client') def test_get_services_by_status(self, client_name): status = self.services[0]["status"] @@ -75,7 +75,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest): for service in services: self.assertEqual(status, service["status"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) @ddt.data('shares_client', 'shares_v2_client') def test_get_services_by_state(self, client_name): state = self.services[0]["state"] @@ -85,7 +85,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest): for service in services: self.assertEqual(state, service["state"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) @ddt.data('shares_client', 'shares_v2_client') def test_get_services_by_all_filters(self, client_name): params = { diff --git a/manila_tempest_tests/tests/api/admin/test_services_negative.py b/manila_tempest_tests/tests/api/admin/test_services_negative.py index 6be53ba7f0..04ff803edf 100644 --- a/manila_tempest_tests/tests/api/admin/test_services_negative.py +++ b/manila_tempest_tests/tests/api/admin/test_services_negative.py @@ -15,7 +15,7 @@ import ddt from tempest.lib import exceptions as lib_exc -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -29,12 +29,12 @@ class ServicesAdminNegativeTest(base.BaseSharesMixedTest): cls.admin_client = cls.admin_shares_v2_client cls.member_client = cls.shares_v2_client - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_list_services_with_non_admin_user(self): self.assertRaises(lib_exc.Forbidden, self.member_client.list_services) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_get_service_by_invalid_params(self): # All services are expected if send the request with invalid parameter services = self.admin_client.list_services() @@ -54,37 +54,37 @@ class ServicesAdminNegativeTest(base.BaseSharesMixedTest): key=lambda service: service['id']), msg) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_get_service_by_invalid_host(self): params = {'host': 'fake_host'} services_fake = self.admin_client.list_services(params) self.assertEqual(0, len(services_fake)) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_get_service_by_invalid_binary(self): params = {'binary': 'fake_binary'} services_fake = self.admin_client.list_services(params) self.assertEqual(0, len(services_fake)) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_get_service_by_invalid_zone(self): params = {'zone': 'fake_zone'} services_fake = self.admin_client.list_services(params) self.assertEqual(0, len(services_fake)) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_get_service_by_invalid_status(self): params = {'status': 'fake_status'} services_fake = self.admin_client.list_services(params) self.assertEqual(0, len(services_fake)) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_get_service_by_invalid_state(self): params = {'state': 'fake_state'} services_fake = self.admin_client.list_services(params) self.assertEqual(0, len(services_fake)) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) @ddt.data( ('os-services', '2.7'), ('services', '2.6'), diff --git a/manila_tempest_tests/tests/api/admin/test_share_instances.py b/manila_tempest_tests/tests/api/admin/test_share_instances.py index 3c2712c7d1..48bca09239 100644 --- a/manila_tempest_tests/tests/api/admin/test_share_instances.py +++ b/manila_tempest_tests/tests/api/admin/test_share_instances.py @@ -14,7 +14,7 @@ # under the License. from tempest import config -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base from manila_tempest_tests import utils @@ -29,7 +29,7 @@ class ShareInstancesTest(base.BaseSharesAdminTest): super(ShareInstancesTest, cls).resource_setup() cls.share = cls.create_share() - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_get_instances_of_share_v2_3(self): """Test that we get only the 1 share instance back for the share.""" share_instances = self.shares_v2_client.get_instances_of_share( @@ -47,7 +47,7 @@ class ShareInstancesTest(base.BaseSharesAdminTest): self.share['id'], si['share_id'])) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_share_instances_v2_3(self): """Test that we get at least the share instance back for the share.""" share_instances = self.shares_v2_client.get_instances_of_share( @@ -83,14 +83,14 @@ class ShareInstancesTest(base.BaseSharesAdminTest): 'expected %s, got %s.' % ( si['id'], expected_keys, actual_keys)) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_get_share_instance_v2_3(self): self._get_share_instance('2.3') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_get_share_instance_v2_9(self): self._get_share_instance('2.9') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_get_share_instance_v2_10(self): self._get_share_instance('2.10') diff --git a/manila_tempest_tests/tests/api/admin/test_share_manage.py b/manila_tempest_tests/tests/api/admin/test_share_manage.py index d8b3e19c54..b8577bc41c 100644 --- a/manila_tempest_tests/tests/api/admin/test_share_manage.py +++ b/manila_tempest_tests/tests/api/admin/test_share_manage.py @@ -17,8 +17,8 @@ import six from tempest import config from tempest.lib.common.utils import data_utils from tempest.lib import exceptions as lib_exc -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base from manila_tempest_tests import utils @@ -160,22 +160,22 @@ class ManageNFSShareTest(base.BaseSharesAdminTest): self.shares_v2_client.get_share, managed_share['id']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_not_supported("2.5") def test_manage_with_os_share_manage_url(self): self._test_manage(share=self.shares[2], version="2.5") - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_not_supported("2.8") def test_manage_with_is_public_True(self): self._test_manage(share=self.shares[3], is_public=True, version="2.8") - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @base.skip_if_microversion_not_supported("2.16") def test_manage_show_user_id(self): self._test_manage(share=self.shares[4], version="2.16") - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_manage(self): # After 'unmanage' operation, share instance should be deleted. # Assert not related to 'manage' test, but placed here for @@ -186,7 +186,7 @@ class ManageNFSShareTest(base.BaseSharesAdminTest): self._test_manage(share=self.shares[0]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_manage_invalid(self): # Try to manage share with invalid parameters, it should not succeed # because the scheduler will reject it. If it succeeds, then this test diff --git a/manila_tempest_tests/tests/api/admin/test_share_networks.py b/manila_tempest_tests/tests/api/admin/test_share_networks.py index 1c11647ce0..e66e50376c 100644 --- a/manila_tempest_tests/tests/api/admin/test_share_networks.py +++ b/manila_tempest_tests/tests/api/admin/test_share_networks.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base from manila_tempest_tests.tests.api import test_share_networks @@ -76,7 +76,7 @@ class ShareNetworkAdminTest( cls.sn_with_kerberos_ss["id"], cls.ss_kerberos["id"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_list_share_networks_all_tenants(self): listed = self.shares_client.list_share_networks_with_detail( {'all_tenants': 1}) @@ -85,7 +85,7 @@ class ShareNetworkAdminTest( self.assertTrue(any(self.sn_with_kerberos_ss['id'] == sn['id'] for sn in listed)) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_list_share_networks_filter_by_project_id(self): listed = self.shares_client.list_share_networks_with_detail( {'project_id': self.sn_with_kerberos_ss['project_id']}) diff --git a/manila_tempest_tests/tests/api/admin/test_share_servers.py b/manila_tempest_tests/tests/api/admin/test_share_servers.py index 2b3bd6f08b..d01600ec32 100644 --- a/manila_tempest_tests/tests/api/admin/test_share_servers.py +++ b/manila_tempest_tests/tests/api/admin/test_share_servers.py @@ -18,7 +18,7 @@ import re import six from tempest import config from tempest.lib import exceptions as lib_exc -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -50,7 +50,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest): cls.date_re = re.compile("^([0-9]{4}-[0-9]{2}-[0-9]{2}[A-Z]{1}" "[0-9]{2}:[0-9]{2}:[0-9]{2}).*$") - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_share_servers_without_filters(self): servers = self.shares_client.list_share_servers() self.assertTrue(len(servers) > 0) @@ -81,7 +81,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest): # Server we used is present. any(s["share_network_name"] in self.sn_name_and_id for s in servers) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_share_servers_with_host_filter(self): # Get list of share servers and remember 'host' name servers = self.shares_client.list_share_servers() @@ -107,7 +107,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest): for server in servers: self.assertEqual(server["host"], host) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_share_servers_with_status_filter(self): # Get list of share servers servers = self.shares_client.list_share_servers() @@ -133,7 +133,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest): for server in servers: self.assertEqual(server["status"], status) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_share_servers_with_project_id_filter(self): search_opts = {"project_id": self.share_network["project_id"]} servers = self.shares_client.list_share_servers(search_opts) @@ -143,7 +143,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest): self.assertEqual(server["project_id"], self.share_network["project_id"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_share_servers_with_share_network_name_filter(self): search_opts = {"share_network": self.share_network["name"]} servers = self.shares_client.list_share_servers(search_opts) @@ -153,7 +153,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest): self.assertEqual(server["share_network_name"], self.share_network["name"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_share_servers_with_share_network_id_filter(self): search_opts = {"share_network": self.share_network["id"]} servers = self.shares_client.list_share_servers(search_opts) @@ -163,7 +163,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest): self.assertIn(server["share_network_name"], self.sn_name_and_id) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_show_share_server(self): share = self.shares_client.get_share(self.share["id"]) server = self.shares_client.show_share_server(share["share_server_id"]) @@ -198,7 +198,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest): # backend_details should be a dict self.assertIsInstance(server["backend_details"], dict) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_show_share_server_details(self): servers = self.shares_client.list_share_servers() details = self.shares_client.show_share_server_details( @@ -265,10 +265,10 @@ class ShareServersAdminTest(base.BaseSharesAdminTest): self.shares_client.wait_for_resource_deletion( sn_id=new_sn["id"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_delete_share_server(self): self._delete_share_server(False) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_delete_share_server_by_deletion_of_share_network(self): self._delete_share_server(True) diff --git a/manila_tempest_tests/tests/api/admin/test_share_servers_negative.py b/manila_tempest_tests/tests/api/admin/test_share_servers_negative.py index 69592c19a0..e281914d54 100644 --- a/manila_tempest_tests/tests/api/admin/test_share_servers_negative.py +++ b/manila_tempest_tests/tests/api/admin/test_share_servers_negative.py @@ -15,7 +15,7 @@ from tempest.lib.common.utils import data_utils from tempest.lib import exceptions as lib_exc -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -28,66 +28,66 @@ class ShareServersNegativeAdminTest(base.BaseSharesMixedTest): cls.admin_client = cls.admin_shares_v2_client cls.member_client = cls.shares_v2_client - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_list_share_servers_with_member(self): self.assertRaises(lib_exc.Forbidden, self.member_client.list_share_servers) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_show_share_server_with_member(self): self.assertRaises(lib_exc.Forbidden, self.member_client.show_share_server, 'fake_id') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_show_share_server_details_with_member(self): self.assertRaises(lib_exc.Forbidden, self.member_client.show_share_server_details, 'fake_id') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_show_share_server_with_inexistent_id(self): self.assertRaises(lib_exc.NotFound, self.admin_client.show_share_server, 'fake_id') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_show_share_server_details_with_inexistent_id(self): self.assertRaises(lib_exc.NotFound, self.admin_client.show_share_server_details, 'fake_id') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_list_share_servers_with_wrong_filter_key(self): search_opts = {'fake_filter_key': 'ACTIVE'} servers = self.admin_client.list_share_servers(search_opts) self.assertEqual(0, len(servers)) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_list_share_servers_with_wrong_filter_value(self): search_opts = {'host': 123} servers = self.admin_client.list_share_servers(search_opts) self.assertEqual(0, len(servers)) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_list_share_servers_with_fake_status(self): search_opts = {"status": data_utils.rand_name("fake_status")} servers = self.admin_client.list_share_servers(search_opts) self.assertEqual(0, len(servers)) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_list_share_servers_with_fake_host(self): search_opts = {"host": data_utils.rand_name("fake_host")} servers = self.admin_client.list_share_servers(search_opts) self.assertEqual(0, len(servers)) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_list_share_servers_with_fake_project(self): search_opts = {"project_id": data_utils.rand_name("fake_project_id")} servers = self.admin_client.list_share_servers(search_opts) self.assertEqual(0, len(servers)) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_list_share_servers_with_fake_share_network(self): search_opts = { "share_network": data_utils.rand_name("fake_share_network"), @@ -95,13 +95,13 @@ class ShareServersNegativeAdminTest(base.BaseSharesMixedTest): servers = self.admin_client.list_share_servers(search_opts) self.assertEqual(0, len(servers)) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_delete_share_server_with_nonexistent_id(self): self.assertRaises(lib_exc.NotFound, self.admin_client.delete_share_server, "fake_nonexistent_share_server_id") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_delete_share_server_with_member(self): self.assertRaises(lib_exc.Forbidden, self.member_client.delete_share_server, diff --git a/manila_tempest_tests/tests/api/admin/test_share_snapshot_instances.py b/manila_tempest_tests/tests/api/admin/test_share_snapshot_instances.py index 68f5661810..33a27fb194 100644 --- a/manila_tempest_tests/tests/api/admin/test_share_snapshot_instances.py +++ b/manila_tempest_tests/tests/api/admin/test_share_snapshot_instances.py @@ -15,8 +15,8 @@ import ddt from tempest import config -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -37,7 +37,7 @@ class ShareSnapshotInstancesTest(base.BaseSharesAdminTest): cls.snapshot = cls.shares_v2_client.get_snapshot(snap['id']) @ddt.data(True, False) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_snapshot_instances_by_snapshot(self, detail): """Test that we get only the 1 snapshot instance from snapshot.""" snapshot_instances = self.shares_v2_client.list_snapshot_instances( @@ -69,7 +69,7 @@ class ShareSnapshotInstancesTest(base.BaseSharesAdminTest): self.assertIn(key, expected_keys) self.assertEqual(len(expected_keys), len(si)) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_snapshot_instances(self): """Test that we get at least the snapshot instance.""" snapshot_instances = self.shares_v2_client.list_snapshot_instances() @@ -80,7 +80,7 @@ class ShareSnapshotInstancesTest(base.BaseSharesAdminTest): self.snapshot['id']) self.assertIn(self.snapshot['id'], snapshot_ids, msg) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_get_snapshot_instance(self): instances = self.shares_v2_client.list_snapshot_instances( snapshot_id=self.snapshot['id']) @@ -101,7 +101,7 @@ class ShareSnapshotInstancesTest(base.BaseSharesAdminTest): self.assertEqual(self.snapshot['provider_location'], instance_detail['provider_location']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_reset_snapshot_instance_status_and_delete(self): """Test resetting a snapshot instance's status attribute.""" snapshot = self.create_snapshot_wait_for_active(self.share["id"]) diff --git a/manila_tempest_tests/tests/api/admin/test_share_snapshot_instances_negative.py b/manila_tempest_tests/tests/api/admin/test_share_snapshot_instances_negative.py index b76481cf1d..fa5672f9de 100644 --- a/manila_tempest_tests/tests/api/admin/test_share_snapshot_instances_negative.py +++ b/manila_tempest_tests/tests/api/admin/test_share_snapshot_instances_negative.py @@ -15,8 +15,8 @@ from tempest import config from tempest.lib import exceptions as lib_exc -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -37,14 +37,14 @@ class SnapshotInstancesNegativeTest(base.BaseSharesMixedTest): cls.snapshot = cls.create_snapshot_wait_for_active( cls.share["id"], client=cls.admin_client) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_list_snapshot_instances_with_snapshot_by_non_admin(self): self.assertRaises( lib_exc.Forbidden, self.member_client.list_snapshot_instances, snapshot_id=self.snapshot['id']) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_get_snapshot_instance_by_non_admin(self): instances = self.admin_client.list_snapshot_instances( snapshot_id=self.snapshot['id']) @@ -53,7 +53,7 @@ class SnapshotInstancesNegativeTest(base.BaseSharesMixedTest): self.member_client.get_snapshot_instance, instance_id=instances[0]['id']) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_reset_snapshot_instance_status_by_non_admin(self): instances = self.admin_client.list_snapshot_instances( snapshot_id=self.snapshot['id']) @@ -75,13 +75,13 @@ class SnapshotInstancesNegativeNoResourceTest(base.BaseSharesMixedTest): cls.admin_client = cls.admin_shares_v2_client cls.member_client = cls.shares_v2_client - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_get_snapshot_instance_with_non_existent_instance(self): self.assertRaises(lib_exc.NotFound, self.admin_client.get_snapshot_instance, instance_id="nonexistent_instance") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_list_snapshot_instances_by_non_admin(self): self.assertRaises( lib_exc.Forbidden, diff --git a/manila_tempest_tests/tests/api/admin/test_share_types.py b/manila_tempest_tests/tests/api/admin/test_share_types.py index d55b01e3a3..c9671c3da2 100644 --- a/manila_tempest_tests/tests/api/admin/test_share_types.py +++ b/manila_tempest_tests/tests/api/admin/test_share_types.py @@ -17,7 +17,7 @@ import ddt from tempest import config from tempest.lib.common.utils import data_utils from tempest.lib import exceptions as lib_exc -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base from manila_tempest_tests import utils @@ -28,7 +28,7 @@ CONF = config.CONF @ddt.ddt class ShareTypesAdminTest(base.BaseSharesAdminTest): - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_share_type_create_delete(self): name = data_utils.rand_name("tempest-manila") extra_specs = self.add_required_extra_specs_to_dict() @@ -58,7 +58,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest): self.assertIn(old_key_name, share_type) self.assertNotIn(new_key_name, share_type) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) @ddt.data('2.0', '2.6', '2.7') def test_share_type_create_get(self, version): self.skip_if_microversion_not_supported(version) @@ -83,7 +83,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest): # Check that backwards compatibility didn't break self.assertDictMatch(get["volume_type"], get["share_type"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) @ddt.data('2.0', '2.6', '2.7') def test_share_type_create_list(self, version): self.skip_if_microversion_not_supported(version) @@ -111,7 +111,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest): for i in range(len(sts)): self.assertDictMatch(sts[i], vts[i]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_get_share_with_share_type(self): # Data @@ -141,7 +141,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest): self.assertEqual(st_create["share_type"]["id"], get["share_type"]) self.assertEqual(shr_type_name, get["share_type_name"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_private_share_type_access(self): name = data_utils.rand_name("tempest-manila") extra_specs = self.add_required_extra_specs_to_dict({"key": "value", }) diff --git a/manila_tempest_tests/tests/api/admin/test_share_types_extra_specs.py b/manila_tempest_tests/tests/api/admin/test_share_types_extra_specs.py index f550ca615f..81d130f37b 100644 --- a/manila_tempest_tests/tests/api/admin/test_share_types_extra_specs.py +++ b/manila_tempest_tests/tests/api/admin/test_share_types_extra_specs.py @@ -16,7 +16,7 @@ import copy from tempest.lib.common.utils import data_utils -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -40,14 +40,14 @@ class ExtraSpecsReadAdminTest(base.BaseSharesAdminTest): cls.shares_client.create_share_type_extra_specs( cls.st_id, cls.custom_extra_specs) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_get_one_share_type_extra_spec(self): es_get_one = self.shares_client.get_share_type_extra_spec( self.st_id, "key1") self.assertEqual({"key1": self.custom_extra_specs["key1"]}, es_get_one) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_get_all_share_type_extra_specs(self): es_get_all = self.shares_client.get_share_type_extra_specs(self.st_id) @@ -72,7 +72,7 @@ class ExtraSpecsWriteAdminTest(base.BaseSharesAdminTest): self.shares_client.create_share_type_extra_specs( self.st_id, self.custom_extra_specs) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_update_one_share_type_extra_spec(self): self.custom_extra_specs["key1"] = "fake_value1_updated" @@ -86,7 +86,7 @@ class ExtraSpecsWriteAdminTest(base.BaseSharesAdminTest): expected_extra_specs.update(self.required_extra_specs) self.assertEqual(self.custom_extra_specs, get) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_update_all_share_type_extra_specs(self): self.custom_extra_specs["key2"] = "value2_updated" @@ -100,7 +100,7 @@ class ExtraSpecsWriteAdminTest(base.BaseSharesAdminTest): expected_extra_specs.update(self.required_extra_specs) self.assertEqual(self.custom_extra_specs, get) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_delete_one_share_type_extra_spec(self): # Delete one extra spec for share type self.shares_client.delete_share_type_extra_spec(self.st_id, "key1") diff --git a/manila_tempest_tests/tests/api/admin/test_share_types_extra_specs_negative.py b/manila_tempest_tests/tests/api/admin/test_share_types_extra_specs_negative.py index 3d8cd32d03..34e5009c60 100644 --- a/manila_tempest_tests/tests/api/admin/test_share_types_extra_specs_negative.py +++ b/manila_tempest_tests/tests/api/admin/test_share_types_extra_specs_negative.py @@ -15,7 +15,7 @@ from tempest.lib.common.utils import data_utils from tempest.lib import exceptions as lib_exc -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -28,7 +28,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): return self.create_share_type( name, extra_specs=extra_specs, client=self.admin_shares_v2_client) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_create_extra_specs_with_user(self): st = self._create_share_type() self.assertRaises( @@ -37,7 +37,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): st["share_type"]["id"], self.add_required_extra_specs_to_dict({"key": "new_value"})) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_list_extra_specs_with_user(self): st = self._create_share_type() self.assertRaises( @@ -45,7 +45,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): self.shares_v2_client.get_share_type_extra_specs, st["share_type"]["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_get_extra_spec_with_user(self): st = self._create_share_type() self.assertRaises( @@ -53,7 +53,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): self.shares_v2_client.get_share_type_extra_spec, st["share_type"]["id"], "key") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_get_extra_specs_with_user(self): st = self._create_share_type() self.assertRaises( @@ -61,7 +61,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): self.shares_v2_client.get_share_type_extra_specs, st["share_type"]["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_read_extra_specs_on_share_type_with_user(self): st = self._create_share_type() share_type = self.shares_v2_client.get_share_type( @@ -73,7 +73,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): 'Incorrect extra specs visible to non-admin user; ' 'expected %s, got %s' % (expected_keys, actual_keys)) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_update_extra_spec_with_user(self): st = self._create_share_type() self.assertRaises( @@ -81,7 +81,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): self.shares_v2_client.update_share_type_extra_spec, st["share_type"]["id"], "key", "new_value") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_update_extra_specs_with_user(self): st = self._create_share_type() self.assertRaises( @@ -89,7 +89,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): self.shares_v2_client.update_share_type_extra_specs, st["share_type"]["id"], {"key": "new_value"}) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_delete_extra_specs_with_user(self): st = self._create_share_type() self.assertRaises( @@ -97,7 +97,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): self.shares_v2_client.delete_share_type_extra_spec, st["share_type"]["id"], "key") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_set_too_long_key(self): too_big_key = "k" * 256 st = self._create_share_type() @@ -107,7 +107,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): st["share_type"]["id"], self.add_required_extra_specs_to_dict({too_big_key: "value"})) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_set_too_long_value_with_creation(self): too_big_value = "v" * 256 st = self._create_share_type() @@ -117,7 +117,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): st["share_type"]["id"], self.add_required_extra_specs_to_dict({"key": too_big_value})) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_set_too_long_value_with_update(self): too_big_value = "v" * 256 st = self._create_share_type() @@ -130,7 +130,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): st["share_type"]["id"], self.add_required_extra_specs_to_dict({"key": too_big_value})) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_set_too_long_value_with_update_of_one_key(self): too_big_value = "v" * 256 st = self._create_share_type() @@ -142,34 +142,34 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): self.admin_shares_v2_client.update_share_type_extra_spec, st["share_type"]["id"], "key", too_big_value) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_list_es_with_empty_shr_type_id(self): self.assertRaises( lib_exc.NotFound, self.admin_shares_v2_client.get_share_type_extra_specs, "") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_list_es_with_invalid_shr_type_id(self): self.assertRaises( lib_exc.NotFound, self.admin_shares_v2_client.get_share_type_extra_specs, data_utils.rand_name("fake")) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_create_es_with_empty_shr_type_id(self): self.assertRaises( lib_exc.NotFound, self.admin_shares_v2_client.create_share_type_extra_specs, "", {"key1": "value1", }) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_create_es_with_invalid_shr_type_id(self): self.assertRaises( lib_exc.NotFound, self.admin_shares_v2_client.create_share_type_extra_specs, data_utils.rand_name("fake"), {"key1": "value1", }) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_create_es_with_empty_specs(self): st = self._create_share_type() self.assertRaises( @@ -177,7 +177,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): self.admin_shares_v2_client.create_share_type_extra_specs, st["share_type"]["id"], "") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_create_es_with_invalid_specs(self): st = self._create_share_type() self.assertRaises( @@ -185,7 +185,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): self.admin_shares_v2_client.create_share_type_extra_specs, st["share_type"]["id"], {"": "value_with_empty_key"}) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_get_extra_spec_with_empty_key(self): st = self._create_share_type() self.assertRaises( @@ -193,7 +193,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): self.admin_shares_v2_client.get_share_type_extra_spec, st["share_type"]["id"], "") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_get_extra_spec_with_invalid_key(self): st = self._create_share_type() self.assertRaises( @@ -201,35 +201,35 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): self.admin_shares_v2_client.get_share_type_extra_spec, st["share_type"]["id"], data_utils.rand_name("fake")) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_get_extra_specs_with_empty_shr_type_id(self): self.assertRaises( lib_exc.NotFound, self.admin_shares_v2_client.get_share_type_extra_specs, "") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_get_extra_specs_with_invalid_shr_type_id(self): self.assertRaises( lib_exc.NotFound, self.admin_shares_v2_client.get_share_type_extra_specs, data_utils.rand_name("fake")) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_delete_es_key_with_empty_shr_type_id(self): self.assertRaises( lib_exc.NotFound, self.admin_shares_v2_client.delete_share_type_extra_spec, "", "key", ) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_delete_es_key_with_invalid_shr_type_id(self): self.assertRaises( lib_exc.NotFound, self.admin_shares_v2_client.delete_share_type_extra_spec, data_utils.rand_name("fake"), "key", ) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_delete_with_invalid_key(self): st = self._create_share_type() self.assertRaises( @@ -237,21 +237,21 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): self.admin_shares_v2_client.delete_share_type_extra_spec, st["share_type"]["id"], data_utils.rand_name("fake")) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_update_spec_with_empty_shr_type_id(self): self.assertRaises( lib_exc.NotFound, self.admin_shares_v2_client.update_share_type_extra_spec, "", "key", "new_value") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_update_spec_with_invalid_shr_type_id(self): self.assertRaises( lib_exc.NotFound, self.admin_shares_v2_client.update_share_type_extra_spec, data_utils.rand_name("fake"), "key", "new_value") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_update_spec_with_empty_key(self): st = self._create_share_type() self.assertRaises( @@ -259,14 +259,14 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): self.admin_shares_v2_client.update_share_type_extra_spec, st["share_type"]["id"], "", "new_value") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_update_with_invalid_shr_type_id(self): self.assertRaises( lib_exc.NotFound, self.admin_shares_v2_client.update_share_type_extra_specs, data_utils.rand_name("fake"), {"key": "new_value"}) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_update_with_invalid_specs(self): st = self._create_share_type() self.assertRaises( @@ -274,7 +274,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): self.admin_shares_v2_client.update_share_type_extra_specs, st["share_type"]["id"], {"": "new_value"}) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_delete_spec_driver_handles_share_servers(self): st = self._create_share_type() @@ -285,7 +285,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest): st["share_type"]["id"], "driver_handles_share_servers") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_delete_spec_snapshot_support(self): st = self._create_share_type() diff --git a/manila_tempest_tests/tests/api/admin/test_share_types_negative.py b/manila_tempest_tests/tests/api/admin/test_share_types_negative.py index 4e1e242088..b0fb9db652 100644 --- a/manila_tempest_tests/tests/api/admin/test_share_types_negative.py +++ b/manila_tempest_tests/tests/api/admin/test_share_types_negative.py @@ -15,7 +15,7 @@ from tempest.lib.common.utils import data_utils from tempest.lib import exceptions as lib_exc -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -28,39 +28,39 @@ class ShareTypesAdminNegativeTest(base.BaseSharesMixedTest): return self.create_share_type( name, extra_specs=extra_specs, client=self.admin_shares_v2_client) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_create_share_with_nonexistent_share_type(self): self.assertRaises(lib_exc.NotFound, self.admin_shares_v2_client.create_share, share_type_id=data_utils.rand_name("fake")) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_create_share_type_with_empty_name(self): self.assertRaises( lib_exc.BadRequest, self.create_share_type, '', client=self.admin_shares_v2_client) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_create_share_type_with_too_big_name(self): self.assertRaises(lib_exc.BadRequest, self.create_share_type, "x" * 256, client=self.admin_shares_v2_client) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_get_share_type_by_nonexistent_id(self): self.assertRaises(lib_exc.NotFound, self.admin_shares_v2_client.get_share_type, data_utils.rand_name("fake")) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_delete_share_type_by_nonexistent_id(self): self.assertRaises(lib_exc.NotFound, self.admin_shares_v2_client.delete_share_type, data_utils.rand_name("fake")) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_create_duplicate_of_share_type(self): st = self._create_share_type() self.assertRaises(lib_exc.Conflict, @@ -69,7 +69,7 @@ class ShareTypesAdminNegativeTest(base.BaseSharesMixedTest): extra_specs=self.add_required_extra_specs_to_dict(), client=self.admin_shares_v2_client) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_add_share_type_allowed_for_public(self): st = self._create_share_type() self.assertRaises(lib_exc.Conflict, @@ -77,7 +77,7 @@ class ShareTypesAdminNegativeTest(base.BaseSharesMixedTest): st["share_type"]["id"], self.admin_shares_v2_client.tenant_id) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_remove_share_type_allowed_for_public(self): st = self._create_share_type() self.assertRaises( @@ -86,14 +86,14 @@ class ShareTypesAdminNegativeTest(base.BaseSharesMixedTest): st["share_type"]["id"], self.admin_shares_v2_client.tenant_id) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_add_share_type_by_nonexistent_id(self): self.assertRaises(lib_exc.NotFound, self.admin_shares_v2_client.add_access_to_share_type, data_utils.rand_name("fake"), self.admin_shares_v2_client.tenant_id) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_remove_share_type_by_nonexistent_id(self): self.assertRaises( lib_exc.NotFound, diff --git a/manila_tempest_tests/tests/api/admin/test_shares_actions.py b/manila_tempest_tests/tests/api/admin/test_shares_actions.py index ed04ffdc09..1e638eb6a9 100644 --- a/manila_tempest_tests/tests/api/admin/test_shares_actions.py +++ b/manila_tempest_tests/tests/api/admin/test_shares_actions.py @@ -15,8 +15,8 @@ from tempest import config from tempest.lib.common.utils import data_utils -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -79,7 +79,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest): snapshot_id=cls.snap['id'], )) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_get_share(self): # get share @@ -106,7 +106,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest): CONF.share.share_size, share["size"]) self.assertEqual(CONF.share.share_size, int(share["size"]), msg) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares(self): # list shares @@ -122,7 +122,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest): msg = "expected id lists %s times in share list" % (len(gen)) self.assertEqual(1, len(gen), msg) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail(self): # list shares @@ -142,7 +142,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest): msg = "expected id lists %s times in share list" % (len(gen)) self.assertEqual(1, len(gen), msg) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_filter_by_metadata(self): filters = {'metadata': self.metadata} @@ -157,7 +157,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest): if CONF.share.run_snapshot_tests: self.assertFalse(self.shares[1]['id'] in [s['id'] for s in shares]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_filter_by_extra_specs(self): filters = { "extra_specs": { @@ -190,7 +190,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest): extra_specs = self.shares_client.get_share_type_extra_specs(st_id) self.assertDictContainsSubset(filters["extra_specs"], extra_specs) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_filter_by_share_type_id(self): filters = {'share_type_id': self.st['share_type']['id']} @@ -220,7 +220,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest): for share in self.shares: self.assertTrue(share['id'] in share_ids) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_filter_by_host(self): base_share = self.shares_client.get_share(self.shares[0]['id']) filters = {'host': base_share['host']} @@ -233,7 +233,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest): for share in shares: self.assertEqual(filters['host'], share['host']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipIf( not CONF.share.multitenancy_enabled, "Only for multitenancy.") def test_list_shares_with_detail_filter_by_share_network_id(self): @@ -249,7 +249,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest): self.assertEqual( filters['share_network_id'], share['share_network_id']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_list_shares_with_detail_filter_by_snapshot_id(self): @@ -264,7 +264,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest): self.assertEqual(filters['snapshot_id'], share['snapshot_id']) self.assertFalse(self.shares[0]['id'] in [s['id'] for s in shares]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_with_asc_sorting(self): filters = {'sort_key': 'created_at', 'sort_dir': 'asc'} @@ -276,21 +276,21 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest): sorted_list = [share['created_at'] for share in shares] self.assertEqual(sorted(sorted_list), sorted_list) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_filter_by_existed_name(self): # list shares by name, at least one share is expected params = {"name": self.share_name} shares = self.shares_client.list_shares_with_detail(params) self.assertEqual(self.share_name, shares[0]["name"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_filter_by_fake_name(self): # list shares by fake name, no shares are expected params = {"name": data_utils.rand_name("fake-nonexistent-name")} shares = self.shares_client.list_shares_with_detail(params) self.assertEqual(0, len(shares)) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_filter_by_active_status(self): # list shares by active status, at least one share is expected params = {"status": "available"} @@ -299,14 +299,14 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest): for share in shares: self.assertEqual(params["status"], share["status"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_filter_by_fake_status(self): # list shares by fake status, no shares are expected params = {"status": 'fake'} shares = self.shares_client.list_shares_with_detail(params) self.assertEqual(0, len(shares)) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_get_snapshot(self): @@ -334,7 +334,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest): "actual share_id: '%s'" % (self.shares[0]["id"], get["share_id"]) self.assertEqual(self.shares[0]["id"], get["share_id"], msg) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_list_snapshots(self): @@ -351,7 +351,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest): msg = "expected id lists %s times in share list" % (len(gen)) self.assertEqual(1, len(gen), msg) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_list_snapshots_with_detail(self): diff --git a/manila_tempest_tests/tests/api/admin/test_snapshot_manage.py b/manila_tempest_tests/tests/api/admin/test_snapshot_manage.py index 317cc84e6e..272b779432 100644 --- a/manila_tempest_tests/tests/api/admin/test_snapshot_manage.py +++ b/manila_tempest_tests/tests/api/admin/test_snapshot_manage.py @@ -18,8 +18,8 @@ import six from tempest import config from tempest.lib.common.utils import data_utils from tempest.lib import exceptions as lib_exc -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base from manila_tempest_tests import utils @@ -121,7 +121,7 @@ class ManageNFSSnapshotTest(base.BaseSharesAdminTest): self.shares_v2_client.get_snapshot, get_snapshot['id']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @ddt.data('2.12', '2.16', CONF.share.max_api_microversion) def test_manage_different_versions(self, version): """Run snapshot manage test for multiple versions. diff --git a/manila_tempest_tests/tests/api/admin/test_snapshot_manage_negative.py b/manila_tempest_tests/tests/api/admin/test_snapshot_manage_negative.py index 8dace66103..dfd892ca69 100644 --- a/manila_tempest_tests/tests/api/admin/test_snapshot_manage_negative.py +++ b/manila_tempest_tests/tests/api/admin/test_snapshot_manage_negative.py @@ -17,8 +17,8 @@ import six from tempest import config from tempest.lib.common.utils import data_utils from tempest.lib import exceptions as lib_exc -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -62,7 +62,7 @@ class ManageNFSSnapshotNegativeTest(base.BaseSharesAdminTest): share_protocol=cls.protocol ) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_manage_not_found(self): # Manage snapshot fails self.assertRaises(lib_exc.NotFound, @@ -71,7 +71,7 @@ class ManageNFSSnapshotNegativeTest(base.BaseSharesAdminTest): 'fake-vol-snap-id', driver_options={}) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_manage_already_exists(self): # Manage already existing snapshot fails diff --git a/manila_tempest_tests/tests/api/test_availability_zones.py b/manila_tempest_tests/tests/api/test_availability_zones.py index b5314395c7..0b4739b71e 100644 --- a/manila_tempest_tests/tests/api/test_availability_zones.py +++ b/manila_tempest_tests/tests/api/test_availability_zones.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -28,14 +28,14 @@ class AvailabilityZonesTest(base.BaseSharesTest): for key in keys: self.assertIn(key, az) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_list_availability_zones_legacy_url_api_v1(self): # NOTE(vponomaryov): remove this test with removal of availability zone # extension url support. azs = self.shares_client.list_availability_zones() self._list_availability_zones_assertions(azs) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) @base.skip_if_microversion_not_supported("2.6") def test_list_availability_zones_legacy_url_api_v2(self): # NOTE(vponomaryov): remove this test with removal of availability zone @@ -44,7 +44,7 @@ class AvailabilityZonesTest(base.BaseSharesTest): url='os-availability-zone', version='2.6') self._list_availability_zones_assertions(azs) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) @base.skip_if_microversion_not_supported("2.7") def test_list_availability_zones(self): azs = self.shares_v2_client.list_availability_zones(version='2.7') diff --git a/manila_tempest_tests/tests/api/test_availability_zones_negative.py b/manila_tempest_tests/tests/api/test_availability_zones_negative.py index 601a644952..477e69c26b 100644 --- a/manila_tempest_tests/tests/api/test_availability_zones_negative.py +++ b/manila_tempest_tests/tests/api/test_availability_zones_negative.py @@ -14,7 +14,7 @@ # under the License. from tempest.lib import exceptions as lib_exc -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -22,7 +22,7 @@ from manila_tempest_tests.tests.api import base @base.skip_if_microversion_not_supported("2.7") class AvailabilityZonesNegativeTest(base.BaseSharesTest): - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_list_availability_zones_api_not_found_with_legacy_url(self): # NOTE(vponomaryov): remove this test with removal of availability zone # extension url support. @@ -33,7 +33,7 @@ class AvailabilityZonesNegativeTest(base.BaseSharesTest): version='2.7', ) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_list_availability_zones_api_not_found(self): self.assertRaises( lib_exc.NotFound, diff --git a/manila_tempest_tests/tests/api/test_consistency_group_actions.py b/manila_tempest_tests/tests/api/test_consistency_group_actions.py index 24c75936cb..7a7c54dfe8 100644 --- a/manila_tempest_tests/tests/api/test_consistency_group_actions.py +++ b/manila_tempest_tests/tests/api/test_consistency_group_actions.py @@ -16,8 +16,8 @@ from tempest import config from tempest.lib.common.utils import data_utils -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -79,7 +79,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesTest): cls.cgsnapshot2 = cls.create_cgsnapshot_wait_for_active( cls.cg2['id'], name=cls.cgsnap_name, description=cls.cgsnap_desc) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_get_consistency_group_v2_4(self): # Get consistency group @@ -105,7 +105,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesTest): self.assertEqual(self.cg_desc, str(consistency_group["description"]), msg) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_get_share_v2_4(self): # Get share @@ -141,7 +141,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesTest): self.cg["id"], share["consistency_group_id"]) self.assertEqual(self.cg["id"], share["consistency_group_id"], msg) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_consistency_groups_v2_4(self): # List consistency groups @@ -160,7 +160,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesTest): cg_id) self.assertEqual(1, len(gen), msg) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_consistency_groups_with_detail_v2_4(self): # List consistency groups @@ -179,7 +179,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesTest): cg_id) self.assertEqual(1, len(gen), msg) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_filter_shares_by_consistency_group_id_v2_4(self): shares = self.shares_v2_client.list_shares( @@ -200,7 +200,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesTest): 'Share %s expected in returned list, but got %s' % (self.shares[0]['id'], share_ids)) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_get_cgsnapshot_v2_4(self): # Get consistency group @@ -226,7 +226,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesTest): self.assertEqual(self.cg_desc, str(consistency_group["description"]), msg) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_get_cgsnapshot_members_v2_4(self): cgsnapshot_members = self.shares_v2_client.list_cgsnapshot_members( @@ -251,7 +251,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesTest): # self.assertEqual(share['share_type'], # member['share_type_id']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_create_consistency_group_from_populated_cgsnapshot_v2_4(self): cgsnapshot_members = self.shares_v2_client.list_cgsnapshot_members( @@ -319,7 +319,7 @@ class ConsistencyGroupRenameTest(base.BaseSharesTest): description=cls.cg_desc, ) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_update_consistency_group_v2_4(self): # Get consistency_group @@ -346,7 +346,7 @@ class ConsistencyGroupRenameTest(base.BaseSharesTest): self.assertEqual(new_name, consistency_group["name"]) self.assertEqual(new_desc, consistency_group["description"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_create_update_read_consistency_group_with_unicode_v2_4(self): value1 = u'ಠ_ಠ' value2 = u'ಠ_ರೃ' diff --git a/manila_tempest_tests/tests/api/test_consistency_groups.py b/manila_tempest_tests/tests/api/test_consistency_groups.py index 3c885549df..8f141da9d2 100644 --- a/manila_tempest_tests/tests/api/test_consistency_groups.py +++ b/manila_tempest_tests/tests/api/test_consistency_groups.py @@ -15,8 +15,8 @@ from tempest import config from tempest.lib import exceptions as lib_exc -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -32,7 +32,7 @@ CGSNAPSHOT_REQUIRED_ELEMENTS = {"id", "name", "description", "created_at", class ConsistencyGroupsTest(base.BaseSharesTest): """Covers consistency group functionality.""" - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_create_populate_delete_consistency_group_v2_4(self): # Create a consistency group consistency_group = self.create_consistency_group( @@ -65,7 +65,7 @@ class ConsistencyGroupsTest(base.BaseSharesTest): self.shares_client.get_share, share['id']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_create_delete_empty_cgsnapshot_v2_4(self): # Create base consistency group consistency_group = self.create_consistency_group( @@ -98,7 +98,7 @@ class ConsistencyGroupsTest(base.BaseSharesTest): cgsnapshot['id'], version='2.4') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_create_consistency_group_from_empty_cgsnapshot(self): # Create base consistency group consistency_group = self.create_consistency_group( diff --git a/manila_tempest_tests/tests/api/test_consistency_groups_negative.py b/manila_tempest_tests/tests/api/test_consistency_groups_negative.py index 9aa62bf0a7..9c38a2bb9a 100644 --- a/manila_tempest_tests/tests/api/test_consistency_groups_negative.py +++ b/manila_tempest_tests/tests/api/test_consistency_groups_negative.py @@ -16,8 +16,8 @@ from tempest import config from tempest.lib.common.utils import data_utils from tempest.lib import exceptions as lib_exc -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -28,21 +28,21 @@ CONF = config.CONF 'Consistency Group tests disabled.') class ConsistencyGroupsAPIOnlyNegativeTest(base.BaseSharesTest): - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_delete_cg_without_passing_cg_id_v2_4(self): self.assertRaises(lib_exc.NotFound, self.shares_v2_client.delete_consistency_group, '', version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_delete_cg_with_wrong_id_v2_4(self): self.assertRaises(lib_exc.NotFound, self.shares_v2_client.delete_consistency_group, "wrong_consistency_group_id", version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_update_cg_with_wrong_id_v2_4(self): self.assertRaises(lib_exc.NotFound, self.shares_v2_client.update_consistency_group, @@ -51,14 +51,14 @@ class ConsistencyGroupsAPIOnlyNegativeTest(base.BaseSharesTest): description='new_description', version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_get_cg_without_passing_cg_id_v2_4(self): self.assertRaises(lib_exc.NotFound, self.shares_v2_client.get_consistency_group, '', version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_filter_shares_on_invalid_cg_id_v2_4(self): shares = self.shares_v2_client.list_shares( detailed=True, @@ -70,7 +70,7 @@ class ConsistencyGroupsAPIOnlyNegativeTest(base.BaseSharesTest): 'Incorrect number of shares returned. Expected 0, ' 'got %s.' % len(shares)) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_create_cgsnapshot_with_invalid_cg_id_value_v2_4(self): self.assertRaises(lib_exc.BadRequest, self.create_cgsnapshot_wait_for_active, @@ -78,7 +78,7 @@ class ConsistencyGroupsAPIOnlyNegativeTest(base.BaseSharesTest): cleanup_in_class=False, version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_create_cg_with_invalid_share_type_id_value_v2_4(self): self.assertRaises(lib_exc.BadRequest, self.create_consistency_group, @@ -86,7 +86,7 @@ class ConsistencyGroupsAPIOnlyNegativeTest(base.BaseSharesTest): cleanup_in_class=False, version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_create_cg_with_invalid_share_network_id_value_v2_4(self): self.assertRaises(lib_exc.BadRequest, self.create_consistency_group, @@ -94,7 +94,7 @@ class ConsistencyGroupsAPIOnlyNegativeTest(base.BaseSharesTest): cleanup_in_class=False, version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_create_cg_with_invalid_source_cgsnapshot_id_value_v2_4( self): self.assertRaises(lib_exc.BadRequest, @@ -134,7 +134,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesTest): name=cls.cgsnap_name, description=cls.cgsnap_desc) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_create_cg_with_nonexistent_source_cgsnapshot_id_value_v2_4(self): self.assertRaises(lib_exc.BadRequest, self.create_consistency_group, @@ -142,7 +142,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesTest): cleanup_in_class=False, version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_create_cg_with_nonexistent_share_network_id_value_v2_4(self): self.assertRaises(lib_exc.BadRequest, self.create_consistency_group, @@ -150,7 +150,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesTest): cleanup_in_class=False, version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_create_cg_with_nonexistent_share_type_id_value_v2_4(self): self.assertRaises(lib_exc.BadRequest, self.create_consistency_group, @@ -158,7 +158,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesTest): cleanup_in_class=False, version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_create_cgsnapshot_with_nonexistent_cg_id_value_v2_4(self): self.assertRaises(lib_exc.BadRequest, self.create_cgsnapshot_wait_for_active, @@ -166,7 +166,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesTest): cleanup_in_class=False, version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_delete_cg_in_use_by_cgsnapshot_v2_4(self): # Attempt delete of share type self.assertRaises(lib_exc.Conflict, @@ -174,7 +174,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesTest): self.consistency_group['id'], version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_delete_share_in_use_by_cgsnapshot_v2_4(self): # Attempt delete of share type params = {'consistency_group_id': self.share['consistency_group_id']} @@ -184,7 +184,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesTest): params=params, version='2.4') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_delete_cg_containing_a_share_v2_4(self): self.assertRaises(lib_exc.Conflict, self.shares_v2_client.delete_consistency_group, @@ -195,7 +195,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesTest): self.consistency_group['id'], version='2.4') self.assertEqual('available', cg['status']) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_filter_shares_on_nonexistent_cg_id_v2_4(self): shares = self.shares_v2_client.list_shares( detailed=True, @@ -207,7 +207,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesTest): 'Incorrect number of shares returned. Expected 0, ' 'got %s.' % len(shares)) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_filter_shares_on_empty_cg_id_v2_4(self): consistency_group = self.create_consistency_group( name='tempest_cg', diff --git a/manila_tempest_tests/tests/api/test_extensions.py b/manila_tempest_tests/tests/api/test_extensions.py index 5dde05022b..d60b86150e 100644 --- a/manila_tempest_tests/tests/api/test_extensions.py +++ b/manila_tempest_tests/tests/api/test_extensions.py @@ -13,14 +13,14 @@ # License for the specific language governing permissions and limitations # under the License. -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base class ExtensionsTest(base.BaseSharesTest): - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_extensions(self): # get extensions diff --git a/manila_tempest_tests/tests/api/test_limits.py b/manila_tempest_tests/tests/api/test_limits.py index 88567b5f6f..5f1f33d139 100644 --- a/manila_tempest_tests/tests/api/test_limits.py +++ b/manila_tempest_tests/tests/api/test_limits.py @@ -13,14 +13,14 @@ # License for the specific language governing permissions and limitations # under the License. -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base class ShareLimitsTest(base.BaseSharesTest): - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_limits_keys(self): # list limits @@ -44,7 +44,7 @@ class ShareLimitsTest(base.BaseSharesTest): ] [self.assertIn(key, limits["absolute"].keys()) for key in abs_keys] - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_limits_values(self): # list limits diff --git a/manila_tempest_tests/tests/api/test_metadata.py b/manila_tempest_tests/tests/api/test_metadata.py index bc3efb4933..a2a92cfbda 100644 --- a/manila_tempest_tests/tests/api/test_metadata.py +++ b/manila_tempest_tests/tests/api/test_metadata.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -25,7 +25,7 @@ class SharesMetadataTest(base.BaseSharesTest): super(SharesMetadataTest, cls).resource_setup() cls.share = cls.create_share() - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_set_metadata_in_share_creation(self): md = {u"key1": u"value1", u"key2": u"value2", } @@ -39,7 +39,7 @@ class SharesMetadataTest(base.BaseSharesTest): # verify metadata self.assertEqual(md, metadata) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_set_get_delete_metadata(self): md = {u"key3": u"value3", u"key4": u"value4", } @@ -64,7 +64,7 @@ class SharesMetadataTest(base.BaseSharesTest): get_metadata = self.shares_client.get_metadata(share["id"]) self.assertEqual({}, get_metadata) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_set_and_update_metadata_by_key(self): md1 = {u"key5": u"value5", u"key6": u"value6", } @@ -85,7 +85,7 @@ class SharesMetadataTest(base.BaseSharesTest): # verify metadata self.assertEqual(md2, get_md) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_set_metadata_min_size_key(self): data = {"k": "value"} @@ -94,7 +94,7 @@ class SharesMetadataTest(base.BaseSharesTest): body_get = self.shares_client.get_metadata(self.share["id"]) self.assertEqual(data['k'], body_get.get('k')) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_set_metadata_max_size_key(self): max_key = "k" * 255 data = {max_key: "value"} @@ -105,7 +105,7 @@ class SharesMetadataTest(base.BaseSharesTest): self.assertIn(max_key, body_get) self.assertEqual(data[max_key], body_get.get(max_key)) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_set_metadata_min_size_value(self): data = {"key": "v"} @@ -114,7 +114,7 @@ class SharesMetadataTest(base.BaseSharesTest): body_get = self.shares_client.get_metadata(self.share["id"]) self.assertEqual(data['key'], body_get['key']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_set_metadata_max_size_value(self): max_value = "v" * 1023 data = {"key": max_value} @@ -124,7 +124,7 @@ class SharesMetadataTest(base.BaseSharesTest): body_get = self.shares_client.get_metadata(self.share["id"]) self.assertEqual(data['key'], body_get['key']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_upd_metadata_min_size_key(self): data = {"k": "value"} @@ -133,7 +133,7 @@ class SharesMetadataTest(base.BaseSharesTest): body_get = self.shares_client.get_metadata(self.share["id"]) self.assertEqual(data, body_get) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_upd_metadata_max_size_key(self): max_key = "k" * 255 data = {max_key: "value"} @@ -143,7 +143,7 @@ class SharesMetadataTest(base.BaseSharesTest): body_get = self.shares_client.get_metadata(self.share["id"]) self.assertEqual(data, body_get) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_upd_metadata_min_size_value(self): data = {"key": "v"} @@ -152,7 +152,7 @@ class SharesMetadataTest(base.BaseSharesTest): body_get = self.shares_client.get_metadata(self.share["id"]) self.assertEqual(data, body_get) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_upd_metadata_max_size_value(self): max_value = "v" * 1023 data = {"key": max_value} diff --git a/manila_tempest_tests/tests/api/test_metadata_negative.py b/manila_tempest_tests/tests/api/test_metadata_negative.py index 51f541a3f6..a4ad2608fc 100644 --- a/manila_tempest_tests/tests/api/test_metadata_negative.py +++ b/manila_tempest_tests/tests/api/test_metadata_negative.py @@ -15,7 +15,7 @@ import ddt from tempest.lib import exceptions as lib_exc -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -23,7 +23,7 @@ from manila_tempest_tests.tests.api import base @ddt.ddt class SharesMetadataAPIOnlyNegativeTest(base.BaseSharesTest): - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) @ddt.data(True, False) def test_try_set_metadata_to_unexisting_share(self, is_v2_client): md = {u"key1": u"value1", u"key2": u"value2", } @@ -32,7 +32,7 @@ class SharesMetadataAPIOnlyNegativeTest(base.BaseSharesTest): client.set_metadata, "wrong_share_id", md) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) @ddt.data(True, False) def test_try_update_all_metadata_for_unexisting_share(self, is_v2_client): md = {u"key1": u"value1", u"key2": u"value2", } @@ -49,19 +49,19 @@ class SharesMetadataNegativeTest(base.BaseSharesTest): super(SharesMetadataNegativeTest, cls).resource_setup() cls.share = cls.create_share() - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_try_set_metadata_with_empty_key(self): self.assertRaises(lib_exc.BadRequest, self.shares_client.set_metadata, self.share["id"], {"": "value"}) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_try_upd_metadata_with_empty_key(self): self.assertRaises(lib_exc.BadRequest, self.shares_client.update_all_metadata, self.share["id"], {"": "value"}) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_try_set_metadata_with_too_big_key(self): too_big_key = "x" * 256 md = {too_big_key: "value"} @@ -69,7 +69,7 @@ class SharesMetadataNegativeTest(base.BaseSharesTest): self.shares_client.set_metadata, self.share["id"], md) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_try_upd_metadata_with_too_big_key(self): too_big_key = "x" * 256 md = {too_big_key: "value"} @@ -77,7 +77,7 @@ class SharesMetadataNegativeTest(base.BaseSharesTest): self.shares_client.update_all_metadata, self.share["id"], md) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_try_set_metadata_with_too_big_value(self): too_big_value = "x" * 1024 md = {"key": too_big_value} @@ -85,7 +85,7 @@ class SharesMetadataNegativeTest(base.BaseSharesTest): self.shares_client.set_metadata, self.share["id"], md) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_try_upd_metadata_with_too_big_value(self): too_big_value = "x" * 1024 md = {"key": too_big_value} @@ -93,7 +93,7 @@ class SharesMetadataNegativeTest(base.BaseSharesTest): self.shares_client.update_all_metadata, self.share["id"], md) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_try_delete_unexisting_metadata(self): self.assertRaises(lib_exc.NotFound, self.shares_client.delete_metadata, diff --git a/manila_tempest_tests/tests/api/test_microversions.py b/manila_tempest_tests/tests/api/test_microversions.py index 965b29b92e..ce259ac093 100644 --- a/manila_tempest_tests/tests/api/test_microversions.py +++ b/manila_tempest_tests/tests/api/test_microversions.py @@ -15,7 +15,7 @@ # under the License. from tempest import config -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -33,7 +33,7 @@ class MicroversionsTest(base.BaseSharesTest): Sends HTTP GET requests to the version API to validate microversions. """ - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_microversions_root_version(self): resp, resp_body = self.shares_v2_client.send_microversion_request() @@ -55,7 +55,7 @@ class MicroversionsTest(base.BaseSharesTest): self.assertEqual(_MIN_API_VERSION, v2.get('min_version')) self.assertEqual(_MAX_API_VERSION, v2.get('version')) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_microversions_v1_no_version(self): resp, resp_body = self.shares_v2_client.send_microversion_request( @@ -72,7 +72,7 @@ class MicroversionsTest(base.BaseSharesTest): self.assertEqual('', version_list[0].get('min_version')) self.assertEqual('', version_list[0].get('version')) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_microversions_v1_with_version(self): resp, resp_body = self.shares_v2_client.send_microversion_request( @@ -89,7 +89,7 @@ class MicroversionsTest(base.BaseSharesTest): self.assertEqual('', version_list[0].get('min_version')) self.assertEqual('', version_list[0].get('version')) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_microversions_v2_no_version(self): resp, resp_body = self.shares_v2_client.send_microversion_request( @@ -107,7 +107,7 @@ class MicroversionsTest(base.BaseSharesTest): self.assertEqual(_MIN_API_VERSION, version_list[0].get('min_version')) self.assertEqual(_MAX_API_VERSION, version_list[0].get('version')) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_microversions_v2_min_version(self): resp, resp_body = self.shares_v2_client.send_microversion_request( @@ -125,7 +125,7 @@ class MicroversionsTest(base.BaseSharesTest): self.assertEqual(_MIN_API_VERSION, version_list[0].get('min_version')) self.assertEqual(_MAX_API_VERSION, version_list[0].get('version')) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_microversions_v2_max_version(self): resp, resp_body = self.shares_v2_client.send_microversion_request( @@ -143,7 +143,7 @@ class MicroversionsTest(base.BaseSharesTest): self.assertEqual(_MIN_API_VERSION, version_list[0].get('min_version')) self.assertEqual(_MAX_API_VERSION, version_list[0].get('version')) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_microversions_v2_invalid_version(self): resp, _ = self.shares_v2_client.send_microversion_request( @@ -151,7 +151,7 @@ class MicroversionsTest(base.BaseSharesTest): self.assertEqual(400, resp.status) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_microversions_v2_unacceptable_version(self): # First get max version from the server diff --git a/manila_tempest_tests/tests/api/test_quotas.py b/manila_tempest_tests/tests/api/test_quotas.py index 3388393ccb..5209b1ce9d 100644 --- a/manila_tempest_tests/tests/api/test_quotas.py +++ b/manila_tempest_tests/tests/api/test_quotas.py @@ -15,7 +15,7 @@ import ddt from tempest import config -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -34,7 +34,7 @@ class SharesQuotasTest(base.BaseSharesTest): cls.user_id = cls.shares_v2_client.user_id cls.tenant_id = cls.shares_v2_client.tenant_id - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) @ddt.data('shares_client', 'shares_v2_client') def test_default_quotas(self, client_name): quotas = getattr(self, client_name).default_quotas(self.tenant_id) @@ -44,7 +44,7 @@ class SharesQuotasTest(base.BaseSharesTest): self.assertGreater(int(quotas["snapshots"]), -2) self.assertGreater(int(quotas["share_networks"]), -2) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) @ddt.data('shares_client', 'shares_v2_client') def test_show_quotas(self, client_name): quotas = getattr(self, client_name).show_quotas(self.tenant_id) @@ -54,7 +54,7 @@ class SharesQuotasTest(base.BaseSharesTest): self.assertGreater(int(quotas["snapshots"]), -2) self.assertGreater(int(quotas["share_networks"]), -2) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) @ddt.data('shares_client', 'shares_v2_client') def test_show_quotas_for_user(self, client_name): quotas = getattr(self, client_name).show_quotas( diff --git a/manila_tempest_tests/tests/api/test_quotas_negative.py b/manila_tempest_tests/tests/api/test_quotas_negative.py index 6add9ac2bc..ed4cf80cd1 100644 --- a/manila_tempest_tests/tests/api/test_quotas_negative.py +++ b/manila_tempest_tests/tests/api/test_quotas_negative.py @@ -16,7 +16,7 @@ import ddt from tempest import config from tempest.lib import exceptions as lib_exc -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -33,18 +33,18 @@ class SharesQuotasNegativeTest(base.BaseSharesTest): raise cls.skipException(msg) super(SharesQuotasNegativeTest, cls).resource_setup() - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_get_quotas_with_empty_tenant_id(self): self.assertRaises(lib_exc.NotFound, self.shares_v2_client.show_quotas, "") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_reset_quotas_with_user(self): self.assertRaises(lib_exc.Forbidden, self.shares_v2_client.reset_quotas, self.shares_v2_client.tenant_id) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_update_quotas_with_user(self): self.assertRaises(lib_exc.Forbidden, self.shares_v2_client.update_quotas, @@ -66,7 +66,7 @@ class SharesQuotasNegativeTest(base.BaseSharesTest): ('os-services', '2.7', 'update_quotas'), ) @ddt.unpack - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) @base.skip_if_microversion_not_supported("2.7") def test_show_quotas_with_wrong_versions(self, url, version, method_name): self.assertRaises( diff --git a/manila_tempest_tests/tests/api/test_replication.py b/manila_tempest_tests/tests/api/test_replication.py index d5ec21a00d..0bdb7adf75 100644 --- a/manila_tempest_tests/tests/api/test_replication.py +++ b/manila_tempest_tests/tests/api/test_replication.py @@ -15,8 +15,8 @@ from tempest import config from tempest.lib.common.utils import data_utils -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.common import constants from manila_tempest_tests import share_exceptions @@ -126,7 +126,7 @@ class ReplicationTest(base.BaseSharesMixedTest): return access_type, access_to - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_add_delete_share_replica(self): # Create the replica share_replica = self._verify_create_replica() @@ -134,7 +134,7 @@ class ReplicationTest(base.BaseSharesMixedTest): # Delete the replica self.delete_share_replica(share_replica["id"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_add_access_rule_create_replica_delete_rule(self): # Add access rule to the share access_type, access_to = self._verify_config_and_set_access_rule_data() @@ -157,7 +157,7 @@ class ReplicationTest(base.BaseSharesMixedTest): self.shares_v2_client.wait_for_resource_deletion( rule_id=rule["id"], share_id=self.shares[0]['id']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_create_replica_add_access_rule_delete_replica(self): access_type, access_to = self._verify_config_and_set_access_rule_data() # Create the replica @@ -174,7 +174,7 @@ class ReplicationTest(base.BaseSharesMixedTest): # Delete the replica self.delete_share_replica(share_replica["id"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @testtools.skipUnless(CONF.share.run_multiple_share_replicas_tests, 'Multiple share replicas tests are disabled.') def test_add_multiple_share_replicas(self): @@ -205,7 +205,7 @@ class ReplicationTest(base.BaseSharesMixedTest): self.assertIn(share_replica1["id"], replica_ids) self.assertIn(share_replica2["id"], replica_ids) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_promote_in_sync_share_replica(self): # Test promote 'in_sync' share_replica to 'active' state if (self.replication_type @@ -236,7 +236,7 @@ class ReplicationTest(base.BaseSharesMixedTest): self.assertEqual(constants.REPLICATION_STATE_ACTIVE, promoted_replica["replica_state"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_promote_and_promote_back(self): # Test promote back and forth between 2 share replicas if (self.replication_type @@ -278,7 +278,7 @@ class ReplicationTest(base.BaseSharesMixedTest): new_replica['id'], constants.REPLICATION_STATE_IN_SYNC, status_attr='replica_state') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_active_replication_state(self): # Verify the replica_state of first instance is set to active. replica = self.shares_v2_client.get_share_replica(self.instance_id1) @@ -356,7 +356,7 @@ class ReplicationActionsTest(base.BaseSharesMixedTest): replica['id'], len(replica_id_list)) self.assertEqual(1, len(replica_id_list), msg) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_show_share_replica(self): replica = self.shares_v2_client.get_share_replica(self.replica1["id"]) @@ -367,7 +367,7 @@ class ReplicationActionsTest(base.BaseSharesMixedTest): 'expected %s, got %s.' % (replica["id"], detail_keys, actual_keys)) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_detail_list_share_replicas_for_share(self): # List replicas for share replica_list = self.shares_v2_client.list_share_replicas( @@ -379,7 +379,7 @@ class ReplicationActionsTest(base.BaseSharesMixedTest): # Verify keys self._validate_replica_list(replica_list) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_detail_list_share_replicas_for_all_shares(self): # List replicas for all available shares replica_list = self.shares_v2_client.list_share_replicas() @@ -391,7 +391,7 @@ class ReplicationActionsTest(base.BaseSharesMixedTest): # Verify keys self._validate_replica_list(replica_list) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_summary_list_share_replicas_for_all_shares(self): # List replicas replica_list = self.shares_v2_client.list_share_replicas_summary() diff --git a/manila_tempest_tests/tests/api/test_replication_negative.py b/manila_tempest_tests/tests/api/test_replication_negative.py index e6a1719002..cfbf210662 100644 --- a/manila_tempest_tests/tests/api/test_replication_negative.py +++ b/manila_tempest_tests/tests/api/test_replication_negative.py @@ -16,8 +16,8 @@ from tempest import config from tempest.lib.common.utils import data_utils from tempest.lib import exceptions as lib_exc -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.common import constants from manila_tempest_tests import share_exceptions @@ -75,7 +75,7 @@ class ReplicationNegativeTest(base.BaseSharesMixedTest): raise self.skipException( msg % ','.join(constants.REPLICATION_PROMOTION_CHOICES)) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_try_add_replica_to_share_with_no_replication_share_type(self): # Create share without replication type share_type = self.create_share_type( @@ -88,7 +88,7 @@ class ReplicationNegativeTest(base.BaseSharesMixedTest): share['id'], self.replica_zone) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_add_replica_to_share_with_error_state(self): # Set "error" state self.admin_client.reset_state( @@ -101,13 +101,13 @@ class ReplicationNegativeTest(base.BaseSharesMixedTest): self.share1['id'], self.replica_zone) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_try_delete_last_active_replica(self): self.assertRaises(lib_exc.BadRequest, self.shares_v2_client.delete_share_replica, self.instance_id1) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_try_delete_share_having_replica(self): self.create_share_replica(self.share1["id"], self.replica_zone, cleanup_in_class=False) @@ -115,7 +115,7 @@ class ReplicationNegativeTest(base.BaseSharesMixedTest): self.shares_v2_client.delete_share, self.share1["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_promote_out_of_sync_share_replica(self): # Test promoting an out_of_sync share_replica to active state self._is_replication_type_promotable() @@ -133,7 +133,7 @@ class ReplicationNegativeTest(base.BaseSharesMixedTest): self.shares_v2_client.promote_share_replica, replica['id']) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_promote_active_share_replica(self): # Test promote active share_replica self._is_replication_type_promotable() @@ -142,7 +142,7 @@ class ReplicationNegativeTest(base.BaseSharesMixedTest): self.shares_v2_client.promote_share_replica(self.instance_id1, expected_status=200) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_promote_share_replica_for_writable_share_type(self): # Test promote active share_replica for writable share if self.replication_type != "writable": @@ -165,13 +165,13 @@ class ReplicationNegativeTest(base.BaseSharesMixedTest): @base.skip_if_microversion_lt(_MIN_SUPPORTED_MICROVERSION) class ReplicationAPIOnlyNegativeTest(base.BaseSharesTest): - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_get_replica_by_nonexistent_id(self): self.assertRaises(lib_exc.NotFound, self.shares_v2_client.get_share_replica, data_utils.rand_uuid()) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_delete_replica_by_nonexistent_id(self): self.assertRaises(lib_exc.NotFound, self.shares_v2_client.delete_share_replica, diff --git a/manila_tempest_tests/tests/api/test_replication_snapshots.py b/manila_tempest_tests/tests/api/test_replication_snapshots.py index 4046200319..e3081ccb80 100644 --- a/manila_tempest_tests/tests/api/test_replication_snapshots.py +++ b/manila_tempest_tests/tests/api/test_replication_snapshots.py @@ -15,8 +15,8 @@ from tempest import config from tempest.lib.common.utils import data_utils -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.common import constants from manila_tempest_tests import share_exceptions @@ -62,7 +62,7 @@ class ReplicationSnapshotTest(base.BaseSharesMixedTest): 'availability_zone': cls.share_zone, }} - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_snapshot_after_share_replica(self): """Test the snapshot for replicated share. @@ -88,7 +88,7 @@ class ReplicationSnapshotTest(base.BaseSharesMixedTest): self.delete_share_replica(original_replica['id']) self.create_share(snapshot_id=snapshot['id']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_snapshot_before_share_replica(self): """Test the snapshot for replicated share. @@ -118,7 +118,7 @@ class ReplicationSnapshotTest(base.BaseSharesMixedTest): self.delete_share_replica(original_replica['id']) self.create_share(snapshot_id=snapshot['id']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_snapshot_before_and_after_share_replica(self): """Test the snapshot for replicated share. @@ -155,7 +155,7 @@ class ReplicationSnapshotTest(base.BaseSharesMixedTest): self.create_share(snapshot_id=snapshot1['id']) self.create_share(snapshot_id=snapshot2['id']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_delete_snapshot_after_adding_replica(self): """Verify the snapshot delete. @@ -175,7 +175,7 @@ class ReplicationSnapshotTest(base.BaseSharesMixedTest): self.shares_v2_client.wait_for_resource_deletion( snapshot_id=snapshot["id"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_create_replica_from_snapshot_share(self): """Test replica for a share that was created from snapshot.""" diff --git a/manila_tempest_tests/tests/api/test_rules.py b/manila_tempest_tests/tests/api/test_rules.py index 8e70a5fbd0..180ed7928c 100644 --- a/manila_tempest_tests/tests/api/test_rules.py +++ b/manila_tempest_tests/tests/api/test_rules.py @@ -16,8 +16,8 @@ import ddt from tempest import config from tempest.lib import exceptions as lib_exc -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base from manila_tempest_tests import utils @@ -78,7 +78,7 @@ class ShareIpRulesForNFSTest(base.BaseSharesTest): cls.access_type = "ip" cls.access_to = "2.2.2.2" - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @ddt.data('1.0', '2.9', LATEST_MICROVERSION) def test_create_delete_access_rules_with_one_ip(self, version): @@ -120,7 +120,7 @@ class ShareIpRulesForNFSTest(base.BaseSharesTest): self.shares_v2_client.wait_for_resource_deletion( rule_id=rule["id"], share_id=self.share['id'], version=version) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @ddt.data('1.0', '2.9', LATEST_MICROVERSION) def test_create_delete_access_rule_with_cidr(self, version): @@ -162,7 +162,7 @@ class ShareIpRulesForNFSTest(base.BaseSharesTest): self.shares_v2_client.wait_for_resource_deletion( rule_id=rule["id"], share_id=self.share['id'], version=version) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @testtools.skipIf( "nfs" not in CONF.share.enable_ro_access_level_for_protocols, "RO access rule tests are disabled for NFS protocol.") @@ -175,7 +175,7 @@ class ShareIpRulesForNFSTest(base.BaseSharesTest): class ShareIpRulesForCIFSTest(ShareIpRulesForNFSTest): protocol = "cifs" - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @testtools.skipIf( "cifs" not in CONF.share.enable_ro_access_level_for_protocols, "RO access rule tests are disabled for CIFS protocol.") @@ -200,7 +200,7 @@ class ShareUserRulesForNFSTest(base.BaseSharesTest): cls.access_type = "user" cls.access_to = CONF.share.username_for_user_rules - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @ddt.data('1.0', '2.9', LATEST_MICROVERSION) def test_create_delete_user_rule(self, version): @@ -239,7 +239,7 @@ class ShareUserRulesForNFSTest(base.BaseSharesTest): self.shares_v2_client.wait_for_resource_deletion( rule_id=rule["id"], share_id=self.share['id'], version=version) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @testtools.skipIf( "nfs" not in CONF.share.enable_ro_access_level_for_protocols, "RO access rule tests are disabled for NFS protocol.") @@ -252,7 +252,7 @@ class ShareUserRulesForNFSTest(base.BaseSharesTest): class ShareUserRulesForCIFSTest(ShareUserRulesForNFSTest): protocol = "cifs" - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @testtools.skipIf( "cifs" not in CONF.share.enable_ro_access_level_for_protocols, "RO access rule tests are disabled for CIFS protocol.") @@ -279,7 +279,7 @@ class ShareCertRulesForGLUSTERFSTest(base.BaseSharesTest): # certificate that it possesses. cls.access_to = "client1.com" - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @ddt.data('1.0', '2.9', LATEST_MICROVERSION) def test_create_delete_cert_rule(self, version): @@ -318,7 +318,7 @@ class ShareCertRulesForGLUSTERFSTest(base.BaseSharesTest): self.shares_v2_client.wait_for_resource_deletion( rule_id=rule["id"], share_id=self.share['id'], version=version) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @testtools.skipIf( "glusterfs" not in CONF.share.enable_ro_access_level_for_protocols, "RO access rule tests are disabled for GLUSTERFS protocol.") @@ -376,7 +376,7 @@ class ShareCephxRulesForCephFSTest(base.BaseSharesTest): # Provide access to a client identified by a cephx auth id. cls.access_to = "bob" - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @ddt.data("alice", "alice_bob", "alice bob") def test_create_delete_cephx_rule(self, access_to): rule = self.shares_v2_client.create_access_rule( @@ -428,7 +428,7 @@ class ShareRulesTest(base.BaseSharesTest): cls.shares_v2_client.share_protocol = cls.protocol cls.share = cls.create_share() - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @ddt.data('1.0', '2.9', LATEST_MICROVERSION) def test_list_access_rules(self, version): if (utils.is_microversion_lt(version, '2.13') and @@ -498,7 +498,7 @@ class ShareRulesTest(base.BaseSharesTest): self.shares_v2_client.wait_for_resource_deletion( rule_id=rule["id"], share_id=self.share['id'], version=version) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @ddt.data('1.0', '2.9', LATEST_MICROVERSION) def test_access_rules_deleted_if_share_deleted(self, version): if (utils.is_microversion_lt(version, '2.13') and diff --git a/manila_tempest_tests/tests/api/test_rules_negative.py b/manila_tempest_tests/tests/api/test_rules_negative.py index 7fc9fc7562..9cd4708c15 100644 --- a/manila_tempest_tests/tests/api/test_rules_negative.py +++ b/manila_tempest_tests/tests/api/test_rules_negative.py @@ -16,8 +16,8 @@ import ddt from tempest import config from tempest.lib import exceptions as lib_exc -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base from manila_tempest_tests import utils @@ -43,63 +43,63 @@ class ShareIpRulesForNFSNegativeTest(base.BaseSharesTest): # create snapshot cls.snap = cls.create_snapshot_wait_for_active(cls.share["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_ip_with_wrong_target_1(self, client_name): self.assertRaises(lib_exc.BadRequest, getattr(self, client_name).create_access_rule, self.share["id"], "ip", "1.2.3.256") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_ip_with_wrong_target_2(self, client_name): self.assertRaises(lib_exc.BadRequest, getattr(self, client_name).create_access_rule, self.share["id"], "ip", "1.1.1.-") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_ip_with_wrong_target_3(self, client_name): self.assertRaises(lib_exc.BadRequest, getattr(self, client_name).create_access_rule, self.share["id"], "ip", "1.2.3.4/33") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_ip_with_wrong_target_4(self, client_name): self.assertRaises(lib_exc.BadRequest, getattr(self, client_name).create_access_rule, self.share["id"], "ip", "1.2.3.*") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_ip_with_wrong_target_5(self, client_name): self.assertRaises(lib_exc.BadRequest, getattr(self, client_name).create_access_rule, self.share["id"], "ip", "1.2.3.*/23") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_ip_with_wrong_target_6(self, client_name): self.assertRaises(lib_exc.BadRequest, getattr(self, client_name).create_access_rule, self.share["id"], "ip", "1.2.3.1|23") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_ip_with_wrong_target_7(self, client_name): self.assertRaises(lib_exc.BadRequest, getattr(self, client_name).create_access_rule, self.share["id"], "ip", "1.2.3.1/-1") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_ip_with_wrong_target_8(self, client_name): self.assertRaises(lib_exc.BadRequest, getattr(self, client_name).create_access_rule, self.share["id"], "ip", "1.2.3.1/") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_with_wrong_level(self, client_name): self.assertRaises(lib_exc.BadRequest, @@ -109,7 +109,7 @@ class ShareIpRulesForNFSNegativeTest(base.BaseSharesTest): '2.2.2.2', 'su') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('1.0', '2.9', LATEST_MICROVERSION) def test_create_duplicate_of_ip_rule(self, version): # test data @@ -181,7 +181,7 @@ class ShareUserRulesForNFSNegativeTest(base.BaseSharesTest): # create snapshot cls.snap = cls.create_snapshot_wait_for_active(cls.share["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_user_with_wrong_input_2(self, client_name): self.assertRaises(lib_exc.BadRequest, @@ -189,28 +189,28 @@ class ShareUserRulesForNFSNegativeTest(base.BaseSharesTest): self.share["id"], "user", "try+") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_user_with_empty_key(self, client_name): self.assertRaises(lib_exc.BadRequest, getattr(self, client_name).create_access_rule, self.share["id"], "user", "") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_user_with_too_little_key(self, client_name): self.assertRaises(lib_exc.BadRequest, getattr(self, client_name).create_access_rule, self.share["id"], "user", "abc") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_user_with_too_big_key(self, client_name): self.assertRaises(lib_exc.BadRequest, getattr(self, client_name).create_access_rule, self.share["id"], "user", "a" * 33) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_user_with_wrong_input_1(self, client_name): self.assertRaises(lib_exc.BadRequest, @@ -218,7 +218,7 @@ class ShareUserRulesForNFSNegativeTest(base.BaseSharesTest): self.share["id"], "user", "try+") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") @@ -229,7 +229,7 @@ class ShareUserRulesForNFSNegativeTest(base.BaseSharesTest): access_type="user", access_to="fakeuser") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_user_with_wrong_share_id(self, client_name): self.assertRaises(lib_exc.NotFound, @@ -238,7 +238,7 @@ class ShareUserRulesForNFSNegativeTest(base.BaseSharesTest): access_type="user", access_to="fakeuser") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_with_wrong_level(self, client_name): self.assertRaises(lib_exc.BadRequest, @@ -271,14 +271,14 @@ class ShareCertRulesForGLUSTERFSNegativeTest(base.BaseSharesTest): # create snapshot cls.snap = cls.create_snapshot_wait_for_active(cls.share["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_cert_with_empty_common_name(self, client_name): self.assertRaises(lib_exc.BadRequest, getattr(self, client_name).create_access_rule, self.share["id"], "cert", "") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_cert_with_whitespace_common_name(self, client_name): @@ -286,7 +286,7 @@ class ShareCertRulesForGLUSTERFSNegativeTest(base.BaseSharesTest): getattr(self, client_name).create_access_rule, self.share["id"], "cert", " ") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_cert_with_too_big_common_name(self, client_name): @@ -295,7 +295,7 @@ class ShareCertRulesForGLUSTERFSNegativeTest(base.BaseSharesTest): getattr(self, client_name).create_access_rule, self.share["id"], "cert", "a" * 65) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") @ddt.data('shares_client', 'shares_v2_client') @@ -306,7 +306,7 @@ class ShareCertRulesForGLUSTERFSNegativeTest(base.BaseSharesTest): access_type="cert", access_to="fakeclient1.com") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_cert_with_wrong_share_id(self, client_name): self.assertRaises(lib_exc.NotFound, @@ -333,14 +333,14 @@ class ShareCephxRulesForCephFSNegativeTest(base.BaseSharesTest): cls.access_type = "cephx" cls.access_to = "david" - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('jane.doe', u"bj\u00F6rn") def test_create_access_rule_cephx_with_invalid_cephx_id(self, access_to): self.assertRaises(lib_exc.BadRequest, self.shares_v2_client.create_access_rule, self.share["id"], self.access_type, access_to) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_create_access_rule_cephx_with_wrong_level(self): self.assertRaises(lib_exc.BadRequest, self.shares_v2_client.create_access_rule, @@ -383,7 +383,7 @@ class ShareRulesNegativeTest(base.BaseSharesTest): # create snapshot cls.snap = cls.create_snapshot_wait_for_active(cls.share["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_delete_access_rule_with_wrong_id(self, client_name): skip_if_cephx_access_type_not_supported_by_client(self, client_name) @@ -391,7 +391,7 @@ class ShareRulesNegativeTest(base.BaseSharesTest): getattr(self, client_name).delete_access_rule, self.share["id"], "wrong_rule_id") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_ip_with_wrong_type(self, client_name): skip_if_cephx_access_type_not_supported_by_client(self, client_name) @@ -399,7 +399,7 @@ class ShareRulesNegativeTest(base.BaseSharesTest): getattr(self, client_name).create_access_rule, self.share["id"], "wrong_type", "1.2.3.4") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @ddt.data('shares_client', 'shares_v2_client') @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") @@ -413,7 +413,7 @@ class ShareRulesNegativeTest(base.BaseSharesTest): @ddt.ddt class ShareRulesAPIOnlyNegativeTest(base.BaseSharesTest): - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) @ddt.data('shares_client', 'shares_v2_client') def test_create_access_rule_ip_with_wrong_share_id(self, client_name): skip_if_cephx_access_type_not_supported_by_client(self, client_name) diff --git a/manila_tempest_tests/tests/api/test_scheduler_stats_negative.py b/manila_tempest_tests/tests/api/test_scheduler_stats_negative.py index a23f2a5db8..c7dc3f09b5 100644 --- a/manila_tempest_tests/tests/api/test_scheduler_stats_negative.py +++ b/manila_tempest_tests/tests/api/test_scheduler_stats_negative.py @@ -14,19 +14,19 @@ # under the License. from tempest.lib import exceptions as lib_exc -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base class SchedulerStatsNegativeTest(base.BaseSharesTest): - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_list_pools_with_user(self): self.assertRaises(lib_exc.Forbidden, self.shares_client.list_pools) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_list_pools_detailed_with_user(self): self.assertRaises(lib_exc.Forbidden, self.shares_client.list_pools, diff --git a/manila_tempest_tests/tests/api/test_security_services.py b/manila_tempest_tests/tests/api/test_security_services.py index 1acf07cdd3..c8b51633c7 100644 --- a/manila_tempest_tests/tests/api/test_security_services.py +++ b/manila_tempest_tests/tests/api/test_security_services.py @@ -16,8 +16,8 @@ from oslo_log import log import six from tempest import config -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -27,7 +27,7 @@ LOG = log.getLogger(__name__) class SecurityServiceListMixin(object): - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_list_security_services(self): listed = self.shares_client.list_security_services() self.assertTrue(any(self.ss_ldap['id'] == ss['id'] for ss in listed)) @@ -38,7 +38,7 @@ class SecurityServiceListMixin(object): keys = ["name", "id", "status", "type", ] [self.assertIn(key, s_s.keys()) for s_s in listed for key in keys] - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_list_security_services_with_detail(self): listed = self.shares_client.list_security_services(detailed=True) self.assertTrue(any(self.ss_ldap['id'] == ss['id'] for ss in listed)) @@ -53,7 +53,7 @@ class SecurityServiceListMixin(object): ] [self.assertIn(key, s_s.keys()) for s_s in listed for key in keys] - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) @testtools.skipIf( not CONF.share.multitenancy_enabled, "Only for multitenancy.") def test_list_security_services_filter_by_share_network(self): @@ -79,7 +79,7 @@ class SecurityServiceListMixin(object): keys = ["name", "id", "status", "type", ] [self.assertIn(key, s_s.keys()) for s_s in listed for key in keys] - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_list_security_services_detailed_filter_by_ss_attributes(self): search_opts = { 'name': 'ss_ldap', @@ -122,7 +122,7 @@ class SecurityServicesTest(base.BaseSharesTest, self.ss_kerberos = self.create_security_service( 'kerberos', **ss_kerberos_data) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_create_delete_security_service(self): data = self.generate_security_service_data() self.service_names = ["ldap", "kerberos", "active_directory"] @@ -132,7 +132,7 @@ class SecurityServicesTest(base.BaseSharesTest, self.assertEqual(ss_name, ss["type"]) self.shares_client.delete_security_service(ss["id"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_get_security_service(self): data = self.generate_security_service_data() ss = self.create_security_service(**data) @@ -141,7 +141,7 @@ class SecurityServicesTest(base.BaseSharesTest, get = self.shares_client.get_security_service(ss["id"]) self.assertDictContainsSubset(data, get) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_update_security_service(self): data = self.generate_security_service_data() ss = self.create_security_service(**data) @@ -155,7 +155,7 @@ class SecurityServicesTest(base.BaseSharesTest, self.assertDictContainsSubset(upd_data, updated) self.assertDictContainsSubset(upd_data, get) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipIf( not CONF.share.multitenancy_enabled, "Only for multitenancy.") def test_try_update_valid_keys_sh_server_exists(self): @@ -193,7 +193,7 @@ class SecurityServicesTest(base.BaseSharesTest, ss["id"], **update_data) self.assertDictContainsSubset(update_data, updated) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_list_security_services_filter_by_invalid_opt(self): listed = self.shares_client.list_security_services( params={'fake_opt': 'some_value'}) diff --git a/manila_tempest_tests/tests/api/test_security_services_mapping.py b/manila_tempest_tests/tests/api/test_security_services_mapping.py index 52cbb7f2a3..8025bf7e24 100644 --- a/manila_tempest_tests/tests/api/test_security_services_mapping.py +++ b/manila_tempest_tests/tests/api/test_security_services_mapping.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -43,7 +43,7 @@ class SecurityServicesMappingTest(base.BaseSharesTest): # Add security service to share network self.cl.add_sec_service_to_share_network(self.sn["id"], self.ss["id"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_map_ss_to_sn_and_list(self): # List security services for share network @@ -52,14 +52,14 @@ class SecurityServicesMappingTest(base.BaseSharesTest): for key in ["status", "id", "name"]: self.assertIn(self.ss[key], ls[0][key]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_map_ss_to_sn_and_delete(self): # Remove security service from share network self.cl.remove_sec_service_from_share_network( self.sn["id"], self.ss["id"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_remap_ss_to_sn(self): # Remove security service from share network diff --git a/manila_tempest_tests/tests/api/test_security_services_mapping_negative.py b/manila_tempest_tests/tests/api/test_security_services_mapping_negative.py index 26e582bce2..94cb25f6e8 100644 --- a/manila_tempest_tests/tests/api/test_security_services_mapping_negative.py +++ b/manila_tempest_tests/tests/api/test_security_services_mapping_negative.py @@ -17,8 +17,8 @@ from oslo_log import log import six from tempest import config from tempest.lib import exceptions as lib_exc -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -35,62 +35,62 @@ class SecServicesMappingNegativeTest(base.BaseSharesTest): cls.ss = cls.create_security_service(cleanup_in_class=True) cls.cl = cls.shares_client - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_add_sec_service_twice_to_share_network(self): self.cl.add_sec_service_to_share_network(self.sn["id"], self.ss["id"]) self.assertRaises(lib_exc.Conflict, self.cl.add_sec_service_to_share_network, self.sn["id"], self.ss["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_add_nonexistant_sec_service_to_share_network(self): self.assertRaises(lib_exc.NotFound, self.cl.add_sec_service_to_share_network, self.sn["id"], "wrong_ss_id") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_add_empty_sec_service_id_to_share_network(self): self.assertRaises(lib_exc.NotFound, self.cl.add_sec_service_to_share_network, self.sn["id"], "") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_add_sec_service_to_nonexistant_share_network(self): self.assertRaises(lib_exc.NotFound, self.cl.add_sec_service_to_share_network, "wrong_sn_id", self.ss["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_add_sec_service_to_share_network_with_empty_id(self): self.assertRaises(lib_exc.NotFound, self.cl.add_sec_service_to_share_network, "", self.ss["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_list_sec_services_for_nonexistant_share_network(self): self.assertRaises(lib_exc.NotFound, self.cl.list_sec_services_for_share_network, "wrong_id") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_delete_nonexistant_sec_service_from_share_network(self): self.assertRaises(lib_exc.NotFound, self.cl.remove_sec_service_from_share_network, self.sn["id"], "wrong_id") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_delete_sec_service_from_nonexistant_share_network(self): self.assertRaises(lib_exc.NotFound, self.cl.remove_sec_service_from_share_network, "wrong_id", self.ss["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_delete_nonexistant_ss_from_nonexistant_sn(self): self.assertRaises(lib_exc.NotFound, self.cl.remove_sec_service_from_share_network, "wrong_id", "wrong_id") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipIf( not CONF.share.multitenancy_enabled, "Only for multitenancy.") def test_delete_ss_from_sn_used_by_share_server(self): @@ -122,7 +122,7 @@ class SecServicesMappingNegativeTest(base.BaseSharesTest): fresh_sn["id"], self.ss["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_map_two_ss_with_same_type_to_sn(self): # create share network data = self.generate_share_network_data() @@ -147,7 +147,7 @@ class SecServicesMappingNegativeTest(base.BaseSharesTest): self.cl.add_sec_service_to_share_network, sn["id"], security_services[1]["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_delete_ss_that_assigned_to_sn(self): # create share network data = self.generate_share_network_data() diff --git a/manila_tempest_tests/tests/api/test_security_services_negative.py b/manila_tempest_tests/tests/api/test_security_services_negative.py index 1b0a4d3718..7f96ae98a4 100644 --- a/manila_tempest_tests/tests/api/test_security_services_negative.py +++ b/manila_tempest_tests/tests/api/test_security_services_negative.py @@ -17,8 +17,8 @@ from oslo_log import log import six from tempest import config from tempest.lib import exceptions as lib_exc -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -28,52 +28,52 @@ LOG = log.getLogger(__name__) class SecurityServicesNegativeTest(base.BaseSharesTest): - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_create_security_service_with_empty_type(self): self.assertRaises(lib_exc.BadRequest, self.shares_client.create_security_service, "") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_create_security_service_with_wrong_type(self): self.assertRaises(lib_exc.BadRequest, self.shares_client.create_security_service, "wrong_type") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_get_security_service_without_id(self): self.assertRaises(lib_exc.NotFound, self.shares_client.get_security_service, "") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_get_security_service_with_wrong_id(self): self.assertRaises(lib_exc.NotFound, self.shares_client.get_security_service, "wrong_id") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_delete_security_service_without_id(self): self.assertRaises(lib_exc.NotFound, self.shares_client.delete_security_service, "") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_delete_security_service_with_wrong_type(self): self.assertRaises(lib_exc.NotFound, self.shares_client.delete_security_service, "wrong_id") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_update_nonexistant_security_service(self): self.assertRaises(lib_exc.NotFound, self.shares_client.update_security_service, "wrong_id", name="name") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_update_security_service_with_empty_id(self): self.assertRaises(lib_exc.NotFound, self.shares_client.update_security_service, "", name="name") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipIf( not CONF.share.multitenancy_enabled, "Only for multitenancy.") def test_try_update_invalid_keys_sh_server_exists(self): @@ -108,7 +108,7 @@ class SecurityServicesNegativeTest(base.BaseSharesTest): ss["id"], user="new_user") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_get_deleted_security_service(self): data = self.generate_security_service_data() ss = self.create_security_service(**data) @@ -121,7 +121,7 @@ class SecurityServicesNegativeTest(base.BaseSharesTest): self.shares_client.get_security_service, ss["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_list_security_services_all_tenants(self): self.assertRaises(lib_exc.Forbidden, self.shares_client.list_security_services, diff --git a/manila_tempest_tests/tests/api/test_share_networks.py b/manila_tempest_tests/tests/api/test_share_networks.py index fcf923d46f..430fba87b6 100644 --- a/manila_tempest_tests/tests/api/test_share_networks.py +++ b/manila_tempest_tests/tests/api/test_share_networks.py @@ -15,8 +15,8 @@ import six from tempest import config -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base from manila_tempest_tests import utils @@ -26,8 +26,8 @@ CONF = config.CONF class ShareNetworkListMixin(object): - @test.attr(type=["gate", "smoke", ]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr("gate", "smoke", ) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_list_share_networks(self): listed = self.shares_client.list_share_networks() any(self.sn_with_ldap_ss["id"] in sn["id"] for sn in listed) @@ -36,7 +36,7 @@ class ShareNetworkListMixin(object): keys = ["name", "id"] [self.assertIn(key, sn.keys()) for sn in listed for key in keys] - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_list_share_networks_with_detail(self): listed = self.shares_v2_client.list_share_networks_with_detail() any(self.sn_with_ldap_ss["id"] in sn["id"] for sn in listed) @@ -59,7 +59,7 @@ class ShareNetworkListMixin(object): [self.assertIn(key, sn.keys()) for sn in listed for key in keys] - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_list_share_networks_filter_by_ss(self): listed = self.shares_client.list_share_networks_with_detail( {'security_service_id': self.ss_ldap['id']}) @@ -71,7 +71,7 @@ class ShareNetworkListMixin(object): self.assertTrue(any(ss['id'] == self.ss_ldap['id'] for ss in ss_list)) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_list_share_networks_all_filter_opts(self): valid_filter_opts = { 'created_before': '2002-10-10', @@ -151,7 +151,7 @@ class ShareNetworksTest(base.BaseSharesTest, ShareNetworkListMixin): cls.sn_with_kerberos_ss["id"], cls.ss_kerberos["id"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_create_delete_share_network(self): # generate data for share network data = self.generate_share_network_data() @@ -163,7 +163,7 @@ class ShareNetworksTest(base.BaseSharesTest, ShareNetworkListMixin): # Delete share_network self.shares_client.delete_share_network(created["id"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_get_share_network(self): get = self.shares_client.get_share_network(self.sn_with_ldap_ss["id"]) self.assertEqual('2002-02-02T00:00:00.000000', get['created_at']) @@ -171,7 +171,7 @@ class ShareNetworksTest(base.BaseSharesTest, ShareNetworkListMixin): del data['created_at'] self.assertDictContainsSubset(data, get) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_update_share_network(self): update_data = self.generate_share_network_data() updated = self.shares_client.update_share_network( @@ -179,7 +179,7 @@ class ShareNetworksTest(base.BaseSharesTest, ShareNetworkListMixin): **update_data) self.assertDictContainsSubset(update_data, updated) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipIf( not CONF.share.multitenancy_enabled, "Only for multitenancy.") def test_update_valid_keys_sh_server_exists(self): @@ -192,7 +192,7 @@ class ShareNetworksTest(base.BaseSharesTest, ShareNetworkListMixin): self.shares_client.share_network_id, **update_dict) self.assertDictContainsSubset(update_dict, updated) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_recreate_share_network(self): # generate data for share network data = self.generate_share_network_data() @@ -211,7 +211,7 @@ class ShareNetworksTest(base.BaseSharesTest, ShareNetworkListMixin): # Delete second share network self.shares_client.delete_share_network(sn2["id"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API) def test_create_two_share_networks_with_same_net_and_subnet(self): # generate data for share network data = self.generate_share_network_data() @@ -230,7 +230,7 @@ class ShareNetworksTest(base.BaseSharesTest, ShareNetworkListMixin): "Only for multitenancy.") @testtools.skipUnless(CONF.service_available.neutron, "Only with neutron.") @base.skip_if_microversion_lt("2.18") - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_gateway_with_neutron(self): os = getattr(self, 'os_%s' % self.credentials[0]) subnet_client = os.subnets_client @@ -250,7 +250,7 @@ class ShareNetworksTest(base.BaseSharesTest, ShareNetworkListMixin): "Only for multitenancy.") @testtools.skipUnless(CONF.service_available.neutron, "Only with neutron.") @base.skip_if_microversion_lt("2.20") - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_mtu_with_neutron(self): os = getattr(self, 'os_%s' % self.credentials[0]) network_client = os.networks_client diff --git a/manila_tempest_tests/tests/api/test_share_networks_negative.py b/manila_tempest_tests/tests/api/test_share_networks_negative.py index 0fb618cba1..4c40857d6a 100644 --- a/manila_tempest_tests/tests/api/test_share_networks_negative.py +++ b/manila_tempest_tests/tests/api/test_share_networks_negative.py @@ -15,8 +15,8 @@ from tempest import config from tempest.lib import exceptions as lib_exc -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -25,39 +25,39 @@ CONF = config.CONF class ShareNetworksNegativeTest(base.BaseSharesTest): - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_get_share_network_without_id(self): self.assertRaises(lib_exc.NotFound, self.shares_client.get_share_network, "") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_get_share_network_with_wrong_id(self): self.assertRaises(lib_exc.NotFound, self.shares_client.get_share_network, "wrong_id") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_delete_share_network_without_id(self): self.assertRaises(lib_exc.NotFound, self.shares_client.delete_share_network, "") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_delete_share_network_with_wrong_type(self): self.assertRaises(lib_exc.NotFound, self.shares_client.delete_share_network, "wrong_id") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_update_nonexistant_share_network(self): self.assertRaises(lib_exc.NotFound, self.shares_client.update_share_network, "wrong_id", name="name") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_update_share_network_with_empty_id(self): self.assertRaises(lib_exc.NotFound, self.shares_client.update_share_network, "", name="name") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipIf( not CONF.share.multitenancy_enabled, "Only for multitenancy.") def test_try_update_invalid_keys_sh_server_exists(self): @@ -68,7 +68,7 @@ class ShareNetworksNegativeTest(base.BaseSharesTest): self.shares_client.share_network_id, neutron_net_id="new_net_id") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_get_deleted_share_network(self): data = self.generate_share_network_data() sn = self.create_share_network(**data) @@ -81,33 +81,33 @@ class ShareNetworksNegativeTest(base.BaseSharesTest): self.shares_client.get_security_service, sn["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_list_share_networks_all_tenants(self): self.assertRaises(lib_exc.Forbidden, self.shares_client.list_share_networks_with_detail, params={'all_tenants': 1}) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_list_share_networks_project_id(self): self.assertRaises(lib_exc.Forbidden, self.shares_client.list_share_networks_with_detail, params={'project_id': 'some_project'}) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_list_share_networks_wrong_created_since_value(self): self.assertRaises( lib_exc.BadRequest, self.shares_client.list_share_networks_with_detail, params={'created_since': '2014-10-23T08:31:58.000000'}) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_list_share_networks_wrong_created_before_value(self): self.assertRaises( lib_exc.BadRequest, self.shares_client.list_share_networks_with_detail, params={'created_before': '2014-10-23T08:31:58.000000'}) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipIf(not CONF.share.multitenancy_enabled, 'Can run only with drivers that do handle share servers ' 'creation. Skipping.') diff --git a/manila_tempest_tests/tests/api/test_share_types_negative.py b/manila_tempest_tests/tests/api/test_share_types_negative.py index 6ebdb8746b..9c7883b754 100644 --- a/manila_tempest_tests/tests/api/test_share_types_negative.py +++ b/manila_tempest_tests/tests/api/test_share_types_negative.py @@ -15,7 +15,7 @@ from tempest.lib.common.utils import data_utils from tempest.lib import exceptions as lib_exc -from tempest import test +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -36,27 +36,27 @@ class ShareTypesNegativeTest(base.BaseSharesMixedTest): cls.admin_client = cls.admin_shares_v2_client cls.st = cls._create_share_type() - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_create_share_type_with_user(self): self.assertRaises(lib_exc.Forbidden, self.create_share_type, data_utils.rand_name("used_user_creds"), client=self.shares_client) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_delete_share_type_with_user(self): self.assertRaises(lib_exc.Forbidden, self.shares_client.delete_share_type, self.st["share_type"]["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_add_access_to_share_type_with_user(self): self.assertRaises(lib_exc.Forbidden, self.shares_client.add_access_to_share_type, self.st['share_type']['id'], self.shares_client.tenant_id) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_try_remove_access_from_share_type_with_user(self): self.assertRaises(lib_exc.Forbidden, self.shares_client.remove_access_from_share_type, diff --git a/manila_tempest_tests/tests/api/test_shares.py b/manila_tempest_tests/tests/api/test_shares.py index 7926b33903..af4a54a98f 100644 --- a/manila_tempest_tests/tests/api/test_shares.py +++ b/manila_tempest_tests/tests/api/test_shares.py @@ -15,8 +15,8 @@ from tempest import config from tempest.lib import exceptions as lib_exc -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base from manila_tempest_tests import utils @@ -36,7 +36,7 @@ class SharesNFSTest(base.BaseSharesTest): raise cls.skipException(message) cls.share = cls.create_share(cls.protocol) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_create_get_delete_share(self): share = self.create_share(self.protocol) @@ -99,7 +99,7 @@ class SharesNFSTest(base.BaseSharesTest): self.shares_v2_client.get_share, share['id']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_create_delete_snapshot(self): @@ -133,7 +133,7 @@ class SharesNFSTest(base.BaseSharesTest): self.assertRaises(lib_exc.NotFound, self.shares_client.get_snapshot, snap['id']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_create_share_from_snapshot(self): @@ -159,7 +159,7 @@ class SharesNFSTest(base.BaseSharesTest): "source of share %s" % (snap["id"], get["snapshot_id"]) self.assertEqual(get["snapshot_id"], snap["id"], msg) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @testtools.skipIf(not CONF.share.multitenancy_enabled, "Only for multitenancy.") @testtools.skipUnless(CONF.share.run_snapshot_tests, diff --git a/manila_tempest_tests/tests/api/test_shares_actions.py b/manila_tempest_tests/tests/api/test_shares_actions.py index 415ca16377..60fd61517d 100644 --- a/manila_tempest_tests/tests/api/test_shares_actions.py +++ b/manila_tempest_tests/tests/api/test_shares_actions.py @@ -17,8 +17,8 @@ import ddt import six from tempest import config from tempest.lib.common.utils import data_utils -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base from manila_tempest_tests import utils @@ -119,45 +119,45 @@ class SharesActionsTest(base.BaseSharesTest): CONF.share.share_size, share["size"]) self.assertEqual(CONF.share.share_size, int(share["size"]), msg) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_get_share_v2_1(self): self._get_share('2.1') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_get_share_with_snapshot_support_key(self): self._get_share('2.2') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @utils.skip_if_microversion_not_supported('2.4') def test_get_share_with_consistency_groups_keys(self): self._get_share('2.4') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @utils.skip_if_microversion_not_supported('2.6') def test_get_share_with_share_type_name_key(self): self._get_share('2.6') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @utils.skip_if_microversion_not_supported('2.9') def test_get_share_export_locations_removed(self): self._get_share('2.9') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @utils.skip_if_microversion_not_supported('2.10') def test_get_share_with_access_rules_status(self): self._get_share('2.10') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @utils.skip_if_microversion_not_supported('2.11') def test_get_share_with_replication_type_key(self): self._get_share('2.11') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @utils.skip_if_microversion_not_supported('2.16') def test_get_share_with_user_id(self): self._get_share('2.16') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares(self): # list shares @@ -209,45 +209,45 @@ class SharesActionsTest(base.BaseSharesTest): msg = "expected id lists %s times in share list" % (len(gen)) self.assertEqual(1, len(gen), msg) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_v2_1(self): self._list_shares_with_detail('2.1') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_and_snapshot_support_key(self): self._list_shares_with_detail('2.2') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @utils.skip_if_microversion_not_supported('2.4') def test_list_shares_with_detail_consistency_groups_keys(self): self._list_shares_with_detail('2.4') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @utils.skip_if_microversion_not_supported('2.6') def test_list_shares_with_detail_share_type_name_key(self): self._list_shares_with_detail('2.6') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @utils.skip_if_microversion_not_supported('2.9') def test_list_shares_with_detail_export_locations_removed(self): self._list_shares_with_detail('2.9') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @utils.skip_if_microversion_not_supported('2.10') def test_list_shares_with_detail_with_access_rules_status(self): self._list_shares_with_detail('2.10') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @utils.skip_if_microversion_not_supported('2.11') def test_list_shares_with_detail_replication_type_key(self): self._list_shares_with_detail('2.11') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @utils.skip_if_microversion_not_supported('2.16') def test_list_shares_with_user_id(self): self._list_shares_with_detail('2.16') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_filter_by_metadata(self): filters = {'metadata': self.metadata} @@ -262,7 +262,7 @@ class SharesActionsTest(base.BaseSharesTest): if CONF.share.run_snapshot_tests: self.assertFalse(self.shares[1]['id'] in [s['id'] for s in shares]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_filter_by_host(self): base_share = self.shares_client.get_share(self.shares[0]['id']) filters = {'host': base_share['host']} @@ -275,7 +275,7 @@ class SharesActionsTest(base.BaseSharesTest): for share in shares: self.assertEqual(filters['host'], share['host']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipIf( not CONF.share.multitenancy_enabled, "Only for multitenancy.") def test_list_shares_with_detail_filter_by_share_network_id(self): @@ -291,7 +291,7 @@ class SharesActionsTest(base.BaseSharesTest): self.assertEqual( filters['share_network_id'], share['share_network_id']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_list_shares_with_detail_filter_by_snapshot_id(self): @@ -306,7 +306,7 @@ class SharesActionsTest(base.BaseSharesTest): self.assertEqual(filters['snapshot_id'], share['snapshot_id']) self.assertFalse(self.shares[0]['id'] in [s['id'] for s in shares]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_with_asc_sorting(self): filters = {'sort_key': 'created_at', 'sort_dir': 'asc'} @@ -318,21 +318,21 @@ class SharesActionsTest(base.BaseSharesTest): sorted_list = [share['created_at'] for share in shares] self.assertEqual(sorted(sorted_list), sorted_list) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_filter_by_existed_name(self): # list shares by name, at least one share is expected params = {"name": self.share_name} shares = self.shares_client.list_shares_with_detail(params) self.assertEqual(self.share_name, shares[0]["name"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_filter_by_fake_name(self): # list shares by fake name, no shares are expected params = {"name": data_utils.rand_name("fake-nonexistent-name")} shares = self.shares_client.list_shares_with_detail(params) self.assertEqual(0, len(shares)) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_filter_by_active_status(self): # list shares by active status, at least one share is expected params = {"status": "available"} @@ -341,14 +341,14 @@ class SharesActionsTest(base.BaseSharesTest): for share in shares: self.assertEqual(params["status"], share["status"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_filter_by_fake_status(self): # list shares by fake status, no shares are expected params = {"status": 'fake'} shares = self.shares_client.list_shares_with_detail(params) self.assertEqual(0, len(shares)) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_with_detail_filter_by_all_tenants(self): # non-admin user can get shares only from his project params = {"all_tenants": 1} @@ -361,7 +361,7 @@ class SharesActionsTest(base.BaseSharesTest): for share in shares: self.assertEqual(project_id, share["project_id"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_list_shares_public_with_detail(self): public_share = self.create_share( name='public_share', @@ -394,7 +394,7 @@ class SharesActionsTest(base.BaseSharesTest): self.assertFalse(any([s["id"] == private_share["id"] for s in shares])) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") @ddt.data(None, '2.16', LATEST_MICROVERSION) @@ -450,7 +450,7 @@ class SharesActionsTest(base.BaseSharesTest): 'actual': snapshot['project_id'], 'key': 'project_id'}) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_list_snapshots(self): @@ -467,7 +467,7 @@ class SharesActionsTest(base.BaseSharesTest): msg = "expected id lists %s times in share list" % (len(gen)) self.assertEqual(1, len(gen), msg) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") @ddt.data(None, '2.16', LATEST_MICROVERSION) @@ -496,7 +496,7 @@ class SharesActionsTest(base.BaseSharesTest): msg = "expected id lists %s times in share list" % (len(gen)) self.assertEqual(1, len(gen), msg) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_list_snapshots_with_detail_use_limit(self): @@ -522,7 +522,7 @@ class SharesActionsTest(base.BaseSharesTest): self.assertEqual(1, len(snaps['snapshots'])) self.assertEqual(self.snap['id'], snaps['snapshots'][0]['id']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_list_snapshots_with_detail_filter_by_status_and_name(self): @@ -538,7 +538,7 @@ class SharesActionsTest(base.BaseSharesTest): self.assertEqual(filters['status'], snap['status']) self.assertEqual(filters['name'], snap['name']) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_list_snapshots_with_detail_and_asc_sorting(self): @@ -553,7 +553,7 @@ class SharesActionsTest(base.BaseSharesTest): sorted_list = [snap['share_id'] for snap in snaps] self.assertEqual(sorted(sorted_list), sorted_list) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @testtools.skipUnless( CONF.share.run_extend_tests, "Share extend tests are disabled.") @@ -576,7 +576,7 @@ class SharesActionsTest(base.BaseSharesTest): ) self.assertEqual(new_size, share_get['size'], msg) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @testtools.skipUnless( CONF.share.run_shrink_tests, "Share shrink tests are disabled.") @@ -621,7 +621,7 @@ class SharesRenameTest(base.BaseSharesTest): cls.snap = cls.create_snapshot_wait_for_active( cls.share["id"], cls.snap_name, cls.snap_desc) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) def test_update_share(self): # get share @@ -645,7 +645,7 @@ class SharesRenameTest(base.BaseSharesTest): self.assertEqual(new_desc, share["description"]) self.assertTrue(share["is_public"]) - @test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_rename_snapshot(self): diff --git a/manila_tempest_tests/tests/api/test_shares_actions_negative.py b/manila_tempest_tests/tests/api/test_shares_actions_negative.py index e062c09864..18d16f0473 100644 --- a/manila_tempest_tests/tests/api/test_shares_actions_negative.py +++ b/manila_tempest_tests/tests/api/test_shares_actions_negative.py @@ -15,8 +15,8 @@ from tempest import config from tempest.lib import exceptions as lib_exc -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.tests.api import base @@ -30,7 +30,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest): cls.admin_client = cls.admin_shares_v2_client cls.share = cls.create_share() - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless( CONF.share.run_extend_tests, "Share extend tests are disabled.") @@ -48,7 +48,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest): self.share['id'], new_size) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless( CONF.share.run_extend_tests, "Share extend tests are disabled.") @@ -61,7 +61,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest): self.share['id'], new_size) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless( CONF.share.run_extend_tests, "Share extend tests are disabled.") @@ -74,7 +74,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest): self.share['id'], new_size) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless( CONF.share.run_extend_tests, "Share extend tests are disabled.") @@ -91,7 +91,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest): share['id'], new_size) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless( CONF.share.run_shrink_tests, "Share shrink tests are disabled.") @@ -104,7 +104,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest): self.share['id'], new_size) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless( CONF.share.run_shrink_tests, "Share shrink tests are disabled.") @@ -117,7 +117,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest): self.share['id'], new_size) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless( CONF.share.run_shrink_tests, "Share shrink tests are disabled.") diff --git a/manila_tempest_tests/tests/api/test_shares_negative.py b/manila_tempest_tests/tests/api/test_shares_negative.py index fa57ebfa7e..7c5619ef82 100644 --- a/manila_tempest_tests/tests/api/test_shares_negative.py +++ b/manila_tempest_tests/tests/api/test_shares_negative.py @@ -15,8 +15,8 @@ from tempest import config from tempest.lib import exceptions as lib_exc -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests import share_exceptions from manila_tempest_tests.tests.api import base @@ -35,13 +35,13 @@ class SharesNegativeTest(base.BaseSharesTest): metadata={'key': 'value'} ) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_update_share_with_wrong_public_value(self): self.assertRaises(lib_exc.BadRequest, self.shares_client.update_share, self.share["id"], is_public="truebar") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_try_delete_share_with_existing_snapshot(self): @@ -57,7 +57,7 @@ class SharesNegativeTest(base.BaseSharesTest): self.assertRaises(lib_exc.Forbidden, self.shares_client.delete_share, share["id"]) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_create_share_from_snap_with_less_size(self): @@ -83,7 +83,7 @@ class SharesNegativeTest(base.BaseSharesTest): snapshot_id=snap["id"], cleanup_in_class=False) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipIf(not CONF.share.multitenancy_enabled, "Only for multitenancy.") def test_create_share_with_nonexistant_share_network(self): @@ -91,7 +91,7 @@ class SharesNegativeTest(base.BaseSharesTest): self.shares_client.create_share, share_network_id="wrong_sn_id") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) @testtools.skipIf(not CONF.share.multitenancy_enabled, "Only for multitenancy.") @testtools.skipUnless(CONF.share.run_snapshot_tests, @@ -126,14 +126,14 @@ class SharesNegativeTest(base.BaseSharesTest): snapshot_id=snap["id"], ) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_update_other_tenants_public_share(self): isolated_client = self.get_client_with_isolated_creds( type_of_creds='alt') self.assertRaises(lib_exc.Forbidden, isolated_client.update_share, self.share["id"], name="new_name") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_delete_other_tenants_public_share(self): isolated_client = self.get_client_with_isolated_creds( type_of_creds='alt') @@ -141,7 +141,7 @@ class SharesNegativeTest(base.BaseSharesTest): isolated_client.delete_share, self.share['id']) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_set_metadata_of_other_tenants_public_share(self): isolated_client = self.get_client_with_isolated_creds( type_of_creds='alt') @@ -150,7 +150,7 @@ class SharesNegativeTest(base.BaseSharesTest): self.share['id'], {'key': 'value'}) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_update_metadata_of_other_tenants_public_share(self): isolated_client = self.get_client_with_isolated_creds( type_of_creds='alt') @@ -159,7 +159,7 @@ class SharesNegativeTest(base.BaseSharesTest): self.share['id'], {'key': 'value'}) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) def test_delete_metadata_of_other_tenants_public_share(self): isolated_client = self.get_client_with_isolated_creds( type_of_creds='alt') @@ -171,47 +171,47 @@ class SharesNegativeTest(base.BaseSharesTest): class SharesAPIOnlyNegativeTest(base.BaseSharesTest): - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_unmanage_share_by_user(self): self.assertRaises(lib_exc.Forbidden, self.shares_client.unmanage_share, 'fake-id') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_manage_share_by_user(self): self.assertRaises(lib_exc.Forbidden, self.shares_client.manage_share, 'fake-host', 'nfs', '/export/path', 'fake-type') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_list_by_share_server_by_user(self): self.assertRaises(lib_exc.Forbidden, self.shares_client.list_shares, params={'share_server_id': 12345}) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_create_share_non_existent_az(self): self.assertRaises(lib_exc.NotFound, self.shares_v2_client.create_share, availability_zone='fake_az') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_create_share_with_zero_size(self): self.assertRaises(lib_exc.BadRequest, self.shares_client.create_share, size=0) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_create_share_with_invalid_size(self): self.assertRaises(lib_exc.BadRequest, self.shares_client.create_share, size="#$%") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_create_share_with_out_passing_size(self): self.assertRaises(lib_exc.BadRequest, self.shares_client.create_share, size="") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_delete_snapshot_with_wrong_id(self): @@ -219,7 +219,7 @@ class SharesAPIOnlyNegativeTest(base.BaseSharesTest): self.shares_client.delete_snapshot, "wrong_share_id") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) @testtools.skipUnless(CONF.share.run_snapshot_tests, "Snapshot tests are disabled.") def test_create_snapshot_with_wrong_id(self): @@ -227,41 +227,41 @@ class SharesAPIOnlyNegativeTest(base.BaseSharesTest): self.shares_client.create_snapshot, "wrong_share_id") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_create_share_with_invalid_protocol(self): self.assertRaises(lib_exc.BadRequest, self.shares_client.create_share, share_protocol="nonexistent_protocol") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_create_share_with_wrong_public_value(self): self.assertRaises(lib_exc.BadRequest, self.shares_client.create_share, is_public='truebar') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_get_share_with_wrong_id(self): self.assertRaises(lib_exc.NotFound, self.shares_client.get_share, "wrong_share_id") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_get_share_without_passing_share_id(self): # Should not be able to get share when empty ID is passed self.assertRaises(lib_exc.NotFound, self.shares_client.get_share, '') - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_list_shares_nonadmin_with_nonexistent_share_server_filter(self): # filtering by share server allowed only for admins by default self.assertRaises(lib_exc.Forbidden, self.shares_client.list_shares_with_detail, {'share_server_id': 'fake_share_server_id'}) - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_delete_share_with_wrong_id(self): self.assertRaises(lib_exc.NotFound, self.shares_client.delete_share, "wrong_share_id") - @test.attr(type=[base.TAG_NEGATIVE, base.TAG_API]) + @tc.attr(base.TAG_NEGATIVE, base.TAG_API) def test_delete_share_without_passing_share_id(self): # Should not be able to delete share when empty ID is passed self.assertRaises(lib_exc.NotFound, diff --git a/manila_tempest_tests/tests/scenario/test_share_basic_ops.py b/manila_tempest_tests/tests/scenario/test_share_basic_ops.py index 532ddd5dfb..34c9c556db 100644 --- a/manila_tempest_tests/tests/scenario/test_share_basic_ops.py +++ b/manila_tempest_tests/tests/scenario/test_share_basic_ops.py @@ -19,8 +19,8 @@ from tempest import config from tempest.lib.common.utils import data_utils from tempest.lib.common.utils import test_utils from tempest.lib import exceptions -from tempest import test import testtools +from testtools import testcase as tc from manila_tempest_tests.common import constants from manila_tempest_tests.tests.api import base @@ -183,8 +183,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest): self.manager.servers_client, instance_id, "ACTIVE") return self.manager.servers_client.show_server(instance_id)["server"] - @test.services('compute', 'network') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_mount_share_one_vm(self): instance = self.boot_instance(wait_until="BUILD") self.create_share() @@ -205,8 +204,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest): self.umount_share(ssh_client) self.servers_client.delete_server(instance['id']) - @test.services('compute', 'network') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) def test_read_write_two_vms(self): """Boots two vms and writes/reads data on it.""" test_data = "Some test data to write" @@ -245,8 +243,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest): data = self.read_data(ssh_client_inst2) self.assertEqual(test_data, data) - @test.services('compute', 'network') - @test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND]) + @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND) @testtools.skipUnless(CONF.share.run_host_assisted_migration_tests or CONF.share.run_driver_assisted_migration_tests, "Share migration tests are disabled.")