Merge "Add share backup tests."
diff --git a/manila_tempest_tests/tests/api/admin/test_share_types.py b/manila_tempest_tests/tests/api/admin/test_share_types.py
index 3d46c9e..d23171a 100644
--- a/manila_tempest_tests/tests/api/admin/test_share_types.py
+++ b/manila_tempest_tests/tests/api/admin/test_share_types.py
@@ -113,22 +113,26 @@
@utils.skip_if_microversion_not_supported("2.50")
@decorators.idempotent_id('a9af19e1-e789-4c4f-a39b-dd8df6ed00b1')
@tc.attr(base.TAG_POSITIVE, base.TAG_API)
- @ddt.data(
- ('2.50', data_utils.rand_name("type_updated"),
+ @ddt.named_data(
+ ('2_50_name_description_public', '2.50',
+ data_utils.rand_name("type_updated"), 'description_updated', True),
+ ('2_50_name', '2.50', data_utils.rand_name("type_updated"), None,
+ None),
+ ('2_50_description_public', '2.50', None, 'description_updated',
+ None),
+ ('2_50_public', '2.50', None, None, True),
+ ('2_50', '2.50', None, None, False),
+ (f'{LATEST_MICROVERSION}_name_description_public',
+ LATEST_MICROVERSION, data_utils.rand_name("type_updated"),
'description_updated', True),
- ('2.50', data_utils.rand_name("type_updated"), None, None),
- ('2.50', None, 'description_updated', None),
- ('2.50', None, None, True),
- ('2.50', None, None, False),
- (LATEST_MICROVERSION, data_utils.rand_name("type_updated"),
- 'description_updated', True),
- (LATEST_MICROVERSION, data_utils.rand_name("type_updated"),
- None, None),
- (LATEST_MICROVERSION, None, 'description_updated', None),
- (LATEST_MICROVERSION, None, None, True),
- (LATEST_MICROVERSION, None, None, False),
+ (f'{LATEST_MICROVERSION}_name', LATEST_MICROVERSION,
+ data_utils.rand_name("type_updated"), None, None),
+ (f'{LATEST_MICROVERSION}_description', LATEST_MICROVERSION, None,
+ 'description_updated', None),
+ (f'{LATEST_MICROVERSION}_public', LATEST_MICROVERSION, None, None,
+ True),
+ (LATEST_MICROVERSION, LATEST_MICROVERSION, None, None, False),
)
- @ddt.unpack
def test_share_type_create_update(self, version, st_name,
st_description, st_is_public):
name = data_utils.rand_name("tempest-manila")
diff --git a/manila_tempest_tests/tests/api/test_metadata.py b/manila_tempest_tests/tests/api/test_metadata.py
index bd73963..862de50 100644
--- a/manila_tempest_tests/tests/api/test_metadata.py
+++ b/manila_tempest_tests/tests/api/test_metadata.py
@@ -33,12 +33,6 @@
def _verify_share_metadata(self, share, md):
- # get metadata of share
- metadata = self.shares_v2_client.get_metadata(share["id"])['metadata']
-
- # verify metadata
- self.assertEqual(md, metadata)
-
# verify metadata items
for key in md:
get_value = self.shares_v2_client.get_metadata_item(
@@ -82,7 +76,8 @@
# verify deletion of metadata
get_metadata = self.shares_v2_client.get_metadata(share["id"])[
'metadata']
- self.assertEmpty(get_metadata)
+ for key in md.keys():
+ self.assertNotIn(key, list(get_metadata.keys()))
@decorators.idempotent_id('4e5f8159-62b6-4d5c-f729-d8b1f029d7de')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@@ -117,7 +112,8 @@
# verify deletion of metadata
get_metadata = self.shares_v2_client.get_metadata(
share["id"])['metadata']
- self.assertEmpty(get_metadata)
+ for key in md.keys():
+ self.assertNotIn(key, list(get_metadata.keys()))
@decorators.idempotent_id('2ec70ba5-050b-3b17-c862-c149e53543c0')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@@ -150,7 +146,8 @@
# verify deletion of metadata
get_metadata = self.shares_v2_client.get_metadata(
share["id"])['metadata']
- self.assertEmpty(get_metadata)
+ for key in md.keys():
+ self.assertNotIn(key, list(get_metadata.keys()))
@decorators.idempotent_id('c94851f4-2559-4712-9297-9912db1da7ff')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@@ -228,7 +225,7 @@
body_get = self.shares_v2_client.get_metadata(
self.share["id"])['metadata']
- self.assertEqual(data, body_get)
+ self.assertEqual(data["k"], body_get["k"])
@decorators.idempotent_id('5eff5619-b7cd-42f1-85e0-47d3d47098dd')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@@ -240,7 +237,9 @@
body_get = self.shares_v2_client.get_metadata(
self.share["id"])['metadata']
- self.assertEqual(data, body_get)
+ body_get_keys = list(body_get.keys())
+ self.assertIn(max_key, body_get_keys)
+ self.assertEqual(data[max_key], body_get[max_key])
@decorators.idempotent_id('44a572f1-6b5c-49d0-8f2e-1583ec3428d8')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@@ -251,7 +250,7 @@
body_get = self.shares_v2_client.get_metadata(
self.share["id"])['metadata']
- self.assertEqual(data, body_get)
+ self.assertEqual(data["key"], body_get["key"])
@decorators.idempotent_id('694d95e1-ba8c-49fc-a888-6f9f0d51d77d')
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@@ -263,4 +262,4 @@
body_get = self.shares_v2_client.get_metadata(
self.share["id"])['metadata']
- self.assertEqual(data, body_get)
+ self.assertEqual(max_value, body_get["key"])
diff --git a/manila_tempest_tests/tests/api/test_share_types_negative.py b/manila_tempest_tests/tests/api/test_share_types_negative.py
index 046af45..af4815f 100644
--- a/manila_tempest_tests/tests/api/test_share_types_negative.py
+++ b/manila_tempest_tests/tests/api/test_share_types_negative.py
@@ -83,15 +83,17 @@
@utils.skip_if_microversion_not_supported("2.50")
@decorators.idempotent_id('4a22945c-8988-43a1-88c9-eb86e6abcd8e')
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
- @ddt.data(
- ('2.50', '', None, None),
- (LATEST_MICROVERSION, '', None, None),
- ('2.50', None, None, 'not_bool'),
- (LATEST_MICROVERSION, None, None, 'not_bool'),
- ('2.50', None, generate_long_description(256), None),
- (LATEST_MICROVERSION, None, generate_long_description(256), None),
+ @ddt.named_data(
+ ('2_50', '2.50', '', None, None),
+ (LATEST_MICROVERSION, LATEST_MICROVERSION, '', None, None),
+ ('2_50_bad_public', '2.50', None, None, 'not_bool'),
+ (f'{LATEST_MICROVERSION}_bad_public', LATEST_MICROVERSION, None, None,
+ 'not_bool'),
+ ('2_50_description', '2.50', None, generate_long_description(256),
+ None),
+ (f'{LATEST_MICROVERSION}_description', LATEST_MICROVERSION, None,
+ generate_long_description(256), None),
)
- @ddt.unpack
def test_share_type_update_bad_request(
self, version, st_name, st_description, st_is_public):
st_id = self.st['id']
diff --git a/requirements.txt b/requirements.txt
index 95ad247..108bbee 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -4,6 +4,6 @@
pbr!=2.1.0,>=2.0.0 # Apache-2.0
-ddt>=1.0.1 # MIT
+ddt>=1.6.0 # MIT
oslo.log>=3.36.0 # Apache-2.0
tempest>=31.1.0 # Apache-2.0