summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen'ichi Ohmichi <ken-oomichi@wx.jp.nec.com>2017-01-27 17:55:24 -0800
committerKen'ichi Ohmichi <ken1ohmichi@gmail.com>2017-02-04 22:45:09 +0000
commitf35efa216df4356507219ddbb28fc1bf24f44ac3 (patch)
tree032af07d219c3fdf86e74ff43da859c8be4e81d9
parentf2d72d8f6d436fc3442ca9854fd7e9942e3acd99 (diff)
downloadtempest-f35efa216df4356507219ddbb28fc1bf24f44ac3.tar.gz
Switch to decorators.idempotent_id on image
So many modules are using test.idempotent_id and this is for switching to decorators.idempotent_id on image. Change-Id: I854b1afb59a4e46991df3672313e5a46a71f8210 Related-Bug: #1616913
-rw-r--r--tempest/api/image/admin/v2/test_images.py4
-rw-r--r--tempest/api/image/v1/test_image_members.py8
-rw-r--r--tempest/api/image/v1/test_image_members_negative.py9
-rw-r--r--tempest/api/image/v1/test_images.py28
-rw-r--r--tempest/api/image/v1/test_images_negative.py15
-rw-r--r--tempest/api/image/v2/test_images.py39
-rw-r--r--tempest/api/image/v2/test_images_member.py16
-rw-r--r--tempest/api/image/v2/test_images_member_negative.py5
-rw-r--r--tempest/api/image/v2/test_images_metadefs_namespace_objects.py8
-rw-r--r--tempest/api/image/v2/test_images_metadefs_namespace_properties.py4
-rw-r--r--tempest/api/image/v2/test_images_metadefs_namespace_tags.py6
-rw-r--r--tempest/api/image/v2/test_images_metadefs_namespaces.py4
-rw-r--r--tempest/api/image/v2/test_images_metadefs_resource_types.py4
-rw-r--r--tempest/api/image/v2/test_images_metadefs_schema.py22
-rw-r--r--tempest/api/image/v2/test_images_negative.py15
-rw-r--r--tempest/api/image/v2/test_images_tags.py4
-rw-r--r--tempest/api/image/v2/test_images_tags_negative.py5
17 files changed, 101 insertions, 95 deletions
diff --git a/tempest/api/image/admin/v2/test_images.py b/tempest/api/image/admin/v2/test_images.py
index f22f321d2..fc5ed7978 100644
--- a/tempest/api/image/admin/v2/test_images.py
+++ b/tempest/api/image/admin/v2/test_images.py
@@ -19,8 +19,8 @@ import testtools
from tempest.api.image import base
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 tempest import test
CONF = config.CONF
@@ -30,7 +30,7 @@ class BasicAdminOperationsImagesTest(base.BaseV2ImageAdminTest):
@testtools.skipUnless(CONF.image_feature_enabled.deactivate_image,
'deactivate-image is not available.')
- @test.idempotent_id('951ebe01-969f-4ea9-9898-8a3f1f442ab0')
+ @decorators.idempotent_id('951ebe01-969f-4ea9-9898-8a3f1f442ab0')
def test_admin_deactivate_reactivate_image(self):
# Create image by non-admin tenant
image_name = data_utils.rand_name('image')
diff --git a/tempest/api/image/v1/test_image_members.py b/tempest/api/image/v1/test_image_members.py
index 9c211ef06..4902316b1 100644
--- a/tempest/api/image/v1/test_image_members.py
+++ b/tempest/api/image/v1/test_image_members.py
@@ -14,13 +14,13 @@
from tempest.api.image import base
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
-from tempest import test
class ImageMembersTest(base.BaseV1ImageMembersTest):
- @test.idempotent_id('1d6ef640-3a20-4c84-8710-d95828fdb6ad')
+ @decorators.idempotent_id('1d6ef640-3a20-4c84-8710-d95828fdb6ad')
def test_add_image_member(self):
image = self._create_image()
self.image_member_client.create_image_member(image, self.alt_tenant_id)
@@ -31,7 +31,7 @@ class ImageMembersTest(base.BaseV1ImageMembersTest):
# get image as alt user
self.alt_img_cli.show_image(image)
- @test.idempotent_id('6a5328a5-80e8-4b82-bd32-6c061f128da9')
+ @decorators.idempotent_id('6a5328a5-80e8-4b82-bd32-6c061f128da9')
def test_get_shared_images(self):
image = self._create_image()
self.image_member_client.create_image_member(image, self.alt_tenant_id)
@@ -45,7 +45,7 @@ class ImageMembersTest(base.BaseV1ImageMembersTest):
self.assertIn(share_image, images)
self.assertIn(image, images)
- @test.idempotent_id('a76a3191-8948-4b44-a9d6-4053e5f2b138')
+ @decorators.idempotent_id('a76a3191-8948-4b44-a9d6-4053e5f2b138')
def test_remove_member(self):
image_id = self._create_image()
self.image_member_client.create_image_member(image_id,
diff --git a/tempest/api/image/v1/test_image_members_negative.py b/tempest/api/image/v1/test_image_members_negative.py
index 25387813b..d1aa801f3 100644
--- a/tempest/api/image/v1/test_image_members_negative.py
+++ b/tempest/api/image/v1/test_image_members_negative.py
@@ -14,6 +14,7 @@
from tempest.api.image import base
from tempest.common.utils import data_utils
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -21,7 +22,7 @@ from tempest import test
class ImageMembersNegativeTest(base.BaseV1ImageMembersTest):
@test.attr(type=['negative'])
- @test.idempotent_id('147a9536-18e3-45da-91ea-b037a028f364')
+ @decorators.idempotent_id('147a9536-18e3-45da-91ea-b037a028f364')
def test_add_member_with_non_existing_image(self):
# Add member with non existing image.
non_exist_image = data_utils.rand_uuid()
@@ -30,7 +31,7 @@ class ImageMembersNegativeTest(base.BaseV1ImageMembersTest):
non_exist_image, self.alt_tenant_id)
@test.attr(type=['negative'])
- @test.idempotent_id('e1559f05-b667-4f1b-a7af-518b52dc0c0f')
+ @decorators.idempotent_id('e1559f05-b667-4f1b-a7af-518b52dc0c0f')
def test_delete_member_with_non_existing_image(self):
# Delete member with non existing image.
non_exist_image = data_utils.rand_uuid()
@@ -39,7 +40,7 @@ class ImageMembersNegativeTest(base.BaseV1ImageMembersTest):
non_exist_image, self.alt_tenant_id)
@test.attr(type=['negative'])
- @test.idempotent_id('f5720333-dd69-4194-bb76-d2f048addd56')
+ @decorators.idempotent_id('f5720333-dd69-4194-bb76-d2f048addd56')
def test_delete_member_with_non_existing_tenant(self):
# Delete member with non existing tenant.
image_id = self._create_image()
@@ -49,7 +50,7 @@ class ImageMembersNegativeTest(base.BaseV1ImageMembersTest):
image_id, non_exist_tenant)
@test.attr(type=['negative'])
- @test.idempotent_id('f25f89e4-0b6c-453b-a853-1f80b9d7ef26')
+ @decorators.idempotent_id('f25f89e4-0b6c-453b-a853-1f80b9d7ef26')
def test_get_image_without_membership(self):
# Image is hidden from another tenants.
image_id = self._create_image()
diff --git a/tempest/api/image/v1/test_images.py b/tempest/api/image/v1/test_images.py
index b22ceedb3..a79c18c71 100644
--- a/tempest/api/image/v1/test_images.py
+++ b/tempest/api/image/v1/test_images.py
@@ -20,8 +20,8 @@ from tempest.common import image as common_image
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
+from tempest.lib import decorators
from tempest.lib import exceptions
-from tempest import test
CONF = config.CONF
@@ -54,7 +54,7 @@ def get_container_and_disk_format():
class CreateRegisterImagesTest(base.BaseV1ImageTest):
"""Here we test the registration and creation of images."""
- @test.idempotent_id('3027f8e6-3492-4a11-8575-c3293017af4d')
+ @decorators.idempotent_id('3027f8e6-3492-4a11-8575-c3293017af4d')
def test_register_then_upload(self):
# Register, then upload an image
properties = {'prop1': 'val1'}
@@ -76,7 +76,7 @@ class CreateRegisterImagesTest(base.BaseV1ImageTest):
self.assertIn('size', body)
self.assertEqual(1024, body.get('size'))
- @test.idempotent_id('69da74d9-68a9-404b-9664-ff7164ccb0f5')
+ @decorators.idempotent_id('69da74d9-68a9-404b-9664-ff7164ccb0f5')
def test_register_remote_image(self):
# Register a new remote image
container_format, disk_format = get_container_and_disk_format()
@@ -93,7 +93,7 @@ class CreateRegisterImagesTest(base.BaseV1ImageTest):
self.assertEqual(properties['key1'], 'value1')
self.assertEqual(properties['key2'], 'value2')
- @test.idempotent_id('6d0e13a7-515b-460c-b91f-9f4793f09816')
+ @decorators.idempotent_id('6d0e13a7-515b-460c-b91f-9f4793f09816')
def test_register_http_image(self):
container_format, disk_format = get_container_and_disk_format()
image = self.create_image(name='New Http Image',
@@ -105,7 +105,7 @@ class CreateRegisterImagesTest(base.BaseV1ImageTest):
waiters.wait_for_image_status(self.client, image['id'], 'active')
self.client.show_image(image['id'])
- @test.idempotent_id('05b19d55-140c-40d0-b36b-fafd774d421b')
+ @decorators.idempotent_id('05b19d55-140c-40d0-b36b-fafd774d421b')
def test_register_image_with_min_ram(self):
# Register an image with min ram
container_format, disk_format = get_container_and_disk_format()
@@ -210,7 +210,7 @@ class ListImagesTest(base.BaseV1ImageTest):
is_public=False, data=image_file)
return image['id']
- @test.idempotent_id('246178ab-3b33-4212-9a4b-a7fe8261794d')
+ @decorators.idempotent_id('246178ab-3b33-4212-9a4b-a7fe8261794d')
def test_index_no_params(self):
# Simple test to see all fixture images returned
images_list = self.client.list_images()['images']
@@ -218,7 +218,7 @@ class ListImagesTest(base.BaseV1ImageTest):
for image_id in self.created_images:
self.assertIn(image_id, image_list)
- @test.idempotent_id('f1755589-63d6-4468-b098-589820eb4031')
+ @decorators.idempotent_id('f1755589-63d6-4468-b098-589820eb4031')
def test_index_disk_format(self):
images_list = self.client.list_images(
disk_format=self.disk_format_alt)['images']
@@ -229,7 +229,7 @@ class ListImagesTest(base.BaseV1ImageTest):
self.assertFalse(self.created_set - self.same_disk_format_set
<= result_set)
- @test.idempotent_id('2143655d-96d9-4bec-9188-8674206b4b3b')
+ @decorators.idempotent_id('2143655d-96d9-4bec-9188-8674206b4b3b')
def test_index_container_format(self):
images_list = self.client.list_images(
container_format=self.container_format)['images']
@@ -240,7 +240,7 @@ class ListImagesTest(base.BaseV1ImageTest):
self.assertFalse(self.created_set - self.same_container_format_set
<= result_set)
- @test.idempotent_id('feb32ac6-22bb-4a16-afd8-9454bb714b14')
+ @decorators.idempotent_id('feb32ac6-22bb-4a16-afd8-9454bb714b14')
def test_index_max_size(self):
images_list = self.client.list_images(size_max=42)['images']
for image in images_list:
@@ -249,7 +249,7 @@ class ListImagesTest(base.BaseV1ImageTest):
self.assertTrue(self.size42_set <= result_set)
self.assertFalse(self.created_set - self.size42_set <= result_set)
- @test.idempotent_id('6ffc16d0-4cbf-4401-95c8-4ac63eac34d8')
+ @decorators.idempotent_id('6ffc16d0-4cbf-4401-95c8-4ac63eac34d8')
def test_index_min_size(self):
images_list = self.client.list_images(size_min=142)['images']
for image in images_list:
@@ -258,7 +258,7 @@ class ListImagesTest(base.BaseV1ImageTest):
self.assertTrue(self.size142_set <= result_set)
self.assertFalse(self.size42_set <= result_set)
- @test.idempotent_id('e5dc26d9-9aa2-48dd-bda5-748e1445da98')
+ @decorators.idempotent_id('e5dc26d9-9aa2-48dd-bda5-748e1445da98')
def test_index_status_active_detail(self):
images_list = self.client.list_images(detail=True,
status='active',
@@ -271,7 +271,7 @@ class ListImagesTest(base.BaseV1ImageTest):
top_size = size
self.assertEqual(image['status'], 'active')
- @test.idempotent_id('097af10a-bae8-4342-bff4-edf89969ed2a')
+ @decorators.idempotent_id('097af10a-bae8-4342-bff4-edf89969ed2a')
def test_index_name(self):
images_list = self.client.list_images(
detail=True,
@@ -305,7 +305,7 @@ class UpdateImageMetaTest(base.BaseV1ImageTest):
properties={'key1': 'value1'})
return image['id']
- @test.idempotent_id('01752c1c-0275-4de3-9e5b-876e44541928')
+ @decorators.idempotent_id('01752c1c-0275-4de3-9e5b-876e44541928')
def test_list_image_metadata(self):
# All metadata key/value pairs for an image should be returned
resp = self.client.check_image(self.image_id)
@@ -313,7 +313,7 @@ class UpdateImageMetaTest(base.BaseV1ImageTest):
expected = {'key1': 'value1'}
self.assertEqual(expected, resp_metadata['properties'])
- @test.idempotent_id('d6d7649c-08ce-440d-9ea7-e3dda552f33c')
+ @decorators.idempotent_id('d6d7649c-08ce-440d-9ea7-e3dda552f33c')
def test_update_image_metadata(self):
# The metadata for the image should match the updated values
req_metadata = {'key1': 'alt1', 'key2': 'value2'}
diff --git a/tempest/api/image/v1/test_images_negative.py b/tempest/api/image/v1/test_images_negative.py
index 3493cc264..abec82aa6 100644
--- a/tempest/api/image/v1/test_images_negative.py
+++ b/tempest/api/image/v1/test_images_negative.py
@@ -16,6 +16,7 @@
from tempest.api.image import base
from tempest.common.utils import data_utils
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -24,7 +25,7 @@ class CreateDeleteImagesNegativeTest(base.BaseV1ImageTest):
"""Here are negative tests for the deletion and creation of images."""
@test.attr(type=['negative'])
- @test.idempotent_id('036ede36-6160-4463-8c01-c781eee6369d')
+ @decorators.idempotent_id('036ede36-6160-4463-8c01-c781eee6369d')
def test_register_with_invalid_container_format(self):
# Negative tests for invalid data supplied to POST /images
self.assertRaises(lib_exc.BadRequest, self.client.create_image,
@@ -33,7 +34,7 @@ class CreateDeleteImagesNegativeTest(base.BaseV1ImageTest):
'x-image-meta-disk_format': 'vhd'})
@test.attr(type=['negative'])
- @test.idempotent_id('993face5-921d-4e84-aabf-c1bba4234a67')
+ @decorators.idempotent_id('993face5-921d-4e84-aabf-c1bba4234a67')
def test_register_with_invalid_disk_format(self):
self.assertRaises(lib_exc.BadRequest, self.client.create_image,
headers={'x-image-meta-name': 'test',
@@ -41,7 +42,7 @@ class CreateDeleteImagesNegativeTest(base.BaseV1ImageTest):
'x-image-meta-disk_format': 'wrong'})
@test.attr(type=['negative'])
- @test.idempotent_id('ec652588-7e3c-4b67-a2f2-0fa96f57c8fc')
+ @decorators.idempotent_id('ec652588-7e3c-4b67-a2f2-0fa96f57c8fc')
def test_delete_non_existent_image(self):
# Return an error while trying to delete a non-existent image
@@ -50,13 +51,13 @@ class CreateDeleteImagesNegativeTest(base.BaseV1ImageTest):
non_existent_image_id)
@test.attr(type=['negative'])
- @test.idempotent_id('04f72aa3-fcec-45a3-81a3-308ef7cc82bc')
+ @decorators.idempotent_id('04f72aa3-fcec-45a3-81a3-308ef7cc82bc')
def test_delete_image_blank_id(self):
# Return an error while trying to delete an image with blank Id
self.assertRaises(lib_exc.NotFound, self.client.delete_image, '')
@test.attr(type=['negative'])
- @test.idempotent_id('950e5054-a3c7-4dee-ada5-e576f1087abd')
+ @decorators.idempotent_id('950e5054-a3c7-4dee-ada5-e576f1087abd')
def test_delete_image_non_hex_string_id(self):
# Return an error while trying to delete an image with non hex id
invalid_image_id = data_utils.rand_uuid()[:-1] + "j"
@@ -64,13 +65,13 @@ class CreateDeleteImagesNegativeTest(base.BaseV1ImageTest):
invalid_image_id)
@test.attr(type=['negative'])
- @test.idempotent_id('4ed757cd-450c-44b1-9fd1-c819748c650d')
+ @decorators.idempotent_id('4ed757cd-450c-44b1-9fd1-c819748c650d')
def test_delete_image_negative_image_id(self):
# Return an error while trying to delete an image with negative id
self.assertRaises(lib_exc.NotFound, self.client.delete_image, -1)
@test.attr(type=['negative'])
- @test.idempotent_id('a4a448ab-3db2-4d2d-b9b2-6a1271241dfe')
+ @decorators.idempotent_id('a4a448ab-3db2-4d2d-b9b2-6a1271241dfe')
def test_delete_image_id_over_character_limit(self):
# Return an error while trying to delete image with id over limit
overlimit_image_id = data_utils.rand_uuid() + "1"
diff --git a/tempest/api/image/v2/test_images.py b/tempest/api/image/v2/test_images.py
index 36dc6c304..56b3517d4 100644
--- a/tempest/api/image/v2/test_images.py
+++ b/tempest/api/image/v2/test_images.py
@@ -22,6 +22,7 @@ from oslo_log import log as logging
from tempest.api.image import base
from tempest.common.utils import data_utils
from tempest import config
+from tempest.lib import decorators
from tempest import test
CONF = config.CONF
@@ -32,7 +33,7 @@ class BasicOperationsImagesTest(base.BaseV2ImageTest):
"""Here we test the basic operations of images"""
@test.attr(type='smoke')
- @test.idempotent_id('139b765e-7f3d-4b3d-8b37-3ca3876ee318')
+ @decorators.idempotent_id('139b765e-7f3d-4b3d-8b37-3ca3876ee318')
def test_register_upload_get_image_file(self):
"""Here we test these functionalities
@@ -74,7 +75,7 @@ class BasicOperationsImagesTest(base.BaseV2ImageTest):
self.assertEqual(file_content, body.data)
@test.attr(type='smoke')
- @test.idempotent_id('f848bb94-1c6e-45a4-8726-39e3a5b23535')
+ @decorators.idempotent_id('f848bb94-1c6e-45a4-8726-39e3a5b23535')
def test_delete_image(self):
# Deletes an image by image_id
@@ -96,7 +97,7 @@ class BasicOperationsImagesTest(base.BaseV2ImageTest):
self.assertNotIn(image['id'], images_id)
@test.attr(type='smoke')
- @test.idempotent_id('f66891a7-a35c-41a8-b590-a065c2a1caa6')
+ @decorators.idempotent_id('f66891a7-a35c-41a8-b590-a065c2a1caa6')
def test_update_image(self):
# Updates an image by image_id
@@ -194,7 +195,7 @@ class ListUserImagesTest(base.BaseV2ImageTest):
msg = 'The list of images was not sorted correctly.'
self.assertEqual(sorted(sorted_list, reverse=desc), sorted_list, msg)
- @test.idempotent_id('1e341d7a-90a9-494c-b143-2cdf2aeb6aee')
+ @decorators.idempotent_id('1e341d7a-90a9-494c-b143-2cdf2aeb6aee')
def test_list_no_params(self):
# Simple test to see all fixture images returned
images_list = self.client.list_images()['images']
@@ -203,25 +204,25 @@ class ListUserImagesTest(base.BaseV2ImageTest):
for image in self.created_images:
self.assertIn(image, image_list)
- @test.idempotent_id('9959ca1d-1aa7-4b7a-a1ea-0fff0499b37e')
+ @decorators.idempotent_id('9959ca1d-1aa7-4b7a-a1ea-0fff0499b37e')
def test_list_images_param_container_format(self):
# Test to get all images with a specific container_format
params = {"container_format": self.test_data['container_format']}
self._list_by_param_value_and_assert(params)
- @test.idempotent_id('4a4735a7-f22f-49b6-b0d9-66e1ef7453eb')
+ @decorators.idempotent_id('4a4735a7-f22f-49b6-b0d9-66e1ef7453eb')
def test_list_images_param_disk_format(self):
# Test to get all images with disk_format = raw
params = {"disk_format": "raw"}
self._list_by_param_value_and_assert(params)
- @test.idempotent_id('7a95bb92-d99e-4b12-9718-7bc6ab73e6d2')
+ @decorators.idempotent_id('7a95bb92-d99e-4b12-9718-7bc6ab73e6d2')
def test_list_images_param_visibility(self):
# Test to get all images with visibility = private
params = {"visibility": "private"}
self._list_by_param_value_and_assert(params)
- @test.idempotent_id('cf1b9a48-8340-480e-af7b-fe7e17690876')
+ @decorators.idempotent_id('cf1b9a48-8340-480e-af7b-fe7e17690876')
def test_list_images_param_size(self):
# Test to get all images by size
image_id = self.created_images[0]
@@ -231,7 +232,7 @@ class ListUserImagesTest(base.BaseV2ImageTest):
params = {"size": image['size']}
self._list_by_param_value_and_assert(params)
- @test.idempotent_id('4ad8c157-971a-4ba8-aa84-ed61154b1e7f')
+ @decorators.idempotent_id('4ad8c157-971a-4ba8-aa84-ed61154b1e7f')
def test_list_images_param_min_max_size(self):
# Test to get all images with size between 2000 to 3000
image_id = self.created_images[0]
@@ -249,13 +250,13 @@ class ListUserImagesTest(base.BaseV2ImageTest):
self.assertLessEqual(image_size, params['size_max'],
"Failed to get images by size_max")
- @test.idempotent_id('7fc9e369-0f58-4d05-9aa5-0969e2d59d15')
+ @decorators.idempotent_id('7fc9e369-0f58-4d05-9aa5-0969e2d59d15')
def test_list_images_param_status(self):
# Test to get all active images
params = {"status": "active"}
self._list_by_param_value_and_assert(params)
- @test.idempotent_id('e914a891-3cc8-4b40-ad32-e0a39ffbddbb')
+ @decorators.idempotent_id('e914a891-3cc8-4b40-ad32-e0a39ffbddbb')
def test_list_images_param_limit(self):
# Test to get images by limit
params = {"limit": 1}
@@ -264,7 +265,7 @@ class ListUserImagesTest(base.BaseV2ImageTest):
self.assertEqual(len(images_list), params['limit'],
"Failed to get images by limit")
- @test.idempotent_id('e9a44b91-31c8-4b40-a332-e0a39ffb4dbb')
+ @decorators.idempotent_id('e9a44b91-31c8-4b40-a332-e0a39ffb4dbb')
def test_list_image_param_owner(self):
# Test to get images by owner
image_id = self.created_images[0]
@@ -274,13 +275,13 @@ class ListUserImagesTest(base.BaseV2ImageTest):
params = {"owner": image['owner']}
self._list_by_param_value_and_assert(params)
- @test.idempotent_id('55c8f5f5-bfed-409d-a6d5-4caeda985d7b')
+ @decorators.idempotent_id('55c8f5f5-bfed-409d-a6d5-4caeda985d7b')
def test_list_images_param_name(self):
# Test to get images by name
params = {'name': self.test_data['name']}
self._list_by_param_value_and_assert(params)
- @test.idempotent_id('aa8ac4df-cff9-418b-8d0f-dd9c67b072c9')
+ @decorators.idempotent_id('aa8ac4df-cff9-418b-8d0f-dd9c67b072c9')
def test_list_images_param_tag(self):
# Test to get images matching a tag
params = {'tag': self.test_data['tags'][0]}
@@ -295,24 +296,24 @@ class ListUserImagesTest(base.BaseV2ImageTest):
observerd_tags=image['tags']))
self.assertIn(self.test_data['tags'][0], image['tags'], msg)
- @test.idempotent_id('eeadce49-04e0-43b7-aec7-52535d903e7a')
+ @decorators.idempotent_id('eeadce49-04e0-43b7-aec7-52535d903e7a')
def test_list_images_param_sort(self):
params = {'sort': 'size:desc'}
self._list_sorted_by_image_size_and_assert(params, desc=True)
- @test.idempotent_id('9faaa0c2-c3a5-43e1-8f61-61c54b409a49')
+ @decorators.idempotent_id('9faaa0c2-c3a5-43e1-8f61-61c54b409a49')
def test_list_images_param_sort_key_dir(self):
params = {'sort_key': 'size', 'sort_dir': 'desc'}
self._list_sorted_by_image_size_and_assert(params, desc=True)
- @test.idempotent_id('622b925c-479f-4736-860d-adeaf13bc371')
+ @decorators.idempotent_id('622b925c-479f-4736-860d-adeaf13bc371')
def test_get_image_schema(self):
# Test to get image schema
schema = "image"
body = self.schemas_client.show_schema(schema)
self.assertEqual("image", body['name'])
- @test.idempotent_id('25c8d7b2-df21-460f-87ac-93130bcdc684')
+ @decorators.idempotent_id('25c8d7b2-df21-460f-87ac-93130bcdc684')
def test_get_images_schema(self):
# Test to get images schema
schema = "images"
@@ -331,7 +332,7 @@ class ListSharedImagesTest(base.BaseV2ImageTest):
cls.image_member_client = cls.os.image_member_client_v2
cls.alt_img_client = cls.os_alt.image_client_v2
- @test.idempotent_id('3fa50be4-8e38-4c02-a8db-7811bb780122')
+ @decorators.idempotent_id('3fa50be4-8e38-4c02-a8db-7811bb780122')
def test_list_images_param_member_status(self):
# Create an image to be shared using default visibility
image_file = six.BytesIO(data_utils.random_bytes(2048))
diff --git a/tempest/api/image/v2/test_images_member.py b/tempest/api/image/v2/test_images_member.py
index 8a4b334c4..7a495e75d 100644
--- a/tempest/api/image/v2/test_images_member.py
+++ b/tempest/api/image/v2/test_images_member.py
@@ -11,12 +11,12 @@
# under the License.
from tempest.api.image import base
-from tempest import test
+from tempest.lib import decorators
class ImagesMemberTest(base.BaseV2MemberImageTest):
- @test.idempotent_id('5934c6ea-27dc-4d6e-9421-eeb5e045494a')
+ @decorators.idempotent_id('5934c6ea-27dc-4d6e-9421-eeb5e045494a')
def test_image_share_accept(self):
image_id = self._create_image()
member = self.image_member_client.create_image_member(
@@ -39,7 +39,7 @@ class ImagesMemberTest(base.BaseV2MemberImageTest):
self.assertEqual(member['image_id'], image_id)
self.assertEqual(member['status'], 'accepted')
- @test.idempotent_id('d9e83e5f-3524-4b38-a900-22abcb26e90e')
+ @decorators.idempotent_id('d9e83e5f-3524-4b38-a900-22abcb26e90e')
def test_image_share_reject(self):
image_id = self._create_image()
member = self.image_member_client.create_image_member(
@@ -55,7 +55,7 @@ class ImagesMemberTest(base.BaseV2MemberImageTest):
status='rejected')
self.assertNotIn(image_id, self._list_image_ids_as_alt())
- @test.idempotent_id('a6ee18b9-4378-465e-9ad9-9a6de58a3287')
+ @decorators.idempotent_id('a6ee18b9-4378-465e-9ad9-9a6de58a3287')
def test_get_image_member(self):
image_id = self._create_image()
self.image_member_client.create_image_member(
@@ -73,7 +73,7 @@ class ImagesMemberTest(base.BaseV2MemberImageTest):
self.assertEqual(image_id, member['image_id'])
self.assertEqual('accepted', member['status'])
- @test.idempotent_id('72989bc7-2268-48ed-af22-8821e835c914')
+ @decorators.idempotent_id('72989bc7-2268-48ed-af22-8821e835c914')
def test_remove_image_member(self):
image_id = self._create_image()
self.image_member_client.create_image_member(
@@ -87,17 +87,17 @@ class ImagesMemberTest(base.BaseV2MemberImageTest):
self.alt_tenant_id)
self.assertNotIn(image_id, self._list_image_ids_as_alt())
- @test.idempotent_id('634dcc3f-f6e2-4409-b8fd-354a0bb25d83')
+ @decorators.idempotent_id('634dcc3f-f6e2-4409-b8fd-354a0bb25d83')
def test_get_image_member_schema(self):
body = self.schemas_client.show_schema("member")
self.assertEqual("member", body['name'])
- @test.idempotent_id('6ae916ef-1052-4e11-8d36-b3ae14853cbb')
+ @decorators.idempotent_id('6ae916ef-1052-4e11-8d36-b3ae14853cbb')
def test_get_image_members_schema(self):
body = self.schemas_client.show_schema("members")
self.assertEqual("members", body['name'])
- @test.idempotent_id('cb961424-3f68-4d21-8e36-30ad66fb6bfb')
+ @decorators.idempotent_id('cb961424-3f68-4d21-8e36-30ad66fb6bfb')
def test_get_private_image(self):
image_id = self._create_image()
member = self.image_member_client.create_image_member(
diff --git a/tempest/api/image/v2/test_images_member_negative.py b/tempest/api/image/v2/test_images_member_negative.py
index fa29a92ae..ae9630aaa 100644
--- a/tempest/api/image/v2/test_images_member_negative.py
+++ b/tempest/api/image/v2/test_images_member_negative.py
@@ -11,6 +11,7 @@
# under the License.
from tempest.api.image import base
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -18,7 +19,7 @@ from tempest import test
class ImagesMemberNegativeTest(base.BaseV2MemberImageTest):
@test.attr(type=['negative'])
- @test.idempotent_id('b79efb37-820d-4cf0-b54c-308b00cf842c')
+ @decorators.idempotent_id('b79efb37-820d-4cf0-b54c-308b00cf842c')
def test_image_share_invalid_status(self):
image_id = self._create_image()
member = self.image_member_client.create_image_member(
@@ -30,7 +31,7 @@ class ImagesMemberNegativeTest(base.BaseV2MemberImageTest):
status='notavalidstatus')
@test.attr(type=['negative'])
- @test.idempotent_id('27002f74-109e-4a37-acd0-f91cd4597967')
+ @decorators.idempotent_id('27002f74-109e-4a37-acd0-f91cd4597967')
def test_image_share_owner_cannot_accept(self):
image_id = self._create_image()
member = self.image_member_client.create_image_member(
diff --git a/tempest/api/image/v2/test_images_metadefs_namespace_objects.py b/tempest/api/image/v2/test_images_metadefs_namespace_objects.py
index 95d15211a..38e56d49c 100644
--- a/tempest/api/image/v2/test_images_metadefs_namespace_objects.py
+++ b/tempest/api/image/v2/test_images_metadefs_namespace_objects.py
@@ -13,7 +13,7 @@
from tempest.api.image import base
from tempest.common.utils import data_utils
from tempest.lib.common.utils import test_utils
-from tempest import test
+from tempest.lib import decorators
class MetadataNamespaceObjectsTest(base.BaseV2ImageTest):
@@ -28,7 +28,7 @@ class MetadataNamespaceObjectsTest(base.BaseV2ImageTest):
namespace['namespace'], object_name)
return namespace_object
- @test.idempotent_id('b1a3775e-3b5c-4f6a-a3b4-1ba3574ae718')
+ @decorators.idempotent_id('b1a3775e-3b5c-4f6a-a3b4-1ba3574ae718')
def test_create_update_delete_meta_namespace_objects(self):
# Create a namespace
namespace = self.create_namespace()
@@ -50,7 +50,7 @@ class MetadataNamespaceObjectsTest(base.BaseV2ImageTest):
namespace['namespace'])['objects']]
self.assertNotIn(up_object_name, namespace_objects)
- @test.idempotent_id('a2a3615e-3b5c-3f6a-a2b1-1ba3574ae738')
+ @decorators.idempotent_id('a2a3615e-3b5c-3f6a-a2b1-1ba3574ae738')
def test_list_meta_namespace_objects(self):
# Create a namespace object
namespace = self.create_namespace()
@@ -62,7 +62,7 @@ class MetadataNamespaceObjectsTest(base.BaseV2ImageTest):
namespace['namespace'])['objects']]
self.assertIn(meta_namespace_object['name'], namespace_objects)
- @test.idempotent_id('b1a3674e-3b4c-3f6a-a3b4-1ba3573ca768')
+ @decorators.idempotent_id('b1a3674e-3b4c-3f6a-a3b4-1ba3573ca768')
def test_show_meta_namespace_objects(self):
# Create a namespace object
namespace = self.create_namespace()
diff --git a/tempest/api/image/v2/test_images_metadefs_namespace_properties.py b/tempest/api/image/v2/test_images_metadefs_namespace_properties.py
index 7113db4ee..ead70f2a8 100644
--- a/tempest/api/image/v2/test_images_metadefs_namespace_properties.py
+++ b/tempest/api/image/v2/test_images_metadefs_namespace_properties.py
@@ -12,13 +12,13 @@
from tempest.api.image import base
from tempest.common.utils import data_utils
-from tempest import test
+from tempest.lib import decorators
class MetadataNamespacePropertiesTest(base.BaseV2ImageTest):
"""Test the Metadata definition namespace property basic functionality"""
- @test.idempotent_id('b1a3765e-3a5d-4f6d-a3a7-3ca3476ae768')
+ @decorators.idempotent_id('b1a3765e-3a5d-4f6d-a3a7-3ca3476ae768')
def test_basic_meta_def_namespace_property(self):
# Get the available resource types and use one resource_type
body = self.resource_types_client.list_resource_types()
diff --git a/tempest/api/image/v2/test_images_metadefs_namespace_tags.py b/tempest/api/image/v2/test_images_metadefs_namespace_tags.py
index 186d9c8c2..608d9fc83 100644
--- a/tempest/api/image/v2/test_images_metadefs_namespace_tags.py
+++ b/tempest/api/image/v2/test_images_metadefs_namespace_tags.py
@@ -13,7 +13,7 @@
from tempest.api.image import base
from tempest.common.utils import data_utils
from tempest.lib.common.utils import test_utils
-from tempest import test
+from tempest.lib import decorators
class MetadataNamespaceTagsTest(base.BaseV2ImageTest):
@@ -41,7 +41,7 @@ class MetadataNamespaceTagsTest(base.BaseV2ImageTest):
namespace['namespace'])
return namespace_tags
- @test.idempotent_id('a2a3765e-3a6d-4f6d-a3a7-3cc3476aa876')
+ @decorators.idempotent_id('a2a3765e-3a6d-4f6d-a3a7-3cc3476aa876')
def test_create_list_delete_namespace_tags(self):
# Create a namespace
namespace = self.create_namespace()
@@ -60,7 +60,7 @@ class MetadataNamespaceTagsTest(base.BaseV2ImageTest):
namespace['namespace'])
self.assertEqual([], body['tags'])
- @test.idempotent_id('a2a3765e-1a2c-3f6d-a3a7-3cc3466ab875')
+ @decorators.idempotent_id('a2a3765e-1a2c-3f6d-a3a7-3cc3466ab875')
def test_create_update_delete_tag(self):
# Create a namespace
namespace = self.create_namespace()
diff --git a/tempest/api/image/v2/test_images_metadefs_namespaces.py b/tempest/api/image/v2/test_images_metadefs_namespaces.py
index a80a0cf71..9fda93771 100644
--- a/tempest/api/image/v2/test_images_metadefs_namespaces.py
+++ b/tempest/api/image/v2/test_images_metadefs_namespaces.py
@@ -16,14 +16,14 @@
from tempest.api.image import base
from tempest.common.utils import data_utils
from tempest.lib.common.utils import test_utils
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
-from tempest import test
class MetadataNamespacesTest(base.BaseV2ImageTest):
"""Test the Metadata definition Namespaces basic functionality"""
- @test.idempotent_id('319b765e-7f3d-4b3d-8b37-3ca3876ee768')
+ @decorators.idempotent_id('319b765e-7f3d-4b3d-8b37-3ca3876ee768')
def test_basic_metadata_definition_namespaces(self):
# get the available resource types and use one resource_type
body = self.resource_types_client.list_resource_types()
diff --git a/tempest/api/image/v2/test_images_metadefs_resource_types.py b/tempest/api/image/v2/test_images_metadefs_resource_types.py
index 3dd432bcb..c60b3f716 100644
--- a/tempest/api/image/v2/test_images_metadefs_resource_types.py
+++ b/tempest/api/image/v2/test_images_metadefs_resource_types.py
@@ -14,13 +14,13 @@
# under the License.
from tempest.api.image import base
-from tempest import test
+from tempest.lib import decorators
class MetadataResourceTypesTest(base.BaseV2ImageTest):
"""Test the Metadata definition resource types basic functionality"""
- @test.idempotent_id('6f358a4e-5ef0-11e6-a795-080027d0d606')
+ @decorators.idempotent_id('6f358a4e-5ef0-11e6-a795-080027d0d606')
def test_basic_meta_def_resource_type_association(self):
# Get the available resource types and use one resource_type
body = self.resource_types_client.list_resource_types()
diff --git a/tempest/api/image/v2/test_images_metadefs_schema.py b/tempest/api/image/v2/test_images_metadefs_schema.py
index 7edf1afab..95cc31079 100644
--- a/tempest/api/image/v2/test_images_metadefs_schema.py
+++ b/tempest/api/image/v2/test_images_metadefs_schema.py
@@ -14,67 +14,67 @@
# under the License.
from tempest.api.image import base
-from tempest import test
+from tempest.lib import decorators
class MetadataSchemaTest(base.BaseV2ImageTest):
"""Test to get metadata schema"""
- @test.idempotent_id('e9e44891-3cb8-3b40-a532-e0a39fea3dab')
+ @decorators.idempotent_id('e9e44891-3cb8-3b40-a532-e0a39fea3dab')
def test_get_metadata_namespace_schema(self):
# Test to get namespace schema
body = self.schemas_client.show_schema("metadefs/namespace")
self.assertEqual("namespace", body['name'])
- @test.idempotent_id('ffe44891-678b-3ba0-a3e2-e0a3967b3aeb')
+ @decorators.idempotent_id('ffe44891-678b-3ba0-a3e2-e0a3967b3aeb')
def test_get_metadata_namespaces_schema(self):
# Test to get namespaces schema
body = self.schemas_client.show_schema("metadefs/namespaces")
self.assertEqual("namespaces", body['name'])
- @test.idempotent_id('fde34891-678b-3b40-ae32-e0a3e67b6beb')
+ @decorators.idempotent_id('fde34891-678b-3b40-ae32-e0a3e67b6beb')
def test_get_metadata_resource_type_schema(self):
# Test to get resource_type schema
body = self.schemas_client.show_schema("metadefs/resource_type")
self.assertEqual("resource_type_association", body['name'])
- @test.idempotent_id('dfe4a891-b38b-3bf0-a3b2-e03ee67b3a3a')
+ @decorators.idempotent_id('dfe4a891-b38b-3bf0-a3b2-e03ee67b3a3a')
def test_get_metadata_resources_types_schema(self):
# Test to get resource_types schema
body = self.schemas_client.show_schema("metadefs/resource_types")
self.assertEqual("resource_type_associations", body['name'])
- @test.idempotent_id('dff4a891-b38b-3bf0-a3b2-e03ee67b3a3b')
+ @decorators.idempotent_id('dff4a891-b38b-3bf0-a3b2-e03ee67b3a3b')
def test_get_metadata_object_schema(self):
# Test to get object schema
body = self.schemas_client.show_schema("metadefs/object")
self.assertEqual("object", body['name'])
- @test.idempotent_id('dee4a891-b38b-3bf0-a3b2-e03ee67b3a3c')
+ @decorators.idempotent_id('dee4a891-b38b-3bf0-a3b2-e03ee67b3a3c')
def test_get_metadata_objects_schema(self):
# Test to get objects schema
body = self.schemas_client.show_schema("metadefs/objects")
self.assertEqual("objects", body['name'])
- @test.idempotent_id('dae4a891-b38b-3bf0-a3b2-e03ee67b3a3d')
+ @decorators.idempotent_id('dae4a891-b38b-3bf0-a3b2-e03ee67b3a3d')
def test_get_metadata_property_schema(self):
# Test to get property schema
body = self.schemas_client.show_schema("metadefs/property")
self.assertEqual("property", body['name'])
- @test.idempotent_id('dce4a891-b38b-3bf0-a3b2-e03ee67b3a3e')
+ @decorators.idempotent_id('dce4a891-b38b-3bf0-a3b2-e03ee67b3a3e')
def test_get_metadata_properties_schema(self):
# Test to get properties schema
body = self.schemas_client.show_schema("metadefs/properties")
self.assertEqual("properties", body['name'])
- @test.idempotent_id('dde4a891-b38b-3bf0-a3b2-e03ee67b3a3e')
+ @decorators.idempotent_id('dde4a891-b38b-3bf0-a3b2-e03ee67b3a3e')
def test_get_metadata_tag_schema(self):
# Test to get tag schema
body = self.schemas_client.show_schema("metadefs/tag")
self.assertEqual("tag", body['name'])
- @test.idempotent_id('cde4a891-b38b-3bf0-a3b2-e03ee67b3a3a')
+ @decorators.idempotent_id('cde4a891-b38b-3bf0-a3b2-e03ee67b3a3a')
def test_get_metadata_tags_schema(self):
# Test to get tags schema
body = self.schemas_client.show_schema("metadefs/tags")
diff --git a/tempest/api/image/v2/test_images_negative.py b/tempest/api/image/v2/test_images_negative.py
index cd1bca002..04c752af8 100644
--- a/tempest/api/image/v2/test_images_negative.py
+++ b/tempest/api/image/v2/test_images_negative.py
@@ -16,6 +16,7 @@
from tempest.api.image import base
from tempest.lib.common.utils import data_utils
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -34,7 +35,7 @@ class ImagesNegativeTest(base.BaseV2ImageTest):
"""
@test.attr(type=['negative'])
- @test.idempotent_id('668743d5-08ad-4480-b2b8-15da34f81d9f')
+ @decorators.idempotent_id('668743d5-08ad-4480-b2b8-15da34f81d9f')
def test_get_non_existent_image(self):
# get the non-existent image
non_existent_id = data_utils.rand_uuid()
@@ -42,14 +43,14 @@ class ImagesNegativeTest(base.BaseV2ImageTest):
non_existent_id)
@test.attr(type=['negative'])
- @test.idempotent_id('ef45000d-0a72-4781-866d-4cb7bf2562ad')
+ @decorators.idempotent_id('ef45000d-0a72-4781-866d-4cb7bf2562ad')
def test_get_image_null_id(self):
# get image with image_id = NULL
image_id = ""
self.assertRaises(lib_exc.NotFound, self.client.show_image, image_id)
@test.attr(type=['negative'])
- @test.idempotent_id('e57fc127-7ba0-4693-92d7-1d8a05ebcba9')
+ @decorators.idempotent_id('e57fc127-7ba0-4693-92d7-1d8a05ebcba9')
def test_get_delete_deleted_image(self):
# get and delete the deleted image
# create and delete image
@@ -68,7 +69,7 @@ class ImagesNegativeTest(base.BaseV2ImageTest):
image['id'])
@test.attr(type=['negative'])
- @test.idempotent_id('6fe40f1c-57bd-4918-89cc-8500f850f3de')
+ @decorators.idempotent_id('6fe40f1c-57bd-4918-89cc-8500f850f3de')
def test_delete_non_existing_image(self):
# delete non-existent image
non_existent_image_id = data_utils.rand_uuid()
@@ -76,7 +77,7 @@ class ImagesNegativeTest(base.BaseV2ImageTest):
non_existent_image_id)
@test.attr(type=['negative'])
- @test.idempotent_id('32248db1-ab88-4821-9604-c7c369f1f88c')
+ @decorators.idempotent_id('32248db1-ab88-4821-9604-c7c369f1f88c')
def test_delete_image_null_id(self):
# delete image with image_id=NULL
image_id = ""
@@ -84,7 +85,7 @@ class ImagesNegativeTest(base.BaseV2ImageTest):
image_id)
@test.attr(type=['negative'])
- @test.idempotent_id('292bd310-369b-41c7-a7a3-10276ef76753')
+ @decorators.idempotent_id('292bd310-369b-41c7-a7a3-10276ef76753')
def test_register_with_invalid_container_format(self):
# Negative tests for invalid data supplied to POST /images
self.assertRaises(lib_exc.BadRequest, self.client.create_image,
@@ -92,7 +93,7 @@ class ImagesNegativeTest(base.BaseV2ImageTest):
disk_format='vhd')
@test.attr(type=['negative'])
- @test.idempotent_id('70c6040c-5a97-4111-9e13-e73665264ce1')
+ @decorators.idempotent_id('70c6040c-5a97-4111-9e13-e73665264ce1')
def test_register_with_invalid_disk_format(self):
self.assertRaises(lib_exc.BadRequest, self.client.create_image,
name='test', container_format='bare',
diff --git a/tempest/api/image/v2/test_images_tags.py b/tempest/api/image/v2/test_images_tags.py
index 03f29bde7..fd9591f1d 100644
--- a/tempest/api/image/v2/test_images_tags.py
+++ b/tempest/api/image/v2/test_images_tags.py
@@ -14,12 +14,12 @@
from tempest.api.image import base
from tempest.common.utils import data_utils
-from tempest import test
+from tempest.lib import decorators
class ImagesTagsTest(base.BaseV2ImageTest):
- @test.idempotent_id('10407036-6059-4f95-a2cd-cbbbee7ed329')
+ @decorators.idempotent_id('10407036-6059-4f95-a2cd-cbbbee7ed329')
def test_update_delete_tags_for_image(self):
image = self.create_image(container_format='bare',
disk_format='raw',
diff --git a/tempest/api/image/v2/test_images_tags_negative.py b/tempest/api/image/v2/test_images_tags_negative.py
index af4ffcf1d..2a08f3a41 100644
--- a/tempest/api/image/v2/test_images_tags_negative.py
+++ b/tempest/api/image/v2/test_images_tags_negative.py
@@ -14,6 +14,7 @@
from tempest.api.image import base
from tempest.common.utils import data_utils
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -21,7 +22,7 @@ from tempest import test
class ImagesTagsNegativeTest(base.BaseV2ImageTest):
@test.attr(type=['negative'])
- @test.idempotent_id('8cd30f82-6f9a-4c6e-8034-c1b51fba43d9')
+ @decorators.idempotent_id('8cd30f82-6f9a-4c6e-8034-c1b51fba43d9')
def test_update_tags_for_non_existing_image(self):
# Update tag with non existing image.
tag = data_utils.rand_name('tag')
@@ -30,7 +31,7 @@ class ImagesTagsNegativeTest(base.BaseV2ImageTest):
non_exist_image, tag)
@test.attr(type=['negative'])
- @test.idempotent_id('39c023a2-325a-433a-9eea-649bf1414b19')
+ @decorators.idempotent_id('39c023a2-325a-433a-9eea-649bf1414b19')
def test_delete_non_existing_tag(self):
# Delete non existing tag.
image = self.create_image(container_format='bare',