Add uuid for tests

We should add a unique identifier for manila tests like
done in tempest. This will help to track a specific
test over time.
This patch adds a unique id for all functional and scenario
tests and also adds check-uuid to tox tests.

Change-Id: I262c7df709a8a7e9ed36591571069b9bcef0f51c
This commit is contained in:
lkuchlan 2020-02-20 11:52:48 +02:00 committed by Goutham Pacha Ravi
parent 4f0dbe042f
commit 88452b3d31
88 changed files with 851 additions and 1 deletions

View File

@ -15,6 +15,7 @@
import ddt
from tempest import config
from tempest.lib import decorators
import testtools
from testtools import testcase as tc
@ -48,6 +49,7 @@ class AdminActionsTest(base.BaseSharesAdminTest):
resource_id, s_type=resource_type, status="available")
self._wait_for_resource_status(resource_id, resource_type[:-1])
@decorators.idempotent_id('4f8c6ae9-0656-445f-a911-fbf98fe761d0')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data("error", "available", "error_deleting", "deleting", "creating")
def test_reset_share_state(self, status):
@ -55,6 +57,7 @@ class AdminActionsTest(base.BaseSharesAdminTest):
self.shares_v2_client.wait_for_share_status(self.sh["id"], status)
self.addCleanup(self._reset_resource_available, self.sh["id"])
@decorators.idempotent_id('13075b2d-fe83-41bf-b6ef-99cfcc00257d')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data("error", "available", "error_deleting", "deleting", "creating")
def test_reset_share_instance_state(self, status):
@ -68,6 +71,7 @@ class AdminActionsTest(base.BaseSharesAdminTest):
self.addCleanup(self._reset_resource_available,
share_instance_id, "share_instances")
@decorators.idempotent_id('3e16d990-fa19-45e9-893f-e0b7a90127bd')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -81,6 +85,7 @@ class AdminActionsTest(base.BaseSharesAdminTest):
self.addCleanup(self._reset_resource_available,
snapshot["id"], "snapshots")
@decorators.idempotent_id('2e8fee75-6b7f-4b69-8f68-0646ce6a96e9')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_force_delete_share(self):
share = self.create_share(share_type_id=self.share_type_id)
@ -96,6 +101,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"])
@decorators.idempotent_id('382fca90-746e-4ad1-a509-b82a643d4a03')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_force_delete_share_instance(self):
share = self.create_share(share_type_id=self.share_type_id,
@ -120,6 +126,7 @@ class AdminActionsTest(base.BaseSharesAdminTest):
self.shares_v2_client.wait_for_resource_deletion(
share_instance_id=instance["id"])
@decorators.idempotent_id('d5a48182-ecd7-463e-a31a-148c81d3c5ed')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -138,6 +145,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"])
@decorators.idempotent_id('49a576eb-733a-4299-aa6f-918fe7c67a6a')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.22")
def test_reset_share_task_state(self):

View File

@ -15,6 +15,7 @@
import ddt
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -44,12 +45,14 @@ class AdminActionsNegativeTest(base.BaseSharesMixedTest):
cls.sn = cls.create_snapshot_wait_for_active(
cls.sh["id"], client=cls.admin_client)
@decorators.idempotent_id('f730c395-a501-44cf-90d9-a3273771b895')
@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")
@decorators.idempotent_id('3bfa9555-9c7e-45a2-b5bd-384329cb6fda')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_reset_share_instance_state_to_unacceptable_state(self):
self.assertRaises(
@ -60,6 +63,7 @@ class AdminActionsNegativeTest(base.BaseSharesMixedTest):
status="fake"
)
@decorators.idempotent_id('02e0d0d5-ac66-4d24-9aa7-568f75944a05')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -68,6 +72,7 @@ class AdminActionsNegativeTest(base.BaseSharesMixedTest):
self.admin_client.reset_state,
self.sn["id"], s_type="snapshots", status="fake")
@decorators.idempotent_id('3b525c29-b657-493f-aa41-b17676a95fd2')
@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
@ -75,6 +80,7 @@ class AdminActionsNegativeTest(base.BaseSharesMixedTest):
self.member_client.reset_state,
self.sh["id"])
@decorators.idempotent_id('d4abddba-1c20-49e1-85b1-5452f0faceb0')
@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
@ -82,6 +88,7 @@ class AdminActionsNegativeTest(base.BaseSharesMixedTest):
self.member_client.reset_state,
self.sh_instance["id"], s_type="share_instances")
@decorators.idempotent_id('48dfb1ec-6db6-4022-8a41-2eb2883e0988')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -91,6 +98,7 @@ class AdminActionsNegativeTest(base.BaseSharesMixedTest):
self.member_client.reset_state,
self.sn["id"], s_type="snapshots")
@decorators.idempotent_id('7cd0b48e-2815-4f8c-8718-3c071ff9701f')
@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
@ -98,6 +106,7 @@ class AdminActionsNegativeTest(base.BaseSharesMixedTest):
self.member_client.force_delete,
self.sh["id"])
@decorators.idempotent_id('257da3e0-9460-4d97-8a56-c86c0427cc64')
@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
@ -105,6 +114,7 @@ class AdminActionsNegativeTest(base.BaseSharesMixedTest):
self.member_client.force_delete,
self.sh_instance["id"], s_type="share_instances")
@decorators.idempotent_id('c9a1894f-d58f-4885-86ba-736e9ab8428a')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -114,6 +124,7 @@ class AdminActionsNegativeTest(base.BaseSharesMixedTest):
self.member_client.force_delete,
self.sn["id"], s_type="snapshots")
@decorators.idempotent_id('821da7c8-3501-44ba-9ffe-45f485a6e573')
@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
@ -121,6 +132,7 @@ class AdminActionsNegativeTest(base.BaseSharesMixedTest):
self.member_client.get_share_instance,
self.sh_instance["id"])
@decorators.idempotent_id('ab361521-adc9-4fe3-9699-a5ccc49b579b')
@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
@ -129,6 +141,7 @@ class AdminActionsNegativeTest(base.BaseSharesMixedTest):
self.member_client.get_instances_of_share,
self.sh['id'])
@decorators.idempotent_id('d662457c-2b84-4f13-aee7-5ffafe2552f1')
@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):
@ -146,12 +159,14 @@ class AdminActionsAPIOnlyNegativeTest(base.BaseSharesMixedTest):
cls.admin_client = cls.admin_shares_v2_client
cls.member_client = cls.shares_v2_client
@decorators.idempotent_id('1c928920-1538-400a-ab28-c58dd75503c3')
@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)
@decorators.idempotent_id('aba8638c-bfed-4c3e-994b-5309fcd912b2')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@base.skip_if_microversion_lt("2.22")
def test_reset_task_state_share_not_found(self):
@ -159,6 +174,7 @@ class AdminActionsAPIOnlyNegativeTest(base.BaseSharesMixedTest):
lib_exc.NotFound, self.admin_client.reset_task_state,
'fake_share', 'migration_error')
@decorators.idempotent_id('e31d2d7b-7202-4699-9423-72f710e72181')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -168,11 +184,13 @@ class AdminActionsAPIOnlyNegativeTest(base.BaseSharesMixedTest):
"fake",
s_type="snapshots")
@decorators.idempotent_id('dedca5c1-151d-40f7-bb7f-8913d51c05a9')
@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")
@decorators.idempotent_id('7cbfc035-12ea-4e2c-8da1-baf261e45f03')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_force_delete_nonexistent_share_instance(self):
self.assertRaises(lib_exc.NotFound,
@ -180,16 +198,19 @@ class AdminActionsAPIOnlyNegativeTest(base.BaseSharesMixedTest):
"fake",
s_type="share_instances")
@decorators.idempotent_id('17e7eb3c-dbe6-4667-b838-663211365d44')
@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")
@decorators.idempotent_id('26ce6f02-98eb-435a-9065-2e5bbcac87c5')
@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")
@decorators.idempotent_id('7e07f684-b68f-4b0e-89cc-05d70a67dd69')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -197,6 +218,7 @@ class AdminActionsAPIOnlyNegativeTest(base.BaseSharesMixedTest):
self.assertRaises(lib_exc.NotFound, self.admin_client.reset_state,
"fake", s_type="snapshots")
@decorators.idempotent_id('59b09ad2-d405-4762-a253-d7b7cf56f0a5')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@ddt.data('migrate_share', 'migration_complete', 'reset_task_state',
'migration_get_progress', 'migration_cancel')

View File

@ -18,6 +18,7 @@ from oslo_utils import timeutils
from oslo_utils import uuidutils
import six
from tempest import config
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -109,6 +110,7 @@ class ExportLocationsTest(base.BaseSharesMixedTest):
# it making assertion that it has proper date value.
timeutils.parse_strtime(time)
@decorators.idempotent_id('dfcb05af-369a-44c9-a06a-67d12a2a0917')
@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):
@ -118,6 +120,7 @@ class ExportLocationsTest(base.BaseSharesMixedTest):
self._verify_export_location_structure(export_locations,
version='2.13')
@decorators.idempotent_id('032173d7-3ddf-4730-8524-d1a96a2a9e16')
@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):
@ -127,6 +130,7 @@ class ExportLocationsTest(base.BaseSharesMixedTest):
self._verify_export_location_structure(export_locations,
version='2.14')
@decorators.idempotent_id('814da2ce-2909-4b02-a92e-12bc1b640580')
@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(
@ -137,6 +141,7 @@ class ExportLocationsTest(base.BaseSharesMixedTest):
self.share['id'], export_location['id'])
self._verify_export_location_structure(el, format='detail')
@decorators.idempotent_id('397969c6-7fc8-4bf8-86c7-300b96857c54')
@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(
@ -144,6 +149,7 @@ class ExportLocationsTest(base.BaseSharesMixedTest):
self._verify_export_location_structure(export_locations, role='member')
@decorators.idempotent_id('66cef86f-5da8-4cb4-bc21-91f6c1e27cb5')
@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(
@ -157,6 +163,7 @@ class ExportLocationsTest(base.BaseSharesMixedTest):
self._verify_export_location_structure(el, role='member',
format='detail')
@decorators.idempotent_id('06ea2636-1c9f-4889-8b5f-e10c2c2572cb')
@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):
@ -167,6 +174,7 @@ class ExportLocationsTest(base.BaseSharesMixedTest):
self._verify_export_location_structure(export_locations,
version='2.13')
@decorators.idempotent_id('b93e4cba-ea98-4b1c-90f8-e0a8763033a3')
@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):
@ -177,6 +185,7 @@ class ExportLocationsTest(base.BaseSharesMixedTest):
self._verify_export_location_structure(export_locations,
version='2.14')
@decorators.idempotent_id('59421c43-293f-41fd-8ac6-e856deeceac9')
@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:
@ -188,6 +197,7 @@ class ExportLocationsTest(base.BaseSharesMixedTest):
share_instance['id'], el['id'])
self._verify_export_location_structure(el, format='detail')
@decorators.idempotent_id('581acd8d-b89d-4684-8310-b910b46acc7a')
@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(

View File

@ -14,6 +14,7 @@
# under the License.
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -49,6 +50,7 @@ class ExportLocationsNegativeTest(base.BaseSharesMixedTest):
cls.share_instances = cls.admin_client.get_instances_of_share(
cls.share['id'])
@decorators.idempotent_id('8eac1355-f272-4913-8a49-1a8a9cb086bd')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_get_inexistent_share_export_location(self):
self.assertRaises(
@ -58,6 +60,7 @@ class ExportLocationsNegativeTest(base.BaseSharesMixedTest):
"fake-inexistent-share-instance-id",
)
@decorators.idempotent_id('064a18dd-1a00-42f1-84c0-5a3e3b46fb39')
@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:
@ -68,6 +71,7 @@ class ExportLocationsNegativeTest(base.BaseSharesMixedTest):
"fake-inexistent-share-instance-id",
)
@decorators.idempotent_id('6d0b9d1b-fc87-4b7f-add5-919b0ddcda90')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_list_share_instance_export_locations_as_member(self):
for share_instance in self.share_instances:
@ -76,6 +80,7 @@ class ExportLocationsNegativeTest(base.BaseSharesMixedTest):
self.admin_member_client.list_share_instance_export_locations,
share_instance['id'])
@decorators.idempotent_id('abde4357-a26c-4adb-88a6-ece6b0e15b5e')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_get_share_instance_export_locations_as_member(self):
for share_instance in self.share_instances:
@ -88,6 +93,7 @@ class ExportLocationsNegativeTest(base.BaseSharesMixedTest):
get_share_instance_export_location),
share_instance['id'], el['id'])
@decorators.idempotent_id('a3c3d16b-5f62-4089-8f86-efc660592986')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_list_share_export_locations_by_different_project_user(self):
self.assertRaises(
@ -95,6 +101,7 @@ class ExportLocationsNegativeTest(base.BaseSharesMixedTest):
self.different_project_client.list_share_export_locations,
self.share['id'])
@decorators.idempotent_id('0f6823a5-3929-4025-9cd4-b5198b4384dd')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_get_share_export_location_by_different_project_user(self):
export_locations = self.admin_client.list_share_export_locations(
@ -115,6 +122,7 @@ class ExportLocationsAPIOnlyNegativeTest(base.BaseSharesAdminTest):
super(ExportLocationsAPIOnlyNegativeTest, cls).skip_checks()
utils.check_skip_if_microversion_lt("2.9")
@decorators.idempotent_id('4b5b4e89-0c80-4383-b272-62d5e0419d9a')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_get_export_locations_by_nonexistent_share(self):
self.assertRaises(
@ -123,6 +131,7 @@ class ExportLocationsAPIOnlyNegativeTest(base.BaseSharesAdminTest):
"fake-inexistent-share-id",
)
@decorators.idempotent_id('21ba5111-91a8-4ec3-86dc-689fc2fa90e6')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_get_export_locations_by_nonexistent_share_instance(self):
self.assertRaises(

View File

@ -17,6 +17,7 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
import testtools
from testtools import testcase as tc
@ -361,6 +362,7 @@ class MigrationBase(base.BaseSharesAdminTest):
class MigrationCancelNFSTest(MigrationBase):
protocol = "nfs"
@decorators.idempotent_id('d39dfa1b-6e91-4efc-84f1-76f878b51f2a')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@base.skip_if_microversion_lt("2.29")
@ddt.data(True, False)
@ -398,6 +400,7 @@ class MigrationCancelNFSTest(MigrationBase):
dest_pool, share, constants.TASK_STATE_MIGRATION_CANCELLED,
complete=False)
@decorators.idempotent_id('640dce56-2084-488d-8dea-456840ff397e')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@base.skip_if_microversion_lt("2.29")
@testtools.skipUnless(
@ -433,6 +436,7 @@ class MigrationCancelNFSTest(MigrationBase):
class MigrationOppositeDriverModesNFSTest(MigrationBase):
protocol = "nfs"
@decorators.idempotent_id('d8cce50d-e8da-4fbc-8f94-0827bf277b6c')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@base.skip_if_microversion_lt("2.29")
@ddt.data(True, False)
@ -500,6 +504,7 @@ class MigrationOppositeDriverModesNFSTest(MigrationBase):
class MigrationTwoPhaseNFSTest(MigrationBase):
protocol = "nfs"
@decorators.idempotent_id('e6cf0e4d-bdf3-49c1-b6ba-56d1ad6c81d2')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@base.skip_if_microversion_lt("2.29")
@ddt.data(True, False)
@ -551,6 +556,7 @@ class MigrationTwoPhaseNFSTest(MigrationBase):
class MigrationWithShareExtendingNFSTest(MigrationBase):
protocol = "nfs"
@decorators.idempotent_id('0e3d75e0-385a-4f7a-889f-2a3db79db8c2')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@base.skip_if_microversion_lt("2.29")
@testtools.skipUnless(
@ -564,6 +570,7 @@ class MigrationWithShareExtendingNFSTest(MigrationBase):
class MigrationWithShareShrinkingNFSTest(MigrationBase):
protocol = "nfs"
@decorators.idempotent_id('58c72e51-d217-48bc-8155-5a010912312e')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@base.skip_if_microversion_lt("2.29")
@testtools.skipUnless(
@ -577,6 +584,7 @@ class MigrationWithShareShrinkingNFSTest(MigrationBase):
class MigrationOfShareWithSnapshotNFSTest(MigrationBase):
protocol = "nfs"
@decorators.idempotent_id('a95eb701-626a-4175-967b-4880d3716857')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@base.skip_if_microversion_lt("2.29")
@testtools.skipUnless(
@ -618,6 +626,7 @@ class MigrationOfShareWithSnapshotNFSTest(MigrationBase):
class MigrationWithDifferentSnapshotSupportNFSTest(MigrationBase):
protocol = "nfs"
@decorators.idempotent_id('a18b3637-2070-4a1b-acd9-c392eb7963b5')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@base.skip_if_microversion_lt("2.29")
@testtools.skipUnless(CONF.share.run_snapshot_tests,
@ -630,6 +639,7 @@ class MigrationWithDifferentSnapshotSupportNFSTest(MigrationBase):
self._validate_share_migration_with_different_snapshot_capability_type(
force_host_assisted, True)
@decorators.idempotent_id('59313673-6576-4163-ab96-41bafcdad63a')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@base.skip_if_microversion_lt("2.29")
@testtools.skipUnless(CONF.share.run_snapshot_tests,

View File

@ -17,6 +17,7 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -79,6 +80,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
cleanup_in_class=True,
extra_specs=utils.get_configured_extra_specs(variation='invalid'))
@decorators.idempotent_id('8aa1f2a0-bc44-4df5-a556-161590e594a3')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.22")
def test_migration_cancel_invalid(self):
@ -86,6 +88,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
lib_exc.BadRequest, self.shares_v2_client.migration_cancel,
self.share['id'])
@decorators.idempotent_id('6d0dfb2e-51a0-4cb7-8c69-6135a49c6057')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.22")
def test_migration_get_progress_None(self):
@ -96,6 +99,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
lib_exc.BadRequest, self.shares_v2_client.migration_get_progress,
self.share['id'])
@decorators.idempotent_id('2ab1fc82-bc13-4c99-8324-c6b23530e8a4')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.22")
def test_migration_complete_invalid(self):
@ -103,6 +107,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
lib_exc.BadRequest, self.shares_v2_client.migration_complete,
self.share['id'])
@decorators.idempotent_id('8ef562b4-7704-4a78-973f-9bf8d2b6f6a6')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.22")
def test_migration_cancel_not_found(self):
@ -110,6 +115,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
lib_exc.NotFound, self.shares_v2_client.migration_cancel,
'invalid_share_id')
@decorators.idempotent_id('044c792b-63e0-42c3-9f44-dc2280e2af08')
@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):
@ -117,6 +123,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
lib_exc.NotFound, self.shares_v2_client.migration_get_progress,
'invalid_share_id')
@decorators.idempotent_id('a509871a-3f3a-4618-bb60-9661732dd371')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.22")
def test_migration_complete_not_found(self):
@ -124,6 +131,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
lib_exc.NotFound, self.shares_v2_client.migration_complete,
'invalid_share_id')
@decorators.idempotent_id('6276bea6-6939-4569-930f-218d99c0fa56')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.29")
@testtools.skipUnless(CONF.share.run_snapshot_tests,
@ -138,6 +146,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
self.shares_v2_client.wait_for_resource_deletion(snapshot_id=snap[
"id"])
@decorators.idempotent_id('78670c24-c4ee-45b5-b166-2d053c333144')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.29")
@ddt.data(True, False)
@ -155,6 +164,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
# NOTE(ganso): No need to assert, it is already waiting for correct
# status (migration_success).
@decorators.idempotent_id('af17204f-ffab-4ba8-8cb6-032e49216f67')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.29")
def test_migrate_share_host_invalid(self):
@ -162,6 +172,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
lib_exc.NotFound, self.shares_v2_client.migrate_share,
self.share['id'], 'invalid_host')
@decorators.idempotent_id('0558e9c4-0416-41d2-b28a-803d4b81521a')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.29")
@ddt.data({'writable': False, 'preserve_metadata': False,
@ -183,6 +194,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
preserve_metadata=preserve_metadata, nondisruptive=nondisruptive,
preserve_snapshots=preserve_snapshots)
@decorators.idempotent_id('ee57024c-d00e-4def-8eec-cbc62bae327f')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.29")
def test_migrate_share_change_type_no_valid_host(self):
@ -201,6 +213,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
self.share['id'], self.dest_pool,
constants.TASK_STATE_MIGRATION_ERROR)
@decorators.idempotent_id('e2bd0cca-c091-4785-a9dc-7f42d2bb95a5')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.29")
def test_migrate_share_not_found(self):
@ -208,6 +221,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
lib_exc.NotFound, self.shares_v2_client.migrate_share,
'invalid_share_id', self.dest_pool)
@decorators.idempotent_id('86b427a7-27c0-4cd5-8f52-9688b339980b')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.29")
def test_migrate_share_not_available(self):
@ -223,6 +237,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
self.shares_client.wait_for_share_status(self.share['id'],
constants.STATUS_AVAILABLE)
@decorators.idempotent_id('e8f1e491-697a-4941-bf51-4d37f0a93fa5')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.29")
def test_migrate_share_invalid_share_network(self):
@ -231,6 +246,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
self.share['id'], self.dest_pool,
new_share_network_id='invalid_net_id')
@decorators.idempotent_id('be262d44-2ca2-4b9c-be3a-5a6a98ed871b')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.29")
def test_migrate_share_invalid_share_type(self):
@ -239,6 +255,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
self.share['id'], self.dest_pool,
new_share_type_id='invalid_type_id')
@decorators.idempotent_id('16c72693-6f9e-4cb4-a166-c60accd3479b')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.29")
def test_migrate_share_opposite_type_share_network_invalid(self):
@ -264,6 +281,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
new_share_type_id=new_type_opposite['share_type']['id'],
new_share_network_id=new_share_network_id)
@decorators.idempotent_id('1f529b09-e404-4f0e-9423-bb4b117b5522')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.48")
def test_share_type_azs_share_migrate_unsupported_az(self):
@ -277,6 +295,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
self.share['id'], self.dest_pool,
new_share_type_id=new_share_type['share_type']['id'])
@decorators.idempotent_id('90cf0ae4-4251-4142-bfa8-41f67a9e5b23')
@testtools.skipUnless(CONF.share.run_driver_assisted_migration_tests,
"Driver-assisted migration tests are disabled.")
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ -284,6 +303,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
def test_create_snapshot_during_share_migration(self):
self._test_share_actions_during_share_migration('create_snapshot', [])
@decorators.idempotent_id('20121039-bb11-45d8-9972-d2daff7a779c')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.29")
@ddt.data(('extend_share', [CONF.share.share_size + 2]),
@ -301,6 +321,7 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
if not property_to_evaluate[method_name]:
raise self.skipException(method_name + 'tests are disabled.')
@decorators.idempotent_id('6e83fc25-4e3e-49a7-93e8-db4e6b355a91')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.29")
def test_add_access_rule_during_migration(self):

View File

@ -15,6 +15,7 @@
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -56,6 +57,7 @@ class ShareMultiBackendTest(base.BaseSharesAdminTest):
# Create shares using precreated share types
cls.shares = cls.create_shares(share_data_list)
@decorators.idempotent_id('888add9d-4ad0-4d88-a62f-af7ee1d9f9ab')
@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"
@ -63,6 +65,7 @@ class ShareMultiBackendTest(base.BaseSharesAdminTest):
get = self.shares_client.get_share(share['id'])
self.assertEqual(2, len(get["host"].split("@")))
@decorators.idempotent_id('691fbcef-6d8d-4ad9-b493-501bbb3dcf3c')
@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
@ -71,6 +74,7 @@ class ShareMultiBackendTest(base.BaseSharesAdminTest):
version="2.5")
self.assertEqual(self.sts[i]["name"], get["share_type"])
@decorators.idempotent_id('f25e0cb0-d656-4f16-a761-ec23992cd9e7')
@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
@ -80,6 +84,7 @@ class ShareMultiBackendTest(base.BaseSharesAdminTest):
self.assertEqual(self.sts[i]["id"], get["share_type"])
self.assertEqual(self.sts[i]["name"], get["share_type_name"])
@decorators.idempotent_id('bfa0c056-0a15-40e1-bdff-f1e10b95736c')
@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

View File

@ -16,6 +16,7 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -46,6 +47,7 @@ class SharesAdminQuotasTest(base.BaseSharesAdminTest):
cls.share_type = cls._create_share_type()
cls.share_type_id = cls.share_type['id']
@decorators.idempotent_id('f62c48e3-9736-4f0c-9f9b-f139f393ac0a')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_default_quotas(self):
quotas = self.client.default_quotas(self.tenant_id)
@ -61,6 +63,7 @@ class SharesAdminQuotasTest(base.BaseSharesAdminTest):
self.assertGreater(int(quotas["share_replicas"]), -2)
self.assertGreater(int(quotas["replica_gigabytes"]), -2)
@decorators.idempotent_id('1ff57cfa-cd8d-495f-86eb-9fead307428e')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_show_quotas(self):
quotas = self.client.show_quotas(self.tenant_id)
@ -76,6 +79,7 @@ class SharesAdminQuotasTest(base.BaseSharesAdminTest):
self.assertGreater(int(quotas["share_replicas"]), -2)
self.assertGreater(int(quotas["replica_gigabytes"]), -2)
@decorators.idempotent_id('9b96dd45-7c0d-41ee-88e4-600185f61358')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_show_quotas_for_user(self):
quotas = self.client.show_quotas(
@ -92,6 +96,7 @@ class SharesAdminQuotasTest(base.BaseSharesAdminTest):
self.assertGreater(int(quotas["share_replicas"]), -2)
self.assertGreater(int(quotas["replica_gigabytes"]), -2)
@decorators.idempotent_id('2e98a13e-b2ed-4977-bafe-47ea48b504f2')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@base.skip_if_microversion_not_supported(PRE_SHARE_GROUPS_MICROVERSION)
def test_show_sg_quotas_using_too_old_microversion(self):
@ -101,6 +106,7 @@ class SharesAdminQuotasTest(base.BaseSharesAdminTest):
for key in ('share_groups', 'share_group_snapshots'):
self.assertNotIn(key, quotas)
@decorators.idempotent_id('b8bcbc04-68fb-4c8f-9f4c-a3b6c6b8911c')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@base.skip_if_microversion_not_supported(PRE_SHARE_GROUPS_MICROVERSION)
def test_show_sg_quotas_for_user_using_too_old_microversion(self):
@ -111,6 +117,7 @@ class SharesAdminQuotasTest(base.BaseSharesAdminTest):
for key in ('share_groups', 'share_group_snapshots'):
self.assertNotIn(key, quotas)
@decorators.idempotent_id('19fe431b-e83e-4c4e-acb8-018d7a470c8b')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@base.skip_if_microversion_not_supported(
PRE_SHARE_REPLICA_QUOTAS_MICROVERSION)
@ -127,6 +134,7 @@ class SharesAdminQuotasTest(base.BaseSharesAdminTest):
('name', False),
)
@ddt.unpack
@decorators.idempotent_id('836e1725-2853-4d54-b281-8173773d8527')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@base.skip_if_microversion_lt("2.39")
def test_show_share_type_quotas(self, share_type_key, is_st_public):
@ -197,6 +205,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
cls.tenant_id = cls.client.tenant_id
cls.user_id = cls.client.user_id
@decorators.idempotent_id('da16e906-e8e6-4aa0-9fc1-76ed48cfd428')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_update_tenant_quota_shares(self):
# get current quotas
@ -212,6 +221,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
"share_groups",
"share_group_snapshots",
)
@decorators.idempotent_id('cb09de7e-94e9-401a-b82b-8b2de210f8b9')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@testtools.skipUnless(
CONF.share.run_share_group_tests, 'Share Group tests disabled.')
@ -226,6 +236,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(new_quota, int(updated[quota_key]))
@decorators.idempotent_id('2c7f9e19-268d-4420-a046-a7faf21174a1')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_update_user_quota_shares(self):
# get current quotas
@ -243,6 +254,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
"share_groups",
"share_group_snapshots",
)
@decorators.idempotent_id('c32a716b-f971-4855-97ea-f30d4423d03d')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@testtools.skipUnless(
CONF.share.run_share_group_tests, 'Share Group tests disabled.')
@ -265,6 +277,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
("replica_gigabytes", True),
)
@ddt.unpack
@decorators.idempotent_id('af16dc89-c93d-43de-8902-2c88c75f107f')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@base.skip_if_microversion_not_supported(SHARE_REPLICA_QUOTAS_MICROVERSION)
def test_update_user_quota_replica_related(self, quota_key, use_user_id):
@ -289,6 +302,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
('name', False),
)
@ddt.unpack
@decorators.idempotent_id('155ea3de-b3b5-4aa0-be8b-eebcc19ce874')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@base.skip_if_microversion_lt("2.39")
def test_update_share_type_quota(self, share_type_key, is_st_public):
@ -326,6 +340,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
for q in quota_keys:
self.assertEqual(int(quotas[q]) - 1, current_quotas[q])
@decorators.idempotent_id('78957d97-afad-4371-a21e-79641fff83f6')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_update_tenant_quota_snapshots(self):
# get current quotas
@ -337,6 +352,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(new_quota, int(updated["snapshots"]))
@decorators.idempotent_id('53f4fd79-39aa-42be-82ce-e423ebffe837')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_update_user_quota_snapshots(self):
# get current quotas
@ -350,6 +366,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(new_quota, int(updated["snapshots"]))
@decorators.idempotent_id('37ee5bd2-db07-4817-b71a-7c3e78634399')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_update_tenant_quota_gigabytes(self):
# get current quotas
@ -363,6 +380,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(gigabytes, int(updated["gigabytes"]))
@decorators.idempotent_id('284a2e95-48a1-4f1b-b952-f734b1b6238a')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_update_tenant_quota_snapshot_gigabytes(self):
# get current quotas
@ -378,6 +396,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(snapshot_gigabytes,
int(updated["snapshot_gigabytes"]))
@decorators.idempotent_id('75977d53-f06b-41a2-8365-0ce549e4a51a')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_update_user_quota_gigabytes(self):
# get current quotas
@ -393,6 +412,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(gigabytes, int(updated["gigabytes"]))
@decorators.idempotent_id('00a189fc-93ed-44c2-b9dc-1d9b6c26d005')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_update_user_quota_snapshot_gigabytes(self):
# get current quotas
@ -409,6 +429,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(snapshot_gigabytes,
int(updated["snapshot_gigabytes"]))
@decorators.idempotent_id('da7f3179-f2f3-402e-82c2-e6855774a99a')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_update_tenant_quota_share_networks(self):
# get current quotas
@ -420,6 +441,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(new_quota, int(updated["share_networks"]))
@decorators.idempotent_id('f75f01a0-5921-44ab-b373-bb9e070f87eb')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_update_user_quota_share_networks(self):
# get current quotas
@ -434,6 +456,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(new_quota, int(updated["share_networks"]))
@decorators.idempotent_id('84e24c32-ee78-461e-ac1f-f9e4d99f88e2')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_reset_tenant_quotas(self):
# Get default_quotas
@ -522,6 +545,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
('name', False),
)
@ddt.unpack
@decorators.idempotent_id('15e57302-5a14-4be4-8720-95b639c2bfad')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@base.skip_if_microversion_lt("2.39")
def test_reset_share_type_quotas(self, share_type_key, is_st_public):
@ -582,6 +606,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertNotEqual(default_quotas[key], current_st_quota[key])
self.assertEqual(current_p_quota[key], current_st_quota[key])
@decorators.idempotent_id('d4bba375-7111-4b93-b6dd-4f0532febc3e')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_unlimited_quota_for_shares(self):
self.update_quotas(self.tenant_id, shares=-1)
@ -590,6 +615,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('shares'))
@decorators.idempotent_id('756ffd0e-a476-49af-ac85-9bb4ce5e29b7')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_unlimited_user_quota_for_shares(self):
self.update_quotas(self.tenant_id, user_id=self.user_id, shares=-1)
@ -598,6 +624,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('shares'))
@decorators.idempotent_id('9779d166-09d3-4745-8acc-2243eadec3ea')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_unlimited_quota_for_snapshots(self):
self.update_quotas(self.tenant_id, snapshots=-1)
@ -606,6 +633,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('snapshots'))
@decorators.idempotent_id('245b3bf3-09ef-4b6d-8643-f156bf1bf23c')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_unlimited_user_quota_for_snapshots(self):
self.update_quotas(self.tenant_id, user_id=self.user_id, snapshots=-1)
@ -614,6 +642,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('snapshots'))
@decorators.idempotent_id('b6a94e87-091a-48dc-9b51-13d81541869c')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_unlimited_quota_for_gigabytes(self):
self.update_quotas(self.tenant_id, gigabytes=-1)
@ -622,6 +651,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('gigabytes'))
@decorators.idempotent_id('0d044db4-ae5b-416d-aa51-098afb72cd6c')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_unlimited_quota_for_snapshot_gigabytes(self):
self.update_quotas(self.tenant_id, snapshot_gigabytes=-1)
@ -630,6 +660,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('snapshot_gigabytes'))
@decorators.idempotent_id('2de4b7cf-9189-413f-858b-860ecf5fd18b')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_unlimited_user_quota_for_gigabytes(self):
self.update_quotas(self.tenant_id, user_id=self.user_id, gigabytes=-1)
@ -638,6 +669,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('gigabytes'))
@decorators.idempotent_id('cbe63027-1108-4779-9fd3-22f41f60d6bb')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_unlimited_user_quota_for_snapshot_gigabytes(self):
self.update_quotas(self.tenant_id,
@ -648,6 +680,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('snapshot_gigabytes'))
@decorators.idempotent_id('e35455f5-92db-4669-ac21-9daf170df248')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_unlimited_quota_for_share_networks(self):
self.update_quotas(self.tenant_id, share_networks=-1)
@ -656,6 +689,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('share_networks'))
@decorators.idempotent_id('66b04887-e611-4d4f-a40b-c8b14766b6af')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_unlimited_user_quota_for_share_networks(self):
self.update_quotas(self.tenant_id,
@ -666,6 +700,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('share_networks'))
@decorators.idempotent_id('7c2cd2d4-4352-4811-9e39-70f56e6297c2')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@testtools.skipUnless(
CONF.share.run_share_group_tests, 'Share Group tests disabled.')
@ -677,6 +712,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('share_groups'))
@decorators.idempotent_id('76d270d5-f314-47cb-9c3f-409f8ff12ce2')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@testtools.skipUnless(
CONF.share.run_share_group_tests, 'Share Group tests disabled.')
@ -691,6 +727,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('share_group_snapshots'))
@ddt.data("share_replicas", "replica_gigabytes")
@decorators.idempotent_id('15aa5df5-b2ae-4a3a-acb8-efbbc84581be')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@utils.skip_if_microversion_not_supported(
SHARE_REPLICA_QUOTAS_MICROVERSION)
@ -703,6 +740,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get(quota_key))
@ddt.data("share_replicas", "replica_gigabytes")
@decorators.idempotent_id('84b99731-f748-44fe-a291-162d05da9e25')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@utils.skip_if_microversion_not_supported(
SHARE_REPLICA_QUOTAS_MICROVERSION)
@ -715,6 +753,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get(quota_key))
@ddt.data(11, -1)
@decorators.idempotent_id('43f58705-3cad-46bc-816c-41e8fa55dd8d')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_update_user_quotas_bigger_than_project_quota(self, user_quota):
self.update_quotas(self.tenant_id, shares=10)
@ -725,6 +764,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
shares=user_quota)
@ddt.data(11, -1)
@decorators.idempotent_id('315cb76f-920d-4cb9-ac7d-16be8e95e1b2')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@base.skip_if_microversion_lt("2.39")
def test_update_share_type_quotas_bigger_than_project_quota(self, st_q):
@ -740,6 +780,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
cleanup=False,
shares=st_q)
@decorators.idempotent_id('c95be1eb-6331-4c37-9fac-ed6c36270457')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@base.skip_if_microversion_lt("2.39")
def test_set_share_type_quota_bigger_than_users_quota(self):
@ -761,6 +802,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
cleanup=False,
shares=12)
@decorators.idempotent_id('4687eb25-17b3-4995-ace2-62f8bda29c57')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.39")
def test_quotas_usages(self):
@ -853,6 +895,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self._check_sgs_usages(p_quotas, sgs_in_use)
self._check_sgs_usages(u_quotas, sgs_in_use)
@decorators.idempotent_id('fe357398-12d4-4a63-b5ae-0d5091ba3442')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(
CONF.share.run_share_group_tests, 'Share Group tests disabled.')

View File

@ -15,6 +15,7 @@
import ddt
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -61,11 +62,13 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
cls.share_group_type = cls._create_share_group_type()
cls.share_group_type_id = cls.share_group_type['id']
@decorators.idempotent_id('c7174059-7172-4cc8-9121-aefe509ef14c')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_get_quotas_with_empty_tenant_id(self):
self.assertRaises(lib_exc.NotFound,
self.client.show_quotas, "")
@decorators.idempotent_id('0fbcbfad-fdb5-42d6-b005-041dc4ddea64')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_reset_quotas_with_empty_tenant_id(self):
self.assertRaises(lib_exc.NotFound,
@ -78,6 +81,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
{"snapshot_gigabytes": -2},
{"share_networks": -2},
)
@decorators.idempotent_id('07d3e69a-7cda-4ca7-9fea-c32f6830fdd3')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_update_quota_with_wrong_data(self, kwargs):
# -1 is acceptable value as unlimited
@ -90,6 +94,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
{"share_groups": -2},
{"share_group_snapshots": -2},
)
@decorators.idempotent_id('b11c5d5f-2b58-4a5f-8469-b22ea51709c0')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@testtools.skipUnless(
CONF.share.run_share_group_tests, 'Share Group tests disabled.')
@ -105,6 +110,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
{"share_replicas": -2},
{"replica_gigabytes": -2},
)
@decorators.idempotent_id('d070ccc6-6685-4f49-a8e5-9b891790881e')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@utils.skip_if_microversion_not_supported(
SHARE_REPLICA_QUOTAS_MICROVERSION)
@ -115,6 +121,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
self.tenant_id,
**kwargs)
@decorators.idempotent_id('75d39eda-a2b5-4271-a61d-9e2c86370b3e')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_create_share_with_size_bigger_than_quota(self):
quotas = self.client.show_quotas(self.tenant_id)
@ -125,6 +132,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
self.create_share,
size=overquota)
@decorators.idempotent_id('37dd40a8-375e-454b-8b80-229cb0eecb01')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@testtools.skipUnless(
CONF.share.run_share_group_tests, 'Share Group tests disabled.')
@ -139,6 +147,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
share_type_ids=[self.share_type_id],
cleanup_in_class=False)
@decorators.idempotent_id('e039535c-dc4e-497a-ac09-30b3395ba95b')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_set_user_quota_shares_bigger_than_tenant_quota(self):
@ -154,6 +163,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
force=False,
shares=bigger_value)
@decorators.idempotent_id('57495588-d645-402e-9b89-0ab63a58ce3e')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_set_user_quota_snaps_bigger_than_tenant_quota(self):
@ -169,6 +179,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
force=False,
snapshots=bigger_value)
@decorators.idempotent_id('6187050f-f262-48cf-bdd6-32982f860fba')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_set_user_quota_gigabytes_bigger_than_tenant_quota(self):
@ -184,6 +195,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
force=False,
gigabytes=bigger_value)
@decorators.idempotent_id('8eb4aed8-c239-49d3-aee1-d63d043aa3d1')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_set_user_quota_snap_gigabytes_bigger_than_tenant_quota(self):
# get current quotas for tenant
@ -198,6 +210,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
force=False,
snapshot_gigabytes=bigger_value)
@decorators.idempotent_id('a272a24b-21a6-4f6c-917c-cbe103203a11')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_set_user_quota_share_networks_bigger_than_tenant_quota(self):
@ -214,6 +227,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
share_networks=bigger_value)
@ddt.data("share_replicas", "replica_gigabytes")
@decorators.idempotent_id('40dabf7d-98da-48a9-bb62-285098d5acb4')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@utils.skip_if_microversion_not_supported(
SHARE_REPLICA_QUOTAS_MICROVERSION)
@ -246,6 +260,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
('os-quota-sets', '2.7', 'update_quotas'),
)
@ddt.unpack
@decorators.idempotent_id('ed38ab0a-694c-48ea-bce5-5c264f485d5b')
@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):
@ -255,6 +270,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
version=version,
url=url)
@decorators.idempotent_id('50af5d8c-0b30-4e8d-93bf-bb975db58516')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_show_quota_detail_with_wrong_versions(self):
version = '2.24'
@ -267,6 +283,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
url=url)
@ddt.data('show', 'reset', 'update')
@decorators.idempotent_id('cf45eb7d-7330-4b2d-8214-e4149eb4a398')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@base.skip_if_microversion_lt("2.39")
def test_share_type_quotas_using_nonexistent_share_type(self, op):
@ -282,6 +299,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
**kwargs)
@ddt.data('id', 'name')
@decorators.idempotent_id('2ba641a1-100b-417e-80e2-d3f717fd3c7c')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@base.skip_if_microversion_lt("2.39")
def test_try_update_share_type_quota_for_share_networks(self, key):
@ -296,6 +314,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
share_networks=int(tenant_quotas["share_networks"]))
@ddt.data('share_groups', 'share_group_snapshots')
@decorators.idempotent_id('5eb6ce15-1172-4bcb-9c7b-91543bf714e8')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@base.skip_if_microversion_lt(SHARE_GROUPS_MICROVERSION)
def test_try_update_share_type_quota_for_share_groups(self, quota_name):
@ -309,6 +328,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
**{quota_name: int(tenant_quotas[quota_name])})
@ddt.data('share_groups', 'share_group_snapshots')
@decorators.idempotent_id('1b504c74-2ce9-40f6-87fb-9e643b1b5906')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@base.skip_if_microversion_not_supported(PRE_SHARE_GROUPS_MICROVERSION)
@base.skip_if_microversion_not_supported(SHARE_GROUPS_MICROVERSION)
@ -326,6 +346,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
**kwargs)
@ddt.data("share_replicas", "replica_gigabytes")
@decorators.idempotent_id('66f22d42-37bc-4f9b-8e0b-a679341e1e88')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@base.skip_if_microversion_not_supported(SHARE_REPLICA_QUOTAS_MICROVERSION)
def test_share_replica_quotas_using_too_old_microversion(self, quota_key):
@ -342,6 +363,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
**kwargs)
@ddt.data('show', 'reset', 'update')
@decorators.idempotent_id('acc609c2-f314-4540-984c-33e93d048f6c')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@base.skip_if_microversion_lt("2.38")
def test_share_type_quotas_using_too_old_microversion(self, op):
@ -357,6 +379,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
**kwargs)
@ddt.data('show', 'reset', 'update')
@decorators.idempotent_id('719768d1-d313-40e9-9127-c5777840ecbd')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@base.skip_if_microversion_lt("2.39")
def test_quotas_providing_share_type_and_user_id(self, op):
@ -372,6 +395,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
**kwargs)
@ddt.data(11, -1)
@decorators.idempotent_id('82256511-aa46-4b99-a6e5-8b400534e96d')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@base.skip_if_microversion_lt("2.39")
def test_update_share_type_quotas_bigger_than_project_quota(self, st_q):
@ -385,6 +409,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
force=False,
shares=st_q)
@decorators.idempotent_id('6396daab-ba73-4140-8a0a-8eef0a01804d')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_create_share_over_quota_limit(self):
self.create_share(share_type_id=self.share_type_id)
@ -434,6 +459,7 @@ class ReplicaQuotasNegativeTest(rep_neg_test.ReplicationNegativeBase):
# Make sure that the new value was properly set
self.assertEqual(new_limit, updated_quota[quota_key])
@decorators.idempotent_id('ad19eaa5-bacd-4bc5-9592-622b0c856cdd')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(('share_replicas', 2), ('replica_gigabytes', None))
@ddt.unpack
@ -455,6 +481,7 @@ class ReplicaQuotasNegativeTest(rep_neg_test.ReplicationNegativeBase):
self.share1['id'],
availability_zone=self.replica_zone)
@decorators.idempotent_id('0006f1ff-69c0-40b7-8437-55cc0a08a195')
@testtools.skipUnless(
CONF.share.run_extend_tests,
"Share extend tests are disabled.")

View File

@ -14,6 +14,7 @@
# under the License.
from tempest import config
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.common import constants
@ -77,6 +78,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest):
return [replica['id'] for replica in replica_list
if replica['replica_state'] == r_state]
@decorators.idempotent_id('0213cdfd-6a0f-4f24-a154-69796888a64a')
@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."""
@ -130,6 +132,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest):
replica_list, constants.REPLICATION_STATE_ACTIVE)
self.assertEqual(1, len(new_active_replicas))
@decorators.idempotent_id('22a199b7-f4f6-4ede-b09f-8047a9d01cad')
@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."""
@ -144,6 +147,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'])
@decorators.idempotent_id('16bd90f0-c478-4a99-8633-b18703ff56fa')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_reset_share_replica_status(self):
"""Test resetting a replica's 'status' attribute."""
@ -156,6 +160,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest):
self.admin_client.wait_for_share_replica_status(
replica['id'], constants.STATUS_ERROR)
@decorators.idempotent_id('258844da-a853-42b6-87db-b16e616018c6')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_reset_share_replica_state(self):
"""Test resetting a replica's 'replica_state' attribute."""
@ -168,6 +173,7 @@ class ReplicationAdminTest(base.BaseSharesMixedTest):
self.admin_client.wait_for_share_replica_status(
replica['id'], constants.STATUS_ERROR, status_attr='replica_state')
@decorators.idempotent_id('2969565a-85e8-4c61-9dfb-cc7f7ca9f6dd')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_resync_share_replica(self):
"""Test resyncing a replica."""

View File

@ -11,6 +11,7 @@
# under the License.
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -76,6 +77,7 @@ class ReplicationActionsAdminTest(base.BaseSharesMixedTest):
cls.replica = cls.admin_client.list_share_replicas(
share_id=cls.share['id'])[0]
@decorators.idempotent_id('b39f319e-2515-42c0-85c4-21c2fb2123bf')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_extend_tests,
'Extend share tests are disabled.')
@ -88,6 +90,7 @@ class ReplicationActionsAdminTest(base.BaseSharesMixedTest):
share = self.admin_client.get_share(self.share["id"])
self.assertEqual(new_size, int(share["size"]))
@decorators.idempotent_id('743bfb8e-a314-4e8e-92b5-079bd3eae72d')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_shrink_tests,
'Shrink share tests are disabled.')
@ -99,6 +102,7 @@ class ReplicationActionsAdminTest(base.BaseSharesMixedTest):
shrink_share = self.admin_client.get_share(self.share["id"])
self.assertEqual(new_size, int(shrink_share["size"]))
@decorators.idempotent_id('84150cd6-2777-4806-8aa3-51359f16816e')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@testtools.skipUnless(CONF.share.run_manage_unmanage_tests,
'Manage/Unmanage Tests are disabled.')
@ -135,6 +139,7 @@ class ReplicationActionsAdminTest(base.BaseSharesMixedTest):
self.create_share_replica(managed_share['id'], self.replica_zone,
cleanup=True, client=self.admin_client)
@decorators.idempotent_id('cbbe2650-47bb-456b-8b41-74c66270ea97')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_manage_unmanage_tests,
'Manage/Unmanage Tests are disabled.')
@ -148,6 +153,7 @@ class ReplicationActionsAdminTest(base.BaseSharesMixedTest):
self.admin_client.unmanage_share,
share_id=self.share['id'])
@decorators.idempotent_id('796fb2a8-1ac3-4eee-b12e-da511eb52e87')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@testtools.skipUnless(CONF.share.run_manage_unmanage_tests,
'Manage/Unmanage Tests are disabled.')
@ -161,6 +167,7 @@ class ReplicationActionsAdminTest(base.BaseSharesMixedTest):
self.admin_client.unmanage_share(share['id'])
self.admin_client.wait_for_resource_deletion(share_id=share['id'])
@decorators.idempotent_id('93220873-c6c4-40f7-840d-d0ff02e7cd7e')
@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.')
@ -176,6 +183,7 @@ class ReplicationActionsAdminTest(base.BaseSharesMixedTest):
provider_location="127.0.0.1:/fake_provider_location/"
"manila_share_9dc61f49_fbc8_48d7_9337_2f9593d9")
@decorators.idempotent_id('0b0cd350-8691-477b-adb1-5e79b92e3759')
@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.')

View File

@ -15,6 +15,7 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -45,6 +46,7 @@ class SchedulerStatsAdminTest(base.BaseSharesAdminTest):
super(SchedulerStatsAdminTest, cls).resource_setup()
cls.admin_client = cls.shares_v2_client
@decorators.idempotent_id('dab6d654-7d1c-4bc0-8017-1c4c072b49a1')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_pool_list(self):
@ -58,6 +60,7 @@ class SchedulerStatsAdminTest(base.BaseSharesAdminTest):
actual_keys = set(pool.keys())
self.assertTrue(actual_keys.issuperset(required_keys))
@decorators.idempotent_id('8f4582c4-df82-4b64-be79-a8c6fdc58eac')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_pool_list_with_filters(self):
@ -87,6 +90,7 @@ class SchedulerStatsAdminTest(base.BaseSharesAdminTest):
for k, v in search_opts.items():
self.assertEqual(v[1:-1], filtered_pool_list[0][k])
@decorators.idempotent_id('1c2f1b0f-c509-4676-8335-bb6b10debea2')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_pool_list_with_filters_negative(self):
@ -103,6 +107,7 @@ class SchedulerStatsAdminTest(base.BaseSharesAdminTest):
# Ensure we got no pools
self.assertEmpty(pool_list)
@decorators.idempotent_id('b6fdd156-3923-495a-ab01-f94bfb5d7040')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_pool_list_detail(self):
@ -116,6 +121,7 @@ class SchedulerStatsAdminTest(base.BaseSharesAdminTest):
actual_keys = set(pool.keys())
self.assertTrue(actual_keys.issuperset(required_keys))
@decorators.idempotent_id('071a1e47-959e-47df-ad19-335064bb25ff')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_pool_list_detail_with_filters(self):
@ -145,6 +151,7 @@ class SchedulerStatsAdminTest(base.BaseSharesAdminTest):
for k, v in search_opts.items():
self.assertEqual(v[1:-1], filtered_pool_list[0][k])
@decorators.idempotent_id('56f04711-7b57-4d2a-a4f3-96c82845208e')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_pool_list_detail_with_filters_negative(self):
@ -161,6 +168,7 @@ class SchedulerStatsAdminTest(base.BaseSharesAdminTest):
# Ensure we got no pools
self.assertEmpty(pool_list)
@decorators.idempotent_id('f027fb62-1ec3-4f52-a782-e9dd9db34fda')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_not_supported("2.23")
@ddt.data((True, "name"), (True, "id"), (False, "name"), (False, "id"))
@ -186,6 +194,7 @@ class SchedulerStatsAdminTest(base.BaseSharesAdminTest):
self.assertIn("pool", pool_keys)
self.assertIs(detail, "capabilities" in pool_keys)
@decorators.idempotent_id('31cb2c99-3abf-4dce-8e66-7fd30b168300')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_not_supported("2.23")
@ddt.data((True, "name"), (True, "id"), (False, "name"), (False, "id"))

View File

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -46,6 +47,7 @@ class SecurityServiceAdminTest(
'kerberos',
**ss_kerberos_data)
@decorators.idempotent_id('6f843a0a-21da-4a83-ae3b-3831f99b3678')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_list_security_services_all_tenants(self):
listed = self.shares_client.list_security_services(
@ -57,6 +59,7 @@ class SecurityServiceAdminTest(
keys = ["name", "id", "status", "type", ]
[self.assertIn(key, s_s.keys()) for s_s in listed for key in keys]
@decorators.idempotent_id('fe515fa7-0275-4190-adc7-5321e1047dad')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_list_security_services_invalid_filters(self):
listed = self.shares_client.list_security_services(

View File

@ -14,6 +14,7 @@
# under the License.
import ddt
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -26,6 +27,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest):
super(ServicesAdminTest, self).setUp()
self.services = self.shares_client.list_services()
@decorators.idempotent_id('74cd12ab-a1f5-40fb-9110-d9035b4b20c5')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data('shares_client', 'shares_v2_client')
def test_list_services(self, client_name):
@ -35,6 +37,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest):
for service in services:
self.assertIsNotNone(service['id'])
@decorators.idempotent_id('e80f4b89-7280-47eb-9cbf-01a09e04c2d8')
@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):
@ -45,6 +48,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest):
for service in services:
self.assertEqual(host, service["host"])
@decorators.idempotent_id('1dd4d799-b900-4476-9e51-ad9db6ee4435')
@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):
@ -55,6 +59,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest):
for service in services:
self.assertEqual(binary, service["binary"])
@decorators.idempotent_id('d12ea678-025f-46b4-95c5-3a03b3e440d7')
@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):
@ -65,6 +70,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest):
for service in services:
self.assertEqual(zone, service["zone"])
@decorators.idempotent_id('e82921a7-6c98-4c9c-a47b-34a0badc3b59')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data('shares_client', 'shares_v2_client')
def test_get_services_by_status(self, client_name):
@ -75,6 +81,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest):
for service in services:
self.assertEqual(status, service["status"])
@decorators.idempotent_id('c30234f0-1331-4560-93a7-cbda7d00eb53')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data('shares_client', 'shares_v2_client')
def test_get_services_by_state(self, client_name):
@ -85,6 +92,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest):
for service in services:
self.assertEqual(state, service["state"])
@decorators.idempotent_id('b77c4bc4-57d5-4181-9e95-e230ab682b32')
@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):

View File

@ -14,6 +14,7 @@
# under the License.
import ddt
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -29,11 +30,13 @@ class ServicesAdminNegativeTest(base.BaseSharesMixedTest):
cls.admin_client = cls.admin_shares_v2_client
cls.member_client = cls.shares_v2_client
@decorators.idempotent_id('59ab1a7d-817d-42e5-a1b9-adfc2912e08c')
@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)
@decorators.idempotent_id('04f59090-069d-4cae-b028-e004ff29126c')
@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
@ -54,36 +57,42 @@ class ServicesAdminNegativeTest(base.BaseSharesMixedTest):
key=lambda service: service['id']),
msg)
@decorators.idempotent_id('386dc131-39f9-4d5f-af87-edf76e3d0e71')
@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))
@decorators.idempotent_id('766461b0-e89a-4113-8229-24c4d11d585a')
@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))
@decorators.idempotent_id('ac570fde-690d-4448-9cce-ce35e0a14b88')
@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))
@decorators.idempotent_id('da0fef1d-c4d3-4c33-a836-5f836e85df69')
@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))
@decorators.idempotent_id('41936575-3a96-455b-8069-7f6563abf0e2')
@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))
@decorators.idempotent_id('3c72227b-7fa1-4294-bdf4-413ec4c324e5')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@ddt.data(
('os-services', '2.7'),

View File

@ -18,6 +18,7 @@ import itertools
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.common import constants
@ -56,6 +57,7 @@ class ShareGroupTypesTest(base.BaseSharesAdminTest):
share_type = cls.create_share_type(name, extra_specs=extra_specs)
cls.share_type2 = share_type['share_type']
@decorators.idempotent_id('e2ba1754-cecc-4178-ad39-eefbb59e4d6d')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data(
*itertools.product(('id', 'name'), set(
@ -95,6 +97,7 @@ class ShareGroupTypesTest(base.BaseSharesAdminTest):
self.shares_v2_client.wait_for_resource_deletion(
share_group_type_id=sg_type_r['id'])
@decorators.idempotent_id('65cf04d6-0620-4e0d-96f2-456946e8a552')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data('id', 'name')
def test_create_share_group_type_multiple_share_types_min(self, st_key):
@ -111,6 +114,7 @@ class ShareGroupTypesTest(base.BaseSharesAdminTest):
set(sg_type['share_types']),
'Share types not applied correctly.')
@decorators.idempotent_id('6e103b7b-cd01-4edb-91e7-a16681781b36')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_create_share_group_type_with_one_spec_min(self):
name = data_utils.rand_name("tempest-manila")
@ -125,6 +129,7 @@ class ShareGroupTypesTest(base.BaseSharesAdminTest):
self.assertDictMatch(group_specs, sg_type['group_specs'])
@decorators.idempotent_id('ec459ebb-5c45-4d4f-95f0-3bbf2974366c')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_create_share_group_type_with_multiple_specs_min(self):
name = data_utils.rand_name("tempest-manila")
@ -139,6 +144,7 @@ class ShareGroupTypesTest(base.BaseSharesAdminTest):
self.assertDictMatch(group_specs, sg_type['group_specs'])
@decorators.idempotent_id('15b44580-a34d-4e0d-a77b-0e76b45d6199')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data(
*set([constants.MIN_SHARE_GROUP_MICROVERSION,
@ -168,6 +174,7 @@ class ShareGroupTypesTest(base.BaseSharesAdminTest):
self.assertEqual('value3', sg_type['group_specs']['key1'])
self.assertEqual(group_specs['key2'], sg_type['group_specs']['key2'])
@decorators.idempotent_id('3ed054c5-d0ab-4a73-b704-994eb7f9c46c')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_update_all_share_group_type_specs_min(self):
name = data_utils.rand_name("tempest-manila")
@ -192,6 +199,7 @@ class ShareGroupTypesTest(base.BaseSharesAdminTest):
self.assertIn(k, sg_type['group_specs'])
self.assertEqual(v, sg_type['group_specs'][k])
@decorators.idempotent_id('efddee69-ca23-4681-8247-94ded81c4c3a')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data(
*set([constants.MIN_SHARE_GROUP_MICROVERSION,
@ -220,6 +228,7 @@ class ShareGroupTypesTest(base.BaseSharesAdminTest):
self.assertDictMatch(group_specs, sg_type['group_specs'])
@decorators.idempotent_id('c2d34b42-e3ec-404e-8b7a-0fe9b1560507')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data(
*set([constants.MIN_SHARE_GROUP_MICROVERSION,
@ -280,6 +289,7 @@ class ShareGroupTypesTest(base.BaseSharesAdminTest):
sgt_id, version=version)
self.assertEmpty(access)
@decorators.idempotent_id('b8b20a96-cecc-4677-8a77-aae3b93e5b96')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data(*set(('2.45', '2.46', LATEST_MICROVERSION)))
def test_share_group_type_create_show_list_with_is_default_key(self,

View File

@ -12,6 +12,7 @@
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -45,6 +46,7 @@ class ShareGroupTypesAdminNegativeTest(base.BaseSharesMixedTest):
share_types=[cls.share_type['share_type']['id']],
client=cls.admin_shares_v2_client)
@decorators.idempotent_id('1f8e3f98-4df7-4383-94d6-4ad058ef79c1')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_create_share_group_type_without_name(self):
self.assertRaises(
@ -53,6 +55,7 @@ class ShareGroupTypesAdminNegativeTest(base.BaseSharesMixedTest):
name=None,
share_types=data_utils.rand_name("fake"))
@decorators.idempotent_id('6c95f5b7-6e30-4e1e-b0fc-a0f05cf2982d')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_create_share_group_type_with_nonexistent_share_type(self):
self.assertRaises(
@ -61,6 +64,7 @@ class ShareGroupTypesAdminNegativeTest(base.BaseSharesMixedTest):
name=data_utils.rand_name("sgt_name_should_have_not_been_created"),
share_types=data_utils.rand_name("fake"))
@decorators.idempotent_id('ce6ba41b-4207-4866-8f70-7a89f64b4cd4')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_create_share_group_type_with_empty_name(self):
self.assertRaises(
@ -68,6 +72,7 @@ class ShareGroupTypesAdminNegativeTest(base.BaseSharesMixedTest):
self.create_share_group_type, '',
client=self.admin_shares_v2_client)
@decorators.idempotent_id('77159ec6-adb7-4d35-9d4b-039d322f7852')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_create_share_group_type_with_too_big_name(self):
self.assertRaises(
@ -75,6 +80,7 @@ class ShareGroupTypesAdminNegativeTest(base.BaseSharesMixedTest):
self.create_share_group_type,
"x" * 256, client=self.admin_shares_v2_client)
@decorators.idempotent_id('43ac388d-05e8-45d5-b633-631cc1f290af')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_create_share_group_type_with_wrong_value_for_group_specs(self):
self.assertRaises(
@ -84,6 +90,7 @@ class ShareGroupTypesAdminNegativeTest(base.BaseSharesMixedTest):
share_types=[self.share_type['share_type']['id']],
group_specs="expecting_error_code_400")
@decorators.idempotent_id('8fb8bd73-0219-460d-993e-bff7ddec29e8')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_get_share_group_type_using_nonexistent_id(self):
self.assertRaises(
@ -91,6 +98,7 @@ class ShareGroupTypesAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.get_share_group_type,
data_utils.rand_name("fake"))
@decorators.idempotent_id('76b5c302-f492-45b4-b464-7be6efd373be')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_delete_share_group_type_using_nonexistent_id(self):
self.assertRaises(
@ -98,6 +106,7 @@ class ShareGroupTypesAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.delete_share_group_type,
data_utils.rand_name("fake"))
@decorators.idempotent_id('081183cb-0f1c-4b67-8552-909935dc0be2')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_create_duplicate_of_share_group_type(self):
unique_name = data_utils.rand_name("unique_sgt_name")
@ -119,6 +128,7 @@ class ShareGroupTypesAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.delete_share_group_type(sg_type['id'])
self.assertEqual(2, len(list_of_ids))
@decorators.idempotent_id('6c30989d-2e8a-48d3-809a-556dddae51bd')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_add_project_access_to_public_share_group_type(self):
self.assertRaises(
@ -127,6 +137,7 @@ class ShareGroupTypesAdminNegativeTest(base.BaseSharesMixedTest):
self.share_group_type["id"],
self.admin_shares_v2_client.tenant_id)
@decorators.idempotent_id('3375a1f8-7828-4cbe-89d7-fe11fcf30b21')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_remove_project_access_from_public_share_group_type(self):
self.assertRaises(
@ -135,6 +146,7 @@ class ShareGroupTypesAdminNegativeTest(base.BaseSharesMixedTest):
self.share_group_type["id"],
self.admin_shares_v2_client.tenant_id)
@decorators.idempotent_id('68e3d7f9-fdc0-44a2-ae84-a72eba314e19')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_add_project_access_to_nonexistent_share_group_type(self):
self.assertRaises(
@ -143,6 +155,7 @@ class ShareGroupTypesAdminNegativeTest(base.BaseSharesMixedTest):
data_utils.rand_name("fake"),
self.admin_shares_v2_client.tenant_id)
@decorators.idempotent_id('94f0c902-ab12-435e-abd5-e09a892db82a')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_remove_project_access_from_nonexistent_share_group_type(self):
self.assertRaises(

View File

@ -16,6 +16,7 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions
import testtools
from testtools import testcase as tc
@ -59,6 +60,7 @@ class ShareGroupsTest(base.BaseSharesAdminTest):
version=constants.MIN_SHARE_GROUP_MICROVERSION)
cls.sg_type_id = cls.sg_type['id']
@decorators.idempotent_id('79eaa86f-4c8f-49fd-acb2-ec051aa6bf93')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
*set([constants.MIN_SHARE_GROUP_MICROVERSION,
@ -96,6 +98,7 @@ class ShareGroupsTest(base.BaseSharesAdminTest):
'Expected %s, got %s' % (
share_group['id'], expected_share_types, actual_share_types))
@decorators.idempotent_id('ff6c17af-03ba-4506-923d-b6c229492d0e')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_create_share_group_with_multiple_share_types_min(self):
share_group = self.create_share_group(
@ -129,6 +132,7 @@ class ShareGroupsTest(base.BaseSharesAdminTest):
'Expected %s, got %s' % (
share_group['id'], expected_share_types, actual_share_types))
@decorators.idempotent_id('99f0471c-e978-42ac-b50b-848b16692eab')
@testtools.skipUnless(
CONF.share.default_share_type_name, "Only if defaults are defined.")
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ -167,6 +171,7 @@ class ShareGroupsTest(base.BaseSharesAdminTest):
'Expected %s, got %s' % (
share_group['id'], expected_sg_type, actual_sg_type))
@decorators.idempotent_id('8ca1f0a0-2a36-4adb-af6b-6741b00307c5')
@testtools.skipUnless(
CONF.share.multitenancy_enabled, "Only for multitenancy.")
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ -201,6 +206,7 @@ class ShareGroupsTest(base.BaseSharesAdminTest):
self.assertEqual(
orig_sg['share_server_id'], new_sg['share_server_id'])
@decorators.idempotent_id('93fd4a97-a25a-4a17-b5ae-c8894c1adfc5')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_create_sg_with_sg_type_but_without_any_group_specs(self):
# Create share group type not specifying any group specs

View File

@ -15,6 +15,7 @@
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.common import constants
@ -36,6 +37,7 @@ class ShareGroupsNegativeTest(base.BaseSharesAdminTest):
utils.check_skip_if_microversion_lt(
constants.MIN_SHARE_GROUP_MICROVERSION)
@decorators.idempotent_id('b90537b7-634d-4fca-b451-770fbcca7927')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_create_share_group_with_wrong_consistent_snapshot_spec(self):
# Create valid share type for share group type

View File

@ -14,6 +14,7 @@
# under the License.
import ddt
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -32,6 +33,7 @@ class ShareInstancesTest(base.BaseSharesAdminTest):
# create share
cls.share = cls.create_share(share_type_id=cls.share_type_id)
@decorators.idempotent_id('b5211759-17ab-4806-a58c-c65bc8a06087')
@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."""
@ -50,6 +52,7 @@ class ShareInstancesTest(base.BaseSharesAdminTest):
self.share['id'],
si['share_id']))
@decorators.idempotent_id('b2d8ccba-5973-4e72-b3df-52555ce40b4f')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_list_share_instances_v2_3(self):
"""Test that we list the share instance back."""
@ -62,6 +65,7 @@ class ShareInstancesTest(base.BaseSharesAdminTest):
msg = 'Share instance for share %s was not found.' % self.share['id']
self.assertIn(self.share['id'], share_ids, msg)
@decorators.idempotent_id('d4b2544a-96ce-41ed-8b8e-e46ceef91462')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data('2.3', '2.9', '2.10', '2.30', '2.54')
def test_get_share_instance(self, version):
@ -99,6 +103,7 @@ class ShareInstancesTest(base.BaseSharesAdminTest):
si['id'], expected_keys, actual_keys))
@ddt.data('path', 'id')
@decorators.idempotent_id('c27b415d-341c-42f0-a269-2c94f69fbee1')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.35")
def test_list_share_instances_with_export_location_path_and_id(

View File

@ -11,6 +11,7 @@
# under the License.
import ddt
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -28,6 +29,7 @@ class ShareInstancesNegativeTest(base.BaseSharesAdminTest):
# create share
cls.share = cls.create_share(share_type_id=cls.share_type_id)
@decorators.idempotent_id('babe885e-a8ab-439d-8b95-e5422983a942')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_not_supported("2.34")
@ddt.data('path', 'id')
@ -44,6 +46,7 @@ class ShareInstancesNegativeTest(base.BaseSharesAdminTest):
self.assertGreater(len(share_instances), 0)
@decorators.idempotent_id('ce0d045c-e418-42fa-86e4-ead493fc0663')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.35")
@ddt.data('path', 'id')

View File

@ -16,6 +16,7 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.common import constants
@ -142,21 +143,25 @@ class ManageNFSShareTest(base.BaseSharesAdminTest):
self._delete_share_server_and_wait(
managed_share['share_server_id'])
@decorators.idempotent_id('15b654d0-34ed-4154-9f5f-b96d2e4e9d1c')
@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(version="2.5")
@decorators.idempotent_id('8c0beefb-19da-441e-b73f-d90eb8000ff3')
@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(is_public=True, version="2.8")
@decorators.idempotent_id('da7b7a4f-6693-4460-bdb7-1f8d42032bc6')
@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(version="2.16")
@decorators.idempotent_id('24ec7840-0174-484f-8b3a-8c6f162bf576')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_manage(self):
self._test_manage(check_manage=True)

View File

@ -15,6 +15,7 @@
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -90,6 +91,7 @@ class ManageNFSShareNegativeTest(base.BaseSharesAdminTest):
return valid_params
@decorators.idempotent_id('8267161e-4f55-44eb-9af5-30d1a3fb2606')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_manage_invalid_param_raises_exception(self):
# Try to manage share with invalid parameters, it should not succeed
@ -140,6 +142,7 @@ class ManageNFSShareNegativeTest(base.BaseSharesAdminTest):
self._delete_share_server_and_wait(
managed_share['share_server_id'])
@decorators.idempotent_id('01b36343-c503-4c14-bb74-71f131ae96b6')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_manage_invalid_param_manage_error(self):
# Try to manage share with invalid parameters, it should not succeed.
@ -184,6 +187,7 @@ class ManageNFSShareNegativeTest(base.BaseSharesAdminTest):
self._delete_share_server_and_wait(
managed_share['share_server_id'])
@decorators.idempotent_id('832b1c4d-e6f2-4a75-9ea5-d99f780db743')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_manage_share_duplicate(self):
share = self._create_share_for_manage()
@ -216,6 +220,7 @@ class ManageNFSShareNegativeTest(base.BaseSharesAdminTest):
self._delete_share_server_and_wait(
managed_share['share_server_id'])
@decorators.idempotent_id('c2f28981-5758-46e8-9d90-5c3269461d94')
@testtools.skipUnless(CONF.share.multitenancy_enabled,
'Multitenancy tests are disabled.')
@utils.skip_if_microversion_not_supported("2.49")
@ -244,6 +249,7 @@ class ManageNFSShareNegativeTest(base.BaseSharesAdminTest):
self._delete_share_server_and_wait(
managed_share['share_server_id'])
@decorators.idempotent_id('162b6b96-e801-40f4-b111-7e533cf8b943')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_delete_share_in_manage_error(self):
share = self._create_share_for_manage()
@ -280,6 +286,7 @@ class ManageNFSShareNegativeTest(base.BaseSharesAdminTest):
self._delete_share_server_and_wait(
managed_share['share_server_id'])
@decorators.idempotent_id('7cad4763-8f78-46a5-aeeb-6ca174284d3d')
@testtools.skipUnless(CONF.share.run_snapshot_tests,
'Snapshot tests are disabled.')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ -300,6 +307,7 @@ class ManageNFSShareNegativeTest(base.BaseSharesAdminTest):
self._delete_snapshot_and_wait(snap)
self._delete_share_and_wait(share)
@decorators.idempotent_id('f71bcb3c-836e-4e9e-972a-50debeb8c285')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_unmanage_share_transitional_state(self):
# A share in transitional state cannot be unmanaged
@ -319,6 +327,7 @@ class ManageNFSShareNegativeTest(base.BaseSharesAdminTest):
# cleanup
self._reset_state_and_delete_share(share)
@decorators.idempotent_id('916ca8e2-5635-4cc9-8ab6-36b7b53ecd0a')
@testtools.skipUnless(CONF.share.multitenancy_enabled,
'Multitenancy tests are disabled.')
@utils.skip_if_microversion_not_supported("2.48")

View File

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -74,6 +75,7 @@ class ShareNetworkAdminTest(base.BaseSharesMixedTest,
cls.sn_with_kerberos_ss["id"],
cls.ss_kerberos["id"])
@decorators.idempotent_id('983fb22d-3057-402f-8988-62ce41a557fb')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_list_share_networks_all_tenants(self):
listed = self.admin_shares_v2_client.list_share_networks_with_detail(
@ -83,6 +85,7 @@ class ShareNetworkAdminTest(base.BaseSharesMixedTest,
self.assertTrue(any(self.sn_with_kerberos_ss['id'] == sn['id']
for sn in listed))
@decorators.idempotent_id('36c26b6b-8984-4255-959b-74f6ef46c37b')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_list_share_networks_filter_by_project_id(self):
listed = self.admin_shares_v2_client.list_share_networks_with_detail(

View File

@ -18,6 +18,7 @@ import re
import ddt
import six
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -69,6 +70,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}).*$")
@decorators.idempotent_id('3f821248-2c05-4323-a95f-a0216a537b0a')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_list_share_servers_without_filters(self):
servers = self.shares_v2_client.list_share_servers()
@ -99,6 +101,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)
@decorators.idempotent_id('515e3332-cce9-4a28-ad2e-96dbb2cc672e')
@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
@ -124,6 +127,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
for server in servers:
self.assertEqual(server["host"], host)
@decorators.idempotent_id('77a5c1c5-db2f-4ff6-872c-ed73a575acd0')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_list_share_servers_with_status_filter(self):
search_opts = {"status": "active"}
@ -135,6 +139,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
for server in servers:
self.assertEqual(server["status"], "active")
@decorators.idempotent_id('ed671cbb-7732-4966-9f1e-b997b8aa05ff')
@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"]}
@ -145,6 +150,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
self.assertEqual(server["project_id"],
self.share_network["project_id"])
@decorators.idempotent_id('70064129-df97-4dba-9482-2819558111ec')
@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"]}
@ -155,6 +161,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
self.assertEqual(server["share_network_name"],
self.share_network["name"])
@decorators.idempotent_id('f64e8024-eb42-4a4c-be6b-97d35633a019')
@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"]}
@ -165,6 +172,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
self.assertIn(server["share_network_name"],
self.sn_name_and_id)
@decorators.idempotent_id('e1af24f4-bf63-467d-a857-3a402fa9b65b')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_show_share_server(self):
share = self.shares_v2_client.get_share(self.share["id"])
@ -203,6 +211,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
# 'backend_details' should be a dict
self.assertIsInstance(server["backend_details"], dict)
@decorators.idempotent_id('782d8f5f-2c02-44dd-8d43-e06b651a71be')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_show_share_server_details(self):
share = self.shares_v2_client.get_share(self.share['id'])
@ -214,6 +223,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
self.assertIsInstance(k, six.string_types)
self.assertIsInstance(v, six.string_types)
@decorators.idempotent_id('2fdf8d29-3ab8-4424-b684-6253f45b9666')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(True, False)
@testtools.skipIf(CONF.share.share_network_id != "",
@ -280,6 +290,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
self.shares_v2_client.wait_for_resource_deletion(
sn_id=new_sn["id"])
@decorators.idempotent_id('960d49c5-f8d6-42be-aaf4-b7890a55df03')
@testtools.skipIf(CONF.share.share_network_id != "",
"This test is not suitable for pre-existing "
"share_network.")

View File

@ -16,6 +16,7 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
import testtools
from testtools import testcase as tc
@ -53,6 +54,7 @@ class ManageShareServersTest(base.BaseSharesAdminTest):
cleanup_in_class=True,
extra_specs=cls.extra_specs)
@decorators.idempotent_id('2bbe564d-d314-474b-8060-ada30581d0cd')
@testtools.skipIf(CONF.share.share_network_id != "",
"This test is not suitable for pre-existing "
"share_network.")

View File

@ -16,6 +16,7 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -81,6 +82,7 @@ class ManageShareServersNegativeTest(base.BaseSharesAdminTest):
('share_network_subnet_id', 'invalid_share_network_subnet_id'),
)
@ddt.unpack
@decorators.idempotent_id('60b94091-f35d-42ac-a25a-ca1f7e66bb44')
@testtools.skipIf(CONF.share.share_network_id != "",
"This test is not suitable for pre-existing "
"share_network.")
@ -131,6 +133,7 @@ class ManageShareServersNegativeTest(base.BaseSharesAdminTest):
# delete share server
self._delete_share_server_and_wait(managed_share_server['id'])
@decorators.idempotent_id('0f21aebe-e983-4112-a494-b287293112d2')
@testtools.skipIf(CONF.share.share_network_id != "",
"This test is not suitable for pre-existing "
"share_network.")
@ -172,6 +175,7 @@ class ManageShareServersNegativeTest(base.BaseSharesAdminTest):
# delete share server
self._delete_share_server_and_wait(share['share_server_id'])
@decorators.idempotent_id('84f9a808-8bff-4652-8877-4c9f0dfeed8a')
@testtools.skipIf(CONF.share.share_network_id != "",
"This test is not suitable for pre-existing "
"share_network.")
@ -213,6 +217,7 @@ class ManageShareServersNegativeTest(base.BaseSharesAdminTest):
# delete share server
self._delete_share_server_and_wait(share['share_server_id'])
@decorators.idempotent_id('fbe6cf2d-3e33-40d8-b420-b785d3cb7559')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_share_server_reset_state_invalid_state(self):
@ -232,6 +237,7 @@ class ManageShareServersNegativeTest(base.BaseSharesAdminTest):
# delete share
self._delete_share_and_wait(share)
@decorators.idempotent_id('c0a13fc4-9f30-483a-b473-0f0ce533f645')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_unmanage_share_server_with_share(self):
@ -250,6 +256,7 @@ class ManageShareServersNegativeTest(base.BaseSharesAdminTest):
# delete share
self._delete_share_and_wait(share)
@decorators.idempotent_id('d2feb338-5c78-4370-b5ba-c8b16df63b43')
@testtools.skipIf(CONF.share.share_network_id != "",
"This test is not suitable for pre-existing "
"share_network.")
@ -299,6 +306,7 @@ class ManageShareServersNegativeTest(base.BaseSharesAdminTest):
# delete share server
self._delete_share_server_and_wait(managed_share_server['id'])
@decorators.idempotent_id('30606085-4b01-4489-a18c-22e67ed0e221')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_manage_share_server_double_manage(self):

View File

@ -14,6 +14,7 @@
# under the License.
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -28,65 +29,76 @@ class ShareServersNegativeAdminTest(base.BaseSharesMixedTest):
cls.admin_client = cls.admin_shares_v2_client
cls.member_client = cls.shares_v2_client
@decorators.idempotent_id('6d55516f-9018-4372-8310-f725c4562961')
@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)
@decorators.idempotent_id('d9021f06-c146-4e76-852e-8a1ebb3fa92e')
@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')
@decorators.idempotent_id('16b6f911-487e-4c25-9241-75de2dbfc8ff')
@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')
@decorators.idempotent_id('f7580ef6-f7bb-4b52-ba45-82d2d2d66dbe')
@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')
@decorators.idempotent_id('368c5404-483e-4eee-bb80-86206d153ea2')
@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')
@decorators.idempotent_id('664b5201-7ba9-4e33-9534-5307fc003e44')
@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))
@decorators.idempotent_id('dcf169c9-1238-40cb-8a5c-ca6aca9d4d6b')
@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))
@decorators.idempotent_id('3e5d6007-5214-4fa2-bd33-dfd3bead67bf')
@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))
@decorators.idempotent_id('e893b32a-124f-4e5c-a425-58c8a4eac4a5')
@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))
@decorators.idempotent_id('2f1162a8-bb52-4e2a-abc0-68d16f769e4f')
@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))
@decorators.idempotent_id('ca23f385-56b2-4c02-9797-d88c3b7fb981')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_list_share_servers_with_fake_share_network(self):
search_opts = {
@ -95,12 +107,14 @@ class ShareServersNegativeAdminTest(base.BaseSharesMixedTest):
servers = self.admin_client.list_share_servers(search_opts)
self.assertEqual(0, len(servers))
@decorators.idempotent_id('0acb9107-18b2-4e9d-8432-37fd0d4c79b3')
@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")
@decorators.idempotent_id('65e12bf7-2ec6-4a5b-971b-b1ecb67b77b7')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_delete_share_server_with_member(self):
self.assertRaises(lib_exc.Forbidden,

View File

@ -15,6 +15,7 @@
import ddt
from tempest import config
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -46,6 +47,7 @@ class ShareSnapshotInstancesTest(base.BaseSharesAdminTest):
cls.snapshot = cls.shares_v2_client.get_snapshot(snap['id'])
@ddt.data(True, False)
@decorators.idempotent_id('bcb29129-9713-4481-8e74-97682c62f218')
@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."""
@ -78,6 +80,7 @@ class ShareSnapshotInstancesTest(base.BaseSharesAdminTest):
self.assertIn(key, expected_keys)
self.assertEqual(len(expected_keys), len(si))
@decorators.idempotent_id('1d0bd333-300d-4af2-81eb-176b550f2c36')
@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."""
@ -89,6 +92,7 @@ class ShareSnapshotInstancesTest(base.BaseSharesAdminTest):
self.snapshot['id'])
self.assertIn(self.snapshot['id'], snapshot_ids, msg)
@decorators.idempotent_id('d21bf82d-2b3b-4061-8db5-502b7376a44d')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_get_snapshot_instance(self):
instances = self.shares_v2_client.list_snapshot_instances(
@ -110,6 +114,7 @@ class ShareSnapshotInstancesTest(base.BaseSharesAdminTest):
self.assertEqual(self.snapshot['provider_location'],
instance_detail['provider_location'])
@decorators.idempotent_id('c7724848-4e17-4d28-801d-2ec77dfcf502')
@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."""

View File

@ -14,6 +14,7 @@
# under the License.
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -47,6 +48,7 @@ class SnapshotInstancesNegativeTest(base.BaseSharesMixedTest):
cls.snapshot = cls.create_snapshot_wait_for_active(
cls.share["id"], client=cls.admin_client)
@decorators.idempotent_id('6e371aac-ff8b-4eac-abc9-b8d777448ff3')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_list_snapshot_instances_with_snapshot_by_non_admin(self):
self.assertRaises(
@ -54,6 +56,7 @@ class SnapshotInstancesNegativeTest(base.BaseSharesMixedTest):
self.member_client.list_snapshot_instances,
snapshot_id=self.snapshot['id'])
@decorators.idempotent_id('d80331e4-8738-46c7-b726-1e716acef738')
@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(
@ -63,6 +66,7 @@ class SnapshotInstancesNegativeTest(base.BaseSharesMixedTest):
self.member_client.get_snapshot_instance,
instance_id=instances[0]['id'])
@decorators.idempotent_id('666a6caf-31b0-45d9-808c-e590250cffd4')
@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(
@ -90,12 +94,14 @@ class SnapshotInstancesNegativeNoResourceTest(base.BaseSharesMixedTest):
cls.admin_client = cls.admin_shares_v2_client
cls.member_client = cls.shares_v2_client
@decorators.idempotent_id('abded04d-40c0-4eb9-b2be-58b4efb16244')
@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")
@decorators.idempotent_id('1609702b-de87-4d12-9a9c-78077d4676f3')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_list_snapshot_instances_by_non_admin(self):
self.assertRaises(

View File

@ -16,6 +16,7 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -30,6 +31,7 @@ LATEST_MICROVERSION = CONF.share.max_api_microversion
@ddt.ddt
class ShareTypesAdminTest(base.BaseSharesAdminTest):
@decorators.idempotent_id('34000fb9-b595-4a10-8306-7465f9ebc45d')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_share_type_create_delete(self):
name = data_utils.rand_name("tempest-manila")
@ -66,6 +68,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
else:
self.assertNotIn('description', share_type)
@decorators.idempotent_id('228d8bab-0b31-433e-956f-9db9877e6573')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data('2.0', '2.6', '2.7', '2.40', '2.41')
def test_share_type_create_get(self, version):
@ -99,6 +102,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
self.assertDictMatch(get["volume_type"], get["share_type"])
@base.skip_if_microversion_lt("2.50")
@decorators.idempotent_id('a9af19e1-e789-4c4f-a39b-dd8df6ed00b1')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data(
('2.50', data_utils.rand_name("type_updated"),
@ -147,6 +151,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
updated_st["share_type"]["share_type_access:is_public"])
@base.skip_if_microversion_lt("2.50")
@decorators.idempotent_id('9019dc61-b2b1-472d-9b15-a3986439d4c3')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data(
('2.50', None, '', None),
@ -176,6 +181,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
self._verify_description(None, updated_st['share_type'], version)
@decorators.idempotent_id('5cc4c2e5-d2a4-4bfc-9208-3455ac551f20')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data('2.0', '2.6', '2.7', '2.40', '2.41')
def test_share_type_create_list(self, version):
@ -208,6 +214,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
for i in range(len(sts)):
self.assertDictMatch(sts[i], vts[i])
@decorators.idempotent_id('4e2ad320-9f3d-4797-a3ad-bf800bcd1831')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_get_share_with_share_type(self):
@ -238,6 +245,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
self.assertEqual(st_create["share_type"]["id"], get["share_type"])
self.assertEqual(shr_type_name, get["share_type_name"])
@decorators.idempotent_id('d2261a27-d4a4-4237-9fad-f6fd8f27783a')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_private_share_type_access(self):
name = data_utils.rand_name("tempest-manila")
@ -286,6 +294,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
access = self.shares_v2_client.list_access_to_share_type(st_id)
self.assertEmpty(access)
@decorators.idempotent_id('90dca5c5-f28e-4f16-90ed-78f5d725664e')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data(*set(('2.45', '2.46', LATEST_MICROVERSION)))
def test_share_type_create_show_list_with_is_default_key(self, version):

View File

@ -18,6 +18,7 @@ import copy
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -46,6 +47,7 @@ class ExtraSpecsReadAdminTest(base.BaseSharesAdminTest):
cls.shares_client.create_share_type_extra_specs(
cls.st_id, cls.custom_extra_specs)
@decorators.idempotent_id('d4cae104-838b-4248-8c9c-125165710786')
@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(
@ -53,6 +55,7 @@ class ExtraSpecsReadAdminTest(base.BaseSharesAdminTest):
self.assertEqual({"key1": self.custom_extra_specs["key1"]}, es_get_one)
@decorators.idempotent_id('508ceb85-5456-4db9-b33f-00620d7baea1')
@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)
@ -79,6 +82,7 @@ class ExtraSpecsWriteAdminTest(base.BaseSharesAdminTest):
self.shares_client.create_share_type_extra_specs(
self.st_id, self.custom_extra_specs)
@decorators.idempotent_id('baba776b-1b05-42ca-a002-bff1f8f14e13')
@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"
@ -93,6 +97,7 @@ class ExtraSpecsWriteAdminTest(base.BaseSharesAdminTest):
expected_extra_specs.update(self.required_extra_specs)
self.assertEqual(self.custom_extra_specs, get)
@decorators.idempotent_id('374e7ff5-0d26-4778-bbb5-4ffd28521ad9')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_update_all_share_type_extra_specs(self):
self.custom_extra_specs["key2"] = "value2_updated"
@ -107,6 +112,7 @@ class ExtraSpecsWriteAdminTest(base.BaseSharesAdminTest):
expected_extra_specs.update(self.required_extra_specs)
self.assertEqual(self.custom_extra_specs, get)
@decorators.idempotent_id('129db0ce-9a4f-4a40-994f-e492174e0661')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_delete_one_share_type_extra_spec(self):
# Delete one extra spec for share type
@ -117,6 +123,7 @@ class ExtraSpecsWriteAdminTest(base.BaseSharesAdminTest):
self.assertNotIn('key1', get)
@decorators.idempotent_id('1b9f501d-8f34-46d0-b318-83bdfed571ec')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data(*set(['2.24', LATEST_MICROVERSION]))
def test_delete_snapshot_support_extra_spec(self, version):

View File

@ -16,6 +16,7 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -37,6 +38,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
extra_specs=extra_specs,
client=self.admin_shares_v2_client)["share_type"]
@decorators.idempotent_id('195c1cc6-249a-4f82-b420-4901d2557b3a')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_create_extra_specs_with_user(self):
st = self._create_share_type()
@ -46,6 +48,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
st["id"],
self.add_extra_specs_to_dict({"key": "new_value"}))
@decorators.idempotent_id('dc883ec3-1bae-4ed7-8bf5-2cdc7027e37b')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_list_extra_specs_with_user(self):
st = self._create_share_type()
@ -54,6 +57,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.shares_v2_client.get_share_type_extra_specs,
st["id"])
@decorators.idempotent_id('1d3e687e-b2fb-4b96-8428-324ff881eea2')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_get_extra_spec_with_user(self):
st = self._create_share_type()
@ -62,6 +66,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.shares_v2_client.get_share_type_extra_spec,
st["id"], "key")
@decorators.idempotent_id('4c9505d9-d4ef-42fa-8410-8ab88ec0c852')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_get_extra_specs_with_user(self):
st = self._create_share_type()
@ -70,6 +75,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.shares_v2_client.get_share_type_extra_specs,
st["id"])
@decorators.idempotent_id('36c5ada4-9efd-4f6a-b58d-24f08a2433ce')
@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()
@ -88,6 +94,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
'Incorrect extra specs visible to non-admin user; '
'expected %s, got %s' % (expected_keys, actual_keys))
@decorators.idempotent_id('62a9b77a-f796-4bd9-baf9-7c24b3f55560')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_update_extra_spec_with_user(self):
st = self._create_share_type()
@ -96,6 +103,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.shares_v2_client.update_share_type_extra_spec,
st["id"], "key", "new_value")
@decorators.idempotent_id('207cec3c-8ed9-4d6d-8fc8-3aecaacdff93')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_update_extra_specs_with_user(self):
st = self._create_share_type()
@ -104,6 +112,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.shares_v2_client.update_share_type_extra_specs,
st["id"], {"key": "new_value"})
@decorators.idempotent_id('3f43c5d0-23c5-4b76-98c7-a3f9adb33c89')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_delete_extra_specs_with_user(self):
st = self._create_share_type()
@ -112,6 +121,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.shares_v2_client.delete_share_type_extra_spec,
st["id"], "key")
@decorators.idempotent_id('d82a7bcc-1dc5-4ef8-87cd-f8dff1574adc')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_set_too_long_key(self):
too_big_key = "k" * 256
@ -122,6 +132,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
st["id"],
self.add_extra_specs_to_dict({too_big_key: "value"}))
@decorators.idempotent_id('210faa88-8f2f-45f5-9bcf-54ce81d03788')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_set_too_long_value_with_creation(self):
too_big_value = "v" * 256
@ -132,6 +143,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
st["id"],
self.add_extra_specs_to_dict({"key": too_big_value}))
@decorators.idempotent_id('890dceaa-22c4-4d2c-99ca-16ac8cdda33c')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_set_too_long_value_with_update(self):
too_big_value = "v" * 256
@ -145,6 +157,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
st["id"],
self.add_extra_specs_to_dict({"key": too_big_value}))
@decorators.idempotent_id('c512437e-6cfd-4545-859f-554955bd0fc9')
@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
@ -157,12 +170,14 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.update_share_type_extra_spec,
st["id"], "key", too_big_value)
@decorators.idempotent_id('938115f7-512e-49c3-a16a-a6498d6069bb')
@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, "")
@decorators.idempotent_id('65c3c528-008f-43f5-b367-8bd77cfab4a7')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_list_es_with_invalid_shr_type_id(self):
self.assertRaises(
@ -170,6 +185,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.get_share_type_extra_specs,
data_utils.rand_name("fake"))
@decorators.idempotent_id('430e0bed-9073-4822-8d0b-a3c55a8dfa31')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_create_es_with_empty_shr_type_id(self):
self.assertRaises(
@ -177,6 +193,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.create_share_type_extra_specs,
"", {"key1": "value1", })
@decorators.idempotent_id('7b43025d-b014-460f-9c9d-1004433fb798')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_create_es_with_invalid_shr_type_id(self):
self.assertRaises(
@ -184,6 +201,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.create_share_type_extra_specs,
data_utils.rand_name("fake"), {"key1": "value1", })
@decorators.idempotent_id('7b9bee14-5ca5-4110-a56a-b3030b6b3948')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_create_es_with_empty_specs(self):
st = self._create_share_type()
@ -192,6 +210,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.create_share_type_extra_specs,
st["id"], "")
@decorators.idempotent_id('7f199925-44d2-4d92-bedc-2636c07621fb')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_create_es_with_invalid_specs(self):
st = self._create_share_type()
@ -200,6 +219,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.create_share_type_extra_specs,
st["id"], {"": "value_with_empty_key"})
@decorators.idempotent_id('51241ed9-350b-4218-bfb0-c446d660d70b')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_get_extra_spec_with_empty_key(self):
st = self._create_share_type()
@ -208,6 +228,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.get_share_type_extra_spec,
st["id"], "")
@decorators.idempotent_id('271d825b-2c57-429a-8dca-2cb9dd140dd0')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_get_extra_spec_with_invalid_key(self):
st = self._create_share_type()
@ -216,6 +237,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.get_share_type_extra_spec,
st["id"], data_utils.rand_name("fake"))
@decorators.idempotent_id('cf07e7bc-cd3a-4c85-a848-786a60ba1f7d')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_get_extra_specs_with_empty_shr_type_id(self):
self.assertRaises(
@ -223,6 +245,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.get_share_type_extra_specs,
"")
@decorators.idempotent_id('dfe6e34b-c86a-4cf6-9bf3-19de3a886b67')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_get_extra_specs_with_invalid_shr_type_id(self):
self.assertRaises(
@ -230,6 +253,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.get_share_type_extra_specs,
data_utils.rand_name("fake"))
@decorators.idempotent_id('0b8f6b51-0583-4b59-a851-9189db657a05')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_delete_es_key_with_empty_shr_type_id(self):
self.assertRaises(
@ -237,6 +261,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.delete_share_type_extra_spec,
"", "key", )
@decorators.idempotent_id('9aa8fb2a-28a5-44b7-848b-9b49e1e9d670')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_delete_es_key_with_invalid_shr_type_id(self):
self.assertRaises(
@ -244,6 +269,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.delete_share_type_extra_spec,
data_utils.rand_name("fake"), "key", )
@decorators.idempotent_id('cd68d020-24d2-4f68-8691-782b4815c1b0')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_delete_with_invalid_key(self):
st = self._create_share_type()
@ -252,6 +278,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.delete_share_type_extra_spec,
st["id"], data_utils.rand_name("fake"))
@decorators.idempotent_id('1ed5cbc9-21a8-45b7-8069-b7c0aaeede21')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_update_spec_with_empty_shr_type_id(self):
self.assertRaises(
@ -259,6 +286,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.update_share_type_extra_spec,
"", "key", "new_value")
@decorators.idempotent_id('704087fa-0397-4d9d-98b7-f9b081f64c86')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_update_spec_with_invalid_shr_type_id(self):
self.assertRaises(
@ -266,6 +294,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.update_share_type_extra_spec,
data_utils.rand_name("fake"), "key", "new_value")
@decorators.idempotent_id('eab96e92-9b95-44b0-89a2-e907a103039d')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_update_spec_with_empty_key(self):
st = self._create_share_type()
@ -274,6 +303,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.update_share_type_extra_spec,
st["id"], "", "new_value")
@decorators.idempotent_id('70af1a8a-ab3e-4c8b-862d-8a36c2d47cb3')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_update_with_invalid_shr_type_id(self):
self.assertRaises(
@ -281,6 +311,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.update_share_type_extra_specs,
data_utils.rand_name("fake"), {"key": "new_value"})
@decorators.idempotent_id('d2595594-eaad-43dc-b847-0a009a17d854')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_update_with_invalid_specs(self):
st = self._create_share_type()
@ -289,6 +320,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
self.admin_shares_v2_client.update_share_type_extra_specs,
st["id"], {"": "new_value"})
@decorators.idempotent_id('6849eada-89a8-4009-a91d-87367621f9aa')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_delete_spec_driver_handles_share_servers(self):
st = self._create_share_type()
@ -300,6 +332,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesMixedTest):
st["id"],
"driver_handles_share_servers")
@decorators.idempotent_id('6ea50e81-2c93-4258-8358-6f8d354a339a')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@ddt.data('2.0', '2.23')
def test_try_delete_required_spec_snapshot_support_version(self, version):

View File

@ -15,6 +15,7 @@
import ddt
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -32,12 +33,14 @@ class ShareTypesAdminNegativeTest(base.BaseSharesMixedTest):
extra_specs=extra_specs,
client=self.admin_shares_v2_client)["share_type"]
@decorators.idempotent_id('0efe4ed6-9318-4174-aef7-fca4b6aa6444')
@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"))
@decorators.idempotent_id('a1cd6c4f-4dc4-4f45-813b-f1cd3527c614')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_create_share_type_with_empty_name(self):
self.assertRaises(
@ -45,6 +48,7 @@ class ShareTypesAdminNegativeTest(base.BaseSharesMixedTest):
self.create_share_type, '',
client=self.admin_shares_v2_client)
@decorators.idempotent_id('ca59430b-d1fb-4e8f-b1e3-6ab6a6b40984')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_create_share_type_with_too_big_name(self):
self.assertRaises(lib_exc.BadRequest,
@ -52,6 +56,7 @@ class ShareTypesAdminNegativeTest(base.BaseSharesMixedTest):
"x" * 256,
client=self.admin_shares_v2_client)
@decorators.idempotent_id('42f7777a-7ee4-4622-80f8-8726b467c4db')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@ddt.data('2.0', '2.6', '2.40')
def test_create_share_type_with_description_in_wrong_version(
@ -64,18 +69,21 @@ class ShareTypesAdminNegativeTest(base.BaseSharesMixedTest):
version=version,
client=self.admin_shares_v2_client)
@decorators.idempotent_id('43b0ef5a-3a05-4f74-a08e-57efebb7e66e')
@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"))
@decorators.idempotent_id('27e00ad7-edc8-4d50-b53e-4da41dd8a5d3')
@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"))
@decorators.idempotent_id('1f481bab-5205-49ee-bf01-b1848a32f9ee')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_create_duplicate_of_share_type(self):
st = self._create_share_type()
@ -85,6 +93,7 @@ class ShareTypesAdminNegativeTest(base.BaseSharesMixedTest):
extra_specs=self.add_extra_specs_to_dict(),
client=self.admin_shares_v2_client)
@decorators.idempotent_id('c13f54eb-17a4-4403-be87-f6a3ca18de6e')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_add_share_type_allowed_for_public(self):
st = self._create_share_type()
@ -93,6 +102,7 @@ class ShareTypesAdminNegativeTest(base.BaseSharesMixedTest):
st["id"],
self.admin_shares_v2_client.tenant_id)
@decorators.idempotent_id('bf1d68fb-b954-4b3b-af54-115f3b67b3b3')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_remove_share_type_allowed_for_public(self):
st = self._create_share_type()
@ -102,6 +112,7 @@ class ShareTypesAdminNegativeTest(base.BaseSharesMixedTest):
st["id"],
self.admin_shares_v2_client.tenant_id)
@decorators.idempotent_id('3d9a7e9d-2b64-422e-b8b6-88c3088564f6')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_add_share_type_by_nonexistent_id(self):
self.assertRaises(lib_exc.NotFound,
@ -109,6 +120,7 @@ class ShareTypesAdminNegativeTest(base.BaseSharesMixedTest):
data_utils.rand_name("fake"),
self.admin_shares_v2_client.tenant_id)
@decorators.idempotent_id('13d5c3cd-15cd-4c2e-ace6-46889cf9e0e2')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_remove_share_type_by_nonexistent_id(self):
self.assertRaises(

View File

@ -16,6 +16,7 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
import testtools
from testtools import testcase as tc
@ -80,6 +81,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
share_type_id=cls.share_type_id,
))
@decorators.idempotent_id('5f61f5dd-891e-478f-b102-803096820882')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_get_share(self):
@ -107,6 +109,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
CONF.share.share_size, share["size"])
self.assertEqual(CONF.share.share_size, int(share["size"]), msg)
@decorators.idempotent_id('60d34573-8452-47ab-9455-0067bdd3ed9c')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_list_shares(self):
@ -123,6 +126,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
msg = "expected id lists %s times in share list" % (len(gen))
self.assertEqual(1, len(gen), msg)
@decorators.idempotent_id('85f9438d-d3f6-4f3a-8134-e89915373df3')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_list_shares_with_detail(self):
@ -143,6 +147,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
msg = "expected id lists %s times in share list" % (len(gen))
self.assertEqual(1, len(gen), msg)
@decorators.idempotent_id('47dad08b-0c36-428f-8ab9-5eba92ffc995')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_list_shares_with_detail_filter_by_metadata(self):
filters = {'metadata': self.metadata}
@ -158,6 +163,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
if CONF.share.capability_create_share_from_snapshot_support:
self.assertFalse(self.shares[1]['id'] in [s['id'] for s in shares])
@decorators.idempotent_id('d884c91e-88f5-4e42-83d9-ec3b440af893')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_list_shares_with_detail_filter_by_extra_specs(self):
filters = {
@ -191,6 +197,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
extra_specs = self.shares_client.get_share_type_extra_specs(st_id)
self.assertDictContainsSubset(filters["extra_specs"], extra_specs)
@decorators.idempotent_id('76fbe8ba-f1d3-4446-b9b8-55617762a2c7')
@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.share_type_id}
@ -221,6 +228,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
for share in self.shares:
self.assertIn(share['id'], share_ids)
@decorators.idempotent_id('04afc330-78ee-494f-a660-7670c877a440')
@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'])
@ -237,6 +245,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
@base.skip_if_microversion_lt("2.35")
@ddt.data(('path', True), ('id', True), ('path', False), ('id', False))
@ddt.unpack
@decorators.idempotent_id('a27e5e3f-451f-4200-af38-99a562ccbe86')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_list_shares_or_with_detail_filter_by_export_location(
self, export_location_type, enable_detail):
@ -260,6 +269,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
self.assertEqual(1, len(shares))
self.assertEqual(self.shares[0]['id'], shares[0]['id'])
@decorators.idempotent_id('4582de51-1dcd-4c44-b550-eca9a9685038')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
@ -276,6 +286,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
self.assertEqual(
filters['share_network_id'], share['share_network_id'])
@decorators.idempotent_id('645aebc4-55ac-406d-b7ab-5614c4fc12e6')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(
CONF.share.capability_create_share_from_snapshot_support,
@ -292,6 +303,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])
@decorators.idempotent_id('87659cee-4692-412a-9bfe-06fc97d30ba0')
@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'}
@ -304,6 +316,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
sorted_list = [share['created_at'] for share in shares]
self.assertEqual(sorted(sorted_list), sorted_list)
@decorators.idempotent_id('631f4226-f1ea-47b1-a472-8f12da2d05c4')
@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
@ -311,6 +324,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
shares = self.shares_client.list_shares_with_detail(params)
self.assertEqual(self.share_name, shares[0]["name"])
@decorators.idempotent_id('d0dae9e5-a826-48e4-b7b7-24b08ad5a7cb')
@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
@ -318,6 +332,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
shares = self.shares_client.list_shares_with_detail(params)
self.assertEqual(0, len(shares))
@decorators.idempotent_id('8eac9b63-666f-4c52-8c5f-58b1fdf201e2')
@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
@ -327,6 +342,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
for share in shares:
self.assertEqual(params["status"], share["status"])
@decorators.idempotent_id('e94f41c0-f6c4-4d77-b4f9-2c796c27e348')
@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
@ -334,6 +350,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
shares = self.shares_client.list_shares_with_detail(params)
self.assertEqual(0, len(shares))
@decorators.idempotent_id('d24a438e-4622-48ac-993e-a30d04746745')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -364,6 +381,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
get["share_id"]))
self.assertEqual(self.shares[0]["id"], get["share_id"], msg)
@decorators.idempotent_id('9fae88a5-dd95-40ba-96e2-ac3694cf455f')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -381,6 +399,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
msg = "expected id lists %s times in share list" % (len(gen))
self.assertEqual(1, len(gen), msg)
@decorators.idempotent_id('84013334-5985-4067-8b54-4c633f6022f3')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")

View File

@ -17,6 +17,7 @@ import ddt
from oslo_utils import uuidutils
import six
from tempest import config
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -95,6 +96,7 @@ class SnapshotExportLocationsTest(base.BaseSharesMixedTest):
self.assertTrue(uuidutils.is_uuid_like(
export_location['share_snapshot_instance_id']))
@decorators.idempotent_id('18287f50-0e12-463d-906f-5c7cba256288')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_list_snapshot_export_location(self):
export_locations = (
@ -104,6 +106,7 @@ class SnapshotExportLocationsTest(base.BaseSharesMixedTest):
for el in export_locations:
self._verify_export_location_structure(el)
@decorators.idempotent_id('6272b60b-31a1-41c1-86f5-af28926898e6')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_get_snapshot_export_location(self):
export_locations = (
@ -115,6 +118,7 @@ class SnapshotExportLocationsTest(base.BaseSharesMixedTest):
self.snapshot['id'], export_location['id'])
self._verify_export_location_structure(el, detail=True)
@decorators.idempotent_id('03be6418-5ba3-4919-a798-89d7e5ffb925')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_get_snapshot_instance_export_location(self):
for snapshot_instance in self.snapshot_instances:
@ -126,6 +130,7 @@ class SnapshotExportLocationsTest(base.BaseSharesMixedTest):
snapshot_instance['id'], el['id'])
self._verify_export_location_structure(el, detail=True)
@decorators.idempotent_id('cdf444ea-95a3-4f7b-ae48-6b027a6b9529')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_snapshot_contains_all_export_locations_of_all_snapshot_instances(
self):

View File

@ -14,6 +14,7 @@
# under the License.
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -56,6 +57,7 @@ class SnapshotExportLocationsNegativeTest(base.BaseSharesMixedTest):
cls.snapshot_instances = cls.admin_client.list_snapshot_instances(
snapshot_id=cls.snapshot['id'])
@decorators.idempotent_id('53f0f184-7398-4e7a-ac21-fa432570db7f')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_get_inexistent_snapshot_export_location(self):
self.assertRaises(
@ -65,6 +67,7 @@ class SnapshotExportLocationsNegativeTest(base.BaseSharesMixedTest):
"fake-inexistent-snapshot-export-location-id",
)
@decorators.idempotent_id('43229517-bf93-4be7-9f89-a69034d2f03c')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_list_snapshot_export_locations_by_different_project_user(self):
self.assertRaises(
@ -73,6 +76,7 @@ class SnapshotExportLocationsNegativeTest(base.BaseSharesMixedTest):
self.snapshot['id']
)
@decorators.idempotent_id('66839514-796a-4ee9-a8ed-7614521d01d5')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_get_snapshot_export_location_by_different_project_user(self):
export_locations = (
@ -88,6 +92,7 @@ class SnapshotExportLocationsNegativeTest(base.BaseSharesMixedTest):
self.snapshot['id'],
export_location['id'])
@decorators.idempotent_id('52e0b807-7b29-4795-960a-518bcadc1503')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_get_inexistent_snapshot_instance_export_location(self):
for snapshot_instance in self.snapshot_instances:
@ -98,6 +103,7 @@ class SnapshotExportLocationsNegativeTest(base.BaseSharesMixedTest):
"fake-inexistent-snapshot-export-location-id",
)
@decorators.idempotent_id('3f4e2a0e-1522-47fb-b770-9d7a0651dde2')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_get_snapshot_instance_export_location_by_member(self):
for snapshot_instance in self.snapshot_instances:
@ -133,6 +139,7 @@ class SnapshotExportLocationsAPIOnlyNegativeTest(base.BaseSharesMixedTest):
cls.admin_member_client = (
cls.admin_project_member_client.shares_v2_client)
@decorators.idempotent_id('37901216-b574-4786-9b1d-9b1ccdf123d2')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_list_export_locations_by_nonexistent_snapshot(self):
self.assertRaises(
@ -141,6 +148,7 @@ class SnapshotExportLocationsAPIOnlyNegativeTest(base.BaseSharesMixedTest):
"fake-inexistent-snapshot-id",
)
@decorators.idempotent_id('c2aa3770-c061-4b49-83ac-ab29773c2e0c')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_list_export_locations_by_nonexistent_snapshot_instance(self):
self.assertRaises(
@ -149,6 +157,7 @@ class SnapshotExportLocationsAPIOnlyNegativeTest(base.BaseSharesMixedTest):
"fake-inexistent-snapshot-instance-id",
)
@decorators.idempotent_id('74d5d46d-8161-4e17-acbc-812248d6d694')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_list_inexistent_snapshot_instance_export_locations_by_member(
self):

View File

@ -16,6 +16,7 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -130,6 +131,7 @@ class ManageNFSSnapshotTest(base.BaseSharesAdminTest):
self.shares_v2_client.get_snapshot,
get_snapshot['id'])
@decorators.idempotent_id('5fb65a19-fb73-4b5a-9210-010f93e0304f')
@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):

View File

@ -16,6 +16,7 @@
import six
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -64,6 +65,7 @@ class ManageNFSSnapshotNegativeTest(base.BaseSharesAdminTest):
share_protocol=cls.protocol
)
@decorators.idempotent_id('df7ac126-2c13-4902-b9c0-d103c71680ee')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_manage_not_found(self):
# Manage non-existing snapshot fails
@ -74,6 +76,7 @@ class ManageNFSSnapshotNegativeTest(base.BaseSharesAdminTest):
'fake-provider-location',
)
@decorators.idempotent_id('645a88f7-1eec-49a2-a232-757dc2112dd8')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_manage_already_exists(self):
# Manage already existing snapshot fails
@ -95,6 +98,7 @@ class ManageNFSSnapshotNegativeTest(base.BaseSharesAdminTest):
# Delete snapshot
self._delete_snapshot_and_wait(snap)
@decorators.idempotent_id('e94706f4-9c72-41f1-9ed4-09eb93d0b36f')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_manage_invalid_provider_location(self):
# Manage a snapshot with wrong provider location fails
@ -133,6 +137,7 @@ class ManageNFSSnapshotNegativeTest(base.BaseSharesAdminTest):
)
self._delete_snapshot_and_wait(managed_snap)
@decorators.idempotent_id('d0049626-a524-4c8a-a58a-006ae2cdfea5')
@testtools.skipUnless(CONF.share.multitenancy_enabled,
'Multitenancy tests are disabled.')
@utils.skip_if_microversion_not_supported("2.48")

View File

@ -52,6 +52,7 @@ class UserMessageTest(base.BaseSharesAdminTest):
self.message = self.create_user_message()
@decorators.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@decorators.idempotent_id('37127e11-7aa7-46b2-ab05-e3bf36d94fd8')
def test_list_messages(self):
body = self.shares_v2_client.list_messages()
self.assertIsInstance(body, list)
@ -60,6 +61,7 @@ class UserMessageTest(base.BaseSharesAdminTest):
self.assertEqual(set(MESSAGE_KEYS), set(message.keys()))
@decorators.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@decorators.idempotent_id('ff938d3e-9cdd-470a-b091-d389be7be755')
def test_list_messages_sorted_and_paginated(self):
self.create_user_message()
self.create_user_message()
@ -77,6 +79,7 @@ class UserMessageTest(base.BaseSharesAdminTest):
self.assertEqual(ids, sorted(ids))
@decorators.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@decorators.idempotent_id('292b0a2c-f066-48a6-9492-8dede87ee7b4')
def test_list_messages_filtered(self):
self.create_user_message()
params = {'resource_id': self.message['resource_id']}
@ -86,6 +89,7 @@ class UserMessageTest(base.BaseSharesAdminTest):
self.assertEqual([self.message['id']], ids)
@decorators.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@decorators.idempotent_id('a92971c5-a72a-4de2-8e9b-dc612b798a7a')
def test_show_message(self):
self.addCleanup(self.shares_v2_client.delete_message,
self.message['id'])
@ -110,6 +114,7 @@ class UserMessageTest(base.BaseSharesAdminTest):
self.assertEqual(set(MESSAGE_KEYS), set(message.keys()))
@decorators.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@decorators.idempotent_id('88b2db98-8e33-4552-9225-c19a3b6f18e0')
def test_delete_message(self):
self.shares_v2_client.delete_message(self.message['id'])
self.shares_v2_client.wait_for_resource_deletion(
@ -117,6 +122,7 @@ class UserMessageTest(base.BaseSharesAdminTest):
@decorators.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@base.skip_if_microversion_not_supported(QUERY_BY_TIMESTAMP_MICROVERSION)
@decorators.idempotent_id('2ed0c40e-cdaa-471b-97d4-5ebe3fb040e9')
def test_list_messages_with_since_and_before_filters(self):
new_message = self.create_user_message()
created_at_1 = timeutils.parse_strtime(self.message['created_at'])

View File

@ -36,24 +36,28 @@ class UserMessageNegativeTest(base.BaseSharesMixedTest):
self.message = self.create_user_message()
@decorators.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
@decorators.idempotent_id('cb6c0dbd-a3cb-404b-a358-7cec3596aff4')
def test_show_message_of_other_tenants(self):
self.assertRaises(lib_exc.NotFound,
self.alt_shares_v2_client.get_message,
self.message['id'])
@decorators.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
@decorators.idempotent_id('f493a1f9-43e1-4a85-a673-8520d5a81f68')
def test_show_nonexistent_message(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.get_message,
six.text_type(uuidutils.generate_uuid()))
@decorators.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
@decorators.idempotent_id('2f5be1aa-974b-4f6a-ae3a-084578e64f82')
def test_delete_message_of_other_tenants(self):
self.assertRaises(lib_exc.NotFound,
self.alt_shares_v2_client.delete_message,
self.message['id'])
@decorators.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
@decorators.idempotent_id('9029cc9f-b904-4e58-b268-adf7a93cc1f1')
def test_delete_nonexistent_message(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.delete_message,
@ -61,6 +65,7 @@ class UserMessageNegativeTest(base.BaseSharesMixedTest):
@decorators.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
@base.skip_if_microversion_not_supported(QUERY_BY_TIMESTAMP_MICROVERSION)
@decorators.idempotent_id('03e80563-1a36-408e-baa8-0e3ed46f7a0a')
def test_list_messages_with_invalid_time_format(self):
params_key = ['created_since', 'created_before']
for key in params_key:

View File

@ -15,6 +15,7 @@
import ddt
from tempest import config
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.common import constants
@ -76,6 +77,7 @@ class AccessRulesMetadataTest(base.BaseSharesMixedTest):
cls.share["id"], cls.access_type,
cls.access_to[cls.access_type].pop(), 'rw', metadata=cls.md1)
@decorators.idempotent_id('4c8e0236-2e7b-4337-be3c-17b51a738644')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_set_get_delete_access_metadata(self):
data = {"key1": "v" * 255, "k" * 255: "value2"}
@ -102,6 +104,7 @@ class AccessRulesMetadataTest(base.BaseSharesMixedTest):
self.shares_v2_client.wait_for_resource_deletion(
rule_id=access["id"], share_id=self.share["id"])
@decorators.idempotent_id('8c294d7d-0702-49ce-b964-0945ec323370')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_update_metadata_by_key(self):
md2 = {"key7": "value7", "key2": "value6_new"}
@ -116,6 +119,7 @@ class AccessRulesMetadataTest(base.BaseSharesMixedTest):
self.md1.update(md2)
self.assertEqual(self.md1, get_access['metadata'])
@decorators.idempotent_id('c97cc976-2c2f-4db3-ba07-cd04af29c9f4')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_list_access_filter_by_metadata(self):
data = {"key3": "v3", "key4": "value4"}

View File

@ -15,6 +15,7 @@
import ddt
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -67,6 +68,7 @@ class AccessesMetadataNegativeTest(base.BaseSharesMixedTest):
cls.share["id"], cls.access_type, cls.access_to,
'rw', metadata={u"key1": u"value1"})
@decorators.idempotent_id('d2d41db8-ae00-4641-a5ec-499cee1877f1')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data({'data': {"": "value"}}, {'data': {"k" * 256: "value"}},
{'data': {"key": "x" * 1024}})
@ -76,6 +78,7 @@ class AccessesMetadataNegativeTest(base.BaseSharesMixedTest):
self.shares_v2_client.update_access_metadata,
self.access["id"], data)
@decorators.idempotent_id('53dc2752-687d-4895-bc9e-518c3bed29d0')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_try_delete_unexisting_access_metadata(self):
self.assertRaises(lib_exc.NotFound,

View File

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -28,6 +29,7 @@ class AvailabilityZonesTest(base.BaseSharesTest):
for key in keys:
self.assertIn(key, az)
@decorators.idempotent_id('202f20d3-1afa-40ea-a5e6-8b7bda40e6cf')
@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
@ -35,6 +37,7 @@ class AvailabilityZonesTest(base.BaseSharesTest):
azs = self.shares_client.list_availability_zones()
self._list_availability_zones_assertions(azs)
@decorators.idempotent_id('7054f2f4-bc77-4d60-82a6-2f23b93d281e')
@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):
@ -44,6 +47,7 @@ class AvailabilityZonesTest(base.BaseSharesTest):
url='os-availability-zone', version='2.6')
self._list_availability_zones_assertions(azs)
@decorators.idempotent_id('4caadb86-2988-4adb-b705-aece99235c1e')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@base.skip_if_microversion_not_supported("2.7")
def test_list_availability_zones(self):

View File

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -27,6 +28,7 @@ class AvailabilityZonesNegativeTest(base.BaseSharesTest):
super(AvailabilityZonesNegativeTest, cls).skip_checks()
utils.check_skip_if_microversion_not_supported('2.7')
@decorators.idempotent_id('050fa9fb-4cc8-4064-9e91-bb169fca03db')
@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
@ -38,6 +40,7 @@ class AvailabilityZonesNegativeTest(base.BaseSharesTest):
version='2.7',
)
@decorators.idempotent_id('133ffc40-bff1-491a-a230-189cddd66e29')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_list_availability_zones_api_not_found(self):
self.assertRaises(

View File

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -20,6 +21,7 @@ from manila_tempest_tests.tests.api import base
class ExtensionsTest(base.BaseSharesTest):
@decorators.idempotent_id('befd2105-c9f6-4eca-a693-9900eb0fb37a')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_extensions(self):

View File

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -20,6 +21,7 @@ from manila_tempest_tests.tests.api import base
class ShareLimitsTest(base.BaseSharesTest):
@decorators.idempotent_id('239903d2-f1cb-4bec-b456-d57456308244')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_limits_keys(self):
@ -44,6 +46,7 @@ class ShareLimitsTest(base.BaseSharesTest):
]
[self.assertIn(key, limits["absolute"].keys()) for key in abs_keys]
@decorators.idempotent_id('fea1a10e-6bcb-46eb-bbba-f6f0a8d4f377')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_limits_values(self):

View File

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -30,6 +31,7 @@ class SharesMetadataTest(base.BaseSharesMixedTest):
# create share
cls.share = cls.create_share(share_type_id=cls.share_type_id)
@decorators.idempotent_id('9070249f-6e94-4a38-a036-08debee547c3')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_set_metadata_in_share_creation(self):
@ -46,6 +48,7 @@ class SharesMetadataTest(base.BaseSharesMixedTest):
# verify metadata
self.assertEqual(md, metadata)
@decorators.idempotent_id('2725ab8e-cc04-4032-9393-74726ba43eb7')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_set_get_delete_metadata(self):
@ -72,6 +75,7 @@ class SharesMetadataTest(base.BaseSharesMixedTest):
get_metadata = self.shares_client.get_metadata(share["id"])
self.assertEqual({}, get_metadata)
@decorators.idempotent_id('c94851f4-2559-4712-9297-9912db1da7ff')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_set_and_update_metadata_by_key(self):
@ -94,6 +98,7 @@ class SharesMetadataTest(base.BaseSharesMixedTest):
# verify metadata
self.assertEqual(md2, get_md)
@decorators.idempotent_id('698ba406-493f-4c69-a093-273676fed438')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_set_metadata_min_size_key(self):
data = {"k": "value"}
@ -103,6 +108,7 @@ class SharesMetadataTest(base.BaseSharesMixedTest):
body_get = self.shares_client.get_metadata(self.share["id"])
self.assertEqual(data['k'], body_get.get('k'))
@decorators.idempotent_id('34c5bd96-ced7-42ef-a114-570cc63cf81d')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_set_metadata_max_size_key(self):
max_key = "k" * 255
@ -114,6 +120,7 @@ class SharesMetadataTest(base.BaseSharesMixedTest):
self.assertIn(max_key, body_get)
self.assertEqual(data[max_key], body_get.get(max_key))
@decorators.idempotent_id('c776ab40-f75e-4d9f-abcf-a8f628a25991')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_set_metadata_min_size_value(self):
data = {"key": "v"}
@ -123,6 +130,7 @@ class SharesMetadataTest(base.BaseSharesMixedTest):
body_get = self.shares_client.get_metadata(self.share["id"])
self.assertEqual(data['key'], body_get['key'])
@decorators.idempotent_id('759ec4ab-2537-44ad-852b-1af85c6ca933')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_set_metadata_max_size_value(self):
max_value = "v" * 1023
@ -133,6 +141,7 @@ class SharesMetadataTest(base.BaseSharesMixedTest):
body_get = self.shares_client.get_metadata(self.share["id"])
self.assertEqual(data['key'], body_get['key'])
@decorators.idempotent_id('c5ca19ba-3595-414a-8ff9-fbc88cd801ba')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_upd_metadata_min_size_key(self):
data = {"k": "value"}
@ -142,6 +151,7 @@ class SharesMetadataTest(base.BaseSharesMixedTest):
body_get = self.shares_client.get_metadata(self.share["id"])
self.assertEqual(data, body_get)
@decorators.idempotent_id('5eff5619-b7cd-42f1-85e0-47d3d47098dd')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_upd_metadata_max_size_key(self):
max_key = "k" * 255
@ -152,6 +162,7 @@ class SharesMetadataTest(base.BaseSharesMixedTest):
body_get = self.shares_client.get_metadata(self.share["id"])
self.assertEqual(data, body_get)
@decorators.idempotent_id('44a572f1-6b5c-49d0-8f2e-1583ec3428d8')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_upd_metadata_min_size_value(self):
data = {"key": "v"}
@ -161,6 +172,7 @@ class SharesMetadataTest(base.BaseSharesMixedTest):
body_get = self.shares_client.get_metadata(self.share["id"])
self.assertEqual(data, body_get)
@decorators.idempotent_id('694d95e1-ba8c-49fc-a888-6f9f0d51d77d')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_upd_metadata_max_size_value(self):
max_value = "v" * 1023

View File

@ -14,6 +14,7 @@
# under the License.
import ddt
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -23,6 +24,7 @@ from manila_tempest_tests.tests.api import base
@ddt.ddt
class SharesMetadataAPIOnlyNegativeTest(base.BaseSharesTest):
@decorators.idempotent_id('22aecf50-0d98-4b97-82b8-599559f7692f')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@ddt.data(True, False)
def test_try_set_metadata_to_unexisting_share(self, is_v2_client):
@ -32,6 +34,7 @@ class SharesMetadataAPIOnlyNegativeTest(base.BaseSharesTest):
client.set_metadata,
"wrong_share_id", md)
@decorators.idempotent_id('7df0acd7-03f8-45c4-8c72-eb6932af70b1')
@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):
@ -54,18 +57,21 @@ class SharesMetadataNegativeTest(base.BaseSharesMixedTest):
# create share
cls.share = cls.create_share(share_type_id=cls.share_type_id)
@decorators.idempotent_id('0cb7f160-4fa4-4d30-8a46-373ddae5844d')
@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"})
@decorators.idempotent_id('759ca34d-1c87-43f3-8da2-8e1d373049ac')
@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"})
@decorators.idempotent_id('94c7ebb3-14c3-4ff1-9839-ae3acb318cd0')
@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
@ -74,6 +80,7 @@ class SharesMetadataNegativeTest(base.BaseSharesMixedTest):
self.shares_client.set_metadata,
self.share["id"], md)
@decorators.idempotent_id('33ef3047-6ca3-4547-a681-b52314382dcb')
@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
@ -82,6 +89,7 @@ class SharesMetadataNegativeTest(base.BaseSharesMixedTest):
self.shares_client.update_all_metadata,
self.share["id"], md)
@decorators.idempotent_id('1114970a-1b45-4c56-b20a-e13e1764e3c4')
@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
@ -90,6 +98,7 @@ class SharesMetadataNegativeTest(base.BaseSharesMixedTest):
self.shares_client.set_metadata,
self.share["id"], md)
@decorators.idempotent_id('c2eddcf0-cf81-4f9f-b06d-c9165ab8553e')
@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
@ -98,12 +107,14 @@ class SharesMetadataNegativeTest(base.BaseSharesMixedTest):
self.shares_client.update_all_metadata,
self.share["id"], md)
@decorators.idempotent_id('14df3262-5a2b-4de4-b335-422329b22b07')
@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,
self.share["id"], "wrong_key")
@decorators.idempotent_id('c6c70d55-7ed0-439f-ae34-f19af55361f6')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(("foo.xml", False), ("foo.json", False),
("foo.xml", True), ("foo.json", True))

View File

@ -15,6 +15,7 @@
# under the License.
from tempest import config
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -33,6 +34,7 @@ class MicroversionsTest(base.BaseSharesTest):
Sends HTTP GET requests to the version API to validate microversions.
"""
@decorators.idempotent_id('1b20943e-a398-49dd-a69d-513ce6ea01b4')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_microversions_root_version(self):
@ -55,6 +57,7 @@ class MicroversionsTest(base.BaseSharesTest):
self.assertEqual(_MIN_API_VERSION, v2.get('min_version'))
self.assertNotIn(v2.get('version'), [None, ''])
@decorators.idempotent_id('6ccaae5f-2382-45a5-a844-6d31837beba8')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_microversions_v1_no_version(self):
@ -73,6 +76,7 @@ class MicroversionsTest(base.BaseSharesTest):
self.assertEqual('', version_list[0].get('min_version'))
self.assertEqual('', version_list[0].get('version'))
@decorators.idempotent_id('7b7e4ddf-08bb-4764-a94f-5f377da3b2cb')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_microversions_v1_with_version(self):
@ -91,6 +95,7 @@ class MicroversionsTest(base.BaseSharesTest):
self.assertEqual('', version_list[0].get('min_version'))
self.assertEqual('', version_list[0].get('version'))
@decorators.idempotent_id('9a8bd7fd-f9d0-4fc6-8e1c-0178d87ec7c1')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_microversions_v2_no_version(self):
@ -110,6 +115,7 @@ class MicroversionsTest(base.BaseSharesTest):
self.assertEqual(_MIN_API_VERSION, version_list[0].get('min_version'))
self.assertNotIn(version_list[0].get('version'), [None, ''])
@decorators.idempotent_id('101574fd-9d47-4bd6-97f6-cde219f089ca')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_microversions_v2_min_version(self):
@ -129,6 +135,7 @@ class MicroversionsTest(base.BaseSharesTest):
self.assertEqual(_MIN_API_VERSION, version_list[0].get('min_version'))
self.assertNotIn(version_list[0].get('version'), [None, ''])
@decorators.idempotent_id('e0766a36-b57c-46f8-b474-a38b74f3b9ed')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_microversions_v2_max_version(self):
@ -148,6 +155,7 @@ class MicroversionsTest(base.BaseSharesTest):
self.assertEqual(_MIN_API_VERSION, version_list[0].get('min_version'))
self.assertNotIn(version_list[0].get('version'), [None, ''])
@decorators.idempotent_id('038ff428-edde-43ff-ae29-1b18676b61d5')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_microversions_v2_invalid_version(self):
@ -156,6 +164,7 @@ class MicroversionsTest(base.BaseSharesTest):
self.assertEqual(400, resp.status)
@decorators.idempotent_id('0d82fc0b-d24d-4d07-ab43-bd0895ec0c4c')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_microversions_v2_unacceptable_version(self):

View File

@ -17,6 +17,7 @@ import itertools
import ddt
from tempest import config
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -40,6 +41,7 @@ class SharesQuotasTest(base.BaseSharesTest):
cls.user_id = cls.shares_v2_client.user_id
cls.tenant_id = cls.shares_v2_client.tenant_id
@decorators.idempotent_id('a4649f11-41d0-4e73-ab5a-1466f2339b2f')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data('shares_client', 'shares_v2_client')
def test_default_quotas(self, client_name):
@ -54,6 +56,7 @@ class SharesQuotasTest(base.BaseSharesTest):
self.assertGreater(int(quotas["share_replicas"]), -2)
self.assertGreater(int(quotas["replica_gigabytes"]), -2)
@decorators.idempotent_id('19525293-2b32-48c3-a7cd-cab279ac4631')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data('shares_client', 'shares_v2_client')
def test_show_quotas(self, client_name):
@ -68,6 +71,7 @@ class SharesQuotasTest(base.BaseSharesTest):
self.assertGreater(int(quotas["share_replicas"]), -2)
self.assertGreater(int(quotas["replica_gigabytes"]), -2)
@decorators.idempotent_id('1e670af7-9734-42a8-97b7-3080526f3aca')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data('shares_client', 'shares_v2_client')
def test_show_quotas_for_user(self, client_name):
@ -88,6 +92,7 @@ class SharesQuotasTest(base.BaseSharesTest):
["2.25", "2.53", CONF.share.max_api_microversion]), (True, False))
)
@ddt.unpack
@decorators.idempotent_id('795614f6-4a18-47d5-b817-0b294e9d4c48')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_show_quotas_detail(self, microversion, with_user):
self.skip_if_microversion_not_supported(microversion)
@ -108,6 +113,7 @@ class SharesQuotasTest(base.BaseSharesTest):
self.assertIn(inner, outer_keys)
self.assertGreater(int(quotas[outer][inner]), -2)
@decorators.idempotent_id('7bd5ac42-9fcb-477f-a253-02cde2bde661')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@base.skip_if_microversion_not_supported(PRE_SHARE_REPLICAS_MICROVERSION)
def test_quota_detail_2_52_no_share_replica_quotas(self):

View File

@ -15,6 +15,7 @@
import ddt
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -33,17 +34,20 @@ class SharesQuotasNegativeTest(base.BaseSharesTest):
raise cls.skipException(msg)
super(SharesQuotasNegativeTest, cls).resource_setup()
@decorators.idempotent_id('d0dfe81d-8e8c-4847-a55f-95ba8a3d922c')
@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, "")
@decorators.idempotent_id('e7dbc580-1857-4f88-8886-988dc2f2c7b9')
@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)
@decorators.idempotent_id('f1c8e16f-5406-4389-a29c-547cca8a56e0')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_update_quotas_with_user(self):
self.assertRaises(lib_exc.Forbidden,
@ -52,6 +56,7 @@ class SharesQuotasNegativeTest(base.BaseSharesTest):
shares=9)
@ddt.data("2.6", "2.7", "2.24")
@decorators.idempotent_id('0f0033b3-357e-42e6-9c94-cac650e1cd50')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_get_quotas_detail_with_wrong_version(self, microversion):
self.assertRaises(lib_exc.NotFound,

View File

@ -15,6 +15,7 @@
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
import testtools
from testtools import testcase as tc
@ -151,6 +152,7 @@ class ReplicationTest(base.BaseSharesMixedTest):
raise self.skipException(
msg % ','.join(constants.REPLICATION_PROMOTION_CHOICES))
@decorators.idempotent_id('8858617f-292d-4e5c-9e15-794b7f1b2e3c')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_add_delete_share_replica(self):
# Create the replica
@ -159,6 +161,7 @@ class ReplicationTest(base.BaseSharesMixedTest):
# Delete the replica
self.delete_share_replica(share_replica["id"])
@decorators.idempotent_id('58c3faf4-6c97-4fec-9a9b-7cff0d2035cd')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
@ -181,6 +184,7 @@ class ReplicationTest(base.BaseSharesMixedTest):
# Delete subnet
self.shares_v2_client.delete_subnet(self.sn_id, subnet['id'])
@decorators.idempotent_id('00e12b41-b95d-494a-99be-e584aae10f5c')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_add_access_rule_create_replica_delete_rule(self):
# Add access rule to the share
@ -204,6 +208,7 @@ class ReplicationTest(base.BaseSharesMixedTest):
self.shares_v2_client.wait_for_resource_deletion(
rule_id=rule["id"], share_id=self.shares[0]['id'])
@decorators.idempotent_id('3af3f19a-1195-464e-870b-1a3918914f1b')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_create_replica_add_access_rule_delete_replica(self):
access_type, access_to = self._get_access_rule_data_from_config()
@ -221,6 +226,7 @@ class ReplicationTest(base.BaseSharesMixedTest):
# Delete the replica
self.delete_share_replica(share_replica["id"])
@decorators.idempotent_id('a542c179-ea41-4bc0-bd80-e06eaddf5253')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@testtools.skipUnless(CONF.share.run_multiple_share_replicas_tests,
'Multiple share replicas tests are disabled.')
@ -252,6 +258,7 @@ class ReplicationTest(base.BaseSharesMixedTest):
self.assertIn(share_replica1["id"], replica_ids)
self.assertIn(share_replica2["id"], replica_ids)
@decorators.idempotent_id('98b7c1d6-02e8-425a-b697-db2d2671fa11')
@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
@ -261,6 +268,7 @@ class ReplicationTest(base.BaseSharesMixedTest):
share["id"])[0]
self._verify_in_sync_replica_promotion(share, original_replica)
@decorators.idempotent_id('3af912f4-b5d7-4241-b2b3-bdf12ff398a4')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_add_rule_promote_share_replica_verify_rule(self):
# Verify the access rule stays intact after share replica promotion
@ -285,6 +293,7 @@ class ReplicationTest(base.BaseSharesMixedTest):
self.assertEqual(access_to, rules_list[0]["access_to"])
self.assertEqual('ro', rules_list[0]["access_level"])
@decorators.idempotent_id('7904e3c7-e6d0-472d-b9c9-c0772b4f9f1b')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_not_supported("2.48")
def test_share_type_azs_share_replicas(self):
@ -307,6 +316,7 @@ class ReplicationTest(base.BaseSharesMixedTest):
self.assertIn(share['availability_zone'], self.zones)
self.assertIn(replica['availability_zone'], self.zones)
@decorators.idempotent_id('b5ade58b-cb81-47eb-966b-28e6d85b5568')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_promote_and_promote_back(self):
# Test promote back and forth between 2 share replicas
@ -345,6 +355,7 @@ class ReplicationTest(base.BaseSharesMixedTest):
new_replica['id'], constants.REPLICATION_STATE_IN_SYNC,
status_attr='replica_state')
@decorators.idempotent_id('1452156b-75a5-4f3c-a921-834732a03b0a')
@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.
@ -439,6 +450,7 @@ class ReplicationActionsTest(base.BaseSharesMixedTest):
replica['id'], len(replica_id_list))
self.assertEqual(1, len(replica_id_list), msg)
@decorators.idempotent_id('abe0e49d-0b94-4b81-a220-ab047712492d')
@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"])
@ -450,6 +462,7 @@ class ReplicationActionsTest(base.BaseSharesMixedTest):
'expected %s, got %s.' % (replica["id"],
detail_keys, actual_keys))
@decorators.idempotent_id('f5225fb7-fcbe-4825-bf5b-0e11c2d26e03')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_detail_list_share_replicas_for_share(self):
# List replicas for share
@ -462,6 +475,7 @@ class ReplicationActionsTest(base.BaseSharesMixedTest):
# Verify keys
self._validate_replica_list(replica_list)
@decorators.idempotent_id('e39aeb5d-fe4b-4896-8615-e6e7290bcb56')
@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
@ -474,6 +488,7 @@ class ReplicationActionsTest(base.BaseSharesMixedTest):
# Verify keys
self._validate_replica_list(replica_list)
@decorators.idempotent_id('8d11848a-7766-41e5-af09-6121e5bad447')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_summary_list_share_replicas_for_all_shares(self):
# List replicas

View File

@ -13,6 +13,7 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
import testtools
from testtools import testcase as tc
@ -118,6 +119,7 @@ class ReplicationExportLocationsTest(base.BaseSharesMixedTest):
for export in expected_exports:
self.assertIn(export['path'], share_export_paths)
@decorators.idempotent_id('da22cfb8-7dd8-4bf1-87fc-a1f7b51ebf8e')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(*set(['2.46', '2.47', LATEST_MICROVERSION]))
def test_replicated_share_export_locations(self, version):
@ -135,6 +137,7 @@ class ReplicationExportLocationsTest(base.BaseSharesMixedTest):
primary_replica_exports,
share_exports, version)
@decorators.idempotent_id('58430f57-c6eb-44e2-9583-eecb1dd10594')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(*set(['2.46', '2.47', LATEST_MICROVERSION]))
@testtools.skipUnless(
@ -184,6 +187,7 @@ class ReplicationExportLocationsTest(base.BaseSharesMixedTest):
# Delete the secondary (the 'active' replica before promotion)
self.delete_share_replica(primary_replica['id'])
@decorators.idempotent_id('10ab6304-a1cd-4e60-90e3-7f9358b8808a')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_not_supported('2.47')
def test_replica_export_locations(self):

View File

@ -12,6 +12,7 @@
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -63,6 +64,7 @@ class ReplicationExportLocationsNegativeTest(base.BaseSharesMixedTest):
cls.share_zone = cls.zones[0]
cls.replica_zone = cls.zones[-1]
@decorators.idempotent_id('7a6318c2-71e9-45d2-aafe-5dcc0810a14a')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_not_supported('2.47')
@testtools.skipUnless(
@ -85,6 +87,7 @@ class ReplicationExportLocationsNegativeTest(base.BaseSharesMixedTest):
self.shares_v2_client.get_share_export_location,
share['id'], export['id'])
@decorators.idempotent_id('f1b89548-4da7-4ce1-a3c0-363a6c1ea726')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_not_supported('2.47')
def test_get_replica_export_location_for_non_replica(self):
@ -101,6 +104,7 @@ class ReplicationExportLocationsNegativeTest(base.BaseSharesMixedTest):
self.shares_v2_client.list_share_replica_export_locations,
instance['id'])
@decorators.idempotent_id('f60d7eec-ec29-4767-985f-ff8c9e771cae')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@utils.skip_if_microversion_not_supported('2.47')
def test_list_replica_export_locations_for_invalid_replica(self):
@ -110,6 +114,7 @@ class ReplicationExportLocationsNegativeTest(base.BaseSharesMixedTest):
self.shares_v2_client.list_share_replica_export_locations,
'invalid-replica-id')
@decorators.idempotent_id('29ec890e-e324-4487-b2e3-f87642b6a58d')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_not_supported('2.47')
def test_get_replica_export_location_for_invalid_export_id(self):

View File

@ -15,6 +15,7 @@
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -89,6 +90,7 @@ class ReplicationNegativeTest(ReplicationNegativeBase):
raise self.skipException(
msg % ','.join(constants.REPLICATION_PROMOTION_CHOICES))
@decorators.idempotent_id('90c5947d-b857-406c-b7dc-7010cbee6482')
@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
@ -103,6 +105,7 @@ class ReplicationNegativeTest(ReplicationNegativeBase):
share['id'],
self.replica_zone)
@decorators.idempotent_id('d14ba73e-4f13-451e-86d5-ffeb188e51b7')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_add_replica_to_share_with_error_state(self):
# Set "error" state
@ -116,12 +119,14 @@ class ReplicationNegativeTest(ReplicationNegativeBase):
self.share1['id'],
self.replica_zone)
@decorators.idempotent_id('94b41c28-e7a9-4f19-9315-4a57210141af')
@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)
@decorators.idempotent_id('6fbf984d-4efa-41d7-88bf-11ef2f078c02')
@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,
@ -130,6 +135,7 @@ class ReplicationNegativeTest(ReplicationNegativeBase):
self.shares_v2_client.delete_share,
self.share1["id"])
@decorators.idempotent_id('b9c2e57b-f1ae-475c-9d0b-df75dbe93b61')
@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
@ -148,6 +154,7 @@ class ReplicationNegativeTest(ReplicationNegativeBase):
self.shares_v2_client.promote_share_replica,
replica['id'])
@decorators.idempotent_id('e525c3d0-9f45-489f-8e78-ed9e3ac540f7')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_promote_active_share_replica(self):
# Test promote active share_replica
@ -157,6 +164,7 @@ class ReplicationNegativeTest(ReplicationNegativeBase):
self.shares_v2_client.promote_share_replica(self.instance_id1,
expected_status=200)
@decorators.idempotent_id('37dc3f7e-5a36-4020-ae1b-3c5e6771f024')
@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
@ -174,6 +182,7 @@ class ReplicationNegativeTest(ReplicationNegativeBase):
# Try promoting the replica
self.shares_v2_client.promote_share_replica(replica['id'])
@decorators.idempotent_id('600a13d2-5cf0-482e-97af-9f598b55a407')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_add_access_rule_share_replica_error_status(self):
access_type, access_to = self._get_access_rule_data_from_config()
@ -190,6 +199,7 @@ class ReplicationNegativeTest(ReplicationNegativeBase):
self.admin_client.create_access_rule,
self.share1["id"], access_type, access_to, 'ro')
@decorators.idempotent_id('91b93b71-4048-412b-bb42-0fe88edfb987')
@testtools.skipUnless(CONF.share.run_host_assisted_migration_tests or
CONF.share.run_driver_assisted_migration_tests,
"Share migration tests are disabled.")
@ -211,6 +221,7 @@ class ReplicationNegativeTest(ReplicationNegativeBase):
lib_exc.Conflict, self.admin_client.migrate_share,
self.share1['id'], dest_host)
@decorators.idempotent_id('bf01bcfc-57cb-4e56-957f-8aa9f1b9be1b')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.48")
def test_try_add_replica_share_type_azs_unsupported_az(self):
@ -224,6 +235,7 @@ class ReplicationNegativeTest(ReplicationNegativeBase):
self.share1['id'],
self.replica_zone)
@decorators.idempotent_id('97fc5ab3-c6e2-4da4-ae45-08d458a5ba0c')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
@ -255,12 +267,14 @@ class ReplicationAPIOnlyNegativeTest(base.BaseSharesTest):
utils.check_skip_if_microversion_lt(_MIN_SUPPORTED_MICROVERSION)
@decorators.idempotent_id('72395c9b-4432-4a8b-84b4-60303e6bc962')
@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())
@decorators.idempotent_id('41d45772-e021-4404-a991-85f7a6e6431b')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_delete_replica_by_nonexistent_id(self):
self.assertRaises(lib_exc.NotFound,

View File

@ -14,6 +14,7 @@
# under the License.
from tempest import config
from tempest.lib import decorators
import testtools
from testtools import testcase as tc
@ -66,6 +67,7 @@ class ReplicationSnapshotTest(base.BaseSharesMixedTest):
cls.share_zone = cls.zones[0]
cls.replica_zone = cls.zones[-1]
@decorators.idempotent_id('67fce02a-1d46-4186-8260-69e30b26195d')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_snapshot_after_share_replica(self):
"""Test the snapshot for replicated share.
@ -100,6 +102,7 @@ class ReplicationSnapshotTest(base.BaseSharesMixedTest):
snapshot_id=snapshot['id'],
share_network_id=self.sn_id)
@decorators.idempotent_id('ced8920b-6e3a-4bb4-9b3d-86e54377fcb7')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_snapshot_before_share_replica(self):
"""Test the snapshot for replicated share.
@ -138,6 +141,7 @@ class ReplicationSnapshotTest(base.BaseSharesMixedTest):
snapshot_id=snapshot['id'],
share_network_id=self.sn_id)
@decorators.idempotent_id('a5372844-69ad-40e1-bbf3-265eb66af123')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_snapshot_before_and_after_share_replica(self):
"""Test the snapshot for replicated share.
@ -187,6 +191,7 @@ class ReplicationSnapshotTest(base.BaseSharesMixedTest):
snapshot_id=snapshot2['id'],
share_network_id=self.sn_id)
@decorators.idempotent_id('b4cd376b-1eb8-4780-801a-64b0c3bee1e4')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_delete_snapshot_after_adding_replica(self):
"""Verify the snapshot delete.
@ -208,6 +213,7 @@ class ReplicationSnapshotTest(base.BaseSharesMixedTest):
self.shares_v2_client.wait_for_resource_deletion(
snapshot_id=snapshot["id"])
@decorators.idempotent_id('913056a7-d897-4a1b-a7be-b2b2cf5d9572')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@testtools.skipUnless(
CONF.share.capability_create_share_from_snapshot_support,

View File

@ -16,6 +16,7 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.common import constants
@ -101,6 +102,7 @@ class RevertToSnapshotTest(base.BaseSharesMixedTest):
cls.shares_v2_client.share_network_id)
cls.sn_id = cls.share_network['id']
@decorators.idempotent_id('196f2bc5-e13a-4730-ac51-61e339068a06')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@ddt.data(
*{constants.REVERT_TO_SNAPSHOT_MICROVERSION,
@ -116,6 +118,7 @@ class RevertToSnapshotTest(base.BaseSharesMixedTest):
self.shares_v2_client.wait_for_share_status(self.share['id'],
constants.STATUS_AVAILABLE)
@decorators.idempotent_id('09bd9942-7ef9-4d24-b2dd-f83bdda27b50')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@ddt.data(
*{constants.REVERT_TO_SNAPSHOT_MICROVERSION,
@ -137,6 +140,7 @@ class RevertToSnapshotTest(base.BaseSharesMixedTest):
self.shares_v2_client.wait_for_share_status(self.share['id'],
constants.STATUS_AVAILABLE)
@decorators.idempotent_id('146de138-d351-49dc-a13a-5cdbed40b9ac')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@tc.skipUnless(CONF.share.run_replication_tests,
'Replication tests are disabled.')

View File

@ -16,6 +16,7 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions
from testtools import testcase as tc
@ -73,6 +74,7 @@ class RevertToSnapshotNegativeTest(base.BaseSharesMixedTest):
cls.share = cls.create_share(share_type_id=cls.st_id)
cls.share2 = cls.create_share(share_type_id=cls.st_id)
@decorators.idempotent_id('21dd8561-8913-42a2-a95c-74b536964c94')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
*{constants.REVERT_TO_SNAPSHOT_MICROVERSION,
@ -90,6 +92,7 @@ class RevertToSnapshotNegativeTest(base.BaseSharesMixedTest):
snapshot1['id'],
version=version)
@decorators.idempotent_id('7360ee16-ac7d-46ce-9c81-251d64fb7434')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
*{constants.REVERT_TO_SNAPSHOT_MICROVERSION,
@ -109,6 +112,7 @@ class RevertToSnapshotNegativeTest(base.BaseSharesMixedTest):
snapshot['id'],
version=version)
@decorators.idempotent_id('108a451e-a8e9-450f-8f75-53883d58c6be')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
*{constants.REVERT_TO_SNAPSHOT_MICROVERSION,
@ -133,6 +137,7 @@ class RevertToSnapshotNegativeTest(base.BaseSharesMixedTest):
snapshot['id'],
version=version)
@decorators.idempotent_id('29024057-dbbd-4cf6-a796-207dfbd4c3ff')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
*{constants.REVERT_TO_SNAPSHOT_MICROVERSION,
@ -145,6 +150,7 @@ class RevertToSnapshotNegativeTest(base.BaseSharesMixedTest):
self.share['id'],
version=version)
@decorators.idempotent_id('ef706fad-5ac4-41dc-af81-5aa0331560cf')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
*{constants.REVERT_TO_SNAPSHOT_MICROVERSION,

View File

@ -17,6 +17,7 @@ import itertools
import ddt
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -102,6 +103,7 @@ class ShareIpRulesForNFSTest(base.BaseSharesMixedTest):
cls.access_type = "ip"
cls.access_to = "2.2.2.2"
@decorators.idempotent_id('3390df2d-f6f8-4634-a562-87c1be994f6a')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@ddt.data(*itertools.chain(
itertools.product({'1.0', '2.9', '2.37', LATEST_MICROVERSION}, {4}),
@ -156,6 +158,7 @@ class ShareIpRulesForNFSTest(base.BaseSharesMixedTest):
self.shares_v2_client.wait_for_resource_deletion(
rule_id=rule["id"], share_id=self.share['id'], version=version)
@decorators.idempotent_id('5d25168a-d646-443e-8cf1-3151eb7887f5')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@ddt.data(*itertools.chain(
itertools.product({'1.0', '2.9', '2.37', LATEST_MICROVERSION}, {4}),
@ -208,6 +211,7 @@ class ShareIpRulesForNFSTest(base.BaseSharesMixedTest):
self.shares_v2_client.wait_for_resource_deletion(
rule_id=rule["id"], share_id=self.share['id'], version=version)
@decorators.idempotent_id('187a4fb0-ba1d-45b9-83c9-f0272e7e6f3e')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@testtools.skipIf(
"nfs" not in CONF.share.enable_ro_access_level_for_protocols,
@ -221,6 +225,7 @@ class ShareIpRulesForNFSTest(base.BaseSharesMixedTest):
class ShareIpRulesForCIFSTest(ShareIpRulesForNFSTest):
protocol = "cifs"
@decorators.idempotent_id('8fa0a15f-c04c-4521-91e7-020943bede8a')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@testtools.skipIf(
"cifs" not in CONF.share.enable_ro_access_level_for_protocols,
@ -258,6 +263,7 @@ class ShareUserRulesForNFSTest(base.BaseSharesMixedTest):
cls.access_type = "user"
cls.access_to = CONF.share.username_for_user_rules
@decorators.idempotent_id('1f87565f-c3d9-448d-b89a-387d6c2fdae6')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@ddt.data(*set(['1.0', '2.9', '2.27', '2.28', LATEST_MICROVERSION]))
def test_create_delete_user_rule(self, version):
@ -303,6 +309,7 @@ class ShareUserRulesForNFSTest(base.BaseSharesMixedTest):
self.shares_v2_client.wait_for_resource_deletion(
rule_id=rule["id"], share_id=self.share['id'], version=version)
@decorators.idempotent_id('ccb08342-b7ef-4dda-84ba-8de9879d8862')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@testtools.skipIf(
"nfs" not in CONF.share.enable_ro_access_level_for_protocols,
@ -316,6 +323,7 @@ class ShareUserRulesForNFSTest(base.BaseSharesMixedTest):
class ShareUserRulesForCIFSTest(ShareUserRulesForNFSTest):
protocol = "cifs"
@decorators.idempotent_id('ee11084d-6c1d-4856-8044-9aa9e6c670fb')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@testtools.skipIf(
"cifs" not in CONF.share.enable_ro_access_level_for_protocols,
@ -354,6 +362,7 @@ class ShareCertRulesForGLUSTERFSTest(base.BaseSharesMixedTest):
# certificate that it possesses.
cls.access_to = "client1.com"
@decorators.idempotent_id('775ebc55-4a4d-4012-a030-2eeb7b6d2ce8')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@ddt.data(*set(['1.0', '2.9', '2.27', '2.28', LATEST_MICROVERSION]))
def test_create_delete_cert_rule(self, version):
@ -399,6 +408,7 @@ class ShareCertRulesForGLUSTERFSTest(base.BaseSharesMixedTest):
self.shares_v2_client.wait_for_resource_deletion(
rule_id=rule["id"], share_id=self.share['id'], version=version)
@decorators.idempotent_id('cdd93d8e-7255-4ed4-8ef0-929a62bb302c')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@testtools.skipIf(
"glusterfs" not in CONF.share.enable_ro_access_level_for_protocols,
@ -474,6 +484,7 @@ class ShareCephxRulesForCephFSTest(base.BaseSharesMixedTest):
# Provide access to a client identified by a cephx auth id.
cls.access_to = "bob"
@decorators.idempotent_id('4e636fd2-26ef-4b63-96eb-77860a8b6cdf')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@ddt.data(*itertools.product(
set(['2.13', '2.27', '2.28', LATEST_MICROVERSION]),
@ -496,6 +507,7 @@ class ShareCephxRulesForCephFSTest(base.BaseSharesMixedTest):
self.shares_v2_client.wait_for_resource_deletion(
rule_id=rule["id"], share_id=self.share['id'])
@decorators.idempotent_id('ad907303-a439-4fcb-8845-fe91ecab7dc2')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_different_users_in_same_tenant_can_use_same_cephx_id(self):
# Grant access to the share
@ -556,6 +568,7 @@ class ShareRulesTest(base.BaseSharesMixedTest):
cls.share_type_id = cls.share_type['id']
cls.share = cls.create_share(share_type_id=cls.share_type_id)
@decorators.idempotent_id('c52e95cc-d6ea-4d02-9b52-cd7c1913dfff')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(*set(
['1.0', '2.9', '2.27', '2.28', '2.45', LATEST_MICROVERSION]))
@ -649,6 +662,7 @@ class ShareRulesTest(base.BaseSharesMixedTest):
self.shares_v2_client.wait_for_resource_deletion(
rule_id=rule["id"], share_id=self.share['id'], version=version)
@decorators.idempotent_id('b77bcbda-9754-48f0-9be6-79341ad1af64')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(*set(['1.0', '2.9', '2.27', '2.28', LATEST_MICROVERSION]))
def test_access_rules_deleted_if_share_deleted(self, version):

View File

@ -15,6 +15,7 @@
import ddt
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -54,6 +55,7 @@ class ShareIpRulesForNFSNegativeTest(base.BaseSharesMixedTest):
# create snapshot
cls.snap = cls.create_snapshot_wait_for_active(cls.share["id"])
@decorators.idempotent_id('16781b45-d2bb-4891-aa97-c28c0769d5bd')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data('1.2.3.256',
'1.1.1.-',
@ -73,6 +75,7 @@ class ShareIpRulesForNFSNegativeTest(base.BaseSharesMixedTest):
getattr(self, client_name).create_access_rule,
self.share["id"], "ip", ip_address)
@decorators.idempotent_id('e891deff-23d9-4872-911c-bd9b43dc797f')
@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):
@ -83,6 +86,7 @@ class ShareIpRulesForNFSNegativeTest(base.BaseSharesMixedTest):
'2.2.2.2',
'su')
@decorators.idempotent_id('efd594aa-dd24-427e-acdf-10d124afb572')
@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):
@ -132,6 +136,7 @@ class ShareIpRulesForNFSNegativeTest(base.BaseSharesMixedTest):
self.shares_v2_client.wait_for_resource_deletion(
rule_id=rule["id"], share_id=self.share["id"], version=version)
@decorators.idempotent_id('63932d1d-a60a-4af7-ba3b-7cf6c68aaee9')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data("10.20.30.40", "fd8c:b029:bba6:ac54::1",
"fd2c:b029:bba6:df54::1/128", "10.10.30.40/32")
@ -165,6 +170,7 @@ class ShareIpRulesForNFSNegativeTest(base.BaseSharesMixedTest):
self.shares_v2_client.create_access_rule,
self.share["id"], "ip", access_to)
@decorators.idempotent_id('d2856c7d-9417-416d-8d08-e68376ee5b2e')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_add_access_rule_on_share_with_no_host(self):
access_type, access_to = self._get_access_rule_data_from_config()
@ -211,6 +217,7 @@ class ShareUserRulesForNFSNegativeTest(base.BaseSharesMixedTest):
# create snapshot
cls.snap = cls.create_snapshot_wait_for_active(cls.share["id"])
@decorators.idempotent_id('d6148911-3a0c-4e1f-afdb-fcf203fe4a5b')
@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):
@ -219,6 +226,7 @@ class ShareUserRulesForNFSNegativeTest(base.BaseSharesMixedTest):
self.share["id"], "user",
"try+")
@decorators.idempotent_id('a4d8358d-dec0-4c2a-a544-182816a0ba6f')
@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):
@ -226,6 +234,7 @@ class ShareUserRulesForNFSNegativeTest(base.BaseSharesMixedTest):
getattr(self, client_name).create_access_rule,
self.share["id"], "user", "")
@decorators.idempotent_id('f5252e86-4767-48ad-8be5-43e12c93df79')
@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):
@ -233,6 +242,7 @@ class ShareUserRulesForNFSNegativeTest(base.BaseSharesMixedTest):
getattr(self, client_name).create_access_rule,
self.share["id"], "user", "abc")
@decorators.idempotent_id('f8f4d3ee-82b8-4d37-917d-a0cd72073df4')
@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):
@ -240,6 +250,7 @@ class ShareUserRulesForNFSNegativeTest(base.BaseSharesMixedTest):
getattr(self, client_name).create_access_rule,
self.share["id"], "user", "a" * 256)
@decorators.idempotent_id('21724a99-0790-49d5-a069-d1df43782965')
@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):
@ -248,6 +259,7 @@ class ShareUserRulesForNFSNegativeTest(base.BaseSharesMixedTest):
self.share["id"], "user",
"try+")
@decorators.idempotent_id('bc62ce96-36fe-4c9b-b6b9-4d5a661c8035')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data('shares_client', 'shares_v2_client')
@testtools.skipUnless(CONF.share.run_snapshot_tests,
@ -259,6 +271,7 @@ class ShareUserRulesForNFSNegativeTest(base.BaseSharesMixedTest):
access_type="user",
access_to="fakeuser")
@decorators.idempotent_id('04d5b25f-b335-4574-82b0-f607c8b3bf25')
@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):
@ -268,6 +281,7 @@ class ShareUserRulesForNFSNegativeTest(base.BaseSharesMixedTest):
access_type="user",
access_to="fakeuser")
@decorators.idempotent_id('301bdbd5-4398-4320-b334-7370995369e9')
@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):
@ -305,6 +319,7 @@ class ShareCertRulesForGLUSTERFSNegativeTest(base.BaseSharesMixedTest):
# create snapshot
cls.snap = cls.create_snapshot_wait_for_active(cls.share["id"])
@decorators.idempotent_id('a16d53d5-50d4-4015-912f-2850c5d62690')
@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):
@ -312,6 +327,7 @@ class ShareCertRulesForGLUSTERFSNegativeTest(base.BaseSharesMixedTest):
getattr(self, client_name).create_access_rule,
self.share["id"], "cert", "")
@decorators.idempotent_id('7b5383d8-5bcd-47aa-955b-ed3757a5bdb4')
@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,
@ -320,6 +336,7 @@ class ShareCertRulesForGLUSTERFSNegativeTest(base.BaseSharesMixedTest):
getattr(self, client_name).create_access_rule,
self.share["id"], "cert", " ")
@decorators.idempotent_id('1c25c134-92b4-4875-a061-88d394e28bcc')
@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,
@ -329,6 +346,7 @@ class ShareCertRulesForGLUSTERFSNegativeTest(base.BaseSharesMixedTest):
getattr(self, client_name).create_access_rule,
self.share["id"], "cert", "a" * 65)
@decorators.idempotent_id('dd85d5cd-aa83-4f44-8572-bd7e68a84fb2')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -340,6 +358,7 @@ class ShareCertRulesForGLUSTERFSNegativeTest(base.BaseSharesMixedTest):
access_type="cert",
access_to="fakeclient1.com")
@decorators.idempotent_id('eb47a511-7688-4689-a2ad-54ba85b39b07')
@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):
@ -371,6 +390,7 @@ class ShareCephxRulesForCephFSNegativeTest(base.BaseSharesMixedTest):
cls.access_type = "cephx"
cls.access_to = "david"
@decorators.idempotent_id('7b33c073-353e-4952-97dc-c3948a3cd037')
@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):
@ -378,6 +398,7 @@ class ShareCephxRulesForCephFSNegativeTest(base.BaseSharesMixedTest):
self.shares_v2_client.create_access_rule,
self.share["id"], self.access_type, access_to)
@decorators.idempotent_id('dd8be44c-c7e8-42fe-b81c-095a1c66730c')
@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,
@ -385,6 +406,7 @@ class ShareCephxRulesForCephFSNegativeTest(base.BaseSharesMixedTest):
self.share["id"], self.access_type, self.access_to,
access_level="su")
@decorators.idempotent_id('4ffed391-d7cc-481b-bb74-9f3406ddd75f')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_different_tenants_cannot_use_same_cephx_id(self):
# Grant access to the share
@ -406,6 +428,7 @@ class ShareCephxRulesForCephFSNegativeTest(base.BaseSharesMixedTest):
share2['id'])
self.assertEqual('error', share_alt_updated['access_rules_status'])
@decorators.idempotent_id('1a9f46f0-d4e1-40ac-8726-aedd0320d583')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_can_apply_new_cephx_rules_when_one_is_in_error_state(self):
# Create share on "primary" tenant
@ -465,6 +488,7 @@ class ShareRulesNegativeTest(base.BaseSharesMixedTest):
# create snapshot
cls.snap = cls.create_snapshot_wait_for_active(cls.share["id"])
@decorators.idempotent_id('84da9231-5c4b-4615-8500-8fc6d30ff7ea')
@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):
@ -472,6 +496,7 @@ class ShareRulesNegativeTest(base.BaseSharesMixedTest):
getattr(self, client_name).delete_access_rule,
self.share["id"], "wrong_rule_id")
@decorators.idempotent_id('13f9329f-12db-467d-9268-a9cca75997d9')
@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):
@ -479,6 +504,7 @@ class ShareRulesNegativeTest(base.BaseSharesMixedTest):
getattr(self, client_name).create_access_rule,
self.share["id"], "wrong_type", "1.2.3.4")
@decorators.idempotent_id('fd6ede10-97d6-4ee8-a661-c516b7421c91')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data('shares_client', 'shares_v2_client')
@testtools.skipUnless(CONF.share.run_snapshot_tests,
@ -492,6 +518,7 @@ class ShareRulesNegativeTest(base.BaseSharesMixedTest):
@ddt.ddt
class ShareRulesAPIOnlyNegativeTest(base.BaseSharesTest):
@decorators.idempotent_id('01279461-3ccc-49b2-a615-d7984dd0db8c')
@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):

View File

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -21,11 +22,13 @@ from manila_tempest_tests.tests.api import base
class SchedulerStatsNegativeTest(base.BaseSharesTest):
@decorators.idempotent_id('33db76eb-7501-43f9-8c4f-8e6e35519a4d')
@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)
@decorators.idempotent_id('f89136cf-34a1-475b-8514-3114f9f159a5')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_list_pools_detailed_with_user(self):
self.assertRaises(lib_exc.Forbidden,

View File

@ -17,6 +17,7 @@ import ddt
from oslo_log import log
import six
from tempest import config
from tempest.lib import decorators
import testtools
from testtools import testcase as tc
@ -31,6 +32,7 @@ LOG = log.getLogger(__name__)
@ddt.ddt
class SecurityServiceListMixin(object):
@decorators.idempotent_id('f6f5657c-a93c-49ed-86e3-b351a92734d5')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_list_security_services(self):
listed = self.shares_client.list_security_services()
@ -42,6 +44,7 @@ class SecurityServiceListMixin(object):
keys = ["name", "id", "status", "type", ]
[self.assertIn(key, s_s.keys()) for s_s in listed for key in keys]
@decorators.idempotent_id('22b22937-7436-458c-ac22-8ff19feab253')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data(*set(['1.0', '2.42', '2.44', LATEST_MICROVERSION]))
def test_list_security_services_with_detail(self, version):
@ -68,6 +71,7 @@ class SecurityServiceListMixin(object):
for ss in listed:
self.assertEqual(with_ou, 'ou' in ss.keys())
@decorators.idempotent_id('88f62835-0aee-4bed-a37f-ffd99430da8a')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
@ -95,6 +99,7 @@ class SecurityServiceListMixin(object):
keys = ["name", "id", "status", "type", ]
[self.assertIn(key, s_s.keys()) for s_s in listed for key in keys]
@decorators.idempotent_id('f055faad-dd36-4eed-9b50-61280931dea2')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_list_security_services_detailed_filter_by_ss_attributes(self):
search_opts = {
@ -151,6 +156,7 @@ class SecurityServicesTest(base.BaseSharesMixedTest,
self.ss_kerberos = self.create_security_service(
'kerberos', **ss_kerberos_data)
@decorators.idempotent_id('70927e29-4a6a-431a-bbc1-76bc419e0579')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_create_delete_security_service(self):
data = self.generate_security_service_data()
@ -161,6 +167,7 @@ class SecurityServicesTest(base.BaseSharesMixedTest,
self.assertEqual(ss_name, ss["type"])
self.shares_client.delete_security_service(ss["id"])
@decorators.idempotent_id('bb052be4-0176-4613-b7d5-e12bef391ddb')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@ddt.data(*set(['1.0', '2.43', '2.44', LATEST_MICROVERSION]))
def test_get_security_service(self, version):
@ -182,6 +189,7 @@ class SecurityServicesTest(base.BaseSharesMixedTest,
self.assertDictContainsSubset(data, get)
self.assertEqual(with_ou, 'ou' in get)
@decorators.idempotent_id('84d47747-13c8-4ab9-9fc4-a43fbb29ad18')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_update_security_service(self):
data = self.generate_security_service_data()
@ -206,6 +214,7 @@ class SecurityServicesTest(base.BaseSharesMixedTest,
self.assertDictContainsSubset(upd_data_ou, updated_ou)
self.assertDictContainsSubset(upd_data_ou, get_ou)
@decorators.idempotent_id('c3c04992-da11-4677-9098-eff3f4231a4b')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
@ -245,6 +254,7 @@ class SecurityServicesTest(base.BaseSharesMixedTest,
ss["id"], **update_data)
self.assertDictContainsSubset(update_data, updated)
@decorators.idempotent_id('8d9af272-df89-470d-9ff8-92ba774c9fff')
@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(
@ -253,6 +263,7 @@ class SecurityServicesTest(base.BaseSharesMixedTest,
self.assertTrue(any(self.ss_kerberos['id'] == ss['id']
for ss in listed))
@decorators.idempotent_id('d501710e-4710-4c13-a373-75ed6ababb13')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_try_list_security_services_all_tenants(self):
listed = self.shares_client.list_security_services(

View File

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -45,6 +46,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"])
@decorators.idempotent_id('e8c5b4d5-7ad2-4aa7-bab0-b454a2e150e9')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_map_ss_to_sn_and_list(self):
@ -54,6 +56,7 @@ class SecurityServicesMappingTest(base.BaseSharesTest):
for key in ["status", "id", "name"]:
self.assertIn(self.ss[key], ls[0][key])
@decorators.idempotent_id('9dd352b2-6d47-4cab-aa61-52d8081f67a2')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_map_ss_to_sn_and_delete(self):
@ -61,6 +64,7 @@ class SecurityServicesMappingTest(base.BaseSharesTest):
self.cl.remove_sec_service_from_share_network(
self.sn["id"], self.ss["id"])
@decorators.idempotent_id('2b0bd5cc-eb35-430f-acfd-f80a2e467667')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_remap_ss_to_sn(self):

View File

@ -16,6 +16,7 @@
from oslo_log import log
import six
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -42,6 +43,7 @@ class SecServicesMappingNegativeTest(base.BaseSharesMixedTest):
cls.share_type = cls._create_share_type()
cls.share_type_id = cls.share_type['id']
@decorators.idempotent_id('e3d17444-8ed4-445e-bc65-c748dbc5d21f')
@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"])
@ -49,54 +51,63 @@ class SecServicesMappingNegativeTest(base.BaseSharesMixedTest):
self.cl.add_sec_service_to_share_network,
self.sn["id"], self.ss["id"])
@decorators.idempotent_id('3f7af51f-3afa-495c-94b7-e9d29f06cf1d')
@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")
@decorators.idempotent_id('85dd5693-a89c-4d05-9416-0e11fbba23f5')
@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"], "")
@decorators.idempotent_id('d9af5086-ace9-4be3-8119-e765699c0c91')
@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"])
@decorators.idempotent_id('7272426d-ab58-4efb-a490-0c78c07fa7fe')
@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"])
@decorators.idempotent_id('f87aefa6-9681-477d-a118-603883849f4f')
@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")
@decorators.idempotent_id('7f8d7527-2d62-478a-ab19-213156777612')
@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")
@decorators.idempotent_id('be1c9c79-efa1-471e-920b-da4733ad383e')
@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"])
@decorators.idempotent_id('c7c2f66f-81f8-4984-b807-2b9520105a33')
@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")
@decorators.idempotent_id('eb66a8f7-b549-4cf1-8719-30844fb151b6')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
@ -130,6 +141,7 @@ class SecServicesMappingNegativeTest(base.BaseSharesMixedTest):
fresh_sn["id"],
self.ss["id"])
@decorators.idempotent_id('6a15c8ff-eba3-40e5-8fa1-6eab52338672')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_map_two_ss_with_same_type_to_sn(self):
# create share network
@ -155,6 +167,7 @@ class SecServicesMappingNegativeTest(base.BaseSharesMixedTest):
self.cl.add_sec_service_to_share_network,
sn["id"], security_services[1]["id"])
@decorators.idempotent_id('d422a15a-1f4c-4531-a092-9216b90c4179')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_delete_ss_that_assigned_to_sn(self):
# create share network

View File

@ -16,6 +16,7 @@
from oslo_log import log
import six
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -35,51 +36,60 @@ class SecurityServicesNegativeTest(base.BaseSharesMixedTest):
cls.share_type = cls._create_share_type()
cls.share_type_id = cls.share_type['id']
@decorators.idempotent_id('f5cdf074-f5d4-4d9e-990b-c3d9385dfc2b')
@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, "")
@decorators.idempotent_id('6a7efebc-989a-42b3-a971-c28af1e209f5')
@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")
@decorators.idempotent_id('2935de41-40b1-4907-8ab5-f4921f670bfd')
@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, "")
@decorators.idempotent_id('34e923a4-e5b4-4375-88b4-8bb05e8f010d')
@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")
@decorators.idempotent_id('887e0c2c-6658-442d-92e7-3b0c86a2dfcd')
@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, "")
@decorators.idempotent_id('c94eb229-5caf-4e81-b8a9-d73c0b63a93b')
@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")
@decorators.idempotent_id('60e51b95-af7f-463d-8d8e-6bca4ed3bec8')
@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")
@decorators.idempotent_id('e4554b3b-bc74-4204-8596-d502149bb408')
@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")
@decorators.idempotent_id('ab62240a-219c-4fa7-b1ca-08f91bec76f0')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
@ -116,6 +126,7 @@ class SecurityServicesNegativeTest(base.BaseSharesMixedTest):
ss["id"],
user="new_user")
@decorators.idempotent_id('288dbf42-ee22-4445-8363-7ebb1c3d89c9')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_get_deleted_security_service(self):
data = self.generate_security_service_data()

View File

@ -17,6 +17,7 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.common import constants
@ -103,6 +104,7 @@ class ShareGroupActionsTest(base.BaseSharesMixedTest):
description=cls.sg_snap_desc,
)
@decorators.idempotent_id('1e359389-09a7-4235-84c9-7b5c83632fff')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
*set([constants.MIN_SHARE_GROUP_MICROVERSION,
@ -128,6 +130,7 @@ class ShareGroupActionsTest(base.BaseSharesMixedTest):
self.assertEqual(self.share_group_name, share_group["name"])
self.assertEqual(self.share_group_desc, share_group["description"])
@decorators.idempotent_id('45b77673-b1bb-43a1-b4b7-41351930adbd')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_get_share_min_supported_sg_microversion(self):
@ -155,6 +158,7 @@ class ShareGroupActionsTest(base.BaseSharesMixedTest):
self.assertEqual(self.share_size, int(share["size"]))
self.assertEqual(self.share_group["id"], share["share_group_id"])
@decorators.idempotent_id('04fcd695-c5f8-4de7-ab09-131424e6bdfb')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
*set([constants.MIN_SHARE_GROUP_MICROVERSION,
@ -185,6 +189,7 @@ class ShareGroupActionsTest(base.BaseSharesMixedTest):
msg = ("Expected id %s exactly once in share group list" % sg_id)
self.assertEqual(1, len(gen), msg)
@decorators.idempotent_id('16986c21-ecbc-429e-ab3d-8d1596a3eac4')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
*set([constants.MIN_SHARE_GROUP_MICROVERSION, '2.36',
@ -220,6 +225,7 @@ class ShareGroupActionsTest(base.BaseSharesMixedTest):
group_id)
self.assertEqual(1, len(gen), msg)
@decorators.idempotent_id('e72be2f9-56db-467f-89d7-0dddbf7e37e9')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_filter_shares_by_share_group_id_min(self):
shares = self.shares_v2_client.list_shares(
@ -243,6 +249,7 @@ class ShareGroupActionsTest(base.BaseSharesMixedTest):
'Share %s expected in returned list, but got %s' % (
self.shares[0]['id'], share_ids))
@decorators.idempotent_id('5d2ca4f5-04da-4528-af47-ec980b95e884')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
*set([constants.MIN_SHARE_GROUP_MICROVERSION,
@ -273,6 +280,7 @@ class ShareGroupActionsTest(base.BaseSharesMixedTest):
self.assertEqual(self.sg_snap_name, sg_snapshot["name"])
self.assertEqual(self.sg_snap_desc, sg_snapshot["description"])
@decorators.idempotent_id('67e8c099-f1c1-4972-9c51-bb7bfe1d7994')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_get_share_group_snapshot_members_min(self):
sg_snapshot = self.shares_v2_client.get_share_group_snapshot(
@ -297,6 +305,7 @@ class ShareGroupActionsTest(base.BaseSharesMixedTest):
if share['id'] == member['share_id']:
self.assertEqual(share['size'], member['size'])
@decorators.idempotent_id('650c5fa7-11f2-48bd-b012-fc2e32b6f446')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
*set([constants.MIN_SHARE_GROUP_MICROVERSION,
@ -401,6 +410,7 @@ class ShareGroupRenameTest(base.BaseSharesMixedTest):
version=version,
)
@decorators.idempotent_id('7f0a07ce-afdd-4c51-a29c-d8fe6cb5f6a5')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
*set([constants.MIN_SHARE_GROUP_MICROVERSION,
@ -440,6 +450,7 @@ class ShareGroupRenameTest(base.BaseSharesMixedTest):
# going to be reused
self._rollback_share_group_update(version)
@decorators.idempotent_id('611b1555-df09-499b-8aef-e8261e3f6863')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
*set([constants.MIN_SHARE_GROUP_MICROVERSION,

View File

@ -15,6 +15,7 @@
import ddt
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -49,6 +50,7 @@ class ShareGroupsTest(base.BaseSharesMixedTest):
cls.share_group_type = cls._create_share_group_type()
cls.share_group_type_id = cls.share_group_type['id']
@decorators.idempotent_id('809d5e3d-5a4b-458a-a985-853d59800da5')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_create_populate_delete_share_group_min(self):
# Create a share group
@ -93,6 +95,7 @@ class ShareGroupsTest(base.BaseSharesMixedTest):
self.assertRaises(
lib_exc.NotFound, self.shares_client.get_share, share['id'])
@decorators.idempotent_id('cf7984af-1e1d-4eaf-bf9a-d8ddf5cebd01')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_create_delete_empty_share_group_snapshot_min(self):
# Create base share group
@ -133,6 +136,7 @@ class ShareGroupsTest(base.BaseSharesMixedTest):
sg_snapshot['id'],
version=constants.MIN_SHARE_GROUP_MICROVERSION)
@decorators.idempotent_id('727d9c69-4c3b-4375-a91b-8b3efd349976')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_create_share_group_from_empty_share_group_snapshot_min(self):
# Create base share group
@ -193,6 +197,7 @@ class ShareGroupsTest(base.BaseSharesMixedTest):
msg)
@base.skip_if_microversion_lt("2.34")
@decorators.idempotent_id('14fd6d88-87ff-4af2-ad17-f95dbd8dcd61')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(
'sg', 'sg_and_share', 'none',

View File

@ -15,6 +15,7 @@
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -78,6 +79,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
description=cls.sg_snap_desc
)
@decorators.idempotent_id('7ce3fb52-1bec-42b1-9b4f-671c8465764b')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_create_sg_with_invalid_source_sg_snapshot_id_value_min(self):
self.assertRaises(
@ -87,6 +89,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
cleanup_in_class=False,
version=constants.MIN_SHARE_GROUP_MICROVERSION)
@decorators.idempotent_id('43c7a454-06b4-4c6e-8aaf-34709db64e28')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_create_sg_with_nonexistent_source_sg_snapshot_id_value_min(self):
self.assertRaises(
@ -96,6 +99,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
cleanup_in_class=False,
version=constants.MIN_SHARE_GROUP_MICROVERSION)
@decorators.idempotent_id('aae1b1db-ea04-4a53-88ad-e5ee648fe938')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_create_sg_with_invalid_share_network_id_value_min(self):
self.assertRaises(
@ -105,6 +109,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
cleanup_in_class=False,
version=constants.MIN_SHARE_GROUP_MICROVERSION)
@decorators.idempotent_id('ea817e28-08b9-40c1-bbab-a8820ec564ac')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_create_group_with_nonexistent_share_network_id_value_min(self):
self.assertRaises(
@ -114,6 +119,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
cleanup_in_class=False,
version=constants.MIN_SHARE_GROUP_MICROVERSION)
@decorators.idempotent_id('8bc89858-61de-49f3-868c-394841a93503')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_create_sg_with_invalid_share_type_id_value_min(self):
self.assertRaises(
@ -123,6 +129,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
cleanup_in_class=False,
version=constants.MIN_SHARE_GROUP_MICROVERSION)
@decorators.idempotent_id('97183b15-d150-4c6b-b812-734c2500afe7')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_create_sg_with_nonexistent_share_type_id_value_min(self):
self.assertRaises(
@ -132,6 +139,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
cleanup_in_class=False,
version=constants.MIN_SHARE_GROUP_MICROVERSION)
@decorators.idempotent_id('25a829e2-be7d-4a4d-881e-bc0634515985')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_create_sg_snapshot_with_invalid_sg_id_value_min(self):
self.assertRaises(
@ -141,6 +149,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
cleanup_in_class=False,
version=constants.MIN_SHARE_GROUP_MICROVERSION)
@decorators.idempotent_id('16ad5a77-0ef7-4906-8e14-56703c2c9d71')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_create_sg_snapshot_with_nonexistent_sg_id_value_min(self):
self.assertRaises(
@ -150,6 +159,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
cleanup_in_class=False,
version=constants.MIN_SHARE_GROUP_MICROVERSION)
@decorators.idempotent_id('d486a184-1160-4664-ad9b-6f8974685343')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_get_sg_with_invalid_id_min(self):
self.assertRaises(
@ -158,6 +168,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
"invalid_share_group_id",
version=constants.MIN_SHARE_GROUP_MICROVERSION)
@decorators.idempotent_id('7a5dcec1-27cc-4bfe-a166-d8c1832a4dc7')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_get_sg_without_passing_group_id_min(self):
self.assertRaises(
@ -165,6 +176,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
self.shares_v2_client.get_share_group,
'', version=constants.MIN_SHARE_GROUP_MICROVERSION)
@decorators.idempotent_id('9127933a-1960-415e-bf21-8bcb5720e371')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_update_sg_with_invalid_id_min(self):
self.assertRaises(
@ -175,6 +187,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
description='new_description',
version=constants.MIN_SHARE_GROUP_MICROVERSION)
@decorators.idempotent_id('bf8f9865-a906-4d55-b233-fec57cf43b66')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_delete_sg_with_invalid_id_min(self):
self.assertRaises(
@ -183,6 +196,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
"invalid_share_group_id",
version=constants.MIN_SHARE_GROUP_MICROVERSION)
@decorators.idempotent_id('16431501-800f-4695-bae6-6a4c715c2fbf')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_delete_sg_without_passing_sg_id_min(self):
self.assertRaises(
@ -190,6 +204,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
self.shares_v2_client.delete_share_group,
'', version=constants.MIN_SHARE_GROUP_MICROVERSION)
@decorators.idempotent_id('18fe2dee-4a07-484e-8f0f-bbc238500dc3')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_delete_sg_in_use_by_sg_snapshot_min(self):
self.assertRaises(
@ -198,6 +213,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
self.share_group['id'],
version=constants.MIN_SHARE_GROUP_MICROVERSION)
@decorators.idempotent_id('d2a58f10-cc86-498d-a5e0-1468d4345852')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_delete_share_in_use_by_sg_snapshot_min(self):
params = {'share_group_id': self.share['share_group_id']}
@ -208,6 +224,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
params=params,
version=constants.MIN_SHARE_GROUP_MICROVERSION)
@decorators.idempotent_id('c2225b19-d5f5-4d15-bb9a-de63bfce6760')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_delete_sg_containing_a_share_min(self):
self.assertRaises(
@ -222,6 +239,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
version=constants.MIN_SHARE_GROUP_MICROVERSION)
self.assertEqual('available', sg['status'])
@decorators.idempotent_id('edd329b8-7188-481f-9445-8f6d913538fa')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_filter_shares_on_invalid_group_id_min(self):
shares = self.shares_v2_client.list_shares(
@ -231,6 +249,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
)
self.assertEqual(0, len(shares), 'Incorrect number of shares returned')
@decorators.idempotent_id('5dc10968-cbff-46d9-a1aa-bafccc7a1905')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_filter_shares_on_nonexistent_group_id_min(self):
shares = self.shares_v2_client.list_shares(
@ -240,6 +259,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
)
self.assertEqual(0, len(shares), 'Incorrect number of shares returned')
@decorators.idempotent_id('f805f683-fe05-4534-9f40-a74be42ff82b')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_filter_shares_on_empty_share_group_id_min(self):
share_group = self.create_share_group(
@ -257,6 +277,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
)
self.assertEqual(0, len(shares), 'Incorrect number of shares returned')
@decorators.idempotent_id('8fc20c22-082f-4851-bcc3-d2f3af57f027')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_create_sg_with_nonexistent_az_min(self):
self.assertRaises(
@ -270,6 +291,7 @@ class ShareGroupsNegativeTest(base.BaseSharesMixedTest):
version=constants.MIN_SHARE_GROUP_MICROVERSION)
@base.skip_if_microversion_lt("2.34")
@decorators.idempotent_id('64527564-9cd6-42db-8897-910f4fc1a151')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_create_sg_and_share_with_different_azs(self):
azs = self.shares_v2_client.list_availability_zones()

View File

@ -15,6 +15,7 @@
import ddt
from tempest import config
from tempest.lib import decorators
import testtools
from testtools import testcase as tc
@ -45,6 +46,7 @@ class ShareNetworkSubnetsTest(base.BaseSharesMixedTest):
cls.share_network = cls.create_share_network()
cls.share_network_id = cls.share_network['id']
@decorators.idempotent_id('3e1e4da7-049f-404e-8673-142695a9a785')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_create_delete_subnet(self):
share_network = self.shares_v2_client.create_share_network()
@ -82,6 +84,7 @@ class ShareNetworkSubnetsTest(base.BaseSharesMixedTest):
# Delete the subnets
self.shares_v2_client.delete_subnet(share_network['id'], created['id'])
@decorators.idempotent_id('51c6836a-c6d2-4b80-a992-cf91f9a4332b')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_show_share_network_subnet(self):
share_network = self.create_share_network()
@ -107,6 +110,7 @@ class ShareNetworkSubnetsTest(base.BaseSharesMixedTest):
self.shares_v2_client.delete_subnet(share_network['id'],
created['id'])
@decorators.idempotent_id('89ed6115-eb1d-4a7e-a0a3-9b4a239fadc1')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
@ -174,6 +178,7 @@ class ShareNetworkSubnetsTest(base.BaseSharesMixedTest):
# Delete the subnets
self.shares_v2_client.delete_subnet(share_network['id'], subnet['id'])
@decorators.idempotent_id('043fbe02-466d-4344-8e2f-f02cb65132cb')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")

View File

@ -15,6 +15,7 @@
import ddt
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -46,6 +47,7 @@ class ShareNetworkSubnetsNegativeTest(base.BaseSharesAdminTest):
cls.az = cls.shares_v2_client.list_availability_zones()[0]
cls.az_name = cls.az['name']
@decorators.idempotent_id('d20b6105-22d1-4fc0-8468-45dd019240c0')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_add_share_network_subnet_share_network_not_found(self):
data = self.generate_subnet_data()
@ -54,6 +56,7 @@ class ShareNetworkSubnetsNegativeTest(base.BaseSharesAdminTest):
'fake_inexistent_id',
**data)
@decorators.idempotent_id('68264ac2-57e5-47ea-aa71-198c020be975')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_add_share_network_subnet_az_not_found(self):
data = {'availability_zone': 'non-existent-az'}
@ -62,6 +65,7 @@ class ShareNetworkSubnetsNegativeTest(base.BaseSharesAdminTest):
self.shares_v2_client.create_subnet,
self.share_network_id, **data)
@decorators.idempotent_id('13f397bf-5e3a-42b0-b4f9-9cd2dbbb0955')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@ddt.data(True, False)
def test_add_share_network_subnet_in_same_az_exists(self, is_default):
@ -79,6 +83,7 @@ class ShareNetworkSubnetsNegativeTest(base.BaseSharesAdminTest):
self.shares_v2_client.create_subnet,
share_network['id'], **data)
@decorators.idempotent_id('36e991c1-f09b-47dc-adc9-3da388b14612')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_add_share_network_subnet_missing_parameters(self):
# Generate subnet data
@ -90,6 +95,7 @@ class ShareNetworkSubnetsNegativeTest(base.BaseSharesAdminTest):
self.shares_v2_client.create_subnet,
self.share_network_id, **data)
@decorators.idempotent_id('11e76b07-f3e3-401f-9469-256b93a768e6')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_show_subnet_share_network_not_found(self):
self.assertRaises(lib_exc.NotFound,
@ -97,6 +103,7 @@ class ShareNetworkSubnetsNegativeTest(base.BaseSharesAdminTest):
'fake-subnet',
'fake-sn')
@decorators.idempotent_id('22d4528b-39ae-4f97-b1b2-1b9d65146c97')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_show_subnet_not_found(self):
self.assertRaises(lib_exc.NotFound,
@ -104,6 +111,7 @@ class ShareNetworkSubnetsNegativeTest(base.BaseSharesAdminTest):
'fake-subnet',
self.share_network_id)
@decorators.idempotent_id('9dfc6ba3-c7be-4a6d-b104-ce77d2337bb3')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_get_deleted_subnet(self):
# Generate subnet data
@ -130,6 +138,7 @@ class ShareNetworkSubnetsNegativeTest(base.BaseSharesAdminTest):
subnet['id'],
self.share_network['id'])
@decorators.idempotent_id('bf9d63c4-37fb-4646-add7-905b196316f1')
@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 '
@ -202,6 +211,7 @@ class ShareNetworkSubnetsNegativeTest(base.BaseSharesAdminTest):
self.shares_v2_client.delete_subnet(share_network_id,
subnet['id'])
@decorators.idempotent_id('5088edfe-2800-4dec-a982-42c864bba954')
@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 '
@ -271,6 +281,7 @@ class ShareNetworkSubnetsNegativeTest(base.BaseSharesAdminTest):
self.shares_v2_client.delete_subnet(share_network_id,
subnet['id'])
@decorators.idempotent_id('1025b69b-f1fd-4e44-b749-33779545ffe8')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_delete_subnet_share_network_not_found(self):
self.assertRaises(lib_exc.NotFound,
@ -278,6 +289,7 @@ class ShareNetworkSubnetsNegativeTest(base.BaseSharesAdminTest):
'fake-sn',
'fake-subnet')
@decorators.idempotent_id('a5bdc817-0c34-4856-9732-f561e6ab5a83')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_delete_subnet_not_found(self):
self.assertRaises(lib_exc.NotFound,

View File

@ -14,6 +14,7 @@
# under the License.
from tempest import config
from tempest.lib import decorators
import testtools
from testtools import testcase as tc
@ -25,6 +26,7 @@ CONF = config.CONF
class ShareNetworkListMixin(object):
@decorators.idempotent_id('41c635b1-d9ef-4c05-9100-5e4b0034b523')
@tc.attr("gate", "smoke", )
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_list_share_networks(self):
@ -35,6 +37,7 @@ class ShareNetworkListMixin(object):
keys = ["name", "id"]
[self.assertIn(key, sn.keys()) for sn in listed for key in keys]
@decorators.idempotent_id('18fe9031-cefc-4df3-bbb0-6541f5fda12b')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_try_list_share_networks_all_tenants(self):
listed = self.shares_client.list_share_networks_with_detail(
@ -45,6 +48,7 @@ class ShareNetworkListMixin(object):
keys = ["name", "id"]
[self.assertIn(key, sn.keys()) for sn in listed for key in keys]
@decorators.idempotent_id('caf6635a-ecb8-4981-9776-11dcfdf3cdbc')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_try_list_share_networks_project_id(self):
listed = self.shares_client.list_share_networks_with_detail(
@ -55,6 +59,7 @@ class ShareNetworkListMixin(object):
keys = ["name", "id"]
[self.assertIn(key, sn.keys()) for sn in listed for key in keys]
@decorators.idempotent_id('285c7a91-1703-42a5-86c8-2463edde60e2')
@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()
@ -91,6 +96,7 @@ class ShareNetworkListMixin(object):
[self.assertIn(key, sn.keys()) for sn in listed for key in keys]
@decorators.idempotent_id('6d13a090-0855-40c0-85b1-424f6878c6ce')
@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(
@ -103,6 +109,7 @@ class ShareNetworkListMixin(object):
self.assertTrue(any(ss['id'] == self.ss_ldap['id']
for ss in ss_list))
@decorators.idempotent_id('bff1356e-70aa-4bbe-b398-cb4dadd8fcb1')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
@base.skip_if_microversion_lt("2.36")
def test_list_share_networks_like_filter(self):
@ -119,6 +126,7 @@ class ShareNetworkListMixin(object):
self.assertTrue(all(value in sn[key] for key, value in
valid_filter_opts.items()))
@decorators.idempotent_id('27490442-60f8-4514-a10a-194a400b48bb')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_list_share_networks_all_filter_opts(self):
valid_filter_opts = {
@ -204,6 +212,7 @@ class ShareNetworksTest(base.BaseSharesMixedTest, ShareNetworkListMixin):
cls.sn_with_kerberos_ss["id"],
cls.ss_kerberos["id"])
@decorators.idempotent_id('b998a594-f630-475d-b46f-e4143caf61fb')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_create_delete_share_network(self):
# generate data for share network
@ -216,6 +225,7 @@ class ShareNetworksTest(base.BaseSharesMixedTest, ShareNetworkListMixin):
# Delete share_network
self.shares_client.delete_share_network(created["id"])
@decorators.idempotent_id('55990ec2-37f0-483f-9c67-76fd6f377cc1')
@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"])
@ -224,6 +234,7 @@ class ShareNetworksTest(base.BaseSharesMixedTest, ShareNetworkListMixin):
del data['created_at']
self.assertDictContainsSubset(data, get)
@decorators.idempotent_id('1837fdd3-8068-4e88-bc50-9224498f84c0')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_update_share_network(self):
update_data = self.generate_share_network_data()
@ -232,6 +243,7 @@ class ShareNetworksTest(base.BaseSharesMixedTest, ShareNetworkListMixin):
**update_data)
self.assertDictContainsSubset(update_data, updated)
@decorators.idempotent_id('198a5c08-3aaf-4623-9720-95d33ebe3376')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
@ -246,6 +258,7 @@ class ShareNetworksTest(base.BaseSharesMixedTest, ShareNetworkListMixin):
self.shares_client.share_network_id, **update_dict)
self.assertDictContainsSubset(update_dict, updated)
@decorators.idempotent_id('7595a844-a28e-476c-89f1-4d3193ce9d5b')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
def test_recreate_share_network(self):
# generate data for share network
@ -265,6 +278,7 @@ class ShareNetworksTest(base.BaseSharesMixedTest, ShareNetworkListMixin):
# Delete second share network
self.shares_client.delete_share_network(sn2["id"])
@decorators.idempotent_id('be5f4f60-493e-47ea-a5bd-f16dfaa98c5c')
@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
@ -278,6 +292,7 @@ class ShareNetworksTest(base.BaseSharesMixedTest, ShareNetworkListMixin):
sn2 = self.create_share_network(**data)
self.assertDictContainsSubset(data, sn2)
@decorators.idempotent_id('50bac743-7ca9-409b-827f-f277da67e32e')
@testtools.skipUnless(CONF.share.create_networks_when_multitenancy_enabled,
"Only for setups with network creation.")
@testtools.skipUnless(CONF.share.multitenancy_enabled,
@ -301,6 +316,7 @@ class ShareNetworksTest(base.BaseSharesMixedTest, ShareNetworkListMixin):
self.assertEqual(subnet_details['subnet']['gateway_ip'],
share_net_info['gateway'])
@decorators.idempotent_id('2dbf91da-04ae-4f9f-a7b9-0299c6b2e02c')
@testtools.skipUnless(CONF.share.create_networks_when_multitenancy_enabled,
"Only for setups with network creation.")
@testtools.skipUnless(CONF.share.multitenancy_enabled,

View File

@ -14,6 +14,7 @@
# under the License.
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -32,38 +33,45 @@ class ShareNetworksNegativeTest(base.BaseSharesMixedTest):
cls.share_type = cls._create_share_type()
cls.share_type_id = cls.share_type['id']
@decorators.idempotent_id('66289664-bf01-40dd-a76d-fd2c953bbceb')
@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, "")
@decorators.idempotent_id('80397850-2f64-48b3-b19b-79c4ac0bd58f')
@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")
@decorators.idempotent_id('fe6ac194-5003-404c-b372-7515a58ff969')
@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, "")
@decorators.idempotent_id('7e22e8b9-a1ce-480c-89b3-b4edd807285a')
@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")
@decorators.idempotent_id('a7c55dbe-c23e-403f-b8aa-4aa1128f32a4')
@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")
@decorators.idempotent_id('984349ca-df7d-4f85-a45f-948189debb65')
@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")
@decorators.idempotent_id('211b64b4-4c2b-4b6b-b011-725f40a37b03')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
@ -76,6 +84,7 @@ class ShareNetworksNegativeTest(base.BaseSharesMixedTest):
self.shares_client.share_network_id,
neutron_net_id="new_net_id")
@decorators.idempotent_id('9166b81c-d6ab-4592-bcf7-9410250e30dd')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_get_deleted_share_network(self):
data = self.generate_share_network_data()
@ -89,6 +98,7 @@ class ShareNetworksNegativeTest(base.BaseSharesMixedTest):
self.shares_client.get_security_service,
sn["id"])
@decorators.idempotent_id('0d104b72-aab5-48b5-87f8-847d2155faa9')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_list_share_networks_wrong_created_since_value(self):
self.assertRaises(
@ -96,6 +106,7 @@ class ShareNetworksNegativeTest(base.BaseSharesMixedTest):
self.shares_client.list_share_networks_with_detail,
params={'created_since': '2014-10-23T08:31:58.000000'})
@decorators.idempotent_id('c96dacaf-4cea-4fe9-bbd7-c9b1001f5495')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_list_share_networks_wrong_created_before_value(self):
self.assertRaises(
@ -103,6 +114,7 @@ class ShareNetworksNegativeTest(base.BaseSharesMixedTest):
self.shares_client.list_share_networks_with_detail,
params={'created_before': '2014-10-23T08:31:58.000000'})
@decorators.idempotent_id('6e4912fd-ae85-4a43-81e8-e5b340099b64')
@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 '
@ -129,6 +141,7 @@ class ShareNetworksNegativeTest(base.BaseSharesMixedTest):
lib_exc.Conflict,
self.shares_client.delete_share_network, new_sn['id'])
@decorators.idempotent_id('4e71de31-1064-40da-948d-a72063fbd647')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_not_supported("2.35")
def test_list_shares_with_like_filter_not_exist(self):
@ -143,6 +156,7 @@ class ShareNetworksNegativeTest(base.BaseSharesMixedTest):
self.assertEqual(0, len(share_networks))
@base.skip_if_microversion_lt("2.51")
@decorators.idempotent_id('8a995305-ede9-4002-a9cd-f24ff4d71f63')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_delete_share_network_contains_more_than_one_subnet(self):
share_network = self.create_share_network()
@ -171,6 +185,7 @@ class ShareNetworksNegativeTest(base.BaseSharesMixedTest):
self.assertIsNone(default_subnet['availability_zone'])
@base.skip_if_microversion_lt("2.51")
@decorators.idempotent_id('d84c3c5c-5913-42d4-9a66-0d5a78295adb')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_create_share_network_inexistent_az(self):
self.assertRaises(

View File

@ -13,6 +13,7 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
import testtools
from manila_tempest_tests.tests.api import base
@ -46,6 +47,7 @@ class ShareTypeAvailabilityZonesTest(base.BaseSharesMixedTest):
cls.valid_azs_spec = ', '.join(cls.valid_azs)
cls.invalid_azs_spec = ', '.join(cls.invalid_azs)
@decorators.idempotent_id('23005fad-59e1-4a4b-994c-7377e34b4ec6')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data('az1, az2, az 3 ', 'az1,az2,az 3', 'az1 ,az2, az 3')
def test_share_type_azs_create_and_get_share_type(self, spec):
@ -64,6 +66,7 @@ class ShareTypeAvailabilityZonesTest(base.BaseSharesMixedTest):
self.assertEqual(
'az1,az2,az 3', share_type['extra_specs']['availability_zones'])
@decorators.idempotent_id('545f1742-39dc-4bfb-8a81-6ec941b58fef')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data('az1', 'az2', 'az 3', 'az1, az 3', 'az 3, az1',
'az2, az 3, az1')
@ -90,6 +93,7 @@ class ShareTypeAvailabilityZonesTest(base.BaseSharesMixedTest):
self.assertIn(share_type_in_specific_azs['id'], share_type_ids)
self.assertIn(share_type_no_az_spec['id'], share_type_ids)
@decorators.idempotent_id('00a3e4ab-00a5-4683-a773-166353a69f28')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_share_type_azs_old_version_api_ignores_spec(self):
"""< v2.48, configuring share type AZs shouldn't fail share creation"""
@ -110,6 +114,7 @@ class ShareTypeAvailabilityZonesTest(base.BaseSharesMixedTest):
# regardless of the 'availability_zones' extra-spec
self.assertIn(share['availability_zone'], self.valid_azs)
@decorators.idempotent_id('3399c706-5dcb-41b2-9701-4550bf4f81cb')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(True, False)
def test_share_type_azs_shares_az_in_create_req(self, specify_az):
@ -127,6 +132,7 @@ class ShareTypeAvailabilityZonesTest(base.BaseSharesMixedTest):
else:
self.assertIn(share['availability_zone'], self.valid_azs)
@decorators.idempotent_id('fa5618ad-c452-41bd-8dc3-cc85abd6cee5')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data(True, False)
def test_share_type_azs_share_groups_az_in_create_req(self, specify_az):

View File

@ -11,6 +11,7 @@
# under the License.
import ddt
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -42,6 +43,7 @@ class ShareTypeAvailabilityZonesNegativeTest(base.BaseSharesMixedTest):
cls.valid_azs_spec = ', '.join(cls.valid_azs)
cls.invalid_azs_spec = ', '.join(cls.invalid_azs)
@decorators.idempotent_id('7a23af8d-a995-43ac-a381-2cd5c5f57f39')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@ddt.data('az1, az2, az 3, ', 'az1,,az 3', ',az2, az 3')
def test_share_type_azs_create_with_invalid_az_spec(self, spec):
@ -56,6 +58,7 @@ class ShareTypeAvailabilityZonesNegativeTest(base.BaseSharesMixedTest):
extra_specs=extra_specs,
client=self.admin_shares_v2_client)
@decorators.idempotent_id('78f1afba-6087-415c-aaa1-a880ae341bfc')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_share_type_azs_filter_by_invalid_azs_extra_spec(self):
self.admin_shares_v2_client.update_share_type_extra_spec(
@ -73,6 +76,7 @@ class ShareTypeAvailabilityZonesNegativeTest(base.BaseSharesMixedTest):
self.assertNotIn(self.share_type_id, share_type_ids)
self.assertIn(share_type_no_az_spec['id'], share_type_ids)
@decorators.idempotent_id('9285d7d5-cb40-462d-998c-891f0f934fdd')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_share_type_azs_shares_unsupported_az(self):
"""Test using an AZ not supported by the share type."""
@ -84,6 +88,7 @@ class ShareTypeAvailabilityZonesNegativeTest(base.BaseSharesMixedTest):
availability_zone=self.valid_azs[0],
cleanup_in_class=False)
@decorators.idempotent_id('5712abae-52a5-46ec-8850-46e732b18b06')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_share_type_azs_share_groups_unsupported(self):
self.admin_shares_v2_client.update_share_type_extra_spec(

View File

@ -18,6 +18,7 @@ import random
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -47,6 +48,7 @@ class ShareTypesNegativeTest(base.BaseSharesMixedTest):
cls.st = cls._create_share_type()
cls.st2 = cls._create_share_type()
@decorators.idempotent_id('d6a6ac4d-6582-408d-ba55-6f5128eb940e')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_create_share_type_with_user(self):
self.assertRaises(lib_exc.Forbidden,
@ -54,12 +56,14 @@ class ShareTypesNegativeTest(base.BaseSharesMixedTest):
data_utils.rand_name("used_user_creds"),
client=self.shares_client)
@decorators.idempotent_id('857c664f-e634-4865-ba05-bdcd4336725d')
@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["id"])
@decorators.idempotent_id('06203276-f6a3-4a07-a014-8749763395d6')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_add_access_to_share_type_with_user(self):
self.assertRaises(lib_exc.Forbidden,
@ -67,6 +71,7 @@ class ShareTypesNegativeTest(base.BaseSharesMixedTest):
self.st['id'],
self.shares_client.tenant_id)
@decorators.idempotent_id('08b2d093-2ad8-46aa-8112-81d50547f36d')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_try_remove_access_from_share_type_with_user(self):
self.assertRaises(lib_exc.Forbidden,
@ -75,6 +80,7 @@ class ShareTypesNegativeTest(base.BaseSharesMixedTest):
self.shares_client.tenant_id)
@base.skip_if_microversion_lt("2.50")
@decorators.idempotent_id('4a22945c-8988-43a1-88c9-eb86e6abcd8e')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@ddt.data(
('2.50', '', None, None),
@ -95,6 +101,7 @@ class ShareTypesNegativeTest(base.BaseSharesMixedTest):
version)
@base.skip_if_microversion_lt("2.50")
@decorators.idempotent_id('7193465a-ed8e-44d5-9ca9-4e8a3c5958e0')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@ddt.data('2.50', LATEST_MICROVERSION)
def test_share_type_update_conflict(self, version):

View File

@ -14,6 +14,7 @@
# under the License.
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -41,6 +42,7 @@ class SharesNFSTest(base.BaseSharesMixedTest):
cls.share = cls.create_share(cls.protocol,
share_type_id=cls.share_type_id)
@decorators.idempotent_id('21ad41fb-04cf-493c-bc2f-66c80220898b')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_create_get_delete_share(self):
@ -127,6 +129,7 @@ class SharesNFSTest(base.BaseSharesMixedTest):
self.shares_v2_client.get_share,
share['id'])
@decorators.idempotent_id('775f8f87-5727-4bb7-b69f-9ce6b9bdb140')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -161,6 +164,7 @@ class SharesNFSTest(base.BaseSharesMixedTest):
self.assertRaises(lib_exc.NotFound,
self.shares_client.get_snapshot, snap['id'])
@decorators.idempotent_id('8a14831d-ad1f-447f-b5de-2b8a233b24c0')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -192,6 +196,7 @@ class SharesNFSTest(base.BaseSharesMixedTest):
"source of share %s" % (snap["id"], get["snapshot_id"]))
self.assertEqual(get["snapshot_id"], snap["id"], msg)
@decorators.idempotent_id('c609c0b2-d649-4ca3-8334-629b213f5c72')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@testtools.skipIf(not CONF.share.multitenancy_enabled,
"Only for multitenancy.")

View File

@ -17,6 +17,7 @@ import ddt
import six
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
import testtools
from testtools import testcase as tc
@ -130,50 +131,60 @@ class SharesActionsTest(base.BaseSharesMixedTest):
CONF.share.share_size, share["size"])
self.assertEqual(CONF.share.share_size, int(share["size"]), msg)
@decorators.idempotent_id('188badb2-0ca3-44e5-abca-3029475d7f73')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_get_share_v2_1(self):
self._get_share('2.1')
@decorators.idempotent_id('45ec8e36-cb8a-4a03-8c41-ba5d5dc2a5c5')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_get_share_with_snapshot_support_key(self):
self._get_share('2.2')
@decorators.idempotent_id('b803a076-593a-469d-ab75-7e67ac294dd5')
@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')
@decorators.idempotent_id('c13c1cf5-c708-4e62-8b71-c47dbb45a7a0')
@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')
@decorators.idempotent_id('2c439716-c34e-46f1-b055-41e411fb4e66')
@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')
@decorators.idempotent_id('67c9ad27-f26d-4ff9-a528-a35b4c5a55c1')
@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')
@decorators.idempotent_id('2a61703d-5a62-49c5-b143-fea0c9125cd9')
@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')
@decorators.idempotent_id('2899055e-607d-4423-b1b7-27eefa6ce5f0')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_not_supported('2.24')
def test_get_share_with_create_share_from_snapshot_support(self):
self._get_share('2.24')
@decorators.idempotent_id('04c359b5-74b3-4a07-9f9e-f0ac1867d58d')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_not_supported(
constants.REVERT_TO_SNAPSHOT_MICROVERSION)
def test_get_share_with_revert_to_snapshot_support(self):
self._get_share(constants.REVERT_TO_SNAPSHOT_MICROVERSION)
@decorators.idempotent_id('7d61311a-81b0-481c-abb9-cfb0b4f82e29')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_list_shares(self):
@ -228,44 +239,53 @@ class SharesActionsTest(base.BaseSharesMixedTest):
msg = "expected id lists %s times in share list" % (len(gen))
self.assertEqual(1, len(gen), msg)
@decorators.idempotent_id('d88a157a-fe4d-456e-90ba-f0bd9e5d02ec')
@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')
@decorators.idempotent_id('ee57db25-0fbf-40ce-8dc1-070845d245a7')
@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')
@decorators.idempotent_id('38a4cf70-8ed9-4a82-a338-9f20463b1147')
@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')
@decorators.idempotent_id('a313cd85-53e5-48b7-b4a7-14e9273e843d')
@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')
@decorators.idempotent_id('0de4dc84-bace-4b9a-8470-a40c4a9b14b4')
@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')
@decorators.idempotent_id('70097cf3-76b8-49d2-b1c7-ad59394dd978')
@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')
@decorators.idempotent_id('f8e57190-b105-4937-b96e-55725eb64739')
@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')
@decorators.idempotent_id('21410324-e0b5-452a-8c7e-599a27267e1d')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_list_shares_with_detail_and_create_share_from_snapshot_support(
self):
self._list_shares_with_detail('2.24')
@decorators.idempotent_id('45041fc9-bb0d-4dd6-ac0d-a40a22a91f3f')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@utils.skip_if_microversion_not_supported(
constants.REVERT_TO_SNAPSHOT_MICROVERSION)
@ -273,6 +293,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
self._list_shares_with_detail(
constants.REVERT_TO_SNAPSHOT_MICROVERSION)
@decorators.idempotent_id('bc24dc42-050b-4105-a90a-f5649cbd8e49')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_list_shares_with_detail_filter_by_metadata(self):
filters = {'metadata': self.metadata}
@ -288,6 +309,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
if CONF.share.capability_create_share_from_snapshot_support:
self.assertFalse(self.shares[1]['id'] in [s['id'] for s in shares])
@decorators.idempotent_id('685286c7-1df6-48c3-839d-8162737446b8')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
@ -304,6 +326,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
self.assertEqual(
filters['share_network_id'], share['share_network_id'])
@decorators.idempotent_id('fd87884d-71a4-4ca8-8b2b-07b4df2de3bd')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -322,6 +345,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
self.assertEqual(filters['snapshot_id'], share['snapshot_id'])
self.assertFalse(self.shares[0]['id'] in [s['id'] for s in shares])
@decorators.idempotent_id('70a9d947-bd45-46db-b529-6c48c0ff8985')
@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'}
@ -334,6 +358,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
sorted_list = [share['created_at'] for share in shares]
self.assertEqual(sorted(sorted_list), sorted_list)
@decorators.idempotent_id('866194c6-3910-409e-ad81-2cff223cfaaf')
@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
@ -341,6 +366,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
shares = self.shares_client.list_shares_with_detail(params)
self.assertEqual(self.share_name, shares[0]["name"])
@decorators.idempotent_id('f446e8cb-5bef-45ac-8b87-f4136f44ca69')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.36")
def test_list_shares_with_detail_filter_by_existed_description(self):
@ -349,6 +375,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
shares = self.shares_v2_client.list_shares_with_detail(params)
self.assertEqual(self.share_name, shares[0]["name"])
@decorators.idempotent_id('1276b97b-cf46-4953-973f-f995985a1ce4')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.36")
def test_list_shares_with_detail_filter_by_inexact_name(self):
@ -358,6 +385,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
for share in shares:
self.assertIn('tempest-share', share["name"])
@decorators.idempotent_id('56416b95-949f-4b09-9a5e-377b674efd25')
@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
@ -365,6 +393,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
shares = self.shares_client.list_shares_with_detail(params)
self.assertEqual(0, len(shares))
@decorators.idempotent_id('708e3e2e-8761-4d16-b18d-a834ee7ca69e')
@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
@ -374,6 +403,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
for share in shares:
self.assertEqual(params["status"], share["status"])
@decorators.idempotent_id('5ec2fcf8-18d4-4790-95de-45c8a05582c7')
@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
@ -381,6 +411,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
shares = self.shares_client.list_shares_with_detail(params)
self.assertEqual(0, len(shares))
@decorators.idempotent_id('7609b7bb-613e-474d-a9b3-e41584842503')
@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
@ -394,6 +425,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
for share in shares:
self.assertEqual(project_id, share["project_id"])
@decorators.idempotent_id('0019afa2-fae2-417f-a7e0-2af665a966b0')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.42")
def test_list_shares_with_detail_with_count(self):
@ -402,6 +434,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
shares = self.shares_v2_client.list_shares_with_detail(params)
self.assertGreater(shares["count"], 0)
@decorators.idempotent_id('557a0474-9e30-47b4-a766-19e2afb13e66')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_list_shares_public_with_detail(self):
public_share = self.create_share(
@ -435,6 +468,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
self.assertFalse(any([s["id"] == private_share["id"] for s in shares]))
@decorators.idempotent_id('174829eb-fd3e-46ef-880b-f05c3d44d1fe')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -491,6 +525,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
'actual': snapshot['project_id'],
'key': 'project_id'})
@decorators.idempotent_id('3d5d85ff-6158-4af2-a765-cfa07a46adde')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -508,6 +543,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
msg = "expected id lists %s times in share list" % (len(gen))
self.assertEqual(1, len(gen), msg)
@decorators.idempotent_id('4d717665-e4ca-47df-b4b9-f6d096159779')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -539,6 +575,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
msg = "expected id lists %s times in share list" % (len(gen))
self.assertEqual(1, len(gen), msg)
@decorators.idempotent_id('80497a21-7533-47b5-93aa-29e0f7924cb9')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -565,6 +602,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
self.assertEqual(1, len(snaps['snapshots']))
self.assertEqual(self.snap['id'], snaps['snapshots'][0]['id'])
@decorators.idempotent_id('0a94e996-c4db-4fef-b486-4004ea65c11a')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -581,6 +619,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
self.assertEqual(filters['status'], snap['status'])
self.assertEqual(filters['name'], snap['name'])
@decorators.idempotent_id('f969aba1-d293-48e3-a638-a89785bb41ef')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -597,6 +636,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
for snap in snaps:
self.assertEqual(filters['description'], snap['description'])
@decorators.idempotent_id('59968026-12af-4029-a3d0-42c291b7db96')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -612,6 +652,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
sorted_list = [snap['share_id'] for snap in snaps]
self.assertEqual(sorted(sorted_list), sorted_list)
@decorators.idempotent_id('17e6f579-e0d7-4724-a639-4974e82bb5ed')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@testtools.skipUnless(
CONF.share.run_extend_tests,
@ -636,6 +677,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
)
self.assertEqual(new_size, share_get['size'], msg)
@decorators.idempotent_id('8f64b930-9b4e-41d7-bbd6-82d9951931f3')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@testtools.skipUnless(
CONF.share.run_shrink_tests,
@ -689,6 +731,7 @@ class SharesRenameTest(base.BaseSharesMixedTest):
cls.snap = cls.create_snapshot_wait_for_active(
cls.share["id"], cls.snap_name, cls.snap_desc)
@decorators.idempotent_id('7661d042-8222-483c-9249-9f53931e7347')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_update_share(self):
@ -713,6 +756,7 @@ class SharesRenameTest(base.BaseSharesMixedTest):
self.assertEqual(new_desc, share["description"])
self.assertTrue(share["is_public"])
@decorators.idempotent_id('20f299f6-2441-4629-b44e-d791d57f413c')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")

View File

@ -16,6 +16,7 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -50,6 +51,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest):
cls.snap = cls.create_snapshot_wait_for_active(
cls.share["id"], cls.snap_name, cls.snap_desc)
@decorators.idempotent_id('c4481ba3-0cff-448b-a728-69a9a34e3aa6')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(
CONF.share.run_extend_tests,
@ -68,6 +70,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest):
self.share['id'],
new_size)
@decorators.idempotent_id('3448cd2b-34eb-453f-b72f-39fbea778e42')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(
CONF.share.run_extend_tests,
@ -81,6 +84,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest):
self.share['id'],
new_size)
@decorators.idempotent_id('79f2304a-7959-4169-8a76-b67814e0733a')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(
CONF.share.run_extend_tests,
@ -94,6 +98,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest):
self.share['id'],
new_size)
@decorators.idempotent_id('067c4b10-4324-45ac-8365-5d446b66c18a')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(
CONF.share.run_extend_tests,
@ -112,6 +117,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest):
share['id'],
new_size)
@decorators.idempotent_id('99d42f94-8da1-4c04-ad5b-9738d6acc139')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(
CONF.share.run_shrink_tests,
@ -125,6 +131,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest):
self.share['id'],
new_size)
@decorators.idempotent_id('3d4c8f34-49b8-4628-b1cb-652ae67473a5')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(
CONF.share.run_shrink_tests,
@ -138,6 +145,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest):
self.share['id'],
new_size)
@decorators.idempotent_id('d53ece5c-70e4-4953-a1d7-7d4384510519')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(
CONF.share.run_shrink_tests,
@ -158,6 +166,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest):
share['id'],
new_size)
@decorators.idempotent_id('ff307c91-3bb9-48b5-926c-5a2747320151')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_not_supported("2.34")
@ddt.data('path', 'id')
@ -174,6 +183,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest):
self.assertGreater(len(shares), 0)
@decorators.idempotent_id('ffc3dc76-2f92-4308-a125-1d3905ed72ba')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_lt("2.35")
@ddt.data('path', 'id')
@ -187,6 +197,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest):
self.assertEqual(0, len(shares))
@decorators.idempotent_id('3dbcf17b-cc63-43ea-b45f-eae12300729e')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_not_supported("2.36")
def test_list_shares_with_like_filter_and_invalid_version(self):
@ -202,6 +213,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest):
self.assertGreater(len(shares), 0)
@decorators.idempotent_id('f41c6cd2-62cf-4bba-a26e-21a6e86eae15')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_not_supported("2.36")
def test_list_shares_with_like_filter_not_exist(self):
@ -213,6 +225,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest):
self.assertEqual(0, len(shares))
@decorators.idempotent_id('31e33495-5ec3-4658-bdef-d9d1e034705a')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_list_shares_with_name_not_exist(self):
filters = {
@ -222,6 +235,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest):
self.assertEqual(0, len(shares))
@decorators.idempotent_id('5b0ceae1-357f-4b51-81a6-88973ea20c16')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_not_supported("2.36")
def test_list_shares_with_description_not_exist(self):
@ -232,6 +246,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest):
self.assertEqual(0, len(shares))
@decorators.idempotent_id('061ee37a-96b2-4b4f-9cfe-2c8c80ed4370')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@base.skip_if_microversion_not_supported("2.36")
def test_list_snapshots_with_description_not_exist(self):
@ -243,6 +258,7 @@ class SharesActionsNegativeTest(base.BaseSharesMixedTest):
self.assertEqual(0, len(shares))
@decorators.idempotent_id('9d3c3158-1a92-4e37-b00f-a4a40b813109')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_list_snapshots_with_name_not_exist(self):
filters = {

View File

@ -16,6 +16,7 @@
from collections import defaultdict
from tempest import config
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -69,6 +70,7 @@ class SharesFromSnapshotAcrossPools(base.BaseSharesMixedTest):
'disabled.')
utils.check_skip_if_microversion_lt("2.54")
@decorators.idempotent_id('6f1fa7d0-94f2-4373-8730-b0986781cc88')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_create_share_from_snapshot_across_pools_within_backend(self):
backends = [pool['backend'] for pool in self.pools]
@ -133,6 +135,7 @@ class SharesFromSnapshotAcrossPools(base.BaseSharesMixedTest):
" source share %s" % pool_name_a)
self.assertNotEqual(pool_name_a, pool_name_b, msg)
@decorators.idempotent_id('46f33338-d70d-4c9a-ae27-3dd5b7bd1531')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_share_from_snapshot_across_azs(self):
azs = next((self.rep_domain_azs[rep] for rep in self.rep_domain_azs if

View File

@ -14,6 +14,7 @@
# under the License.
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
@ -42,12 +43,14 @@ class SharesNegativeTest(base.BaseSharesMixedTest):
metadata={'key': 'value'}
)
@decorators.idempotent_id('255011c0-4ed9-4174-bb13-8bbd06a62529')
@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")
@decorators.idempotent_id('b9bb8dee-0c7c-4e51-909c-028335b1a6a0')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -64,6 +67,7 @@ class SharesNegativeTest(base.BaseSharesMixedTest):
self.assertRaises(lib_exc.Forbidden,
self.shares_client.delete_share, share["id"])
@decorators.idempotent_id('3df8e2d8-9b79-428d-9d8b-30bc66b5b40e')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -96,6 +100,7 @@ class SharesNegativeTest(base.BaseSharesMixedTest):
snapshot_id=snap["id"],
cleanup_in_class=False)
@decorators.idempotent_id('3047fb1c-5acc-4ef2-8796-b2d2d49829b5')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipIf(not CONF.share.multitenancy_enabled,
"Only for multitenancy.")
@ -105,6 +110,7 @@ class SharesNegativeTest(base.BaseSharesMixedTest):
share_type_id=self.share_type_id,
share_network_id="wrong_sn_id")
@decorators.idempotent_id('e84ce567-a090-47c7-87c4-6ee427bdee7a')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@testtools.skipIf(not CONF.share.multitenancy_enabled,
"Only for multitenancy.")
@ -148,6 +154,7 @@ class SharesNegativeTest(base.BaseSharesMixedTest):
snapshot_id=snap["id"],
)
@decorators.idempotent_id('3443493b-f56a-4faa-9968-e7cbb0d2802f')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_update_other_tenants_public_share(self):
self.assertRaises(lib_exc.Forbidden,
@ -155,12 +162,14 @@ class SharesNegativeTest(base.BaseSharesMixedTest):
self.share["id"],
name="new_name")
@decorators.idempotent_id('68d1f1bc-16e4-4086-8982-7e44ca6bdc4d')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_delete_other_tenants_public_share(self):
self.assertRaises(lib_exc.Forbidden,
self.alt_shares_v2_client.delete_share,
self.share['id'])
@decorators.idempotent_id('1f9e5d84-0885-4a4b-9196-9031a1c01508')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_set_metadata_of_other_tenants_public_share(self):
self.assertRaises(lib_exc.Forbidden,
@ -168,6 +177,7 @@ class SharesNegativeTest(base.BaseSharesMixedTest):
self.share['id'],
{'key': 'value'})
@decorators.idempotent_id('fed7a935-9699-43a1-854e-67b61ba6233e')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_update_metadata_of_other_tenants_public_share(self):
self.assertRaises(lib_exc.Forbidden,
@ -175,6 +185,7 @@ class SharesNegativeTest(base.BaseSharesMixedTest):
self.share['id'],
{'key': 'value'})
@decorators.idempotent_id('bd62adeb-73c2-4b04-8812-80b479cd5c3b')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_delete_metadata_of_other_tenants_public_share(self):
self.assertRaises(lib_exc.Forbidden,
@ -192,12 +203,14 @@ class SharesAPIOnlyNegativeTest(base.BaseSharesMixedTest):
cls.share_type = cls._create_share_type()
cls.share_type_id = cls.share_type['id']
@decorators.idempotent_id('75837f93-8c2c-40a4-bb9e-d76c53db07c7')
@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')
@decorators.idempotent_id('97a4dd2f-7c90-4eb7-bf74-d698c3060833')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_manage_share_by_user(self):
self.assertRaises(lib_exc.Forbidden,
@ -205,18 +218,21 @@ class SharesAPIOnlyNegativeTest(base.BaseSharesMixedTest):
'fake-host', 'nfs', '/export/path',
'fake-type')
@decorators.idempotent_id('1a438374-8a91-4566-9cef-0386f6609445')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_list_by_user_with_host_filter(self):
self.assertRaises(lib_exc.Forbidden,
self.shares_v2_client.list_shares,
params={'host': 'fake_host'})
@decorators.idempotent_id('73f37f33-946d-4213-9d27-25cd4e9a0208')
@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})
@decorators.idempotent_id('2f0df934-b2fb-4ebd-96f7-183cb699dcdd')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_create_share_non_existent_az(self):
self.assertRaises(lib_exc.NotFound,
@ -224,6 +240,7 @@ class SharesAPIOnlyNegativeTest(base.BaseSharesMixedTest):
share_type_id=self.share_type_id,
availability_zone='fake_az')
@decorators.idempotent_id('5ae2ecd7-a694-4ba9-ae23-cca75580b9d8')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_create_share_with_zero_size(self):
self.assertRaises(lib_exc.BadRequest,
@ -231,6 +248,7 @@ class SharesAPIOnlyNegativeTest(base.BaseSharesMixedTest):
share_type_id=self.share_type_id,
size=0)
@decorators.idempotent_id('3620a380-f9f9-4521-a468-473581637344')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_create_share_with_invalid_size(self):
self.assertRaises(lib_exc.BadRequest,
@ -238,6 +256,7 @@ class SharesAPIOnlyNegativeTest(base.BaseSharesMixedTest):
share_type_id=self.share_type_id,
size="#$%")
@decorators.idempotent_id('26ed523d-a215-4661-a038-633b74c9cad7')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_create_share_with_out_passing_size(self):
self.assertRaises(lib_exc.BadRequest,
@ -245,6 +264,7 @@ class SharesAPIOnlyNegativeTest(base.BaseSharesMixedTest):
share_type_id=self.share_type_id,
size="")
@decorators.idempotent_id('bf303b29-bbcb-4a96-96e9-270e12df58d1')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -253,6 +273,7 @@ class SharesAPIOnlyNegativeTest(base.BaseSharesMixedTest):
self.shares_client.delete_snapshot,
"wrong_share_id")
@decorators.idempotent_id('08e5a9c7-45cb-414c-b375-28c335f20ff1')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -261,6 +282,7 @@ class SharesAPIOnlyNegativeTest(base.BaseSharesMixedTest):
self.shares_client.create_snapshot,
"wrong_share_id")
@decorators.idempotent_id('78e5e327-c68e-4910-82b2-27f5f4d150ac')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_create_share_with_invalid_protocol(self):
self.assertRaises(lib_exc.BadRequest,
@ -268,6 +290,7 @@ class SharesAPIOnlyNegativeTest(base.BaseSharesMixedTest):
share_type_id=self.share_type_id,
share_protocol="nonexistent_protocol")
@decorators.idempotent_id('2b7c7ea8-c0e9-446c-a8e3-add765452c04')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_create_share_with_wrong_public_value(self):
self.assertRaises(lib_exc.BadRequest,
@ -275,17 +298,20 @@ class SharesAPIOnlyNegativeTest(base.BaseSharesMixedTest):
share_type_id=self.share_type_id,
is_public='truebar')
@decorators.idempotent_id('f82d1667-ae39-43bb-b5aa-bfc9b2ec7292')
@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")
@decorators.idempotent_id('d03cf44e-6e69-415f-be36-25defb86df56')
@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, '')
@decorators.idempotent_id('a9487254-606b-444f-ba6a-2f461bcaf474')
@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
@ -293,11 +319,13 @@ class SharesAPIOnlyNegativeTest(base.BaseSharesMixedTest):
self.shares_client.list_shares_with_detail,
{'share_server_id': 'fake_share_server_id'})
@decorators.idempotent_id('9698d1a3-8ee8-46fa-a46b-1084d98e7149')
@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")
@decorators.idempotent_id('b8097d56-067e-4d7c-8401-31bc7021fd24')
@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

View File

@ -16,6 +16,7 @@
import ddt
import six
from tempest import config
from tempest.lib import decorators
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
@ -83,6 +84,7 @@ class ShareSnapshotIpRulesForNFSTest(BaseShareSnapshotRulesTest):
super(ShareSnapshotIpRulesForNFSTest, cls).resource_setup()
cls.access_type = "ip"
@decorators.idempotent_id('bdce2be8-80b9-4f68-bdc0-09a52ba0e6fd')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@ddt.data("1.1.1.1", "1.2.3.4/32")
def test_create_delete_access_rules(self, access_to):
@ -110,6 +112,7 @@ class ShareSnapshotUserRulesForCIFSTest(BaseShareSnapshotRulesTest):
super(ShareSnapshotUserRulesForCIFSTest, cls).resource_setup()
cls.access_type = "user"
@decorators.idempotent_id('c2625cd2-4dc0-431d-b47b-8f097e22f16d')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_create_delete_access_rules(self):
access_to = CONF.share.username_for_user_rules

View File

@ -15,6 +15,7 @@
import ddt
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc
@ -56,6 +57,7 @@ class SnapshotIpRulesForNFSNegativeTest(
share_type_id=cls.share_type_id)
cls.snap = cls.create_snapshot_wait_for_active(cls.share["id"])
@decorators.idempotent_id('a877276e-03d4-4fc5-b4b4-c8874d23f1dc')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data("1.2.3.256", "1.1.1.-", "1.2.3.4/33", "1.2.3.*", "1.2.3.*/23",
"1.2.3.1|23", "1.2.3.1/", "1.2.3.1/-1",
@ -67,6 +69,7 @@ class SnapshotIpRulesForNFSNegativeTest(
self.shares_v2_client.create_snapshot_access_rule,
self.snap["id"], "ip", target)
@decorators.idempotent_id('dd93150f-8081-4533-abb3-f99a03652a87')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
@ddt.data("1.2.3.4", "fd8c:b029:bba6:ac54::1",
"fd8c:b029:bba6:ac54::1/128", "1.2.3.4/32")

View File

@ -16,6 +16,7 @@
import ddt
from oslo_log import log as logging
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions
import testtools
from testtools import testcase as tc
@ -44,6 +45,14 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
* Terminate the instance
"""
def _ping_host_from_export_location(self, export, remote_client):
ip, version = self.get_ip_and_version_from_export_location(export)
if version == 6:
remote_client.exec_command("ping6 -c 5 %s" % ip)
else:
remote_client.exec_command("ping -c 5 %s" % ip)
@decorators.idempotent_id('825be71c-cf14-4884-a0ad-cf47d511df9a')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_mount_share_one_vm(self):
instance = self.boot_instance(wait_until="BUILD")
@ -58,6 +67,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
self.mount_share(location, remote_client)
self.unmount_share(remote_client)
@decorators.idempotent_id('7cc61131-90e1-42fb-9f07-d3786efb338f')
@tc.attr(base.TAG_NEGATIVE, base.TAG_BACKEND)
def test_write_with_ro_access(self):
'''Test if an instance with ro access can write on the share.'''
@ -89,6 +99,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
self.write_data_to_mounted_share,
test_data, remote_client_inst)
@decorators.idempotent_id('5e184576-c7d1-4c16-9b7c-bc9bcd65ba58')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_read_write_two_vms(self):
"""Boots two vms and writes/reads data on it."""
@ -126,6 +137,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
data = self.read_data_from_mounted_share(remote_client_inst2)
self.assertEqual(test_data, data)
@decorators.idempotent_id('15d42949-545e-4ad8-b06e-bb2556c54375')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@base.skip_if_microversion_lt("2.29")
@testtools.skipUnless(CONF.share.run_host_assisted_migration_tests or
@ -234,6 +246,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
self.assertIn('1m4.bin', output)
self.assertIn('1m5.bin', output)
@decorators.idempotent_id('87b803bf-679a-492b-a538-af4c9ff013c8')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@testtools.skipUnless(
CONF.share.capability_create_share_from_snapshot_support,
@ -316,6 +329,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
self.assertNotIn('file2', output)
self.assertIn('file3', output)
@decorators.idempotent_id('c98e6876-3a4f-40e8-8b4f-023c94c242c3')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@base.skip_if_microversion_lt("2.32")
@testtools.skipUnless(CONF.share.run_mount_snapshot_tests,
@ -429,17 +443,20 @@ class TestShareBasicOpsCIFS(ShareBasicOpsBase):
"sudo mount.cifs \"%s\" %s -o guest" % (location, target_dir)
)
@decorators.idempotent_id('4344a47a-d316-496b-97a4-12a59297950a')
@tc.attr(base.TAG_NEGATIVE, base.TAG_BACKEND)
def test_write_with_ro_access(self):
msg = ("Skipped for CIFS protocol because RO access is not "
"supported for shares by IP.")
raise self.skipException(msg)
@decorators.idempotent_id('a691332b-dd7a-4041-9bbd-3893e168aefa')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_read_mountable_snapshot(self):
msg = "Skipped for CIFS protocol because of bug/1649573"
raise self.skipException(msg)
@decorators.idempotent_id('8c936c3e-4793-49d2-8409-4038f03e7012')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_write_data_to_share_created_from_snapshot(self):
msg = "Skipped for CIFS protocol because of bug/1649573"
@ -449,16 +466,19 @@ class TestShareBasicOpsCIFS(ShareBasicOpsBase):
class TestShareBasicOpsCEPHFS(ShareBasicOpsBase, manager.BaseShareCEPHFSTest):
protocol = "cephfs"
@decorators.idempotent_id('9fb12879-45b3-4042-acac-82be338dbde1')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_mount_share_one_vm_with_ceph_fuse_client(self):
self.mount_client = 'fuse'
super(TestShareBasicOpsCEPHFS, self).test_mount_share_one_vm()
@decorators.idempotent_id('a2a70b94-f5fc-438a-9dfa-53aa60ee3949')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_write_with_ro_access_with_ceph_fuse_client(self):
self.mount_client = 'fuse'
super(TestShareBasicOpsCEPHFS, self).test_write_with_ro_access()
@decorators.idempotent_id('c247f51f-0ffc-4a4f-894c-781647619faf')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_read_write_two_vms_with_ceph_fuse_client(self):
self.mount_client = 'fuse'

View File

@ -15,6 +15,7 @@ from oslo_log import log as logging
from oslo_utils import units
import six
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions
from testtools import testcase as tc
@ -45,6 +46,7 @@ class ShareExtendBase(manager.ShareScenarioTest):
* Terminate the instance
"""
@decorators.idempotent_id('e1c0d614-c8f2-43cf-9c49-25808b07ba4a')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_create_extend_and_write(self):
default_share_size = CONF.share.share_size
@ -197,6 +199,7 @@ class TestShareExtendCIFS(ShareExtendBase):
class TestShareExtendCEPHFS(ShareExtendBase, manager.BaseShareCEPHFSTest):
protocol = "cephfs"
@decorators.idempotent_id('9ca1e4a9-23e3-4da6-a63e-46e7919335e0')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_create_extend_and_write_with_ceph_fuse_client(self):
self.mount_client = 'fuse'

View File

@ -13,6 +13,7 @@
import ddt
from oslo_log import log as logging
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions
import testtools
from testtools import testcase as tc
@ -59,6 +60,7 @@ class ShareManageUnmanageBase(manager.ShareScenarioTest):
cls.protocol)
raise cls.skipException(message)
@decorators.idempotent_id('165f22b4-9417-45ee-8e1d-2b8669ac2f00')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@testtools.skipUnless(
CONF.share.run_manage_unmanage_tests,

View File

@ -15,6 +15,7 @@ import time
from oslo_log import log as logging
import six
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions
import testtools
from testtools import testcase as tc
@ -47,6 +48,7 @@ class ShareShrinkBase(manager.ShareScenarioTest):
* Terminate the instance
"""
@decorators.idempotent_id('ed0f9c0c-5302-4cc9-9f5d-f7641cc3b83b')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
@testtools.skipUnless(
CONF.share.run_shrink_tests, 'Shrink share tests are disabled.')
@ -212,6 +214,7 @@ class TestShareShrinkCIFS(ShareShrinkBase):
class TestShareShrinkCEPHFS(ShareShrinkBase, manager.BaseShareCEPHFSTest):
protocol = "cephfs"
@decorators.idempotent_id('7fb324ed-7479-4bd9-b022-b3739dee9bcb')
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
def test_create_shrink_and_write_with_ceph_fuse_client(self):
self.mount_client = 'fuse'

View File

@ -20,7 +20,12 @@ deps =
# commands = python setup.py test --slowest --testr-args='{posargs}'
[testenv:pep8]
commands = flake8 {posargs}
commands =
flake8 {posargs}
check-uuid --package manila_tempest_tests
[testenv:uuidgen]
commands = check-uuid --fix --package manila_tempest_tests
[testenv:venv]
commands = {posargs}