Switch to decorators.idempotent_id on compute.*

So many modules are using test.idempotent_id and this is for
switching to decorators.idempotent_id on compute.*.

Change-Id: Ib4ace375a41b9607d1b1cea7dda296fb601a0264
Related-Bug: #1616913
This commit is contained in:
Ken'ichi Ohmichi 2017-01-27 17:32:10 -08:00
parent 14b0ae1a31
commit 6c92edfa2f
36 changed files with 185 additions and 165 deletions

View File

@ -15,7 +15,7 @@
from tempest.api.compute import base
from tempest import config
from tempest import test
from tempest.lib import decorators
CONF = config.CONF
@ -28,14 +28,14 @@ class CertificatesV2TestJSON(base.BaseV2ComputeTest):
if not CONF.compute_feature_enabled.nova_cert:
raise cls.skipException("Nova cert is not available")
@test.idempotent_id('c070a441-b08e-447e-a733-905909535b1b')
@decorators.idempotent_id('c070a441-b08e-447e-a733-905909535b1b')
def test_create_root_certificate(self):
# create certificates
body = self.certificates_client.create_certificate()['certificate']
self.assertIn('data', body)
self.assertIn('private_key', body)
@test.idempotent_id('3ac273d0-92d2-4632-bdfc-afbc21d4606c')
@decorators.idempotent_id('3ac273d0-92d2-4632-bdfc-afbc21d4606c')
def test_get_root_certificate(self):
# get the root certificate
body = (self.certificates_client.show_certificate('root')

View File

@ -14,6 +14,7 @@
# under the License.
from tempest.api.compute import base
from tempest.lib import decorators
from tempest import test
@ -27,7 +28,7 @@ class FlavorsV2TestJSON(base.BaseV2ComputeTest):
cls.client = cls.flavors_client
@test.attr(type='smoke')
@test.idempotent_id('e36c0eaa-dff5-4082-ad1f-3f9a80aa3f59')
@decorators.idempotent_id('e36c0eaa-dff5-4082-ad1f-3f9a80aa3f59')
def test_list_flavors(self):
# List of all flavors should contain the expected flavor
flavors = self.client.list_flavors()['flavors']
@ -36,7 +37,7 @@ class FlavorsV2TestJSON(base.BaseV2ComputeTest):
'name': flavor['name']}
self.assertIn(flavor_min_detail, flavors)
@test.idempotent_id('6e85fde4-b3cd-4137-ab72-ed5f418e8c24')
@decorators.idempotent_id('6e85fde4-b3cd-4137-ab72-ed5f418e8c24')
def test_list_flavors_with_detail(self):
# Detailed list of all flavors should contain the expected flavor
flavors = self.client.list_flavors(detail=True)['flavors']
@ -44,27 +45,27 @@ class FlavorsV2TestJSON(base.BaseV2ComputeTest):
self.assertIn(flavor, flavors)
@test.attr(type='smoke')
@test.idempotent_id('1f12046b-753d-40d2-abb6-d8eb8b30cb2f')
@decorators.idempotent_id('1f12046b-753d-40d2-abb6-d8eb8b30cb2f')
def test_get_flavor(self):
# The expected flavor details should be returned
flavor = self.client.show_flavor(self.flavor_ref)['flavor']
self.assertEqual(self.flavor_ref, flavor['id'])
@test.idempotent_id('8d7691b3-6ed4-411a-abc9-2839a765adab')
@decorators.idempotent_id('8d7691b3-6ed4-411a-abc9-2839a765adab')
def test_list_flavors_limit_results(self):
# Only the expected number of flavors should be returned
params = {'limit': 1}
flavors = self.client.list_flavors(**params)['flavors']
self.assertEqual(1, len(flavors))
@test.idempotent_id('b26f6327-2886-467a-82be-cef7a27709cb')
@decorators.idempotent_id('b26f6327-2886-467a-82be-cef7a27709cb')
def test_list_flavors_detailed_limit_results(self):
# Only the expected number of flavors (detailed) should be returned
params = {'limit': 1}
flavors = self.client.list_flavors(detail=True, **params)['flavors']
self.assertEqual(1, len(flavors))
@test.idempotent_id('e800f879-9828-4bd0-8eae-4f17189951fb')
@decorators.idempotent_id('e800f879-9828-4bd0-8eae-4f17189951fb')
def test_list_flavors_using_marker(self):
# The list of flavors should start from the provided marker
flavor = self.client.show_flavor(self.flavor_ref)['flavor']
@ -75,7 +76,7 @@ class FlavorsV2TestJSON(base.BaseV2ComputeTest):
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]),
'The list of flavors did not start after the marker.')
@test.idempotent_id('6db2f0c0-ddee-4162-9c84-0703d3dd1107')
@decorators.idempotent_id('6db2f0c0-ddee-4162-9c84-0703d3dd1107')
def test_list_flavors_detailed_using_marker(self):
# The list of flavors should start from the provided marker
flavor = self.client.show_flavor(self.flavor_ref)['flavor']
@ -86,7 +87,7 @@ class FlavorsV2TestJSON(base.BaseV2ComputeTest):
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]),
'The list of flavors did not start after the marker.')
@test.idempotent_id('3df2743e-3034-4e57-a4cb-b6527f6eac79')
@decorators.idempotent_id('3df2743e-3034-4e57-a4cb-b6527f6eac79')
def test_list_flavors_detailed_filter_by_min_disk(self):
# The detailed list of flavors should be filtered by disk space
flavor = self.client.show_flavor(self.flavor_ref)['flavor']
@ -96,7 +97,7 @@ class FlavorsV2TestJSON(base.BaseV2ComputeTest):
flavors = self.client.list_flavors(detail=True, **params)['flavors']
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
@test.idempotent_id('09fe7509-b4ee-4b34-bf8b-39532dc47292')
@decorators.idempotent_id('09fe7509-b4ee-4b34-bf8b-39532dc47292')
def test_list_flavors_detailed_filter_by_min_ram(self):
# The detailed list of flavors should be filtered by RAM
flavor = self.client.show_flavor(self.flavor_ref)['flavor']
@ -106,7 +107,7 @@ class FlavorsV2TestJSON(base.BaseV2ComputeTest):
flavors = self.client.list_flavors(detail=True, **params)['flavors']
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
@test.idempotent_id('10645a4d-96f5-443f-831b-730711e11dd4')
@decorators.idempotent_id('10645a4d-96f5-443f-831b-730711e11dd4')
def test_list_flavors_filter_by_min_disk(self):
# The list of flavors should be filtered by disk space
flavor = self.client.show_flavor(self.flavor_ref)['flavor']
@ -116,7 +117,7 @@ class FlavorsV2TestJSON(base.BaseV2ComputeTest):
flavors = self.client.list_flavors(**params)['flavors']
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
@test.idempotent_id('935cf550-e7c8-4da6-8002-00f92d5edfaa')
@decorators.idempotent_id('935cf550-e7c8-4da6-8002-00f92d5edfaa')
def test_list_flavors_filter_by_min_ram(self):
# The list of flavors should be filtered by RAM
flavor = self.client.show_flavor(self.flavor_ref)['flavor']

View File

@ -16,6 +16,7 @@
from tempest.api.compute.floating_ips import base
from tempest import config
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
@ -52,7 +53,7 @@ class FloatingIPsTestJSON(base.BaseFloatingIPsTest):
cls.client.delete_floating_ip(cls.floating_ip_id)
super(FloatingIPsTestJSON, cls).resource_cleanup()
@test.idempotent_id('f7bfb946-297e-41b8-9e8c-aba8e9bb5194')
@decorators.idempotent_id('f7bfb946-297e-41b8-9e8c-aba8e9bb5194')
@test.services('network')
def test_allocate_floating_ip(self):
# Positive test:Allocation of a new floating IP to a project
@ -68,7 +69,7 @@ class FloatingIPsTestJSON(base.BaseFloatingIPsTest):
body = self.client.list_floating_ips()['floating_ips']
self.assertIn(floating_ip_details, body)
@test.idempotent_id('de45e989-b5ca-4a9b-916b-04a52e7bbb8b')
@decorators.idempotent_id('de45e989-b5ca-4a9b-916b-04a52e7bbb8b')
@test.services('network')
def test_delete_floating_ip(self):
# Positive test:Deletion of valid floating IP from project
@ -83,7 +84,7 @@ class FloatingIPsTestJSON(base.BaseFloatingIPsTest):
# Check it was really deleted.
self.client.wait_for_resource_deletion(floating_ip_body['id'])
@test.idempotent_id('307efa27-dc6f-48a0-8cd2-162ce3ef0b52')
@decorators.idempotent_id('307efa27-dc6f-48a0-8cd2-162ce3ef0b52')
@test.services('network')
def test_associate_disassociate_floating_ip(self):
# Positive test:Associate and disassociate the provided floating IP
@ -104,7 +105,7 @@ class FloatingIPsTestJSON(base.BaseFloatingIPsTest):
self.floating_ip,
self.server_id)
@test.idempotent_id('6edef4b2-aaf1-4abc-bbe3-993e2561e0fe')
@decorators.idempotent_id('6edef4b2-aaf1-4abc-bbe3-993e2561e0fe')
@test.services('network')
def test_associate_already_associated_floating_ip(self):
# positive test:Association of an already associated floating IP

View File

@ -16,6 +16,7 @@
from tempest.api.compute.floating_ips import base
from tempest.common.utils import data_utils
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@ -48,7 +49,7 @@ class FloatingIPsNegativeTestJSON(base.BaseFloatingIPsTest):
break
@test.attr(type=['negative'])
@test.idempotent_id('6e0f059b-e4dd-48fb-8207-06e3bba5b074')
@decorators.idempotent_id('6e0f059b-e4dd-48fb-8207-06e3bba5b074')
@test.services('network')
def test_allocate_floating_ip_from_nonexistent_pool(self):
# Negative test:Allocation of a new floating IP from a nonexistent_pool
@ -58,7 +59,7 @@ class FloatingIPsNegativeTestJSON(base.BaseFloatingIPsTest):
pool="non_exist_pool")
@test.attr(type=['negative'])
@test.idempotent_id('ae1c55a8-552b-44d4-bfb6-2a115a15d0ba')
@decorators.idempotent_id('ae1c55a8-552b-44d4-bfb6-2a115a15d0ba')
@test.services('network')
def test_delete_nonexistent_floating_ip(self):
# Negative test:Deletion of a nonexistent floating IP
@ -69,7 +70,7 @@ class FloatingIPsNegativeTestJSON(base.BaseFloatingIPsTest):
self.non_exist_id)
@test.attr(type=['negative'])
@test.idempotent_id('595fa616-1a71-4670-9614-46564ac49a4c')
@decorators.idempotent_id('595fa616-1a71-4670-9614-46564ac49a4c')
@test.services('network')
def test_associate_nonexistent_floating_ip(self):
# Negative test:Association of a non existent floating IP
@ -80,7 +81,7 @@ class FloatingIPsNegativeTestJSON(base.BaseFloatingIPsTest):
"0.0.0.0", self.server_id)
@test.attr(type=['negative'])
@test.idempotent_id('0a081a66-e568-4e6b-aa62-9587a876dca8')
@decorators.idempotent_id('0a081a66-e568-4e6b-aa62-9587a876dca8')
@test.services('network')
def test_dissociate_nonexistent_floating_ip(self):
# Negative test:Dissociation of a non existent floating IP should fail
@ -90,7 +91,7 @@ class FloatingIPsNegativeTestJSON(base.BaseFloatingIPsTest):
"0.0.0.0", self.server_id)
@test.attr(type=['negative'])
@test.idempotent_id('804b4fcb-bbf5-412f-925d-896672b61eb3')
@decorators.idempotent_id('804b4fcb-bbf5-412f-925d-896672b61eb3')
@test.services('network')
def test_associate_ip_to_server_without_passing_floating_ip(self):
# Negative test:Association of empty floating IP to specific server

View File

@ -15,6 +15,7 @@
from tempest.api.compute import base
from tempest import config
from tempest.lib import decorators
from tempest import test
CONF = config.CONF
@ -45,7 +46,7 @@ class FloatingIPDetailsTestJSON(base.BaseV2ComputeTest):
cls.client.delete_floating_ip(f_id)
super(FloatingIPDetailsTestJSON, cls).resource_cleanup()
@test.idempotent_id('16db31c3-fb85-40c9-bbe2-8cf7b67ff99f')
@decorators.idempotent_id('16db31c3-fb85-40c9-bbe2-8cf7b67ff99f')
@test.services('network')
def test_list_floating_ips(self):
# Positive test:Should return the list of floating IPs
@ -56,7 +57,7 @@ class FloatingIPDetailsTestJSON(base.BaseV2ComputeTest):
for i in range(3):
self.assertIn(self.floating_ip[i], floating_ips)
@test.idempotent_id('eef497e0-8ff7-43c8-85ef-558440574f84')
@decorators.idempotent_id('eef497e0-8ff7-43c8-85ef-558440574f84')
@test.services('network')
def test_get_floating_ip_details(self):
# Positive test:Should be able to GET the details of floatingIP
@ -78,7 +79,7 @@ class FloatingIPDetailsTestJSON(base.BaseV2ComputeTest):
body['fixed_ip'])
self.assertEqual(floating_ip_id, body['id'])
@test.idempotent_id('df389fc8-56f5-43cc-b290-20eda39854d3')
@decorators.idempotent_id('df389fc8-56f5-43cc-b290-20eda39854d3')
@test.services('network')
def test_list_floating_ip_pools(self):
# Positive test:Should return the list of floating IP Pools

View File

@ -16,6 +16,7 @@
from tempest.api.compute import base
from tempest.common.utils import data_utils
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@ -30,7 +31,7 @@ class FloatingIPDetailsNegativeTestJSON(base.BaseV2ComputeTest):
cls.client = cls.floating_ips_client
@test.attr(type=['negative'])
@test.idempotent_id('7ab18834-4a4b-4f28-a2c5-440579866695')
@decorators.idempotent_id('7ab18834-4a4b-4f28-a2c5-440579866695')
@test.services('network')
def test_get_nonexistent_floating_ip_details(self):
# Negative test:Should not be able to GET the details

View File

@ -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
@ -83,7 +83,7 @@ class ImagesMetadataTestJSON(base.BaseV2ComputeTest):
meta = {'os_version': 'value1', 'os_distro': 'value2'}
self.client.set_image_metadata(self.image_id, meta)
@test.idempotent_id('37ec6edd-cf30-4c53-bd45-ae74db6b0531')
@decorators.idempotent_id('37ec6edd-cf30-4c53-bd45-ae74db6b0531')
def test_list_image_metadata(self):
# All metadata key/value pairs for an image should be returned
resp_metadata = self.client.list_image_metadata(self.image_id)
@ -91,7 +91,7 @@ class ImagesMetadataTestJSON(base.BaseV2ComputeTest):
'os_version': 'value1', 'os_distro': 'value2'}}
self.assertEqual(expected, resp_metadata)
@test.idempotent_id('ece7befc-d3ce-42a4-b4be-c3067a418c29')
@decorators.idempotent_id('ece7befc-d3ce-42a4-b4be-c3067a418c29')
def test_set_image_metadata(self):
# The metadata for the image should match the new values
req_metadata = {'os_version': 'value2', 'architecture': 'value3'}
@ -102,7 +102,7 @@ class ImagesMetadataTestJSON(base.BaseV2ComputeTest):
['metadata'])
self.assertEqual(req_metadata, resp_metadata)
@test.idempotent_id('7b491c11-a9d5-40fe-a696-7f7e03d3fea2')
@decorators.idempotent_id('7b491c11-a9d5-40fe-a696-7f7e03d3fea2')
def test_update_image_metadata(self):
# The metadata for the image should match the updated values
req_metadata = {'os_version': 'alt1', 'architecture': 'value3'}
@ -116,14 +116,14 @@ class ImagesMetadataTestJSON(base.BaseV2ComputeTest):
'architecture': 'value3'}}
self.assertEqual(expected, resp_metadata)
@test.idempotent_id('4f5db52f-6685-4c75-b848-f4bb363f9aa6')
@decorators.idempotent_id('4f5db52f-6685-4c75-b848-f4bb363f9aa6')
def test_get_image_metadata_item(self):
# The value for a specific metadata key should be returned
meta = self.client.show_image_metadata_item(self.image_id,
'os_distro')['meta']
self.assertEqual('value2', meta['os_distro'])
@test.idempotent_id('f2de776a-4778-4d90-a5da-aae63aee64ae')
@decorators.idempotent_id('f2de776a-4778-4d90-a5da-aae63aee64ae')
def test_set_image_metadata_item(self):
# The value provided for the given meta item should be set for
# the image
@ -134,7 +134,7 @@ class ImagesMetadataTestJSON(base.BaseV2ComputeTest):
expected = {'metadata': {'os_version': 'alt', 'os_distro': 'value2'}}
self.assertEqual(expected, resp_metadata)
@test.idempotent_id('a013796c-ba37-4bb5-8602-d944511def14')
@decorators.idempotent_id('a013796c-ba37-4bb5-8602-d944511def14')
def test_delete_image_metadata_item(self):
# The metadata value/key pair should be deleted from the image
self.client.delete_image_metadata_item(self.image_id,

View File

@ -15,6 +15,7 @@
from tempest.api.compute 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
@ -27,7 +28,7 @@ class ImagesMetadataNegativeTestJSON(base.BaseV2ComputeTest):
cls.client = cls.compute_images_client
@test.attr(type=['negative'])
@test.idempotent_id('94069db2-792f-4fa8-8bd3-2271a6e0c095')
@decorators.idempotent_id('94069db2-792f-4fa8-8bd3-2271a6e0c095')
def test_list_nonexistent_image_metadata(self):
# Negative test: List on nonexistent image
# metadata should not happen
@ -35,7 +36,7 @@ class ImagesMetadataNegativeTestJSON(base.BaseV2ComputeTest):
data_utils.rand_uuid())
@test.attr(type=['negative'])
@test.idempotent_id('a403ef9e-9f95-427c-b70a-3ce3388796f1')
@decorators.idempotent_id('a403ef9e-9f95-427c-b70a-3ce3388796f1')
def test_update_nonexistent_image_metadata(self):
# Negative test:An update should not happen for a non-existent image
meta = {'os_distro': 'alt1', 'os_version': 'alt2'}
@ -44,7 +45,7 @@ class ImagesMetadataNegativeTestJSON(base.BaseV2ComputeTest):
data_utils.rand_uuid(), meta)
@test.attr(type=['negative'])
@test.idempotent_id('41ae052c-6ee6-405c-985e-5712393a620d')
@decorators.idempotent_id('41ae052c-6ee6-405c-985e-5712393a620d')
def test_get_nonexistent_image_metadata_item(self):
# Negative test: Get on non-existent image should not happen
self.assertRaises(lib_exc.NotFound,
@ -52,7 +53,7 @@ class ImagesMetadataNegativeTestJSON(base.BaseV2ComputeTest):
data_utils.rand_uuid(), 'os_version')
@test.attr(type=['negative'])
@test.idempotent_id('dc64f2ce-77e8-45b0-88c8-e15041d08eaf')
@decorators.idempotent_id('dc64f2ce-77e8-45b0-88c8-e15041d08eaf')
def test_set_nonexistent_image_metadata(self):
# Negative test: Metadata should not be set to a non-existent image
meta = {'os_distro': 'alt1', 'os_version': 'alt2'}
@ -60,7 +61,7 @@ class ImagesMetadataNegativeTestJSON(base.BaseV2ComputeTest):
data_utils.rand_uuid(), meta)
@test.attr(type=['negative'])
@test.idempotent_id('2154fd03-ab54-457c-8874-e6e3eb56e9cf')
@decorators.idempotent_id('2154fd03-ab54-457c-8874-e6e3eb56e9cf')
def test_set_nonexistent_image_metadata_item(self):
# Negative test: Metadata item should not be set to a
# nonexistent image
@ -71,7 +72,7 @@ class ImagesMetadataNegativeTestJSON(base.BaseV2ComputeTest):
meta)
@test.attr(type=['negative'])
@test.idempotent_id('848e157f-6bcf-4b2e-a5dd-5124025a8518')
@decorators.idempotent_id('848e157f-6bcf-4b2e-a5dd-5124025a8518')
def test_delete_nonexistent_image_metadata_item(self):
# Negative test: Shouldn't be able to delete metadata
# item from non-existent image

View File

@ -16,7 +16,7 @@ from tempest.api.compute import base
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
from tempest import test
from tempest.lib import decorators
CONF = config.CONF
@ -39,7 +39,7 @@ class ImagesTestJSON(base.BaseV2ComputeTest):
super(ImagesTestJSON, cls).setup_clients()
cls.client = cls.compute_images_client
@test.idempotent_id('aa06b52b-2db5-4807-b218-9441f75d74e3')
@decorators.idempotent_id('aa06b52b-2db5-4807-b218-9441f75d74e3')
def test_delete_saving_image(self):
server = self.create_test_server(wait_until='ACTIVE')
self.addCleanup(self.servers_client.delete_server, server['id'])
@ -50,7 +50,7 @@ class ImagesTestJSON(base.BaseV2ComputeTest):
.format(image_id=image['id']))
self.assertTrue(self.client.is_resource_deleted(image['id']), msg)
@test.idempotent_id('aaacd1d0-55a2-4ce8-818a-b5439df8adc9')
@decorators.idempotent_id('aaacd1d0-55a2-4ce8-818a-b5439df8adc9')
def test_create_image_from_stopped_server(self):
server = self.create_test_server(wait_until='ACTIVE')
self.servers_client.stop_server(server['id'])

View File

@ -16,6 +16,7 @@ from tempest.api.compute import base
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 as lib_exc
from tempest import test
@ -41,7 +42,7 @@ class ImagesNegativeTestJSON(base.BaseV2ComputeTest):
cls.client = cls.compute_images_client
@test.attr(type=['negative'])
@test.idempotent_id('6cd5a89d-5b47-46a7-93bc-3916f0d84973')
@decorators.idempotent_id('6cd5a89d-5b47-46a7-93bc-3916f0d84973')
def test_create_image_from_deleted_server(self):
# An image should not be created if the server instance is removed
server = self.create_test_server(wait_until='ACTIVE')
@ -56,7 +57,7 @@ class ImagesNegativeTestJSON(base.BaseV2ComputeTest):
server['id'], meta=meta)
@test.attr(type=['negative'])
@test.idempotent_id('82c5b0c4-9dbd-463c-872b-20c4755aae7f')
@decorators.idempotent_id('82c5b0c4-9dbd-463c-872b-20c4755aae7f')
def test_create_image_from_invalid_server(self):
# An image should not be created with invalid server id
# Create a new image with invalid server id
@ -65,7 +66,7 @@ class ImagesNegativeTestJSON(base.BaseV2ComputeTest):
data_utils.rand_name('invalid'), meta=meta)
@test.attr(type=['negative'])
@test.idempotent_id('ec176029-73dc-4037-8d72-2e4ff60cf538')
@decorators.idempotent_id('ec176029-73dc-4037-8d72-2e4ff60cf538')
def test_create_image_specify_uuid_35_characters_or_less(self):
# Return an error if Image ID passed is 35 characters or less
snapshot_name = data_utils.rand_name('test-snap')
@ -74,7 +75,7 @@ class ImagesNegativeTestJSON(base.BaseV2ComputeTest):
test_uuid, name=snapshot_name)
@test.attr(type=['negative'])
@test.idempotent_id('36741560-510e-4cc2-8641-55fe4dfb2437')
@decorators.idempotent_id('36741560-510e-4cc2-8641-55fe4dfb2437')
def test_create_image_specify_uuid_37_characters_or_more(self):
# Return an error if Image ID passed is 37 characters or more
snapshot_name = data_utils.rand_name('test-snap')
@ -83,14 +84,14 @@ class ImagesNegativeTestJSON(base.BaseV2ComputeTest):
test_uuid, name=snapshot_name)
@test.attr(type=['negative'])
@test.idempotent_id('381acb65-785a-4942-94ce-d8f8c84f1f0f')
@decorators.idempotent_id('381acb65-785a-4942-94ce-d8f8c84f1f0f')
def test_delete_image_with_invalid_image_id(self):
# An image should not be deleted with invalid image id
self.assertRaises(lib_exc.NotFound, self.client.delete_image,
data_utils.rand_name('invalid'))
@test.attr(type=['negative'])
@test.idempotent_id('137aef61-39f7-44a1-8ddf-0adf82511701')
@decorators.idempotent_id('137aef61-39f7-44a1-8ddf-0adf82511701')
def test_delete_non_existent_image(self):
# Return an error while trying to delete a non-existent image
@ -99,13 +100,13 @@ class ImagesNegativeTestJSON(base.BaseV2ComputeTest):
non_existent_image_id)
@test.attr(type=['negative'])
@test.idempotent_id('e6e41425-af5c-4fe6-a4b5-7b7b963ffda5')
@decorators.idempotent_id('e6e41425-af5c-4fe6-a4b5-7b7b963ffda5')
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('924540c3-f1f1-444c-8f58-718958b6724e')
@decorators.idempotent_id('924540c3-f1f1-444c-8f58-718958b6724e')
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"
@ -113,13 +114,13 @@ class ImagesNegativeTestJSON(base.BaseV2ComputeTest):
invalid_image_id)
@test.attr(type=['negative'])
@test.idempotent_id('68e2c175-bd26-4407-ac0f-4ea9ce2139ea')
@decorators.idempotent_id('68e2c175-bd26-4407-ac0f-4ea9ce2139ea')
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('b340030d-82cd-4066-a314-c72fb7c59277')
@decorators.idempotent_id('b340030d-82cd-4066-a314-c72fb7c59277')
def test_delete_image_with_id_over_character_limit(self):
# Return an error while trying to delete image with id over limit
invalid_image_id = data_utils.rand_uuid() + "1"

View File

@ -18,7 +18,7 @@ from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
from tempest.lib.common.utils import test_utils
from tempest import test
from tempest.lib import decorators
CONF = config.CONF
@ -46,7 +46,7 @@ class ImagesOneServerTestJSON(base.BaseV2ComputeTest):
flavor = self.flavors_client.show_flavor(flavor_id)['flavor']
return flavor['disk']
@test.idempotent_id('3731d080-d4c5-4872-b41a-64d0d0021314')
@decorators.idempotent_id('3731d080-d4c5-4872-b41a-64d0d0021314')
def test_create_delete_image(self):
server_id = self.create_test_server(wait_until='ACTIVE')['id']
@ -79,7 +79,7 @@ class ImagesOneServerTestJSON(base.BaseV2ComputeTest):
self.client.delete_image(image_id)
self.client.wait_for_resource_deletion(image_id)
@test.idempotent_id('3b7c6fe4-dfe7-477c-9243-b06359db51e6')
@decorators.idempotent_id('3b7c6fe4-dfe7-477c-9243-b06359db51e6')
def test_create_image_specify_multibyte_character_image_name(self):
server_id = self.create_test_server(wait_until='ACTIVE')['id']

View File

@ -20,6 +20,7 @@ from tempest.api.compute import base
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 as lib_exc
from tempest import test
@ -82,7 +83,7 @@ class ImagesOneServerNegativeTestJSON(base.BaseV2ComputeTest):
cls.image_ids = []
@test.attr(type=['negative'])
@test.idempotent_id('55d1d38c-dd66-4933-9c8e-7d92aeb60ddc')
@decorators.idempotent_id('55d1d38c-dd66-4933-9c8e-7d92aeb60ddc')
def test_create_image_specify_invalid_metadata(self):
# Return an error when creating image with invalid metadata
snapshot_name = data_utils.rand_name('test-snap')
@ -91,7 +92,7 @@ class ImagesOneServerNegativeTestJSON(base.BaseV2ComputeTest):
self.server_id, name=snapshot_name, metadata=meta)
@test.attr(type=['negative'])
@test.idempotent_id('3d24d11f-5366-4536-bd28-cff32b748eca')
@decorators.idempotent_id('3d24d11f-5366-4536-bd28-cff32b748eca')
def test_create_image_specify_metadata_over_limits(self):
# Return an error when creating image with meta data over 255 chars
snapshot_name = data_utils.rand_name('test-snap')
@ -100,7 +101,7 @@ class ImagesOneServerNegativeTestJSON(base.BaseV2ComputeTest):
self.server_id, name=snapshot_name, metadata=meta)
@test.attr(type=['negative'])
@test.idempotent_id('0460efcf-ee88-4f94-acef-1bf658695456')
@decorators.idempotent_id('0460efcf-ee88-4f94-acef-1bf658695456')
def test_create_second_image_when_first_image_is_being_saved(self):
# Disallow creating another image when first image is being saved
@ -117,7 +118,7 @@ class ImagesOneServerNegativeTestJSON(base.BaseV2ComputeTest):
self.server_id, name=alt_snapshot_name)
@test.attr(type=['negative'])
@test.idempotent_id('084f0cbc-500a-4963-8a4e-312905862581')
@decorators.idempotent_id('084f0cbc-500a-4963-8a4e-312905862581')
def test_create_image_specify_name_over_character_limit(self):
# Return an error if snapshot name over 255 characters is passed
@ -126,7 +127,7 @@ class ImagesOneServerNegativeTestJSON(base.BaseV2ComputeTest):
self.server_id, name=snapshot_name)
@test.attr(type=['negative'])
@test.idempotent_id('0894954d-2db2-4195-a45b-ffec0bc0187e')
@decorators.idempotent_id('0894954d-2db2-4195-a45b-ffec0bc0187e')
def test_delete_image_that_is_not_yet_active(self):
# Return an error while trying to delete an image what is creating

View File

@ -23,8 +23,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
@ -122,7 +122,7 @@ class ListImageFiltersTestJSON(base.BaseV2ComputeTest):
cls.server1['id'], wait_until='ACTIVE')
cls.snapshot2_id = cls.snapshot2['id']
@test.idempotent_id('a3f5b513-aeb3-42a9-b18e-f091ef73254d')
@decorators.idempotent_id('a3f5b513-aeb3-42a9-b18e-f091ef73254d')
def test_list_images_filter_by_status(self):
# The list of images should contain only images with the
# provided status
@ -133,7 +133,7 @@ class ListImageFiltersTestJSON(base.BaseV2ComputeTest):
self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
@test.idempotent_id('33163b73-79f5-4d07-a7ea-9213bcc468ff')
@decorators.idempotent_id('33163b73-79f5-4d07-a7ea-9213bcc468ff')
def test_list_images_filter_by_name(self):
# List of all images should contain the expected images filtered
# by name
@ -144,7 +144,7 @@ class ListImageFiltersTestJSON(base.BaseV2ComputeTest):
self.assertFalse(any([i for i in images if i['id'] == self.image2_id]))
self.assertFalse(any([i for i in images if i['id'] == self.image3_id]))
@test.idempotent_id('9f238683-c763-45aa-b848-232ec3ce3105')
@decorators.idempotent_id('9f238683-c763-45aa-b848-232ec3ce3105')
@testtools.skipUnless(CONF.compute_feature_enabled.snapshot,
'Snapshotting is not available.')
def test_list_images_filter_by_server_id(self):
@ -161,7 +161,7 @@ class ListImageFiltersTestJSON(base.BaseV2ComputeTest):
self.assertFalse(any([i for i in images
if i['id'] == self.snapshot3_id]))
@test.idempotent_id('05a377b8-28cf-4734-a1e6-2ab5c38bf606')
@decorators.idempotent_id('05a377b8-28cf-4734-a1e6-2ab5c38bf606')
@testtools.skipUnless(CONF.compute_feature_enabled.snapshot,
'Snapshotting is not available.')
def test_list_images_filter_by_server_ref(self):
@ -180,7 +180,7 @@ class ListImageFiltersTestJSON(base.BaseV2ComputeTest):
self.assertTrue(any([i for i in images
if i['id'] == self.snapshot3_id]))
@test.idempotent_id('e3356918-4d3e-4756-81d5-abc4524ba29f')
@decorators.idempotent_id('e3356918-4d3e-4756-81d5-abc4524ba29f')
@testtools.skipUnless(CONF.compute_feature_enabled.snapshot,
'Snapshotting is not available.')
def test_list_images_filter_by_type(self):
@ -197,14 +197,14 @@ class ListImageFiltersTestJSON(base.BaseV2ComputeTest):
self.assertFalse(any([i for i in images
if i['id'] == self.image_ref]))
@test.idempotent_id('3a484ca9-67ba-451e-b494-7fcf28d32d62')
@decorators.idempotent_id('3a484ca9-67ba-451e-b494-7fcf28d32d62')
def test_list_images_limit_results(self):
# Verify only the expected number of results are returned
params = {'limit': '1'}
images = self.client.list_images(**params)['images']
self.assertEqual(1, len([x for x in images if 'id' in x]))
@test.idempotent_id('18bac3ae-da27-436c-92a9-b22474d13aab')
@decorators.idempotent_id('18bac3ae-da27-436c-92a9-b22474d13aab')
def test_list_images_filter_by_changes_since(self):
# Verify only updated images are returned in the detailed list
@ -215,7 +215,7 @@ class ListImageFiltersTestJSON(base.BaseV2ComputeTest):
found = any([i for i in images if i['id'] == self.image3_id])
self.assertTrue(found)
@test.idempotent_id('9b0ea018-6185-4f71-948a-a123a107988e')
@decorators.idempotent_id('9b0ea018-6185-4f71-948a-a123a107988e')
def test_list_images_with_detail_filter_by_status(self):
# Detailed list of all images should only contain images
# with the provided status
@ -226,7 +226,7 @@ class ListImageFiltersTestJSON(base.BaseV2ComputeTest):
self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
@test.idempotent_id('644ea267-9bd9-4f3b-af9f-dffa02396a17')
@decorators.idempotent_id('644ea267-9bd9-4f3b-af9f-dffa02396a17')
def test_list_images_with_detail_filter_by_name(self):
# Detailed list of all images should contain the expected
# images filtered by name
@ -237,7 +237,7 @@ class ListImageFiltersTestJSON(base.BaseV2ComputeTest):
self.assertFalse(any([i for i in images if i['id'] == self.image2_id]))
self.assertFalse(any([i for i in images if i['id'] == self.image3_id]))
@test.idempotent_id('ba2fa9a9-b672-47cc-b354-3b4c0600e2cb')
@decorators.idempotent_id('ba2fa9a9-b672-47cc-b354-3b4c0600e2cb')
def test_list_images_with_detail_limit_results(self):
# Verify only the expected number of results (with full details)
# are returned
@ -245,7 +245,7 @@ class ListImageFiltersTestJSON(base.BaseV2ComputeTest):
images = self.client.list_images(detail=True, **params)['images']
self.assertEqual(1, len(images))
@test.idempotent_id('8c78f822-203b-4bf6-8bba-56ebd551cf84')
@decorators.idempotent_id('8c78f822-203b-4bf6-8bba-56ebd551cf84')
@testtools.skipUnless(CONF.compute_feature_enabled.snapshot,
'Snapshotting is not available.')
def test_list_images_with_detail_filter_by_server_ref(self):
@ -264,7 +264,7 @@ class ListImageFiltersTestJSON(base.BaseV2ComputeTest):
self.assertTrue(any([i for i in images
if i['id'] == self.snapshot3_id]))
@test.idempotent_id('888c0cc0-7223-43c5-9db0-b125fd0a393b')
@decorators.idempotent_id('888c0cc0-7223-43c5-9db0-b125fd0a393b')
@testtools.skipUnless(CONF.compute_feature_enabled.snapshot,
'Snapshotting is not available.')
def test_list_images_with_detail_filter_by_type(self):
@ -282,7 +282,7 @@ class ListImageFiltersTestJSON(base.BaseV2ComputeTest):
self.assertFalse(any([i for i in images
if i['id'] == self.image_ref]))
@test.idempotent_id('7d439e18-ac2e-4827-b049-7e18004712c4')
@decorators.idempotent_id('7d439e18-ac2e-4827-b049-7e18004712c4')
def test_list_images_with_detail_filter_by_changes_since(self):
# Verify an update image is returned

View File

@ -15,6 +15,7 @@
from tempest.api.compute import base
from tempest.common.utils import data_utils
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@ -36,7 +37,7 @@ class ListImageFiltersNegativeTestJSON(base.BaseV2ComputeTest):
cls.client = cls.compute_images_client
@test.attr(type=['negative'])
@test.idempotent_id('391b0440-432c-4d4b-b5da-c5096aa247eb')
@decorators.idempotent_id('391b0440-432c-4d4b-b5da-c5096aa247eb')
def test_get_nonexistent_image(self):
# Check raises a NotFound
nonexistent_image = data_utils.rand_uuid()

View File

@ -15,7 +15,7 @@
from tempest.api.compute import base
from tempest import config
from tempest import test
from tempest.lib import decorators
CONF = config.CONF
@ -34,20 +34,20 @@ class ListImagesTestJSON(base.BaseV2ComputeTest):
super(ListImagesTestJSON, cls).setup_clients()
cls.client = cls.compute_images_client
@test.idempotent_id('490d0898-e12a-463f-aef0-c50156b9f789')
@decorators.idempotent_id('490d0898-e12a-463f-aef0-c50156b9f789')
def test_get_image(self):
# Returns the correct details for a single image
image = self.client.show_image(self.image_ref)['image']
self.assertEqual(self.image_ref, image['id'])
@test.idempotent_id('fd51b7f4-d4a3-4331-9885-866658112a6f')
@decorators.idempotent_id('fd51b7f4-d4a3-4331-9885-866658112a6f')
def test_list_images(self):
# The list of all images should contain the image
images = self.client.list_images()['images']
found = any([i for i in images if i['id'] == self.image_ref])
self.assertTrue(found)
@test.idempotent_id('9f94cb6b-7f10-48c5-b911-a0b84d7d4cd6')
@decorators.idempotent_id('9f94cb6b-7f10-48c5-b911-a0b84d7d4cd6')
def test_list_images_with_detail(self):
# Detailed list of all images should contain the expected images
images = self.client.list_images(detail=True)['images']

View File

@ -15,13 +15,13 @@
from tempest.api.compute.keypairs import base
from tempest.common.utils import data_utils
from tempest import test
from tempest.lib import decorators
class KeyPairsV2TestJSON(base.BaseKeypairTest):
max_microversion = '2.1'
@test.idempotent_id('1d1dbedb-d7a0-432a-9d09-83f543c3c19b')
@decorators.idempotent_id('1d1dbedb-d7a0-432a-9d09-83f543c3c19b')
def test_keypairs_create_list_delete(self):
# Keypairs created should be available in the response list
# Create 3 keypairs
@ -46,7 +46,7 @@ class KeyPairsV2TestJSON(base.BaseKeypairTest):
"Failed to find keypairs %s in fetched list"
% ', '.join(m_key['name'] for m_key in missing_kps))
@test.idempotent_id('6c1d3123-4519-4742-9194-622cb1714b7d')
@decorators.idempotent_id('6c1d3123-4519-4742-9194-622cb1714b7d')
def test_keypair_create_delete(self):
# Keypair should be created, verified and deleted
k_name = data_utils.rand_name('keypair')
@ -59,7 +59,7 @@ class KeyPairsV2TestJSON(base.BaseKeypairTest):
self.assertIsNotNone(private_key,
"Field private_key is empty or not found.")
@test.idempotent_id('a4233d5d-52d8-47cc-9a25-e1864527e3df')
@decorators.idempotent_id('a4233d5d-52d8-47cc-9a25-e1864527e3df')
def test_get_keypair_detail(self):
# Keypair should be created, Got details by name and deleted
k_name = data_utils.rand_name('keypair')
@ -74,7 +74,7 @@ class KeyPairsV2TestJSON(base.BaseKeypairTest):
self.assertIsNotNone(public_key,
"Field public_key is empty or not found.")
@test.idempotent_id('39c90c6a-304a-49dd-95ec-2366129def05')
@decorators.idempotent_id('39c90c6a-304a-49dd-95ec-2366129def05')
def test_keypair_create_with_pub_key(self):
# Keypair should be created with a given public key
k_name = data_utils.rand_name('keypair')

View File

@ -16,13 +16,14 @@
from tempest.api.compute.keypairs 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
class KeyPairsNegativeTestJSON(base.BaseKeypairTest):
@test.attr(type=['negative'])
@test.idempotent_id('29cca892-46ae-4d48-bc32-8fe7e731eb81')
@decorators.idempotent_id('29cca892-46ae-4d48-bc32-8fe7e731eb81')
def test_keypair_create_with_invalid_pub_key(self):
# Keypair should not be created with a non RSA public key
pub_key = "ssh-rsa JUNK nova@ubuntu"
@ -30,7 +31,7 @@ class KeyPairsNegativeTestJSON(base.BaseKeypairTest):
self.create_keypair, pub_key=pub_key)
@test.attr(type=['negative'])
@test.idempotent_id('7cc32e47-4c42-489d-9623-c5e2cb5a2fa5')
@decorators.idempotent_id('7cc32e47-4c42-489d-9623-c5e2cb5a2fa5')
def test_keypair_delete_nonexistent_key(self):
# Non-existent key deletion should throw a proper error
k_name = data_utils.rand_name("keypair-non-existent")
@ -38,7 +39,7 @@ class KeyPairsNegativeTestJSON(base.BaseKeypairTest):
k_name)
@test.attr(type=['negative'])
@test.idempotent_id('dade320e-69ca-42a9-ba4a-345300f127e0')
@decorators.idempotent_id('dade320e-69ca-42a9-ba4a-345300f127e0')
def test_create_keypair_with_empty_public_key(self):
# Keypair should not be created with an empty public key
pub_key = ' '
@ -46,7 +47,7 @@ class KeyPairsNegativeTestJSON(base.BaseKeypairTest):
pub_key=pub_key)
@test.attr(type=['negative'])
@test.idempotent_id('fc100c19-2926-4b9c-8fdc-d0589ee2f9ff')
@decorators.idempotent_id('fc100c19-2926-4b9c-8fdc-d0589ee2f9ff')
def test_create_keypair_when_public_key_bits_exceeds_maximum(self):
# Keypair should not be created when public key bits are too long
pub_key = 'ssh-rsa ' + 'A' * 2048 + ' openstack@ubuntu'
@ -54,7 +55,7 @@ class KeyPairsNegativeTestJSON(base.BaseKeypairTest):
pub_key=pub_key)
@test.attr(type=['negative'])
@test.idempotent_id('0359a7f1-f002-4682-8073-0c91e4011b7c')
@decorators.idempotent_id('0359a7f1-f002-4682-8073-0c91e4011b7c')
def test_create_keypair_with_duplicate_name(self):
# Keypairs with duplicate names should not be created
k_name = data_utils.rand_name('keypair')
@ -65,14 +66,14 @@ class KeyPairsNegativeTestJSON(base.BaseKeypairTest):
self.client.delete_keypair(k_name)
@test.attr(type=['negative'])
@test.idempotent_id('1398abe1-4a84-45fb-9294-89f514daff00')
@decorators.idempotent_id('1398abe1-4a84-45fb-9294-89f514daff00')
def test_create_keypair_with_empty_name_string(self):
# Keypairs with name being an empty string should not be created
self.assertRaises(lib_exc.BadRequest, self.create_keypair,
'')
@test.attr(type=['negative'])
@test.idempotent_id('3faa916f-779f-4103-aca7-dc3538eee1b7')
@decorators.idempotent_id('3faa916f-779f-4103-aca7-dc3538eee1b7')
def test_create_keypair_with_long_keynames(self):
# Keypairs with name longer than 255 chars should not be created
k_name = 'keypair-'.ljust(260, '0')
@ -80,7 +81,7 @@ class KeyPairsNegativeTestJSON(base.BaseKeypairTest):
k_name)
@test.attr(type=['negative'])
@test.idempotent_id('45fbe5e0-acb5-49aa-837a-ff8d0719db91')
@decorators.idempotent_id('45fbe5e0-acb5-49aa-837a-ff8d0719db91')
def test_create_keypair_invalid_name(self):
# Keypairs with name being an invalid name should not be created
k_name = 'key_/.\@:'

View File

@ -14,7 +14,7 @@
from tempest.api.compute.keypairs import test_keypairs
from tempest.common.utils import data_utils
from tempest import test
from tempest.lib import decorators
class KeyPairsV22TestJSON(test_keypairs.KeyPairsV2TestJSON):
@ -41,11 +41,11 @@ class KeyPairsV22TestJSON(test_keypairs.KeyPairsV2TestJSON):
if keypair['keypair']['name'] == k_name:
self._check_keypair_type(keypair['keypair'], keypair_type)
@test.idempotent_id('8726fa85-7f98-4b20-af9e-f710a4f3391c')
@decorators.idempotent_id('8726fa85-7f98-4b20-af9e-f710a4f3391c')
def test_keypairsv22_create_list_show(self):
self._test_keypairs_create_list_show()
@test.idempotent_id('89d59d43-f735-441a-abcf-0601727f47b6')
@decorators.idempotent_id('89d59d43-f735-441a-abcf-0601727f47b6')
def test_keypairsv22_create_list_show_with_type(self):
keypair_type = 'x509'
self._test_keypairs_create_list_show(keypair_type=keypair_type)

View File

@ -14,7 +14,7 @@
# under the License.
from tempest.api.compute import base
from tempest import test
from tempest.lib import decorators
class AbsoluteLimitsTestJSON(base.BaseV2ComputeTest):
@ -24,7 +24,7 @@ class AbsoluteLimitsTestJSON(base.BaseV2ComputeTest):
super(AbsoluteLimitsTestJSON, cls).setup_clients()
cls.client = cls.limits_client
@test.idempotent_id('b54c66af-6ab6-4cf0-a9e5-a0cb58d75e0b')
@decorators.idempotent_id('b54c66af-6ab6-4cf0-a9e5-a0cb58d75e0b')
def test_absLimits_get(self):
# To check if all limits are present in the response
limits = self.client.show_limits()['limits']

View File

@ -15,6 +15,7 @@
from tempest.api.compute import base
from tempest.common import tempest_fixtures as fixtures
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@ -32,7 +33,7 @@ class AbsoluteLimitsNegativeTestJSON(base.BaseV2ComputeTest):
cls.client = cls.limits_client
@test.attr(type=['negative'])
@test.idempotent_id('215cd465-d8ae-49c9-bf33-9c911913a5c8')
@decorators.idempotent_id('215cd465-d8ae-49c9-bf33-9c911913a5c8')
def test_max_image_meta_exceed_limit(self):
# We should not create vm with image meta over maxImageMeta limit
# Get max limit value

View File

@ -15,6 +15,7 @@
from tempest.api.compute.security_groups import base
from tempest import config
from tempest.lib import decorators
from tempest import test
CONF = config.CONF
@ -57,7 +58,7 @@ class SecurityGroupRulesTestJSON(base.BaseSecurityGroupsTest):
"Miss-matched key is %s" % key)
@test.attr(type='smoke')
@test.idempotent_id('850795d7-d4d3-4e55-b527-a774c0123d3a')
@decorators.idempotent_id('850795d7-d4d3-4e55-b527-a774c0123d3a')
@test.services('network')
def test_security_group_rules_create(self):
# Positive test: Creation of Security Group rule
@ -75,7 +76,7 @@ class SecurityGroupRulesTestJSON(base.BaseSecurityGroupsTest):
self.expected['ip_range'] = {'cidr': '0.0.0.0/0'}
self._check_expected_response(rule)
@test.idempotent_id('7a01873e-3c38-4f30-80be-31a043cfe2fd')
@decorators.idempotent_id('7a01873e-3c38-4f30-80be-31a043cfe2fd')
@test.services('network')
def test_security_group_rules_create_with_optional_cidr(self):
# Positive test: Creation of Security Group rule
@ -98,7 +99,7 @@ class SecurityGroupRulesTestJSON(base.BaseSecurityGroupsTest):
self.expected['ip_range'] = {'cidr': cidr}
self._check_expected_response(rule)
@test.idempotent_id('7f5d2899-7705-4d4b-8458-4505188ffab6')
@decorators.idempotent_id('7f5d2899-7705-4d4b-8458-4505188ffab6')
@test.services('network')
def test_security_group_rules_create_with_optional_group_id(self):
# Positive test: Creation of Security Group rule
@ -127,7 +128,7 @@ class SecurityGroupRulesTestJSON(base.BaseSecurityGroupsTest):
self._check_expected_response(rule)
@test.attr(type='smoke')
@test.idempotent_id('a6154130-5a55-4850-8be4-5e9e796dbf17')
@decorators.idempotent_id('a6154130-5a55-4850-8be4-5e9e796dbf17')
@test.services('network')
def test_security_group_rules_list(self):
# Positive test: Created Security Group rules should be
@ -165,7 +166,7 @@ class SecurityGroupRulesTestJSON(base.BaseSecurityGroupsTest):
self.assertTrue(any([i for i in rules if i['id'] == rule1_id]))
self.assertTrue(any([i for i in rules if i['id'] == rule2_id]))
@test.idempotent_id('fc5c5acf-2091-43a6-a6ae-e42760e9ffaf')
@decorators.idempotent_id('fc5c5acf-2091-43a6-a6ae-e42760e9ffaf')
@test.services('network')
def test_security_group_rules_delete_when_peer_group_deleted(self):
# Positive test:rule will delete when peer group deleting

View File

@ -15,6 +15,7 @@
from tempest.api.compute.security_groups 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
@ -27,7 +28,7 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest):
cls.rules_client = cls.security_group_rules_client
@test.attr(type=['negative'])
@test.idempotent_id('1d507e98-7951-469b-82c3-23f1e6b8c254')
@decorators.idempotent_id('1d507e98-7951-469b-82c3-23f1e6b8c254')
@test.services('network')
def test_create_security_group_rule_with_non_existent_id(self):
# Negative test: Creation of Security Group rule should FAIL
@ -44,7 +45,7 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest):
to_port=to_port)
@test.attr(type=['negative'])
@test.idempotent_id('2244d7e4-adb7-4ecb-9930-2d77e123ce4f')
@decorators.idempotent_id('2244d7e4-adb7-4ecb-9930-2d77e123ce4f')
@test.services('network')
def test_create_security_group_rule_with_invalid_id(self):
# Negative test: Creation of Security Group rule should FAIL
@ -61,7 +62,7 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest):
to_port=to_port)
@test.attr(type=['negative'])
@test.idempotent_id('8bd56d02-3ffa-4d67-9933-b6b9a01d6089')
@decorators.idempotent_id('8bd56d02-3ffa-4d67-9933-b6b9a01d6089')
@test.services('network')
def test_create_security_group_rule_duplicate(self):
# Negative test: Create Security Group rule duplicate should fail
@ -86,7 +87,7 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest):
to_port=to_port)
@test.attr(type=['negative'])
@test.idempotent_id('84c81249-9f6e-439c-9bbf-cbb0d2cddbdf')
@decorators.idempotent_id('84c81249-9f6e-439c-9bbf-cbb0d2cddbdf')
@test.services('network')
def test_create_security_group_rule_with_invalid_ip_protocol(self):
# Negative test: Creation of Security Group rule should FAIL
@ -106,7 +107,7 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest):
to_port=to_port)
@test.attr(type=['negative'])
@test.idempotent_id('12bbc875-1045-4f7a-be46-751277baedb9')
@decorators.idempotent_id('12bbc875-1045-4f7a-be46-751277baedb9')
@test.services('network')
def test_create_security_group_rule_with_invalid_from_port(self):
# Negative test: Creation of Security Group rule should FAIL
@ -125,7 +126,7 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest):
to_port=to_port)
@test.attr(type=['negative'])
@test.idempotent_id('ff88804d-144f-45d1-bf59-dd155838a43a')
@decorators.idempotent_id('ff88804d-144f-45d1-bf59-dd155838a43a')
@test.services('network')
def test_create_security_group_rule_with_invalid_to_port(self):
# Negative test: Creation of Security Group rule should FAIL
@ -144,7 +145,7 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest):
to_port=to_port)
@test.attr(type=['negative'])
@test.idempotent_id('00296fa9-0576-496a-ae15-fbab843189e0')
@decorators.idempotent_id('00296fa9-0576-496a-ae15-fbab843189e0')
@test.services('network')
def test_create_security_group_rule_with_invalid_port_range(self):
# Negative test: Creation of Security Group rule should FAIL
@ -163,7 +164,7 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest):
to_port=to_port)
@test.attr(type=['negative'])
@test.idempotent_id('56fddcca-dbb8-4494-a0db-96e9f869527c')
@decorators.idempotent_id('56fddcca-dbb8-4494-a0db-96e9f869527c')
@test.services('network')
def test_delete_security_group_rule_with_non_existent_id(self):
# Negative test: Deletion of Security Group rule should be FAIL

View File

@ -16,6 +16,7 @@
from tempest.api.compute.security_groups import base
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@ -28,7 +29,7 @@ class SecurityGroupsTestJSON(base.BaseSecurityGroupsTest):
cls.client = cls.security_groups_client
@test.attr(type='smoke')
@test.idempotent_id('eb2b087d-633d-4d0d-a7bd-9e6ba35b32de')
@decorators.idempotent_id('eb2b087d-633d-4d0d-a7bd-9e6ba35b32de')
@test.services('network')
def test_security_groups_create_list_delete(self):
# Positive test:Should return the list of Security Groups
@ -60,7 +61,7 @@ class SecurityGroupsTestJSON(base.BaseSecurityGroupsTest):
"list" % ', '.join(m_group['name']
for m_group in deleted_sgs))
@test.idempotent_id('ecc0da4a-2117-48af-91af-993cca39a615')
@decorators.idempotent_id('ecc0da4a-2117-48af-91af-993cca39a615')
@test.services('network')
def test_security_group_create_get_delete(self):
# Security Group should be created, fetched and deleted
@ -82,7 +83,7 @@ class SecurityGroupsTestJSON(base.BaseSecurityGroupsTest):
self.client.delete_security_group(securitygroup['id'])
self.client.wait_for_resource_deletion(securitygroup['id'])
@test.idempotent_id('fe4abc0d-83f5-4c50-ad11-57a1127297a2')
@decorators.idempotent_id('fe4abc0d-83f5-4c50-ad11-57a1127297a2')
@test.services('network')
def test_server_security_groups(self):
# Checks that security groups may be added and linked to a server
@ -124,7 +125,7 @@ class SecurityGroupsTestJSON(base.BaseSecurityGroupsTest):
self.client.delete_security_group(sg['id'])
self.client.delete_security_group(sg2['id'])
@test.idempotent_id('7d4e1d3c-3209-4d6d-b020-986304ebad1f')
@decorators.idempotent_id('7d4e1d3c-3209-4d6d-b020-986304ebad1f')
@test.services('network')
def test_update_security_groups(self):
# Update security group name and description

View File

@ -38,7 +38,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
cls.neutron_available = CONF.service_available.neutron
@test.attr(type=['negative'])
@test.idempotent_id('673eaec1-9b3e-48ed-bdf1-2786c1b9661c')
@decorators.idempotent_id('673eaec1-9b3e-48ed-bdf1-2786c1b9661c')
@test.services('network')
def test_security_group_get_nonexistent_group(self):
# Negative test:Should not be able to GET the details
@ -50,7 +50,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
@decorators.skip_because(bug="1161411",
condition=CONF.service_available.neutron)
@test.attr(type=['negative'])
@test.idempotent_id('1759c3cb-b0fc-44b7-86ce-c99236be911d')
@decorators.idempotent_id('1759c3cb-b0fc-44b7-86ce-c99236be911d')
@test.services('network')
def test_security_group_create_with_invalid_group_name(self):
# Negative test: Security Group should not be created with group name
@ -73,7 +73,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
@decorators.skip_because(bug="1161411",
condition=CONF.service_available.neutron)
@test.attr(type=['negative'])
@test.idempotent_id('777b6f14-aca9-4758-9e84-38783cfa58bc')
@decorators.idempotent_id('777b6f14-aca9-4758-9e84-38783cfa58bc')
@test.services('network')
def test_security_group_create_with_invalid_group_description(self):
# Negative test: Security Group should not be created with description
@ -86,7 +86,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
self.client.create_security_group,
name=s_name, description=s_description)
@test.idempotent_id('9fdb4abc-6b66-4b27-b89c-eb215a956168')
@decorators.idempotent_id('9fdb4abc-6b66-4b27-b89c-eb215a956168')
@testtools.skipIf(CONF.service_available.neutron,
"Neutron allows duplicate names for security groups")
@test.attr(type=['negative'])
@ -103,7 +103,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
name=s_name, description=s_description)
@test.attr(type=['negative'])
@test.idempotent_id('36a1629f-c6da-4a26-b8b8-55e7e5d5cd58')
@decorators.idempotent_id('36a1629f-c6da-4a26-b8b8-55e7e5d5cd58')
@test.services('network')
def test_delete_the_default_security_group(self):
# Negative test:Deletion of the "default" Security Group should Fail
@ -119,7 +119,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
default_security_group_id)
@test.attr(type=['negative'])
@test.idempotent_id('6727c00b-214c-4f9e-9a52-017ac3e98411')
@decorators.idempotent_id('6727c00b-214c-4f9e-9a52-017ac3e98411')
@test.services('network')
def test_delete_nonexistent_security_group(self):
# Negative test:Deletion of a non-existent Security Group should fail
@ -128,7 +128,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
self.client.delete_security_group, non_exist_id)
@test.attr(type=['negative'])
@test.idempotent_id('1438f330-8fa4-4aeb-8a94-37c250106d7f')
@decorators.idempotent_id('1438f330-8fa4-4aeb-8a94-37c250106d7f')
@test.services('network')
def test_delete_security_group_without_passing_id(self):
# Negative test:Deletion of a Security Group with out passing ID
@ -136,7 +136,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
self.assertRaises(lib_exc.NotFound,
self.client.delete_security_group, '')
@test.idempotent_id('00579617-fe04-4e1c-9d08-ca7467d2e34b')
@decorators.idempotent_id('00579617-fe04-4e1c-9d08-ca7467d2e34b')
@testtools.skipIf(CONF.service_available.neutron,
"Neutron does not check the security group ID")
@test.attr(type=['negative'])
@ -151,7 +151,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
self.client.update_security_group, sg_id_invalid,
name=s_name, description=s_description)
@test.idempotent_id('cda8d8b4-59f8-4087-821d-20cf5a03b3b1')
@decorators.idempotent_id('cda8d8b4-59f8-4087-821d-20cf5a03b3b1')
@testtools.skipIf(CONF.service_available.neutron,
"Neutron does not check the security group name")
@test.attr(type=['negative'])
@ -167,7 +167,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
self.client.update_security_group,
securitygroup_id, name=s_new_name)
@test.idempotent_id('97d12b1c-a610-4194-93f1-ba859e718b45')
@decorators.idempotent_id('97d12b1c-a610-4194-93f1-ba859e718b45')
@testtools.skipIf(CONF.service_available.neutron,
"Neutron does not check the security group description")
@test.attr(type=['negative'])
@ -184,7 +184,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
securitygroup_id, description=s_new_des)
@test.attr(type=['negative'])
@test.idempotent_id('27edee9c-873d-4da6-a68a-3c256efebe8f')
@decorators.idempotent_id('27edee9c-873d-4da6-a68a-3c256efebe8f')
@test.services('network')
def test_update_non_existent_security_group(self):
# Update a non-existent Security Group should Fail

View File

@ -17,6 +17,7 @@ from oslo_log import log as logging
from tempest.api.compute import base
from tempest import config
from tempest.lib import decorators
from tempest import test
CONF = config.CONF
@ -27,7 +28,7 @@ LOG = logging.getLogger(__name__)
class ExtensionsTestJSON(base.BaseV2ComputeTest):
@test.idempotent_id('3bb27738-b759-4e0d-a5fa-37d7a6df07d1')
@decorators.idempotent_id('3bb27738-b759-4e0d-a5fa-37d7a6df07d1')
def test_list_extensions(self):
# List of all extensions
if len(CONF.compute_feature_enabled.api_extensions) == 0:
@ -44,7 +45,7 @@ class ExtensionsTestJSON(base.BaseV2ComputeTest):
extension_list = map(lambda x: x['alias'], extensions)
LOG.debug("Nova extensions: %s", ','.join(extension_list))
@test.idempotent_id('05762f39-bdfa-4cdb-9b46-b78f8e78e2fd')
@decorators.idempotent_id('05762f39-bdfa-4cdb-9b46-b78f8e78e2fd')
@test.requires_ext(extension='os-consoles', service='compute')
def test_get_extension(self):
# get the specified extensions

View File

@ -17,6 +17,7 @@ from tempest.api.compute import base
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 as lib_exc
from tempest import test
@ -42,7 +43,7 @@ class LiveBlockMigrationNegativeTestJSON(base.BaseV2ComputeAdminTest):
disk_over_commit=False)
@test.attr(type=['negative'])
@test.idempotent_id('7fb7856e-ae92-44c9-861a-af62d7830bcb')
@decorators.idempotent_id('7fb7856e-ae92-44c9-861a-af62d7830bcb')
def test_invalid_host_for_migration(self):
# Migrating to an invalid host should not change the status
target_host = data_utils.rand_name('host')

View File

@ -14,7 +14,7 @@
from tempest.api.compute import base
from tempest import config
from tempest import test
from tempest.lib import decorators
CONF = config.CONF
@ -31,7 +31,7 @@ class ComputeNetworksTest(base.BaseV2ComputeTest):
super(ComputeNetworksTest, cls).setup_clients()
cls.client = cls.os.compute_networks_client
@test.idempotent_id('3fe07175-312e-49a5-a623-5f52eeada4c2')
@decorators.idempotent_id('3fe07175-312e-49a5-a623-5f52eeada4c2')
def test_list_networks(self):
networks = self.client.list_networks()['networks']
self.assertNotEmpty(networks, "No networks found.")

View File

@ -15,6 +15,7 @@
from tempest.api.compute import base
from tempest.common import tempest_fixtures as fixtures
from tempest.lib import decorators
from tempest import test
@ -51,7 +52,7 @@ class QuotasTestJSON(base.BaseV2ComputeTest):
'cores', 'security_groups',
'server_group_members', 'server_groups'))
@test.idempotent_id('f1ef0a97-dbbb-4cca-adc5-c9fbc4f76107')
@decorators.idempotent_id('f1ef0a97-dbbb-4cca-adc5-c9fbc4f76107')
def test_get_quotas(self):
# User can get the quota set for it's tenant
expected_quota_set = self.default_quota_set | set(['id'])
@ -67,7 +68,7 @@ class QuotasTestJSON(base.BaseV2ComputeTest):
for quota in expected_quota_set:
self.assertIn(quota, quota_set.keys())
@test.idempotent_id('9bfecac7-b966-4f47-913f-1a9e2c12134a')
@decorators.idempotent_id('9bfecac7-b966-4f47-913f-1a9e2c12134a')
def test_get_default_quotas(self):
# User can get the default quota set for it's tenant
expected_quota_set = self.default_quota_set | set(['id'])
@ -77,7 +78,7 @@ class QuotasTestJSON(base.BaseV2ComputeTest):
for quota in expected_quota_set:
self.assertIn(quota, quota_set.keys())
@test.idempotent_id('cd65d997-f7e4-4966-a7e9-d5001b674fdc')
@decorators.idempotent_id('cd65d997-f7e4-4966-a7e9-d5001b674fdc')
def test_compare_tenant_quotas_with_default_quotas(self):
# Tenants are created with the default quota values
default_quota_set = \

View File

@ -13,6 +13,7 @@
# under the License.
from tempest.api.compute import base
from tempest.lib import decorators
from tempest import test
@ -29,7 +30,7 @@ class ComputeTenantNetworksTest(base.BaseV2ComputeTest):
cls.set_network_resources(network=True)
super(ComputeTenantNetworksTest, cls).setup_credentials()
@test.idempotent_id('edfea98e-bbe3-4c7a-9739-87b986baff26')
@decorators.idempotent_id('edfea98e-bbe3-4c7a-9739-87b986baff26')
@test.services('network')
def test_list_show_tenant_networks(self):
# Fetch all networks that are visible to the tenant: this may include

View File

@ -13,12 +13,12 @@
# under the License.
from tempest.api.compute import base
from tempest import test
from tempest.lib import decorators
class TestVersions(base.BaseV2ComputeTest):
@test.idempotent_id('6c0a0990-43b6-4529-9b61-5fd8daf7c55c')
@decorators.idempotent_id('6c0a0990-43b6-4529-9b61-5fd8daf7c55c')
def test_list_api_versions(self):
"""Test that a get of the unversioned url returns the choices doc.
@ -36,7 +36,7 @@ class TestVersions(base.BaseV2ComputeTest):
self.assertEqual(versions[0]['id'], 'v2.0',
"The first listed version should be v2.0")
@test.idempotent_id('b953a29e-929c-4a8e-81be-ec3a7e03cb76')
@decorators.idempotent_id('b953a29e-929c-4a8e-81be-ec3a7e03cb76')
def test_get_version_details(self):
"""Test individual version endpoints info works.

View File

@ -21,8 +21,8 @@ from tempest.common import compute
from tempest.common.utils.linux import remote_client
from tempest.common import waiters
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
CONF = config.CONF
@ -85,7 +85,7 @@ class AttachVolumeTestJSON(base.BaseV2ComputeTest):
return attachment
@test.idempotent_id('52e9045a-e90d-4c0d-9087-79d657faffff')
@decorators.idempotent_id('52e9045a-e90d-4c0d-9087-79d657faffff')
def test_attach_detach_volume(self):
# Stop and Start a server with an attached volume, ensuring that
# the volume remains attached.
@ -136,7 +136,7 @@ class AttachVolumeTestJSON(base.BaseV2ComputeTest):
disks = linux_client.get_disks()
self.assertNotIn(device_name_to_match, disks)
@test.idempotent_id('7fa563fe-f0f7-43eb-9e22-a1ece036b513')
@decorators.idempotent_id('7fa563fe-f0f7-43eb-9e22-a1ece036b513')
def test_list_get_volume_attachments(self):
# List volume attachment of the server
server = self._create_server()
@ -156,7 +156,7 @@ class AttachVolumeTestJSON(base.BaseV2ComputeTest):
self.assertEqual(volume['id'], body['volumeId'])
self.assertEqual(attachment['id'], body['id'])
@test.idempotent_id('757d488b-a951-4bc7-b3cd-f417028da08a')
@decorators.idempotent_id('757d488b-a951-4bc7-b3cd-f417028da08a')
def test_list_get_two_volume_attachments(self):
# NOTE: This test is using the volume device auto-assignment
# without specifying the device ("/dev/sdb", etc). The feature
@ -243,7 +243,7 @@ class AttachVolumeShelveTestJSON(AttachVolumeTestJSON):
counted_volumes = self._count_volumes(server)
self.assertEqual(number_of_volumes, counted_volumes)
@test.idempotent_id('13a940b6-3474-4c3c-b03f-29b89112bfee')
@decorators.idempotent_id('13a940b6-3474-4c3c-b03f-29b89112bfee')
@testtools.skipUnless(CONF.compute_feature_enabled.shelve,
'Shelve is not available.')
def test_attach_volume_shelved_or_offload_server(self):
@ -269,7 +269,7 @@ class AttachVolumeShelveTestJSON(AttachVolumeTestJSON):
# case of shelved_offloaded.
self.assertIsNotNone(volume_attachment['device'])
@test.idempotent_id('b54e86dd-a070-49c4-9c07-59ae6dae15aa')
@decorators.idempotent_id('b54e86dd-a070-49c4-9c07-59ae6dae15aa')
@testtools.skipUnless(CONF.compute_feature_enabled.shelve,
'Shelve is not available.')
def test_detach_volume_shelved_or_offload_server(self):

View File

@ -14,6 +14,7 @@
from tempest.api.compute import base
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@ -30,7 +31,7 @@ class AttachVolumeNegativeTest(base.BaseV2ComputeTest):
raise cls.skipException(skip_msg)
@test.related_bug('1630783', status_code=500)
@test.idempotent_id('a313b5cd-fbd0-49cc-94de-870e99f763c7')
@decorators.idempotent_id('a313b5cd-fbd0-49cc-94de-870e99f763c7')
def test_delete_attached_volume(self):
server = self.create_test_server(wait_until='ACTIVE')
volume = self.create_volume()

View File

@ -19,7 +19,7 @@ from tempest.api.compute import base
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
from tempest import test
from tempest.lib import decorators
CONF = config.CONF
@ -40,7 +40,7 @@ class VolumesSnapshotsTestJSON(base.BaseV2ComputeTest):
cls.volumes_client = cls.volumes_extensions_client
cls.snapshots_client = cls.snapshots_extensions_client
@test.idempotent_id('cd4ec87d-7825-450d-8040-6e2068f2da8f')
@decorators.idempotent_id('cd4ec87d-7825-450d-8040-6e2068f2da8f')
@testtools.skipUnless(CONF.volume_feature_enabled.snapshot,
'Cinder volume snapshots are disabled')
def test_volume_snapshot_create_get_list_delete(self):

View File

@ -19,7 +19,7 @@ from tempest.api.compute import base
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
from tempest import test
from tempest.lib import decorators
CONF = config.CONF
@ -39,7 +39,7 @@ class VolumesGetTestJSON(base.BaseV2ComputeTest):
super(VolumesGetTestJSON, cls).setup_clients()
cls.client = cls.volumes_extensions_client
@test.idempotent_id('f10f25eb-9775-4d9d-9cbe-1cf54dae9d5f')
@decorators.idempotent_id('f10f25eb-9775-4d9d-9cbe-1cf54dae9d5f')
def test_volume_create_get_delete(self):
# CREATE, GET, DELETE Volume
v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')

View File

@ -15,7 +15,7 @@
from tempest.api.compute import base
from tempest import config
from tempest import test
from tempest.lib import decorators
CONF = config.CONF
@ -52,7 +52,7 @@ class VolumesTestJSON(base.BaseV2ComputeTest):
cls.volume_list.append(volume)
cls.volume_id_list.append(volume['id'])
@test.idempotent_id('bc2dd1a0-15af-48e5-9990-f2e75a48325d')
@decorators.idempotent_id('bc2dd1a0-15af-48e5-9990-f2e75a48325d')
def test_volume_list(self):
# Should return the list of Volumes
# Fetch all Volumes
@ -67,7 +67,7 @@ class VolumesTestJSON(base.BaseV2ComputeTest):
', '.join(m_vol['displayName']
for m_vol in missing_volumes))
@test.idempotent_id('bad0567a-5a4f-420b-851e-780b55bb867c')
@decorators.idempotent_id('bad0567a-5a4f-420b-851e-780b55bb867c')
def test_volume_list_with_details(self):
# Should return the list of Volumes with details
# Fetch all Volumes
@ -82,7 +82,7 @@ class VolumesTestJSON(base.BaseV2ComputeTest):
', '.join(m_vol['displayName']
for m_vol in missing_volumes))
@test.idempotent_id('1048ed81-2baf-487a-b284-c0622b86e7b8')
@decorators.idempotent_id('1048ed81-2baf-487a-b284-c0622b86e7b8')
def test_volume_list_param_limit(self):
# Return the list of volumes based on limit set
params = {'limit': 2}
@ -91,7 +91,7 @@ class VolumesTestJSON(base.BaseV2ComputeTest):
self.assertEqual(len(fetched_vol_list), params['limit'],
"Failed to list volumes by limit set")
@test.idempotent_id('33985568-4965-49d5-9bcc-0aa007ca5b7a')
@decorators.idempotent_id('33985568-4965-49d5-9bcc-0aa007ca5b7a')
def test_volume_list_with_detail_param_limit(self):
# Return the list of volumes with details based on limit set.
params = {'limit': 2}
@ -101,7 +101,7 @@ class VolumesTestJSON(base.BaseV2ComputeTest):
self.assertEqual(len(fetched_vol_list), params['limit'],
"Failed to list volume details by limit set")
@test.idempotent_id('51c22651-a074-4ea7-af0b-094f9331303e')
@decorators.idempotent_id('51c22651-a074-4ea7-af0b-094f9331303e')
def test_volume_list_param_offset_and_limit(self):
# Return the list of volumes based on offset and limit set.
# get all volumes list
@ -118,7 +118,7 @@ class VolumesTestJSON(base.BaseV2ComputeTest):
all_vol_list[index + params['offset']]['id'],
"Failed to list volumes by offset and limit")
@test.idempotent_id('06b6abc4-3f10-48e9-a7a1-3facc98f03e5')
@decorators.idempotent_id('06b6abc4-3f10-48e9-a7a1-3facc98f03e5')
def test_volume_list_with_detail_param_offset_and_limit(self):
# Return the list of volumes details based on offset and limit set.
# get all volumes list

View File

@ -16,6 +16,7 @@
from tempest.api.compute import base
from tempest.common.utils import data_utils
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@ -37,7 +38,7 @@ class VolumesNegativeTest(base.BaseV2ComputeTest):
cls.client = cls.volumes_extensions_client
@test.attr(type=['negative'])
@test.idempotent_id('c03ea686-905b-41a2-8748-9635154b7c57')
@decorators.idempotent_id('c03ea686-905b-41a2-8748-9635154b7c57')
def test_volume_get_nonexistent_volume_id(self):
# Negative: Should not be able to get details of nonexistent volume
# Creating a nonexistent volume id
@ -46,7 +47,7 @@ class VolumesNegativeTest(base.BaseV2ComputeTest):
data_utils.rand_uuid())
@test.attr(type=['negative'])
@test.idempotent_id('54a34226-d910-4b00-9ef8-8683e6c55846')
@decorators.idempotent_id('54a34226-d910-4b00-9ef8-8683e6c55846')
def test_volume_delete_nonexistent_volume_id(self):
# Negative: Should not be able to delete nonexistent Volume
# Creating nonexistent volume id
@ -55,7 +56,7 @@ class VolumesNegativeTest(base.BaseV2ComputeTest):
data_utils.rand_uuid())
@test.attr(type=['negative'])
@test.idempotent_id('5125ae14-152b-40a7-b3c5-eae15e9022ef')
@decorators.idempotent_id('5125ae14-152b-40a7-b3c5-eae15e9022ef')
def test_create_volume_with_invalid_size(self):
# Negative: Should not be able to create volume with invalid size
# in request
@ -65,7 +66,7 @@ class VolumesNegativeTest(base.BaseV2ComputeTest):
size='#$%', display_name=v_name, metadata=metadata)
@test.attr(type=['negative'])
@test.idempotent_id('131cb3a1-75cc-4d40-b4c3-1317f64719b0')
@decorators.idempotent_id('131cb3a1-75cc-4d40-b4c3-1317f64719b0')
def test_create_volume_without_passing_size(self):
# Negative: Should not be able to create volume without passing size
# in request
@ -75,7 +76,7 @@ class VolumesNegativeTest(base.BaseV2ComputeTest):
size='', display_name=v_name, metadata=metadata)
@test.attr(type=['negative'])
@test.idempotent_id('8cce995e-0a83-479a-b94d-e1e40b8a09d1')
@decorators.idempotent_id('8cce995e-0a83-479a-b94d-e1e40b8a09d1')
def test_create_volume_with_size_zero(self):
# Negative: Should not be able to create volume with size zero
v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
@ -84,13 +85,13 @@ class VolumesNegativeTest(base.BaseV2ComputeTest):
size='0', display_name=v_name, metadata=metadata)
@test.attr(type=['negative'])
@test.idempotent_id('62bab09a-4c03-4617-8cca-8572bc94af9b')
@decorators.idempotent_id('62bab09a-4c03-4617-8cca-8572bc94af9b')
def test_get_volume_without_passing_volume_id(self):
# Negative: Should not be able to get volume when empty ID is passed
self.assertRaises(lib_exc.NotFound, self.client.show_volume, '')
@test.attr(type=['negative'])
@test.idempotent_id('62972737-124b-4513-b6cf-2f019f178494')
@decorators.idempotent_id('62972737-124b-4513-b6cf-2f019f178494')
def test_delete_invalid_volume_id(self):
# Negative: Should not be able to delete volume when invalid ID is
# passed
@ -99,7 +100,7 @@ class VolumesNegativeTest(base.BaseV2ComputeTest):
data_utils.rand_name('invalid'))
@test.attr(type=['negative'])
@test.idempotent_id('0d1417c5-4ae8-4c2c-adc5-5f0b864253e5')
@decorators.idempotent_id('0d1417c5-4ae8-4c2c-adc5-5f0b864253e5')
def test_delete_volume_without_passing_volume_id(self):
# Negative: Should not be able to delete volume when empty ID is passed
self.assertRaises(lib_exc.NotFound, self.client.delete_volume, '')