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
This commit is contained in:
Ken'ichi Ohmichi
2017-01-27 17:55:24 -08:00
committed by Ken'ichi Ohmichi
parent f2d72d8f6d
commit f35efa216d
17 changed files with 101 additions and 95 deletions

View File

@@ -19,8 +19,8 @@ import testtools
from tempest.api.image import base from tempest.api.image import base
from tempest import config from tempest import config
from tempest.lib.common.utils import data_utils from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc from tempest.lib import exceptions as lib_exc
from tempest import test
CONF = config.CONF CONF = config.CONF
@@ -30,7 +30,7 @@ class BasicAdminOperationsImagesTest(base.BaseV2ImageAdminTest):
@testtools.skipUnless(CONF.image_feature_enabled.deactivate_image, @testtools.skipUnless(CONF.image_feature_enabled.deactivate_image,
'deactivate-image is not available.') '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): def test_admin_deactivate_reactivate_image(self):
# Create image by non-admin tenant # Create image by non-admin tenant
image_name = data_utils.rand_name('image') image_name = data_utils.rand_name('image')

View File

@@ -14,13 +14,13 @@
from tempest.api.image import base from tempest.api.image import base
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc from tempest.lib import exceptions as lib_exc
from tempest import test
class ImageMembersTest(base.BaseV1ImageMembersTest): 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): def test_add_image_member(self):
image = self._create_image() image = self._create_image()
self.image_member_client.create_image_member(image, self.alt_tenant_id) 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 # get image as alt user
self.alt_img_cli.show_image(image) 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): def test_get_shared_images(self):
image = self._create_image() image = self._create_image()
self.image_member_client.create_image_member(image, self.alt_tenant_id) 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(share_image, images)
self.assertIn(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): def test_remove_member(self):
image_id = self._create_image() image_id = self._create_image()
self.image_member_client.create_image_member(image_id, self.image_member_client.create_image_member(image_id,

View File

@@ -14,6 +14,7 @@
from tempest.api.image import base from tempest.api.image import base
from tempest.common.utils import data_utils from tempest.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc from tempest.lib import exceptions as lib_exc
from tempest import test from tempest import test
@@ -21,7 +22,7 @@ from tempest import test
class ImageMembersNegativeTest(base.BaseV1ImageMembersTest): class ImageMembersNegativeTest(base.BaseV1ImageMembersTest):
@test.attr(type=['negative']) @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): def test_add_member_with_non_existing_image(self):
# Add member with non existing image. # Add member with non existing image.
non_exist_image = data_utils.rand_uuid() non_exist_image = data_utils.rand_uuid()
@@ -30,7 +31,7 @@ class ImageMembersNegativeTest(base.BaseV1ImageMembersTest):
non_exist_image, self.alt_tenant_id) non_exist_image, self.alt_tenant_id)
@test.attr(type=['negative']) @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): def test_delete_member_with_non_existing_image(self):
# Delete member with non existing image. # Delete member with non existing image.
non_exist_image = data_utils.rand_uuid() non_exist_image = data_utils.rand_uuid()
@@ -39,7 +40,7 @@ class ImageMembersNegativeTest(base.BaseV1ImageMembersTest):
non_exist_image, self.alt_tenant_id) non_exist_image, self.alt_tenant_id)
@test.attr(type=['negative']) @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): def test_delete_member_with_non_existing_tenant(self):
# Delete member with non existing tenant. # Delete member with non existing tenant.
image_id = self._create_image() image_id = self._create_image()
@@ -49,7 +50,7 @@ class ImageMembersNegativeTest(base.BaseV1ImageMembersTest):
image_id, non_exist_tenant) image_id, non_exist_tenant)
@test.attr(type=['negative']) @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): def test_get_image_without_membership(self):
# Image is hidden from another tenants. # Image is hidden from another tenants.
image_id = self._create_image() image_id = self._create_image()

View File

@@ -20,8 +20,8 @@ from tempest.common import image as common_image
from tempest.common.utils import data_utils from tempest.common.utils import data_utils
from tempest.common import waiters from tempest.common import waiters
from tempest import config from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test
CONF = config.CONF CONF = config.CONF
@@ -54,7 +54,7 @@ def get_container_and_disk_format():
class CreateRegisterImagesTest(base.BaseV1ImageTest): class CreateRegisterImagesTest(base.BaseV1ImageTest):
"""Here we test the registration and creation of images.""" """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): def test_register_then_upload(self):
# Register, then upload an image # Register, then upload an image
properties = {'prop1': 'val1'} properties = {'prop1': 'val1'}
@@ -76,7 +76,7 @@ class CreateRegisterImagesTest(base.BaseV1ImageTest):
self.assertIn('size', body) self.assertIn('size', body)
self.assertEqual(1024, body.get('size')) 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): def test_register_remote_image(self):
# Register a new remote image # Register a new remote image
container_format, disk_format = get_container_and_disk_format() 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['key1'], 'value1')
self.assertEqual(properties['key2'], 'value2') 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): def test_register_http_image(self):
container_format, disk_format = get_container_and_disk_format() container_format, disk_format = get_container_and_disk_format()
image = self.create_image(name='New Http Image', 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') waiters.wait_for_image_status(self.client, image['id'], 'active')
self.client.show_image(image['id']) 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): def test_register_image_with_min_ram(self):
# Register an image with min ram # Register an image with min ram
container_format, disk_format = get_container_and_disk_format() container_format, disk_format = get_container_and_disk_format()
@@ -210,7 +210,7 @@ class ListImagesTest(base.BaseV1ImageTest):
is_public=False, data=image_file) is_public=False, data=image_file)
return image['id'] 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): def test_index_no_params(self):
# Simple test to see all fixture images returned # Simple test to see all fixture images returned
images_list = self.client.list_images()['images'] images_list = self.client.list_images()['images']
@@ -218,7 +218,7 @@ class ListImagesTest(base.BaseV1ImageTest):
for image_id in self.created_images: for image_id in self.created_images:
self.assertIn(image_id, image_list) 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): def test_index_disk_format(self):
images_list = self.client.list_images( images_list = self.client.list_images(
disk_format=self.disk_format_alt)['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 self.assertFalse(self.created_set - self.same_disk_format_set
<= result_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): def test_index_container_format(self):
images_list = self.client.list_images( images_list = self.client.list_images(
container_format=self.container_format)['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 self.assertFalse(self.created_set - self.same_container_format_set
<= result_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): def test_index_max_size(self):
images_list = self.client.list_images(size_max=42)['images'] images_list = self.client.list_images(size_max=42)['images']
for image in images_list: for image in images_list:
@@ -249,7 +249,7 @@ class ListImagesTest(base.BaseV1ImageTest):
self.assertTrue(self.size42_set <= result_set) self.assertTrue(self.size42_set <= result_set)
self.assertFalse(self.created_set - 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): def test_index_min_size(self):
images_list = self.client.list_images(size_min=142)['images'] images_list = self.client.list_images(size_min=142)['images']
for image in images_list: for image in images_list:
@@ -258,7 +258,7 @@ class ListImagesTest(base.BaseV1ImageTest):
self.assertTrue(self.size142_set <= result_set) self.assertTrue(self.size142_set <= result_set)
self.assertFalse(self.size42_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): def test_index_status_active_detail(self):
images_list = self.client.list_images(detail=True, images_list = self.client.list_images(detail=True,
status='active', status='active',
@@ -271,7 +271,7 @@ class ListImagesTest(base.BaseV1ImageTest):
top_size = size top_size = size
self.assertEqual(image['status'], 'active') 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): def test_index_name(self):
images_list = self.client.list_images( images_list = self.client.list_images(
detail=True, detail=True,
@@ -305,7 +305,7 @@ class UpdateImageMetaTest(base.BaseV1ImageTest):
properties={'key1': 'value1'}) properties={'key1': 'value1'})
return image['id'] 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): def test_list_image_metadata(self):
# All metadata key/value pairs for an image should be returned # All metadata key/value pairs for an image should be returned
resp = self.client.check_image(self.image_id) resp = self.client.check_image(self.image_id)
@@ -313,7 +313,7 @@ class UpdateImageMetaTest(base.BaseV1ImageTest):
expected = {'key1': 'value1'} expected = {'key1': 'value1'}
self.assertEqual(expected, resp_metadata['properties']) 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): def test_update_image_metadata(self):
# The metadata for the image should match the updated values # The metadata for the image should match the updated values
req_metadata = {'key1': 'alt1', 'key2': 'value2'} req_metadata = {'key1': 'alt1', 'key2': 'value2'}

View File

@@ -16,6 +16,7 @@
from tempest.api.image import base from tempest.api.image import base
from tempest.common.utils import data_utils from tempest.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc from tempest.lib import exceptions as lib_exc
from tempest import test from tempest import test
@@ -24,7 +25,7 @@ class CreateDeleteImagesNegativeTest(base.BaseV1ImageTest):
"""Here are negative tests for the deletion and creation of images.""" """Here are negative tests for the deletion and creation of images."""
@test.attr(type=['negative']) @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): def test_register_with_invalid_container_format(self):
# Negative tests for invalid data supplied to POST /images # Negative tests for invalid data supplied to POST /images
self.assertRaises(lib_exc.BadRequest, self.client.create_image, self.assertRaises(lib_exc.BadRequest, self.client.create_image,
@@ -33,7 +34,7 @@ class CreateDeleteImagesNegativeTest(base.BaseV1ImageTest):
'x-image-meta-disk_format': 'vhd'}) 'x-image-meta-disk_format': 'vhd'})
@test.attr(type=['negative']) @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): def test_register_with_invalid_disk_format(self):
self.assertRaises(lib_exc.BadRequest, self.client.create_image, self.assertRaises(lib_exc.BadRequest, self.client.create_image,
headers={'x-image-meta-name': 'test', headers={'x-image-meta-name': 'test',
@@ -41,7 +42,7 @@ class CreateDeleteImagesNegativeTest(base.BaseV1ImageTest):
'x-image-meta-disk_format': 'wrong'}) 'x-image-meta-disk_format': 'wrong'})
@test.attr(type=['negative']) @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): def test_delete_non_existent_image(self):
# Return an error while trying to delete a non-existent image # Return an error while trying to delete a non-existent image
@@ -50,13 +51,13 @@ class CreateDeleteImagesNegativeTest(base.BaseV1ImageTest):
non_existent_image_id) non_existent_image_id)
@test.attr(type=['negative']) @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): def test_delete_image_blank_id(self):
# Return an error while trying to delete an image with blank Id # Return an error while trying to delete an image with blank Id
self.assertRaises(lib_exc.NotFound, self.client.delete_image, '') self.assertRaises(lib_exc.NotFound, self.client.delete_image, '')
@test.attr(type=['negative']) @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): def test_delete_image_non_hex_string_id(self):
# Return an error while trying to delete an image with non hex id # Return an error while trying to delete an image with non hex id
invalid_image_id = data_utils.rand_uuid()[:-1] + "j" invalid_image_id = data_utils.rand_uuid()[:-1] + "j"
@@ -64,13 +65,13 @@ class CreateDeleteImagesNegativeTest(base.BaseV1ImageTest):
invalid_image_id) invalid_image_id)
@test.attr(type=['negative']) @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): def test_delete_image_negative_image_id(self):
# Return an error while trying to delete an image with negative id # Return an error while trying to delete an image with negative id
self.assertRaises(lib_exc.NotFound, self.client.delete_image, -1) self.assertRaises(lib_exc.NotFound, self.client.delete_image, -1)
@test.attr(type=['negative']) @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): def test_delete_image_id_over_character_limit(self):
# Return an error while trying to delete image with id over limit # Return an error while trying to delete image with id over limit
overlimit_image_id = data_utils.rand_uuid() + "1" overlimit_image_id = data_utils.rand_uuid() + "1"

View File

@@ -22,6 +22,7 @@ from oslo_log import log as logging
from tempest.api.image import base from tempest.api.image import base
from tempest.common.utils import data_utils from tempest.common.utils import data_utils
from tempest import config from tempest import config
from tempest.lib import decorators
from tempest import test from tempest import test
CONF = config.CONF CONF = config.CONF
@@ -32,7 +33,7 @@ class BasicOperationsImagesTest(base.BaseV2ImageTest):
"""Here we test the basic operations of images""" """Here we test the basic operations of images"""
@test.attr(type='smoke') @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): def test_register_upload_get_image_file(self):
"""Here we test these functionalities """Here we test these functionalities
@@ -74,7 +75,7 @@ class BasicOperationsImagesTest(base.BaseV2ImageTest):
self.assertEqual(file_content, body.data) self.assertEqual(file_content, body.data)
@test.attr(type='smoke') @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): def test_delete_image(self):
# Deletes an image by image_id # Deletes an image by image_id
@@ -96,7 +97,7 @@ class BasicOperationsImagesTest(base.BaseV2ImageTest):
self.assertNotIn(image['id'], images_id) self.assertNotIn(image['id'], images_id)
@test.attr(type='smoke') @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): def test_update_image(self):
# Updates an image by image_id # Updates an image by image_id
@@ -194,7 +195,7 @@ class ListUserImagesTest(base.BaseV2ImageTest):
msg = 'The list of images was not sorted correctly.' msg = 'The list of images was not sorted correctly.'
self.assertEqual(sorted(sorted_list, reverse=desc), sorted_list, msg) 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): def test_list_no_params(self):
# Simple test to see all fixture images returned # Simple test to see all fixture images returned
images_list = self.client.list_images()['images'] images_list = self.client.list_images()['images']
@@ -203,25 +204,25 @@ class ListUserImagesTest(base.BaseV2ImageTest):
for image in self.created_images: for image in self.created_images:
self.assertIn(image, image_list) 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): def test_list_images_param_container_format(self):
# Test to get all images with a specific container_format # Test to get all images with a specific container_format
params = {"container_format": self.test_data['container_format']} params = {"container_format": self.test_data['container_format']}
self._list_by_param_value_and_assert(params) 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): def test_list_images_param_disk_format(self):
# Test to get all images with disk_format = raw # Test to get all images with disk_format = raw
params = {"disk_format": "raw"} params = {"disk_format": "raw"}
self._list_by_param_value_and_assert(params) 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): def test_list_images_param_visibility(self):
# Test to get all images with visibility = private # Test to get all images with visibility = private
params = {"visibility": "private"} params = {"visibility": "private"}
self._list_by_param_value_and_assert(params) 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): def test_list_images_param_size(self):
# Test to get all images by size # Test to get all images by size
image_id = self.created_images[0] image_id = self.created_images[0]
@@ -231,7 +232,7 @@ class ListUserImagesTest(base.BaseV2ImageTest):
params = {"size": image['size']} params = {"size": image['size']}
self._list_by_param_value_and_assert(params) 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): def test_list_images_param_min_max_size(self):
# Test to get all images with size between 2000 to 3000 # Test to get all images with size between 2000 to 3000
image_id = self.created_images[0] image_id = self.created_images[0]
@@ -249,13 +250,13 @@ class ListUserImagesTest(base.BaseV2ImageTest):
self.assertLessEqual(image_size, params['size_max'], self.assertLessEqual(image_size, params['size_max'],
"Failed to get images by 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): def test_list_images_param_status(self):
# Test to get all active images # Test to get all active images
params = {"status": "active"} params = {"status": "active"}
self._list_by_param_value_and_assert(params) 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): def test_list_images_param_limit(self):
# Test to get images by limit # Test to get images by limit
params = {"limit": 1} params = {"limit": 1}
@@ -264,7 +265,7 @@ class ListUserImagesTest(base.BaseV2ImageTest):
self.assertEqual(len(images_list), params['limit'], self.assertEqual(len(images_list), params['limit'],
"Failed to get images by 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): def test_list_image_param_owner(self):
# Test to get images by owner # Test to get images by owner
image_id = self.created_images[0] image_id = self.created_images[0]
@@ -274,13 +275,13 @@ class ListUserImagesTest(base.BaseV2ImageTest):
params = {"owner": image['owner']} params = {"owner": image['owner']}
self._list_by_param_value_and_assert(params) 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): def test_list_images_param_name(self):
# Test to get images by name # Test to get images by name
params = {'name': self.test_data['name']} params = {'name': self.test_data['name']}
self._list_by_param_value_and_assert(params) 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): def test_list_images_param_tag(self):
# Test to get images matching a tag # Test to get images matching a tag
params = {'tag': self.test_data['tags'][0]} params = {'tag': self.test_data['tags'][0]}
@@ -295,24 +296,24 @@ class ListUserImagesTest(base.BaseV2ImageTest):
observerd_tags=image['tags'])) observerd_tags=image['tags']))
self.assertIn(self.test_data['tags'][0], image['tags'], msg) 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): def test_list_images_param_sort(self):
params = {'sort': 'size:desc'} params = {'sort': 'size:desc'}
self._list_sorted_by_image_size_and_assert(params, desc=True) 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): def test_list_images_param_sort_key_dir(self):
params = {'sort_key': 'size', 'sort_dir': 'desc'} params = {'sort_key': 'size', 'sort_dir': 'desc'}
self._list_sorted_by_image_size_and_assert(params, desc=True) 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): def test_get_image_schema(self):
# Test to get image schema # Test to get image schema
schema = "image" schema = "image"
body = self.schemas_client.show_schema(schema) body = self.schemas_client.show_schema(schema)
self.assertEqual("image", body['name']) 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): def test_get_images_schema(self):
# Test to get images schema # Test to get images schema
schema = "images" schema = "images"
@@ -331,7 +332,7 @@ class ListSharedImagesTest(base.BaseV2ImageTest):
cls.image_member_client = cls.os.image_member_client_v2 cls.image_member_client = cls.os.image_member_client_v2
cls.alt_img_client = cls.os_alt.image_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): def test_list_images_param_member_status(self):
# Create an image to be shared using default visibility # Create an image to be shared using default visibility
image_file = six.BytesIO(data_utils.random_bytes(2048)) image_file = six.BytesIO(data_utils.random_bytes(2048))

View File

@@ -11,12 +11,12 @@
# under the License. # under the License.
from tempest.api.image import base from tempest.api.image import base
from tempest import test from tempest.lib import decorators
class ImagesMemberTest(base.BaseV2MemberImageTest): 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): def test_image_share_accept(self):
image_id = self._create_image() image_id = self._create_image()
member = self.image_member_client.create_image_member( 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['image_id'], image_id)
self.assertEqual(member['status'], 'accepted') 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): def test_image_share_reject(self):
image_id = self._create_image() image_id = self._create_image()
member = self.image_member_client.create_image_member( member = self.image_member_client.create_image_member(
@@ -55,7 +55,7 @@ class ImagesMemberTest(base.BaseV2MemberImageTest):
status='rejected') status='rejected')
self.assertNotIn(image_id, self._list_image_ids_as_alt()) 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): def test_get_image_member(self):
image_id = self._create_image() image_id = self._create_image()
self.image_member_client.create_image_member( self.image_member_client.create_image_member(
@@ -73,7 +73,7 @@ class ImagesMemberTest(base.BaseV2MemberImageTest):
self.assertEqual(image_id, member['image_id']) self.assertEqual(image_id, member['image_id'])
self.assertEqual('accepted', member['status']) 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): def test_remove_image_member(self):
image_id = self._create_image() image_id = self._create_image()
self.image_member_client.create_image_member( self.image_member_client.create_image_member(
@@ -87,17 +87,17 @@ class ImagesMemberTest(base.BaseV2MemberImageTest):
self.alt_tenant_id) self.alt_tenant_id)
self.assertNotIn(image_id, self._list_image_ids_as_alt()) 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): def test_get_image_member_schema(self):
body = self.schemas_client.show_schema("member") body = self.schemas_client.show_schema("member")
self.assertEqual("member", body['name']) 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): def test_get_image_members_schema(self):
body = self.schemas_client.show_schema("members") body = self.schemas_client.show_schema("members")
self.assertEqual("members", body['name']) 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): def test_get_private_image(self):
image_id = self._create_image() image_id = self._create_image()
member = self.image_member_client.create_image_member( member = self.image_member_client.create_image_member(

View File

@@ -11,6 +11,7 @@
# under the License. # under the License.
from tempest.api.image import base from tempest.api.image import base
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc from tempest.lib import exceptions as lib_exc
from tempest import test from tempest import test
@@ -18,7 +19,7 @@ from tempest import test
class ImagesMemberNegativeTest(base.BaseV2MemberImageTest): class ImagesMemberNegativeTest(base.BaseV2MemberImageTest):
@test.attr(type=['negative']) @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): def test_image_share_invalid_status(self):
image_id = self._create_image() image_id = self._create_image()
member = self.image_member_client.create_image_member( member = self.image_member_client.create_image_member(
@@ -30,7 +31,7 @@ class ImagesMemberNegativeTest(base.BaseV2MemberImageTest):
status='notavalidstatus') status='notavalidstatus')
@test.attr(type=['negative']) @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): def test_image_share_owner_cannot_accept(self):
image_id = self._create_image() image_id = self._create_image()
member = self.image_member_client.create_image_member( member = self.image_member_client.create_image_member(

View File

@@ -13,7 +13,7 @@
from tempest.api.image import base from tempest.api.image import base
from tempest.common.utils import data_utils from tempest.common.utils import data_utils
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
from tempest import test from tempest.lib import decorators
class MetadataNamespaceObjectsTest(base.BaseV2ImageTest): class MetadataNamespaceObjectsTest(base.BaseV2ImageTest):
@@ -28,7 +28,7 @@ class MetadataNamespaceObjectsTest(base.BaseV2ImageTest):
namespace['namespace'], object_name) namespace['namespace'], object_name)
return namespace_object 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): def test_create_update_delete_meta_namespace_objects(self):
# Create a namespace # Create a namespace
namespace = self.create_namespace() namespace = self.create_namespace()
@@ -50,7 +50,7 @@ class MetadataNamespaceObjectsTest(base.BaseV2ImageTest):
namespace['namespace'])['objects']] namespace['namespace'])['objects']]
self.assertNotIn(up_object_name, 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): def test_list_meta_namespace_objects(self):
# Create a namespace object # Create a namespace object
namespace = self.create_namespace() namespace = self.create_namespace()
@@ -62,7 +62,7 @@ class MetadataNamespaceObjectsTest(base.BaseV2ImageTest):
namespace['namespace'])['objects']] namespace['namespace'])['objects']]
self.assertIn(meta_namespace_object['name'], 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): def test_show_meta_namespace_objects(self):
# Create a namespace object # Create a namespace object
namespace = self.create_namespace() namespace = self.create_namespace()

View File

@@ -12,13 +12,13 @@
from tempest.api.image import base from tempest.api.image import base
from tempest.common.utils import data_utils from tempest.common.utils import data_utils
from tempest import test from tempest.lib import decorators
class MetadataNamespacePropertiesTest(base.BaseV2ImageTest): class MetadataNamespacePropertiesTest(base.BaseV2ImageTest):
"""Test the Metadata definition namespace property basic functionality""" """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): def test_basic_meta_def_namespace_property(self):
# Get the available resource types and use one resource_type # Get the available resource types and use one resource_type
body = self.resource_types_client.list_resource_types() body = self.resource_types_client.list_resource_types()

View File

@@ -13,7 +13,7 @@
from tempest.api.image import base from tempest.api.image import base
from tempest.common.utils import data_utils from tempest.common.utils import data_utils
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
from tempest import test from tempest.lib import decorators
class MetadataNamespaceTagsTest(base.BaseV2ImageTest): class MetadataNamespaceTagsTest(base.BaseV2ImageTest):
@@ -41,7 +41,7 @@ class MetadataNamespaceTagsTest(base.BaseV2ImageTest):
namespace['namespace']) namespace['namespace'])
return namespace_tags 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): def test_create_list_delete_namespace_tags(self):
# Create a namespace # Create a namespace
namespace = self.create_namespace() namespace = self.create_namespace()
@@ -60,7 +60,7 @@ class MetadataNamespaceTagsTest(base.BaseV2ImageTest):
namespace['namespace']) namespace['namespace'])
self.assertEqual([], body['tags']) 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): def test_create_update_delete_tag(self):
# Create a namespace # Create a namespace
namespace = self.create_namespace() namespace = self.create_namespace()

View File

@@ -16,14 +16,14 @@
from tempest.api.image import base from tempest.api.image import base
from tempest.common.utils import data_utils from tempest.common.utils import data_utils
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc from tempest.lib import exceptions as lib_exc
from tempest import test
class MetadataNamespacesTest(base.BaseV2ImageTest): class MetadataNamespacesTest(base.BaseV2ImageTest):
"""Test the Metadata definition Namespaces basic functionality""" """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): def test_basic_metadata_definition_namespaces(self):
# get the available resource types and use one resource_type # get the available resource types and use one resource_type
body = self.resource_types_client.list_resource_types() body = self.resource_types_client.list_resource_types()

View File

@@ -14,13 +14,13 @@
# under the License. # under the License.
from tempest.api.image import base from tempest.api.image import base
from tempest import test from tempest.lib import decorators
class MetadataResourceTypesTest(base.BaseV2ImageTest): class MetadataResourceTypesTest(base.BaseV2ImageTest):
"""Test the Metadata definition resource types basic functionality""" """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): def test_basic_meta_def_resource_type_association(self):
# Get the available resource types and use one resource_type # Get the available resource types and use one resource_type
body = self.resource_types_client.list_resource_types() body = self.resource_types_client.list_resource_types()

View File

@@ -14,67 +14,67 @@
# under the License. # under the License.
from tempest.api.image import base from tempest.api.image import base
from tempest import test from tempest.lib import decorators
class MetadataSchemaTest(base.BaseV2ImageTest): class MetadataSchemaTest(base.BaseV2ImageTest):
"""Test to get metadata schema""" """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): def test_get_metadata_namespace_schema(self):
# Test to get namespace schema # Test to get namespace schema
body = self.schemas_client.show_schema("metadefs/namespace") body = self.schemas_client.show_schema("metadefs/namespace")
self.assertEqual("namespace", body['name']) 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): def test_get_metadata_namespaces_schema(self):
# Test to get namespaces schema # Test to get namespaces schema
body = self.schemas_client.show_schema("metadefs/namespaces") body = self.schemas_client.show_schema("metadefs/namespaces")
self.assertEqual("namespaces", body['name']) 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): def test_get_metadata_resource_type_schema(self):
# Test to get resource_type schema # Test to get resource_type schema
body = self.schemas_client.show_schema("metadefs/resource_type") body = self.schemas_client.show_schema("metadefs/resource_type")
self.assertEqual("resource_type_association", body['name']) 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): def test_get_metadata_resources_types_schema(self):
# Test to get resource_types schema # Test to get resource_types schema
body = self.schemas_client.show_schema("metadefs/resource_types") body = self.schemas_client.show_schema("metadefs/resource_types")
self.assertEqual("resource_type_associations", body['name']) 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): def test_get_metadata_object_schema(self):
# Test to get object schema # Test to get object schema
body = self.schemas_client.show_schema("metadefs/object") body = self.schemas_client.show_schema("metadefs/object")
self.assertEqual("object", body['name']) 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): def test_get_metadata_objects_schema(self):
# Test to get objects schema # Test to get objects schema
body = self.schemas_client.show_schema("metadefs/objects") body = self.schemas_client.show_schema("metadefs/objects")
self.assertEqual("objects", body['name']) 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): def test_get_metadata_property_schema(self):
# Test to get property schema # Test to get property schema
body = self.schemas_client.show_schema("metadefs/property") body = self.schemas_client.show_schema("metadefs/property")
self.assertEqual("property", body['name']) 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): def test_get_metadata_properties_schema(self):
# Test to get properties schema # Test to get properties schema
body = self.schemas_client.show_schema("metadefs/properties") body = self.schemas_client.show_schema("metadefs/properties")
self.assertEqual("properties", body['name']) 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): def test_get_metadata_tag_schema(self):
# Test to get tag schema # Test to get tag schema
body = self.schemas_client.show_schema("metadefs/tag") body = self.schemas_client.show_schema("metadefs/tag")
self.assertEqual("tag", body['name']) 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): def test_get_metadata_tags_schema(self):
# Test to get tags schema # Test to get tags schema
body = self.schemas_client.show_schema("metadefs/tags") body = self.schemas_client.show_schema("metadefs/tags")

View File

@@ -16,6 +16,7 @@
from tempest.api.image import base from tempest.api.image import base
from tempest.lib.common.utils import data_utils from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc from tempest.lib import exceptions as lib_exc
from tempest import test from tempest import test
@@ -34,7 +35,7 @@ class ImagesNegativeTest(base.BaseV2ImageTest):
""" """
@test.attr(type=['negative']) @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): def test_get_non_existent_image(self):
# get the non-existent image # get the non-existent image
non_existent_id = data_utils.rand_uuid() non_existent_id = data_utils.rand_uuid()
@@ -42,14 +43,14 @@ class ImagesNegativeTest(base.BaseV2ImageTest):
non_existent_id) non_existent_id)
@test.attr(type=['negative']) @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): def test_get_image_null_id(self):
# get image with image_id = NULL # get image with image_id = NULL
image_id = "" image_id = ""
self.assertRaises(lib_exc.NotFound, self.client.show_image, image_id) self.assertRaises(lib_exc.NotFound, self.client.show_image, image_id)
@test.attr(type=['negative']) @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): def test_get_delete_deleted_image(self):
# get and delete the deleted image # get and delete the deleted image
# create and delete image # create and delete image
@@ -68,7 +69,7 @@ class ImagesNegativeTest(base.BaseV2ImageTest):
image['id']) image['id'])
@test.attr(type=['negative']) @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): def test_delete_non_existing_image(self):
# delete non-existent image # delete non-existent image
non_existent_image_id = data_utils.rand_uuid() non_existent_image_id = data_utils.rand_uuid()
@@ -76,7 +77,7 @@ class ImagesNegativeTest(base.BaseV2ImageTest):
non_existent_image_id) non_existent_image_id)
@test.attr(type=['negative']) @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): def test_delete_image_null_id(self):
# delete image with image_id=NULL # delete image with image_id=NULL
image_id = "" image_id = ""
@@ -84,7 +85,7 @@ class ImagesNegativeTest(base.BaseV2ImageTest):
image_id) image_id)
@test.attr(type=['negative']) @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): def test_register_with_invalid_container_format(self):
# Negative tests for invalid data supplied to POST /images # Negative tests for invalid data supplied to POST /images
self.assertRaises(lib_exc.BadRequest, self.client.create_image, self.assertRaises(lib_exc.BadRequest, self.client.create_image,
@@ -92,7 +93,7 @@ class ImagesNegativeTest(base.BaseV2ImageTest):
disk_format='vhd') disk_format='vhd')
@test.attr(type=['negative']) @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): def test_register_with_invalid_disk_format(self):
self.assertRaises(lib_exc.BadRequest, self.client.create_image, self.assertRaises(lib_exc.BadRequest, self.client.create_image,
name='test', container_format='bare', name='test', container_format='bare',

View File

@@ -14,12 +14,12 @@
from tempest.api.image import base from tempest.api.image import base
from tempest.common.utils import data_utils from tempest.common.utils import data_utils
from tempest import test from tempest.lib import decorators
class ImagesTagsTest(base.BaseV2ImageTest): 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): def test_update_delete_tags_for_image(self):
image = self.create_image(container_format='bare', image = self.create_image(container_format='bare',
disk_format='raw', disk_format='raw',

View File

@@ -14,6 +14,7 @@
from tempest.api.image import base from tempest.api.image import base
from tempest.common.utils import data_utils from tempest.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc from tempest.lib import exceptions as lib_exc
from tempest import test from tempest import test
@@ -21,7 +22,7 @@ from tempest import test
class ImagesTagsNegativeTest(base.BaseV2ImageTest): class ImagesTagsNegativeTest(base.BaseV2ImageTest):
@test.attr(type=['negative']) @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): def test_update_tags_for_non_existing_image(self):
# Update tag with non existing image. # Update tag with non existing image.
tag = data_utils.rand_name('tag') tag = data_utils.rand_name('tag')
@@ -30,7 +31,7 @@ class ImagesTagsNegativeTest(base.BaseV2ImageTest):
non_exist_image, tag) non_exist_image, tag)
@test.attr(type=['negative']) @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): def test_delete_non_existing_tag(self):
# Delete non existing tag. # Delete non existing tag.
image = self.create_image(container_format='bare', image = self.create_image(container_format='bare',