diff --git a/api/test_addresses.py b/api/test_addresses.py index fb8bf69..534dc1c 100644 --- a/api/test_addresses.py +++ b/api/test_addresses.py @@ -17,6 +17,7 @@ import time import botocore.exceptions from oslo_log import log +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -29,6 +30,7 @@ LOG = log.getLogger(__name__) class AddressTest(base.EC2TestCase): @base.skip_without_vpc() + @decorators.idempotent_id('218a4b6b-c3a9-44b0-8148-4bd0bc36bd7d') def test_create_delete_vpc_address(self): kwargs = { 'Domain': 'vpc', @@ -43,6 +45,7 @@ class AddressTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) @base.skip_without_ec2() + @decorators.idempotent_id('285b8b4e-5aef-4e7f-be9e-37e6475be21b') def test_create_delete_standard_address(self): data = self.client.allocate_address() ip = data['PublicIp'] @@ -53,6 +56,7 @@ class AddressTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) @base.skip_without_vpc() + @decorators.idempotent_id('5be3ad8d-b071-472b-b92a-7199c82334a2') def test_invalid_delete_vpc_address(self): kwargs = { 'Domain': 'vpc', @@ -96,6 +100,7 @@ class AddressTest(base.EC2TestCase): self.client.release_address, PublicIp='ip') + @decorators.idempotent_id('e8171637-9ccd-471a-97da-c78a36ba3c4b') def test_invalid_create_address(self): kwargs = { 'Domain': 'invalid', @@ -113,6 +118,7 @@ class AddressTest(base.EC2TestCase): e.response['Error']['Code']) @base.skip_without_vpc() + @decorators.idempotent_id('b0d0b498-1fe2-479e-995c-80ace2f339a7') def test_describe_vpc_addresses(self): kwargs = { 'Domain': 'vpc', @@ -185,6 +191,7 @@ class AddressTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean2) @base.skip_without_ec2() + @decorators.idempotent_id('a5c09f47-3be3-4d46-b59d-25195d67e6d5') def test_describe_standard_addresses(self): data = self.client.allocate_address(*[], **{}) ip = data['PublicIp'] @@ -220,6 +227,7 @@ class AddressTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) @base.skip_without_vpc() + @decorators.idempotent_id('6f154e48-f260-4d8d-b1d1-a1cf174f58fa') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_associate_disassociate_vpc_addresses(self): aws_zone = CONF.aws.aws_zone @@ -305,6 +313,7 @@ class AddressTest(base.EC2TestCase): self.cancelResourceCleanUp(clean_vpc) self.get_vpc_waiter().wait_delete(vpc_id) + @decorators.idempotent_id('4aaf01d2-ade5-4e8b-b24a-ab22448b3236') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") # skip this test for nova network due to bug #1607350 @base.skip_without_vpc() @@ -343,6 +352,7 @@ class AddressTest(base.EC2TestCase): self.get_instance_waiter().wait_delete(instance_id) @base.skip_without_vpc() + @decorators.idempotent_id('3c0ab7f5-ee9c-4966-8d43-e89f5520f245') def test_disassociate_not_associated_vpc_addresses(self): aws_zone = CONF.aws.aws_zone @@ -387,6 +397,7 @@ class AddressTest(base.EC2TestCase): self.get_vpc_waiter().wait_delete(vpc_id) @base.skip_without_ec2() + @decorators.idempotent_id('a70babef-18ec-4340-a3a2-63388cfc3cb5') def test_disassociate_not_associated_standard_addresses(self): data = self.client.allocate_address(Domain='standard') ip = data['PublicIp'] @@ -399,6 +410,7 @@ class AddressTest(base.EC2TestCase): self.cancelResourceCleanUp(clean_a) @base.skip_without_vpc() + @decorators.idempotent_id('91b971f5-2674-478e-84df-115fef506c5b') @testtools.skipUnless(CONF.aws.run_incompatible_tests, 'preliminary address association is not supported') def test_preliminary_associate_address(self): diff --git a/api/test_customer_gateways.py b/api/test_customer_gateways.py index 8d1a735..4b5519d 100644 --- a/api/test_customer_gateways.py +++ b/api/test_customer_gateways.py @@ -14,6 +14,7 @@ # under the License. import botocore.exceptions +from tempest.lib import decorators from ec2api.tests.functional import base from ec2api.tests.functional import config @@ -33,6 +34,7 @@ class CustomerGatewayTest(base.EC2TestCase): raise cls.skipException('VPC is disabled') base.check_network_feature_enabled('vpnaas') + @decorators.idempotent_id('54a40b66-1675-44b1-938d-0cad2eb6afe4') def test_create_delete_customer_gateway(self): data = self.client.create_customer_gateway( Type='ipsec.1', PublicIp=self.CUSTOMER_GATEWAY_IP, BgpAsn=65000) diff --git a/api/test_dhcp_options.py b/api/test_dhcp_options.py index 6b71a92..bc939c5 100644 --- a/api/test_dhcp_options.py +++ b/api/test_dhcp_options.py @@ -16,6 +16,7 @@ import time from oslo_log import log +from tempest.lib import decorators from ec2api.tests.functional import base from ec2api.tests.functional import config @@ -33,6 +34,7 @@ class DhcpOptionsTest(base.EC2TestCase): if not base.TesterStateHolder().get_vpc_enabled(): raise cls.skipException('VPC is disabled') + @decorators.idempotent_id('2331fc49-50e0-4df3-8c45-bd6f61cc86bf') def test_create_delete_dhcp_options(self): kwargs = { 'DhcpConfigurations': [ @@ -81,6 +83,7 @@ class DhcpOptionsTest(base.EC2TestCase): data = self.client.delete_dhcp_options(DhcpOptionsId=id) self.cancelResourceCleanUp(res_clean) + @decorators.idempotent_id('ff1d4f6e-97fc-4053-b98f-ff59e7e8d061') def test_invalid_create_delete(self): def _rollback(fn_data): self.client.delete_dhcp_options( @@ -108,6 +111,7 @@ class DhcpOptionsTest(base.EC2TestCase): self.client.create_dhcp_options, rollback_fn=_rollback, **kwargs) + @decorators.idempotent_id('1c3e8ff9-bb3b-40ba-889e-d2306a92f418') def test_describe_dhcp_options(self): kwargs = { 'DhcpConfigurations': [ @@ -140,6 +144,7 @@ class DhcpOptionsTest(base.EC2TestCase): data = self.client.delete_dhcp_options(DhcpOptionsId=id) self.cancelResourceCleanUp(res_clean) + @decorators.idempotent_id('1b4d678a-c2a2-4c73-9e62-789fe2f6b173') def test_associate_dhcp_options(self): kwargs = { 'DhcpConfigurations': [ diff --git a/api/test_images.py b/api/test_images.py index 5508b0a..dafb2c4 100644 --- a/api/test_images.py +++ b/api/test_images.py @@ -14,6 +14,7 @@ # under the License. from tempest.lib.common.utils import data_utils +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -24,6 +25,7 @@ CONF = config.CONF class ImageTest(base.EC2TestCase): + @decorators.idempotent_id('19a2fda6-0b78-4544-a6c5-ac16f39811c8') @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined") def test_check_ebs_image_type(self): image_id = CONF.aws.ebs_image_id @@ -33,6 +35,7 @@ class ImageTest(base.EC2TestCase): self.assertEqual("ebs", image['RootDeviceType'], "Image is not EBS image") + @decorators.idempotent_id('d45be578-5968-4189-8f25-56bf8ef23d20') @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined") def test_check_ebs_image_volume_properties(self): image_id = CONF.aws.ebs_image_id @@ -56,6 +59,7 @@ class ImageTest(base.EC2TestCase): self.assertFalse(ebs.get('Encrypted')) self.assertIsNotNone(ebs.get('VolumeType')) + @decorators.idempotent_id('a139f5ea-45fd-4b3e-9a52-32de0f8c3bca') @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined") def test_describe_image_with_filters(self): image_id = CONF.aws.ebs_image_id @@ -72,6 +76,7 @@ class ImageTest(base.EC2TestCase): self.assertEqual(1, len(data['Images'])) self.assertEqual(image_id, data['Images'][0]['ImageId']) + @decorators.idempotent_id('743e1f87-e0b6-4787-ab22-176379030007') @testtools.skipUnless(CONF.aws.image_id, "Image id is not defined") def test_check_image_operations_negative(self): # NOTE(andrey-mp): image_id is a public image created by admin @@ -125,6 +130,7 @@ class ImageTest(base.EC2TestCase): self.client.deregister_image, ImageId=image_id) + @decorators.idempotent_id('a948dad1-9128-446b-86ee-82db13342054') @testtools.skipUnless(CONF.aws.image_id, 'image id is not defined') def test_create_image_from_non_ebs_instance(self): image_id = CONF.aws.image_id @@ -179,6 +185,7 @@ class ImageTest(base.EC2TestCase): return image_id, image_clean + @decorators.idempotent_id('f4fbb311-8a59-443d-a60a-11779917c757') @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined") def test_create_image_from_ebs_instance(self): name = data_utils.rand_name('image') @@ -202,6 +209,7 @@ class ImageTest(base.EC2TestCase): data = self.client.deregister_image(ImageId=image_id) self.cancelResourceCleanUp(image_clean) + @decorators.idempotent_id('b9aba1f7-0a7e-4717-b879-efe3bbea74e2') @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined") def test_check_simple_image_attributes(self): name = data_utils.rand_name('image') @@ -236,6 +244,7 @@ class ImageTest(base.EC2TestCase): data = self.client.deregister_image(ImageId=image_id) self.cancelResourceCleanUp(image_clean) + @decorators.idempotent_id('680963cf-84f2-488d-bcdb-fc6f9b39f78c') @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined") def test_check_bdm_in_image(self): image_id = CONF.aws.ebs_image_id @@ -261,6 +270,7 @@ class ImageTest(base.EC2TestCase): data = self.client.deregister_image(ImageId=image_id) self.cancelResourceCleanUp(image_clean) + @decorators.idempotent_id('1c244c9a-af3e-47f0-bc85-034e24b051e4') @testtools.skipUnless(CONF.aws.run_incompatible_tests, 'By default glance is configured as "publicize_image": "role:admin"') @testtools.skipUnless(CONF.aws.run_incompatible_tests, @@ -316,6 +326,7 @@ class ImageRegisterTest(base.EC2TestCase): if not cls.image_location: raise cls.skipException('Image materials are not ready in S3') + @decorators.idempotent_id('3e25269d-c8a2-4438-ab25-c343cb53db79') def test_register_get_deregister_ami_image(self): image_name = data_utils.rand_name("ami-name") data = self.client.register_image( diff --git a/api/test_instance_attributes.py b/api/test_instance_attributes.py index 08cbe49..e1c8db5 100644 --- a/api/test_instance_attributes.py +++ b/api/test_instance_attributes.py @@ -17,6 +17,7 @@ import time from oslo_log import log from tempest.lib.common.utils import data_utils +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -28,6 +29,7 @@ LOG = log.getLogger(__name__) class InstanceAttributeTest(base.EC2TestCase): + @decorators.idempotent_id('485107d8-f65f-4441-9558-2ff783e52e22') @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined") def test_describe_instance_attributes(self): instance_id = self.run_instance(ImageId=CONF.aws.ebs_image_id) @@ -78,6 +80,7 @@ class InstanceAttributeTest(base.EC2TestCase): self.client.terminate_instances(InstanceIds=[instance_id]) self.get_instance_waiter().wait_delete(instance_id) + @decorators.idempotent_id('391f6645-d014-42c7-a727-f3a6e7a13a4c') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_disable_api_termination_attribute(self): instance_id = self.run_instance(DisableApiTermination=True) @@ -118,6 +121,7 @@ class InstanceAttributeTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) self.get_instance_waiter().wait_delete(instance_id) + @decorators.idempotent_id('50671a21-99bf-4514-acb0-97617f92e868') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_instance_attributes_negative(self): instance_id = self.run_instance() @@ -193,6 +197,7 @@ class InstanceAttributeTest(base.EC2TestCase): self.get_instance_waiter().wait_delete(instance_id) @base.skip_without_vpc() + @decorators.idempotent_id('6fd2c8eb-f7f9-420d-a8ae-5d5af3a49a35') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_attributes_for_multiple_interfaces_negative(self): vpc_id, subnet_id = self.create_vpc_and_subnet('10.30.0.0/24') @@ -242,6 +247,7 @@ class InstanceAttributeTest(base.EC2TestCase): self.get_instance_waiter().wait_delete(instance_id) @base.skip_without_vpc() + @decorators.idempotent_id('da26cc0d-6c2d-4638-97f1-1abfae8f00b5') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_group_set_attribute(self): vpc_id, subnet_id = self.create_vpc_and_subnet('10.30.0.0/24') @@ -289,6 +295,7 @@ class InstanceAttributeTest(base.EC2TestCase): self.get_instance_waiter().wait_delete(instance_id) @base.skip_without_vpc() + @decorators.idempotent_id('8e7b37b5-1f2d-4c38-b51e-dcd0e726edb3') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_source_dest_check_attribute(self): vpc_id, subnet_id = self.create_vpc_and_subnet('10.30.0.0/24') @@ -320,6 +327,7 @@ class InstanceAttributeTest(base.EC2TestCase): self.client.terminate_instances(InstanceIds=[instance_id]) self.get_instance_waiter().wait_delete(instance_id) + @decorators.idempotent_id('a2640ab1-6aaa-4626-9f23-4aba52e3b88a') @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined") @testtools.skipUnless(CONF.aws.instance_type_alt, "Alternative instance type is not defined") diff --git a/api/test_instances.py b/api/test_instances.py index 54f4557..deac2d5 100644 --- a/api/test_instances.py +++ b/api/test_instances.py @@ -15,6 +15,7 @@ from oslo_log import log from tempest.lib.common.utils import data_utils +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -34,6 +35,7 @@ class InstanceTest(base.EC2TestCase): raise cls.skipException('aws image_id does not provided') cls.zone = CONF.aws.aws_zone + @decorators.idempotent_id('5604e461-c36a-4fea-84bc-eddfe702ae4f') def test_create_delete_instance(self): instance_type = CONF.aws.instance_type image_id = CONF.aws.image_id @@ -69,6 +71,7 @@ class InstanceTest(base.EC2TestCase): # Amazon returns instance in 'terminated' state some time after # instance deletion. But Openstack doesn't return such instance. + @decorators.idempotent_id('40b273e5-3d43-4529-99b0-da5dd7e6764e') def test_create_idempotent_instance(self): client_token = data_utils.rand_name('t') instance_type = CONF.aws.instance_type @@ -103,6 +106,7 @@ class InstanceTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) self.get_instance_waiter().wait_delete(instance_id) + @decorators.idempotent_id('4c3c709a-72e2-4c87-bab2-e3a16fc5d1fe') def test_describe_instances_filter(self): instance_type = CONF.aws.instance_type image_id = CONF.aws.image_id @@ -156,6 +160,7 @@ class InstanceTest(base.EC2TestCase): self.assertNotEmpty(instances) self.assertEqual(instance_id, instances[0]['InstanceId']) + @decorators.idempotent_id('d40bf881-4220-46a9-b04a-fca9054c9731') def test_get_password_data_and_console_output(self): instance_type = CONF.aws.instance_type image_id = CONF.aws.image_id @@ -189,6 +194,7 @@ class InstanceTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) self.get_instance_waiter().wait_delete(instance_id) + @decorators.idempotent_id('5947ccaa-a519-46f4-9d58-ceb79042266a') @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined") def test_stop_instance(self): instance_type = CONF.aws.instance_type @@ -218,6 +224,7 @@ class InstanceTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) self.get_instance_waiter().wait_delete(instance_id) + @decorators.idempotent_id('0f29affb-eae5-42be-9b52-d28a17ba7107') @testtools.skipUnless(CONF.aws.run_incompatible_tests, "Openstack doesn't assign public ip automatically for new instance") def test_public_ip_is_assigned(self): diff --git a/api/test_instances_ebs.py b/api/test_instances_ebs.py index ed38004..29b9096 100644 --- a/api/test_instances_ebs.py +++ b/api/test_instances_ebs.py @@ -14,6 +14,7 @@ # under the License. from oslo_log import log +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -25,6 +26,7 @@ LOG = log.getLogger(__name__) class InstanceWithEBSTest(base.EC2TestCase): + @decorators.idempotent_id('a5cad848-bed2-4dcb-8ba0-987bb7e9c487') @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined") def test_create_get_delete_ebs_instance(self): """Launch EBS-backed instance, check results, and terminate it.""" @@ -53,6 +55,7 @@ class InstanceWithEBSTest(base.EC2TestCase): data = self.client.terminate_instances(InstanceIds=[instance_id]) self.get_instance_waiter().wait_delete(instance_id) + @decorators.idempotent_id('b6226b7b-d965-4c3a-b2a8-48add794c194') @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined") def test_create_root_volume_snapshot(self): """Create snapshot of root volume of EBS-backed instance.""" diff --git a/api/test_instances_vpc.py b/api/test_instances_vpc.py index acf8ee0..a60bde4 100644 --- a/api/test_instances_vpc.py +++ b/api/test_instances_vpc.py @@ -14,6 +14,7 @@ # under the License. from oslo_log import log +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -51,6 +52,7 @@ class InstanceInVPCTest(base.EC2TestCase): SubnetId=cls.subnet_id) cls.get_subnet_waiter().wait_available(cls.subnet_id) + @decorators.idempotent_id('af8bd493-4a68-49e7-a3d1-326251b8d16e') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_create_delete_instance(self): instance_id = self.run_instance(SubnetId=self.subnet_id) @@ -81,6 +83,7 @@ class InstanceInVPCTest(base.EC2TestCase): # Amazon returns instance in 'terminated' state some time after # instance deletion. But Openstack doesn't return such instance. + @decorators.idempotent_id('17ba6206-3044-4e51-9e9b-f5d5728cc047') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_describe_instances_filter(self): instance_id = self.run_instance(SubnetId=self.subnet_id) @@ -137,6 +140,7 @@ class InstanceInVPCTest(base.EC2TestCase): self.assertNotEmpty(instances) self.assertEqual(instance_id, instances[0]['InstanceId']) + @decorators.idempotent_id('60ceda8b-85ae-47a7-807b-c4a4dd05a13b') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_create_instance_with_two_interfaces(self): kwargs = { @@ -183,6 +187,7 @@ class InstanceInVPCTest(base.EC2TestCase): self.cancelResourceCleanUp(clean_ni1) self.get_network_interface_waiter().wait_delete(ni_id1) + @decorators.idempotent_id('a7dc520a-e828-4347-91e1-385c4e0e6070') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_create_instance_with_private_ip(self): ip = '10.16.0.12' @@ -196,6 +201,7 @@ class InstanceInVPCTest(base.EC2TestCase): self.client.terminate_instances(InstanceIds=[instance_id]) self.get_instance_waiter().wait_delete(instance_id) + @decorators.idempotent_id('582ac8ed-58e7-4f27-bd65-35b999241c63') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_create_instance_with_invalid_params(self): def _rollback(fn_data): diff --git a/api/test_internet_gateways.py b/api/test_internet_gateways.py index d170080..afdc53e 100644 --- a/api/test_internet_gateways.py +++ b/api/test_internet_gateways.py @@ -16,6 +16,7 @@ import time from oslo_log import log +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -50,6 +51,7 @@ class InternetGatewayTest(base.EC2TestCase): cls.addResourceCleanUpStatic(cls.client.delete_vpc, VpcId=cls.vpc_id_alt) + @decorators.idempotent_id('f2d40306-4b18-4e17-90a5-371db0ddc7cb') def test_create_attach_internet_gateway(self): data = self.client.create_internet_gateway() gw_id = data['InternetGateway']['InternetGatewayId'] @@ -70,6 +72,7 @@ class InternetGatewayTest(base.EC2TestCase): self.client.describe_internet_gateways, InternetGatewayIds=[gw_id]) + @decorators.idempotent_id('f092b63d-9460-4d8f-ba8a-bcd380666033') def test_delete_attached_internet_gateway(self): data = self.client.create_internet_gateway() gw_id = data['InternetGateway']['InternetGatewayId'] @@ -90,6 +93,7 @@ class InternetGatewayTest(base.EC2TestCase): data = self.client.delete_internet_gateway(InternetGatewayId=gw_id) self.cancelResourceCleanUp(res_clean) + @decorators.idempotent_id('89700013-5753-4608-8245-4fc99fbb67ea') @testtools.skipUnless(CONF.aws.run_incompatible_tests, "Another error code returned - InvalidParameterValue") def test_attach_detach_invalid_internet_gateway(self): @@ -102,6 +106,7 @@ class InternetGatewayTest(base.EC2TestCase): self.client.detach_internet_gateway, VpcId=self.vpc_id, InternetGatewayId=gw_id) + @decorators.idempotent_id('e3e4d8c4-8f62-43e8-a24d-bfd292b4144c') def test_double_attach_internet_gateway(self): data = self.client.create_internet_gateway() gw_id = data['InternetGateway']['InternetGatewayId'] @@ -122,6 +127,7 @@ class InternetGatewayTest(base.EC2TestCase): data = self.client.delete_internet_gateway(InternetGatewayId=gw_id) self.cancelResourceCleanUp(res_clean) + @decorators.idempotent_id('d8f3a488-a4ba-4ed5-998c-3dc6f43d6d9e') def test_attach_one_internet_gateway_to_two_vpcs(self): data = self.client.create_internet_gateway() gw_id = data['InternetGateway']['InternetGatewayId'] @@ -142,6 +148,7 @@ class InternetGatewayTest(base.EC2TestCase): data = self.client.delete_internet_gateway(InternetGatewayId=gw_id) self.cancelResourceCleanUp(res_clean) + @decorators.idempotent_id('b86f338c-613e-4cd7-9742-07c86864b0da') def test_describe_internet_gateways_base(self): data = self.client.create_internet_gateway() gw_id = data['InternetGateway']['InternetGatewayId'] @@ -172,6 +179,7 @@ class InternetGatewayTest(base.EC2TestCase): data = self.client.delete_internet_gateway(InternetGatewayId=gw_id) self.cancelResourceCleanUp(res_clean) + @decorators.idempotent_id('3f141c56-9ee6-46bf-9c14-0d922ed8a482') def test_describe_internet_gateways_filters(self): # NOTE(andrey-mp): by filter real vpc-id before creation data = self.client.describe_internet_gateways( diff --git a/api/test_key_pairs.py b/api/test_key_pairs.py index d7efc7f..21687e9 100644 --- a/api/test_key_pairs.py +++ b/api/test_key_pairs.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -23,6 +24,7 @@ CONF = config.CONF class KeyPairTest(base.EC2TestCase): + @decorators.idempotent_id('15cfd866-d6bb-473a-9b8a-6420900a5ca3') def test_create_delete_key_pair(self): keyName = 'Test key' data = self.client.create_key_pair(KeyName=keyName) @@ -37,6 +39,7 @@ class KeyPairTest(base.EC2TestCase): data = self.client.delete_key_pair(KeyName=keyName) self.cancelResourceCleanUp(res_clean) + @decorators.idempotent_id('05478a51-1505-42a8-8c7d-4fd7e32c467e') def test_create_duplicate_key_pair(self): keyName = 'Test key' self.client.create_key_pair(KeyName=keyName) @@ -50,6 +53,7 @@ class KeyPairTest(base.EC2TestCase): self.client.delete_key_pair(KeyName=keyName) self.cancelResourceCleanUp(res_clean) + @decorators.idempotent_id('43d87b6e-6667-4d19-8c0b-e73901105bb7') def test_describe_key_pairs(self): keyName = 'Test key' data = self.client.create_key_pair(KeyName=keyName) @@ -91,6 +95,7 @@ class KeyPairTest(base.EC2TestCase): # NOTE(andrey-mp): Amazon allows to delete absent key and returns 200 self.client.delete_key_pair(KeyName=keyName) + @decorators.idempotent_id('0e51eec5-3f61-4d8a-89c9-8d098f381682') def test_import_empty_key_pair(self): keyName = 'Test key' publicKey = '' @@ -103,6 +108,7 @@ class KeyPairTest(base.EC2TestCase): rollback_fn=_rollback, KeyName=keyName, PublicKeyMaterial=publicKey) + @decorators.idempotent_id('478c17e6-b7ca-4115-bee2-be279bdd0f65') @testtools.skipUnless(CONF.aws.run_incompatible_tests, "Different error code") def test_import_invalid_key_pair(self): @@ -117,6 +123,7 @@ class KeyPairTest(base.EC2TestCase): rollback_fn=_rollback, KeyName=keyName, PublicKeyMaterial=publicKey) + @decorators.idempotent_id('eda525d6-144b-4840-b6ba-e18d93e3589f') def test_import_key_pair(self): keyName = 'Test key' publicKey = ("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCs" diff --git a/api/test_network_interfaces.py b/api/test_network_interfaces.py index fe33a4e..56f4999 100644 --- a/api/test_network_interfaces.py +++ b/api/test_network_interfaces.py @@ -18,6 +18,7 @@ import time import botocore.exceptions from oslo_log import log from tempest.lib.common.utils import data_utils +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -61,6 +62,7 @@ class NetworkInterfaceTest(base.EC2TestCase): # to wait this request time.sleep(5) + @decorators.idempotent_id('d03f49b1-a77e-439b-96e2-5e152b968863') def test_delete_subnet_with_network_interface(self): data = self.client.create_subnet(VpcId=self.vpc_id, CidrBlock='10.7.1.0/28') @@ -88,6 +90,7 @@ class NetworkInterfaceTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean_subnet) self.get_subnet_waiter().wait_delete(subnet_id) + @decorators.idempotent_id('e19e450d-5c24-47b1-9814-4a65a78e5a31') def test_create_network_interface(self): desc = data_utils.rand_name('ni') data = self.client.create_network_interface(SubnetId=self.subnet_id, @@ -128,6 +131,7 @@ class NetworkInterfaceTest(base.EC2TestCase): # TODO(andrey-mp): add creation with addresses + @decorators.idempotent_id('61e16648-7736-4647-b618-27d3f4f0c9c6') def test_create_max_network_interface(self): # NOTE(andrey-mp): wait some time while all ports will be deleted # for this subnet(that are deleting after previous test) @@ -163,6 +167,7 @@ class NetworkInterfaceTest(base.EC2TestCase): self.cancelResourceCleanUp(addr[1]) self.get_network_interface_waiter().wait_delete(addr[0]) + @decorators.idempotent_id('8c174e5f-e377-4bf2-9315-b868a8199c17') def test_unassign_primary_addresses(self): data = self.client.create_network_interface(SubnetId=self.subnet_id) ni_id = data['NetworkInterface']['NetworkInterfaceId'] @@ -180,6 +185,7 @@ class NetworkInterfaceTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) self.get_network_interface_waiter().wait_delete(ni_id) + @decorators.idempotent_id('de0d0375-d99a-476c-939a-0e15c4e431a8') def test_assign_unassign_private_addresses_by_count(self): data = self.client.describe_subnets(SubnetIds=[self.subnet_id]) count = data['Subnets'][0]['AvailableIpAddressCount'] @@ -220,6 +226,7 @@ class NetworkInterfaceTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) self.get_network_interface_waiter().wait_delete(ni_id) + @decorators.idempotent_id('5d7bda42-d23e-4cbf-9e66-8ca052ac28ff') def test_assign_unassign_private_addresses_by_addresses(self): data = self.client.describe_subnets(SubnetIds=[self.subnet_id]) count = data['Subnets'][0]['AvailableIpAddressCount'] @@ -263,6 +270,7 @@ class NetworkInterfaceTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) self.get_network_interface_waiter().wait_delete(ni_id) + @decorators.idempotent_id('0c514bb4-5800-4db0-9032-0aa3ab998612') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_attach_network_interface(self): data = self.client.create_network_interface(SubnetId=self.subnet_id) @@ -310,6 +318,7 @@ class NetworkInterfaceTest(base.EC2TestCase): self.client.terminate_instances(InstanceIds=[instance_id]) self.get_instance_waiter().wait_delete(instance_id) + @decorators.idempotent_id('381c9995-bc83-4e7e-b716-25a451660ace') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_network_interfaces_are_not_deleted_on_termination(self): instance_id = self.run_instance(SubnetId=self.subnet_id) @@ -368,6 +377,7 @@ class NetworkInterfaceTest(base.EC2TestCase): self.cancelResourceCleanUp(clean_ni2) self.get_network_interface_waiter().wait_delete(ni_id2) + @decorators.idempotent_id('de910bc7-008a-40c2-b4b2-4587a489fc1c') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_network_interfaces_are_deleted_on_termination(self): instance_id = self.run_instance(SubnetId=self.subnet_id) @@ -406,6 +416,7 @@ class NetworkInterfaceTest(base.EC2TestCase): self.get_network_interface_waiter().wait_delete(ni_id) self.get_network_interface_waiter().wait_delete(ni_id2) + @decorators.idempotent_id('028eb864-59e9-4ed6-a062-9d5de9eba652') def test_network_interface_attribute_description(self): desc = data_utils.rand_name('ni') data = self.client.create_network_interface( @@ -431,6 +442,7 @@ class NetworkInterfaceTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) self.get_network_interface_waiter().wait_delete(ni_id) + @decorators.idempotent_id('9428b5e6-42f2-495f-a535-df53d1fcf4af') def test_network_interface_attribute_source_dest_check(self): data = self.client.create_network_interface(SubnetId=self.subnet_id) ni_id = data['NetworkInterface']['NetworkInterfaceId'] @@ -459,6 +471,7 @@ class NetworkInterfaceTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) self.get_network_interface_waiter().wait_delete(ni_id) + @decorators.idempotent_id('19d25f59-5b32-4314-b4da-7c8f679b7a96') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_network_interface_attribute_attachment(self): instance_id = self.run_instance(SubnetId=self.subnet_id) @@ -481,6 +494,7 @@ class NetworkInterfaceTest(base.EC2TestCase): self.client.terminate_instances(InstanceIds=[instance_id]) self.get_instance_waiter().wait_delete(instance_id) + @decorators.idempotent_id('74967cd0-155f-4cfe-994e-2c6803dad04c') def test_network_interface_attribute_empty_attachment(self): data = self.client.create_network_interface(SubnetId=self.subnet_id) ni_id = data['NetworkInterface']['NetworkInterfaceId'] @@ -496,6 +510,7 @@ class NetworkInterfaceTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) self.get_network_interface_waiter().wait_delete(ni_id) + @decorators.idempotent_id('a55f1169-d302-4166-b74e-e84a0d79129c') def test_network_interface_attribute_group_set(self): data = self.client.create_network_interface(SubnetId=self.subnet_id) ni_id = data['NetworkInterface']['NetworkInterfaceId'] @@ -513,6 +528,7 @@ class NetworkInterfaceTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) self.get_network_interface_waiter().wait_delete(ni_id) + @decorators.idempotent_id('7832976f-27cb-405e-ab05-466b102d86f8') def test_instance_attributes_negative(self): data = self.client.create_network_interface(SubnetId=self.subnet_id) ni_id = data['NetworkInterface']['NetworkInterfaceId'] diff --git a/api/test_regions.py b/api/test_regions.py index cabda03..7d68271 100644 --- a/api/test_regions.py +++ b/api/test_regions.py @@ -13,6 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +from tempest.lib import decorators + from ec2api.tests.functional import base from ec2api.tests.functional import config @@ -21,6 +23,7 @@ CONF = config.CONF class RegionTest(base.EC2TestCase): + @decorators.idempotent_id('f303e87e-4e5f-4110-a5da-5f690acb44ba') def test_describe_regions(self): data = self.client.describe_regions() self.assertNotEmpty(data['Regions']) @@ -32,6 +35,7 @@ class RegionTest(base.EC2TestCase): regions = [r['RegionName'] for r in data['Regions']] self.assertIn(region, regions) + @decorators.idempotent_id('be38f383-4637-4581-bb62-b47c1463f0a1') def test_describe_zones(self): data = self.client.describe_availability_zones() self.assertNotEmpty(data['AvailabilityZones']) diff --git a/api/test_routes.py b/api/test_routes.py index e0dd181..d610b71 100644 --- a/api/test_routes.py +++ b/api/test_routes.py @@ -14,6 +14,7 @@ # under the License. from oslo_log import log +from tempest.lib import decorators from ec2api.tests.functional import base from ec2api.tests.functional import config @@ -40,6 +41,7 @@ class RouteTest(base.EC2TestCase): cls.addResourceCleanUpStatic(cls.client.delete_vpc, VpcId=cls.vpc_id) cls.get_vpc_waiter().wait_available(cls.vpc_id) + @decorators.idempotent_id('69c04d14-5603-4a98-9331-739821b98b10') def test_create_delete_route_table(self): data = self.client.create_route_table(VpcId=self.vpc_id) rt_id = data['RouteTable']['RouteTableId'] @@ -63,6 +65,7 @@ class RouteTest(base.EC2TestCase): self.client.delete_route_table, RouteTableId=rt_id) + @decorators.idempotent_id('d8051b30-eb70-4c4b-988b-56078a125af3') def test_describe_route_tables_base(self): data = self.client.create_route_table(VpcId=self.vpc_id) rt_id = data['RouteTable']['RouteTableId'] @@ -81,6 +84,7 @@ class RouteTest(base.EC2TestCase): data = self.client.delete_route_table(RouteTableId=rt_id) self.cancelResourceCleanUp(res_clean) + @decorators.idempotent_id('77a53f3e-437a-45ed-b3b5-e6b7ab2c9407') def test_describe_route_tables_filters(self): data = self.client.create_route_table(VpcId=self.vpc_id) rt_id = data['RouteTable']['RouteTableId'] @@ -133,6 +137,7 @@ class RouteTest(base.EC2TestCase): self.client.describe_route_tables, Filters=[{'Name': 'fake', 'Values': ['fake']}]) + @decorators.idempotent_id('55361f57-331a-43b8-8729-efee2d1c0dc9') def test_associate_disassociate_route_table(self): data = self.client.create_route_table(VpcId=self.vpc_id) rt_id = data['RouteTable']['RouteTableId'] @@ -162,6 +167,7 @@ class RouteTest(base.EC2TestCase): data = self.client.delete_route_table(RouteTableId=rt_id) self.cancelResourceCleanUp(res_clean_rt) + @decorators.idempotent_id('b1a07211-6e9a-41db-8017-47e7c4b9c043') def test_replace_route_table(self): data = self.client.create_subnet(VpcId=self.vpc_id, CidrBlock=self.SUBNET_CIDR) @@ -224,6 +230,7 @@ class RouteTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean_subnet) self.get_subnet_waiter().wait_delete(subnet_id) + @decorators.idempotent_id('c112ecdb-dce3-4497-b11b-5349a2d89336') def test_create_delete_route(self): data = self.client.create_subnet(VpcId=self.vpc_id, CidrBlock=self.SUBNET_CIDR) diff --git a/api/test_security_groups.py b/api/test_security_groups.py index 18602f8..cdea36a 100644 --- a/api/test_security_groups.py +++ b/api/test_security_groups.py @@ -17,6 +17,7 @@ import time from oslo_log import log from tempest.lib.common.utils import data_utils +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -125,6 +126,7 @@ class SecurityGroupInVPCTest(SecurityGroupBaseTest): cls.addResourceCleanUpStatic(cls.client.delete_vpc, VpcId=cls.vpc_id) cls.get_vpc_waiter().wait_available(cls.vpc_id) + @decorators.idempotent_id('f8354908-1b3a-4e7b-89e3-6956850bbbfb') def test_create_delete_security_group(self): name = data_utils.rand_name('sgName') desc = data_utils.rand_name('sgDesc') @@ -147,6 +149,7 @@ class SecurityGroupInVPCTest(SecurityGroupBaseTest): self.client.delete_security_group, GroupId=group_id) + @decorators.idempotent_id('fe209503-c348-4456-94b4-a77e68fabcbb') def test_create_duplicate_security_group(self): name = data_utils.rand_name('sgName') desc = data_utils.rand_name('sgDesc') @@ -165,6 +168,7 @@ class SecurityGroupInVPCTest(SecurityGroupBaseTest): data = self.client.delete_security_group(GroupId=group_id) self.cancelResourceCleanUp(res_clean) + @decorators.idempotent_id('ffe5084a-2d05-42d1-ae8d-edcb0af27909') def test_create_duplicate_security_group_in_another_vpc(self): name = data_utils.rand_name('sgName') desc = data_utils.rand_name('sgDesc') @@ -194,6 +198,7 @@ class SecurityGroupInVPCTest(SecurityGroupBaseTest): data = self.client.delete_security_group(GroupId=group_id) self.cancelResourceCleanUp(res_clean) + @decorators.idempotent_id('524993f7-a8d3-4ffc-bbf1-6a3014377181') @testtools.skipUnless(CONF.aws.run_incompatible_tests, "MismatchError: 'InvalidParameterValue' != 'ValidationError'") def test_create_invalid_name_desc(self): @@ -222,11 +227,13 @@ class SecurityGroupInVPCTest(SecurityGroupBaseTest): self.client.create_security_group, VpcId=self.vpc_id, GroupName='', Description=valid) + @decorators.idempotent_id('3460cefd-c759-4738-ba75-b275939aad1d') def test_ingress_rules(self): self._test_rules(self.client.authorize_security_group_ingress, self.client.revoke_security_group_ingress, 'IpPermissions', self.vpc_id) + @decorators.idempotent_id('74a5de83-69b4-4cc5-9431-e4c1f691f0c1') def test_egress_rules(self): self._test_rules(self.client.authorize_security_group_egress, self.client.revoke_security_group_egress, @@ -242,6 +249,7 @@ class SecurityGroupEC2ClassicTest(SecurityGroupBaseTest): if not base.TesterStateHolder().get_ec2_enabled(): raise cls.skipException('EC2-classic is disabled') + @decorators.idempotent_id('eb097f7c-4b10-4365-aa34-c17e5769f4a7') def test_create_delete_security_group(self): name = data_utils.rand_name('sgName') desc = data_utils.rand_name('sgDesc') @@ -263,6 +271,7 @@ class SecurityGroupEC2ClassicTest(SecurityGroupBaseTest): self.client.delete_security_group(GroupName=name) self.cancelResourceCleanUp(res_clean) + @decorators.idempotent_id('b97b8b4a-811e-4584-8e79-086499459aca') def test_create_duplicate_security_group(self): name = data_utils.rand_name('sgName') desc = data_utils.rand_name('sgDesc') @@ -280,6 +289,7 @@ class SecurityGroupEC2ClassicTest(SecurityGroupBaseTest): self.client.delete_security_group(GroupId=group_id) self.cancelResourceCleanUp(res_clean) + @decorators.idempotent_id('b80c578d-0c0d-4c7e-b0ee-a7ed23b6b209') @testtools.skipUnless(CONF.aws.run_incompatible_tests, "MismatchError: 'MissingParameter' != 'ValidationError'") def test_create_invalid_name_desc(self): @@ -297,11 +307,13 @@ class SecurityGroupEC2ClassicTest(SecurityGroupBaseTest): self.client.create_security_group, GroupName='default', Description='default') + @decorators.idempotent_id('eba8a7c4-3781-4562-b137-dbe8037395a3') def test_ingress_rules(self): self._test_rules(self.client.authorize_security_group_ingress, self.client.revoke_security_group_ingress, 'IpPermissions') + @decorators.idempotent_id('435d5e53-060f-455a-9317-60177246e04d') def test_egress_rules(self): def _test(): self._test_rules( diff --git a/api/test_snapshots.py b/api/test_snapshots.py index c19044d..ad37909 100644 --- a/api/test_snapshots.py +++ b/api/test_snapshots.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -23,6 +24,7 @@ CONF = config.CONF class SnapshotTest(base.EC2TestCase): + @decorators.idempotent_id('3eb8868b-5c6b-4619-8c99-9429ca86a526') def test_create_delete_snapshot(self): kwargs = { 'Size': 1, @@ -62,6 +64,7 @@ class SnapshotTest(base.EC2TestCase): self.cancelResourceCleanUp(clean_vol) self.get_volume_waiter().wait_delete(volume_id) + @decorators.idempotent_id('dfe0f2e6-c103-4e26-93e5-63010bf6b0af') def test_describe_snapshots(self): kwargs = { 'Size': 1, @@ -122,6 +125,7 @@ class SnapshotTest(base.EC2TestCase): self.cancelResourceCleanUp(clean_vol) self.get_volume_waiter().wait_delete(volume_id) + @decorators.idempotent_id('c4a99068-3c9e-4d8c-8d7a-e96548cfdaa7') def test_create_volume_from_snapshot(self): kwargs = { 'Size': 1, @@ -177,6 +181,7 @@ class SnapshotTest(base.EC2TestCase): self.cancelResourceCleanUp(clean_vol2) self.get_volume_waiter().wait_delete(volume_id2) + @decorators.idempotent_id('c6f0be0a-67ca-4f33-b821-83e9158cee66') def test_create_increased_volume_from_snapshot(self): kwargs = { 'Size': 1, @@ -227,6 +232,7 @@ class SnapshotTest(base.EC2TestCase): self.cancelResourceCleanUp(clean_vol2) self.get_volume_waiter().wait_delete(volume_id2) + @decorators.idempotent_id('8f885da3-97e3-419e-b382-036ca7b25877') @testtools.skipUnless(CONF.aws.run_incompatible_tests, "Openstack can't delete volume with snapshots") def test_delete_volume_with_snapshots(self): diff --git a/api/test_subnets.py b/api/test_subnets.py index b217606..02e0c1c 100644 --- a/api/test_subnets.py +++ b/api/test_subnets.py @@ -14,6 +14,7 @@ # under the License. from oslo_log import log +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -41,6 +42,7 @@ class SubnetTest(base.EC2TestCase): cls.addResourceCleanUpStatic(cls.client.delete_vpc, VpcId=cls.vpc_id) cls.get_vpc_waiter().wait_available(cls.vpc_id) + @decorators.idempotent_id('506993c3-aff6-48ea-8916-da8a4f199a66') def test_create_delete_subnet(self): cidr = self.BASE_CIDR + '/24' data = self.client.create_subnet(VpcId=self.vpc_id, @@ -65,6 +67,7 @@ class SubnetTest(base.EC2TestCase): self.client.delete_subnet, SubnetId=subnet_id) + @decorators.idempotent_id('4d27f078-46d2-4e2c-87c4-b5ba4589c2aa') def test_dependency_subnet_to_vpc(self): data = self.client.create_vpc(CidrBlock=self.VPC_CIDR) vpc_id = data['Vpc']['VpcId'] @@ -90,6 +93,7 @@ class SubnetTest(base.EC2TestCase): self.client.delete_vpc(VpcId=vpc_id) self.cancelResourceCleanUp(vpc_clean) + @decorators.idempotent_id('85ee17ca-5e2c-4d54-84ca-efcca8f94ff9') @testtools.skipUnless( CONF.aws.run_incompatible_tests, "bug with overlapped subnets") @@ -113,6 +117,7 @@ class SubnetTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) self.get_subnet_waiter().wait_delete(subnet_id) + @decorators.idempotent_id('20ea7ea4-67e6-42ed-9b91-e7b4b8d82605') def test_create_subnet_invalid_cidr(self): def _rollback(fn_data): self.client.delete_subnet(SubnetId=fn_data['Subnet']['SubnetId']) @@ -135,6 +140,7 @@ class SubnetTest(base.EC2TestCase): self.client.create_subnet, rollback_fn=_rollback, VpcId=self.vpc_id, CidrBlock=cidr) + @decorators.idempotent_id('8f0f2637-118f-4307-8585-7470808b3a86') def test_describe_subnets_base(self): cidr = self.BASE_CIDR + '/24' data = self.client.create_subnet(VpcId=self.vpc_id, CidrBlock=cidr) @@ -156,6 +162,7 @@ class SubnetTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) self.get_subnet_waiter().wait_delete(subnet_id) + @decorators.idempotent_id('182d151c-2dca-46bd-b137-1dece7276e1f') def test_describe_subnets_filters(self): cidr = self.BASE_CIDR + '/24' data = self.client.create_subnet(VpcId=self.vpc_id, CidrBlock=cidr) diff --git a/api/test_tags.py b/api/test_tags.py index 2733684..c50c02d 100644 --- a/api/test_tags.py +++ b/api/test_tags.py @@ -16,6 +16,7 @@ import time from tempest.lib.common.utils import data_utils +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -39,6 +40,7 @@ class TagTest(base.EC2TestCase): VolumeId=cls.volume_id) cls.get_volume_waiter().wait_available(cls.volume_id) + @decorators.idempotent_id('249f59cf-2fcd-47ac-a233-682f17fc3129') def test_create_get_delete_tag(self): tag_key = data_utils.rand_name('tag-key') self.client.create_tags(Resources=[self.volume_id], @@ -58,6 +60,7 @@ class TagTest(base.EC2TestCase): Filters=[{'Name': 'resource-id', 'Values': [self.volume_id]}]) self.assertEqual(0, len(data['Tags'])) + @decorators.idempotent_id('41dec90b-a878-4367-ba95-83757281e343') def test_describe_tags(self): tag_key = data_utils.rand_name('tag-key') self.client.create_tags(Resources=[self.volume_id], @@ -149,6 +152,7 @@ class TagTest(base.EC2TestCase): Resources=[resource_id], Tags=[{'Key': tag_key, 'Value': 'fake_value'}]) + @decorators.idempotent_id('36478dc6-cf3f-4a4b-b275-282ba147822b') def test_tag_image(self): image_id = CONF.aws.ebs_image_id if not image_id: @@ -173,6 +177,7 @@ class TagTest(base.EC2TestCase): self._test_tag_resource(image_id, 'image', describe_func) @base.skip_without_vpc() + @decorators.idempotent_id('adc459f3-858d-4ce8-a097-549ab9350b18') def test_tag_dhcp_options(self): kwargs = { 'DhcpConfigurations': [ @@ -196,6 +201,7 @@ class TagTest(base.EC2TestCase): self.client.delete_dhcp_options(DhcpOptionsId=res_id) self.cancelResourceCleanUp(res_clean) + @decorators.idempotent_id('afa064b2-8caf-442d-b001-b6cb8120e57e') def test_tag_volume(self): def describe_func(*args, **kwargs): data = self.client.describe_volumes(*args, **kwargs) @@ -205,6 +211,7 @@ class TagTest(base.EC2TestCase): self._test_tag_resource(self.volume_id, 'volume', describe_func) @base.skip_without_vpc() + @decorators.idempotent_id('96e581c6-8f38-41f9-9126-e35215c83d3e') def test_tag_address(self): kwargs = { 'Domain': 'vpc', @@ -220,6 +227,7 @@ class TagTest(base.EC2TestCase): self.client.release_address(AllocationId=res_id) self.cancelResourceCleanUp(res_clean) + @decorators.idempotent_id('f9a6dd26-b26f-4482-aad3-0b4f0e7cc3dd') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_tag_instance(self): instance_id = self.run_instance() @@ -237,6 +245,7 @@ class TagTest(base.EC2TestCase): self.get_instance_waiter().wait_delete(instance_id) @base.skip_without_vpc() + @decorators.idempotent_id('a223af28-b355-4404-a465-7fc9e9d71ad7') def test_tag_internet_gateway(self): data = self.client.create_internet_gateway() gw_id = data['InternetGateway']['InternetGatewayId'] @@ -255,6 +264,7 @@ class TagTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) @base.skip_without_vpc() + @decorators.idempotent_id('4691eefb-c118-4595-a386-8a2abd5c0d77') def test_tag_network_interface(self): cidr = '10.1.0.0/16' data = self.client.create_vpc(CidrBlock=cidr) @@ -297,6 +307,7 @@ class TagTest(base.EC2TestCase): self.get_vpc_waiter().wait_delete(vpc_id) @base.skip_without_vpc() + @decorators.idempotent_id('384083a0-d492-4620-8093-166cd339ffaa') def test_tag_route_table(self): cidr = '10.1.0.0/16' data = self.client.create_vpc(CidrBlock=cidr) @@ -324,6 +335,7 @@ class TagTest(base.EC2TestCase): self.get_vpc_waiter().wait_delete(vpc_id) @base.skip_without_vpc() + @decorators.idempotent_id('03b8cd38-3017-4a8f-b2e0-1c4ac5e7333d') def test_tag_security_group(self): cidr = '10.1.0.0/16' data = self.client.create_vpc(CidrBlock=cidr) @@ -356,6 +368,7 @@ class TagTest(base.EC2TestCase): self.cancelResourceCleanUp(dv_clean) self.get_vpc_waiter().wait_delete(vpc_id) + @decorators.idempotent_id('bed98f9c-f987-4192-afd8-4bdf35ac916e') def test_tag_snapshot(self): data = self.client.create_snapshot(VolumeId=self.volume_id) snapshot_id = data['SnapshotId'] @@ -376,6 +389,7 @@ class TagTest(base.EC2TestCase): self.get_snapshot_waiter().wait_delete(snapshot_id) @base.skip_without_vpc() + @decorators.idempotent_id('3a6f64fc-d2d4-496d-bf30-3ee0efe04e42') def test_tag_subnet(self): cidr = '10.1.0.0/16' data = self.client.create_vpc(CidrBlock=cidr) @@ -406,6 +420,7 @@ class TagTest(base.EC2TestCase): self.get_vpc_waiter().wait_delete(vpc_id) @base.skip_without_vpc() + @decorators.idempotent_id('0667c68b-9d3c-4599-9335-0cee68ba5d80') def test_tag_vpc(self): cidr = '10.1.0.0/16' data = self.client.create_vpc(CidrBlock=cidr) @@ -425,6 +440,7 @@ class TagTest(base.EC2TestCase): self.get_vpc_waiter().wait_delete(vpc_id) @base.skip_without_vpc() + @decorators.idempotent_id('07b2f20d-6b26-4c3d-9d32-93f98f187d78') def test_tag_customer_gateway(self): data = self.client.create_customer_gateway( Type='ipsec.1', PublicIp='198.51.100.77', BgpAsn=65000) @@ -442,6 +458,7 @@ class TagTest(base.EC2TestCase): @base.skip_without_vpc() @base.skip_without_network_feature('vpnaas') + @decorators.idempotent_id('a0437171-81a1-4871-9b71-c7629b25c337') def test_tag_vpn_gateway(self): data = self.client.create_vpn_gateway(Type='ipsec.1') vgw_id = data['VpnGateway']['VpnGatewayId'] @@ -458,6 +475,7 @@ class TagTest(base.EC2TestCase): @base.skip_without_vpc() @base.skip_without_network_feature('vpnaas') + @decorators.idempotent_id('ecd343b4-f448-4990-880d-02a68febc9cf') def test_tag_vpn_connection(self): data = self.client.create_customer_gateway( Type='ipsec.1', PublicIp='198.51.100.77', BgpAsn=65000) diff --git a/api/test_volumes.py b/api/test_volumes.py index 5bb2a36..4564163 100644 --- a/api/test_volumes.py +++ b/api/test_volumes.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -23,6 +24,7 @@ CONF = config.CONF class VolumeTest(base.EC2TestCase): + @decorators.idempotent_id('51fd4d06-7b00-427a-9d69-6ecd076c219a') def test_create_delete_volume(self): kwargs = { 'Size': 1, @@ -55,6 +57,7 @@ class VolumeTest(base.EC2TestCase): self.client.delete_volume, VolumeId=volume_id) + @decorators.idempotent_id('a7f1c4f8-2153-4d09-b5d5-bf087ea2f6ed') @testtools.skipUnless(CONF.aws.run_incompatible_tests, "Encryption is not implemented") def test_create_encrypted_volume(self): @@ -76,6 +79,7 @@ class VolumeTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) self.get_volume_waiter().wait_delete(volume_id) + @decorators.idempotent_id('16c97f73-c4f2-4e91-9506-4f6da4a33f8a') def test_describe_volumes(self): kwargs = { 'Size': 1, @@ -112,6 +116,7 @@ class VolumeTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) self.get_volume_waiter().wait_delete(volume_id) + @decorators.idempotent_id('30697dd5-12e7-4dd3-8cf8-5bdb296f26d8') @testtools.skipUnless(CONF.aws.run_incompatible_tests, "Volume statuses are not implemented") def test_describe_volume_status(self): @@ -138,6 +143,7 @@ class VolumeTest(base.EC2TestCase): self.cancelResourceCleanUp(res_clean) self.get_volume_waiter().wait_delete(volume_id) + @decorators.idempotent_id('b0116edc-250c-4083-b1ad-66c0eb984415') @testtools.skipUnless(CONF.aws.ebs_image_id, "ebs image id is not defined") def test_attach_detach_volume(self): clean_dict = {} @@ -213,6 +219,7 @@ class VolumeTest(base.EC2TestCase): self.cancelResourceCleanUp(clean_i) self.get_instance_waiter().wait_delete(instance_id) + @decorators.idempotent_id('c4b470b7-0825-418f-bc76-533f84247878') @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined") def test_attaching_stage(self): clean_dict = {} @@ -268,6 +275,7 @@ class VolumeTest(base.EC2TestCase): self.cancelResourceCleanUp(clean_i) self.get_instance_waiter().wait_delete(instance_id) + @decorators.idempotent_id('949ced35-fb66-4e87-afd8-f64de3dd20e9') @testtools.skipUnless(CONF.aws.run_incompatible_tests, "Volume statuses are not implemented") @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined") @@ -332,6 +340,7 @@ class VolumeTest(base.EC2TestCase): self.client.terminate_instances(InstanceIds=[instance_id]) self.get_instance_waiter().wait_delete(instance_id) + @decorators.idempotent_id('c37b01f7-5b27-4773-9278-9e0b8eaccb5f') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_volume_auto_termination_swithed_off(self): instance_id = self.run_instance() @@ -370,6 +379,7 @@ class VolumeTest(base.EC2TestCase): self.cancelResourceCleanUp(clean_v) self.get_volume_waiter().wait_delete(volume_id) + @decorators.idempotent_id('c8649cab-e1f4-42f7-9578-8e72d06534ba') @testtools.skipUnless(CONF.aws.run_incompatible_tests, "modify_instance_attribute is not implemented") @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") diff --git a/api/test_vpcs.py b/api/test_vpcs.py index afc6404..a111f3b 100644 --- a/api/test_vpcs.py +++ b/api/test_vpcs.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -30,6 +31,7 @@ class VPCTest(base.EC2TestCase): if not base.TesterStateHolder().get_vpc_enabled(): raise cls.skipException('VPC is disabled') + @decorators.idempotent_id('446b19ba-2b70-4f52-9e32-82e04771cb70') def test_create_delete_vpc(self): cidr = '10.1.0.0/16' data = self.client.create_vpc(CidrBlock=cidr) @@ -57,6 +59,7 @@ class VPCTest(base.EC2TestCase): self.client.delete_vpc, VpcId=vpc_id) + @decorators.idempotent_id('de300ce9-41a4-4b88-a991-99186e8c97b4') def test_create_more_than_one_vpc(self): cidr = '10.0.0.0/16' data = self.client.create_vpc(CidrBlock=cidr) @@ -78,6 +81,7 @@ class VPCTest(base.EC2TestCase): self.cancelResourceCleanUp(rc2) self.get_vpc_waiter().wait_delete(vpc_id2) + @decorators.idempotent_id('011bd6e0-65c3-4716-a1f3-ba6cdb477b19') def test_describe_vpcs_base(self): cidr = '10.1.0.0/16' data = self.client.create_vpc(CidrBlock=cidr) @@ -99,6 +103,7 @@ class VPCTest(base.EC2TestCase): self.cancelResourceCleanUp(dv_clean) self.get_vpc_waiter().wait_delete(vpc_id) + @decorators.idempotent_id('9c8735b9-f745-49a0-b68d-33f771bac660') def test_describe_vpcs_filters(self): cidr = '10.163.0.0/16' data = self.client.create_vpc(CidrBlock=cidr) @@ -126,6 +131,7 @@ class VPCTest(base.EC2TestCase): self.cancelResourceCleanUp(dv_clean) self.get_vpc_waiter().wait_delete(vpc_id) + @decorators.idempotent_id('3070ea61-992b-4711-a874-322c6c672204') @testtools.skipUnless(CONF.aws.run_incompatible_tests, "Invalid request on checking vpc atributes.") def test_vpc_attributes(self): @@ -156,6 +162,7 @@ class VPCTest(base.EC2TestCase): Attribute=req_attr) self.assertNotEqual(attr, data[attribute].get('Value')) + @decorators.idempotent_id('8c5f1e82-05da-40e0-8ee8-640db2d94dd6') def test_create_with_invalid_cidr(self): def _rollback(fn_data): self.client.delete_vpc(VpcId=fn_data['Vpc']['VpcId']) @@ -170,17 +177,20 @@ class VPCTest(base.EC2TestCase): self.client.create_vpc, rollback_fn=_rollback, CidrBlock='10.0.0.0/29') + @decorators.idempotent_id('5abb2ff0-8ea2-4e02-b9a4-95a371982b82') def test_describe_non_existing_vpc_by_id(self): vpc_id = 'vpc-00000000' self.assertRaises('InvalidVpcID.NotFound', self.client.describe_vpcs, VpcIds=[vpc_id]) + @decorators.idempotent_id('e99d81f1-902a-46b0-afc8-c64e6d548891') def test_describe_non_existing_vpc_by_cidr(self): data = self.client.describe_vpcs( Filters=[{'Name': 'cidr', 'Values': ['123.0.0.0/16']}]) self.assertEqual(0, len(data['Vpcs'])) + @decorators.idempotent_id('62263b68-6991-4bbe-b7b2-9997a84fd0a5') def test_describe_with_invalid_filter(self): cidr = '10.1.0.0/16' data = self.client.create_vpc(CidrBlock=cidr) diff --git a/api/test_vpn_connections.py b/api/test_vpn_connections.py index e4d2fbc..538d620 100644 --- a/api/test_vpn_connections.py +++ b/api/test_vpn_connections.py @@ -15,6 +15,7 @@ import botocore.exceptions from lxml import etree +from tempest.lib import decorators from ec2api.tests.functional import base from ec2api.tests.functional import config @@ -51,6 +52,7 @@ class VpnConnectionTest(base.EC2TestCase): cls.client.delete_vpn_gateway, VpnGatewayId=cls.vgw_id) cls.get_vpn_gateway_waiter().wait_available(cls.vgw_id) + @decorators.idempotent_id('57426aab-cf2d-4114-a11d-2bd6642ac606') def test_create_delete_vpn_connection(self): data = self.client.create_vpn_connection( CustomerGatewayId=self.cgw_id, VpnGatewayId=self.vgw_id, @@ -80,6 +82,7 @@ class VpnConnectionTest(base.EC2TestCase): self.assertEqual('InvalidVpnConnectionID.NotFound', ex.response['Error']['Code']) + @decorators.idempotent_id('6fa8c58d-876b-4d3f-85ba-e972a9d6db3b') def test_create_delete_vpn_connection_route(self): data = self.client.create_vpn_connection( CustomerGatewayId=self.cgw_id, VpnGatewayId=self.vgw_id, diff --git a/api/test_vpn_gateways.py b/api/test_vpn_gateways.py index 148ef32..6344b78 100644 --- a/api/test_vpn_gateways.py +++ b/api/test_vpn_gateways.py @@ -14,6 +14,7 @@ # under the License. import botocore.exceptions +from tempest.lib import decorators from ec2api.tests.functional import base from ec2api.tests.functional import config @@ -39,6 +40,7 @@ class VpnGatewayTest(base.EC2TestCase): cls.get_vpc_waiter().wait_available(cls.vpc_id) cls.addResourceCleanUpStatic(cls.client.delete_vpc, VpcId=cls.vpc_id) + @decorators.idempotent_id('d38c0185-782c-4da3-b02c-9cd7bf91b001') def test_create_delete_vpn_gateway(self): data = self.client.create_vpn_gateway( Type='ipsec.1', AvailabilityZone=CONF.aws.aws_zone) @@ -60,6 +62,7 @@ class VpnGatewayTest(base.EC2TestCase): self.assertEqual('InvalidVpnGatewayID.NotFound', ex.response['Error']['Code']) + @decorators.idempotent_id('1d76b335-57ba-449a-9751-af75a8a7d11c') def test_attach_detach_vpn_gateway(self): data = self.client.create_vpn_gateway( Type='ipsec.1', AvailabilityZone=CONF.aws.aws_zone) diff --git a/scenario/test_ebs_instances.py b/scenario/test_ebs_instances.py index 77cded8..21a89b8 100644 --- a/scenario/test_ebs_instances.py +++ b/scenario/test_ebs_instances.py @@ -16,6 +16,7 @@ import math from oslo_log import log from tempest.lib.common.utils import data_utils +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -51,6 +52,7 @@ class EC2_EBSInstanceTuneBDM(base.EC2TestCase): assert 1 == len(data['Snapshots']) cls.root_device_size = data['Snapshots'][0]['VolumeSize'] + @decorators.idempotent_id('2f51dd78-ff1e-494a-bcbc-f47580df17cb') def test_launch_ebs_instance_with_persistent_root_device(self): """ @@ -81,6 +83,7 @@ class EC2_EBSInstanceTuneBDM(base.EC2TestCase): self.cancelResourceCleanUp(res_clean_vol) self.get_volume_waiter().wait_delete(volume_id) + @decorators.idempotent_id('0c820ed3-2e2f-4384-9649-cea907f00bf4') def test_launch_ebs_instance_with_resized_root_device(self): """Launch EBS-backed instance with resizing root device.""" new_size = int(math.ceil(self.root_device_size * 1.1)) @@ -103,6 +106,7 @@ class EC2_EBSInstanceTuneBDM(base.EC2TestCase): self.client.terminate_instances(InstanceIds=[instance_id]) self.get_instance_waiter().wait_delete(instance_id) + @decorators.idempotent_id('a0dbb3bd-167f-4f35-bb9d-aa53233e3123') def test_launch_ebs_instance_with_creating_blank_volume(self): """Launch instance with creating blank volume.""" device_name_prefix = base.get_device_name_prefix(self.root_device_name) @@ -270,11 +274,13 @@ class EC2_EBSInstanceAttaching(base.EC2TestCase): bdt = self.get_instance_bdm(self.instance_id, new_device_name) self.assertIsNotNone(bdt) + @decorators.idempotent_id('2176d935-5254-4e2a-9eb4-fc899f63c530') def test_attaching_by_full_name(self): """Attach and reattach device by full name.""" self._test_attaching(self.volume_id1, self.device1_name, self.full_device_name_prefix, "e") + @decorators.idempotent_id('43af092e-3f04-45a7-bec7-8da39cde1f4c') def test_attaching_by_short_name(self): """Attach and reattach device by short name.""" self._test_attaching(self.volume_id2, self.device2_name, @@ -298,6 +304,7 @@ class EC2_EBSInstanceSnapshot(base.EC2TestCase): cls.image_id = CONF.aws.ebs_image_id cls.zone = CONF.aws.aws_zone + @decorators.idempotent_id('07caac78-750c-48a1-975d-d3a6bd988108') def test_create_ebs_instance_snapshot(self): """Create snapshot of EBS-backed instance and check it.""" @@ -372,6 +379,7 @@ class EC2_EBSInstanceResizeRootDevice(base.EC2TestCase): cls.image_id = CONF.aws.ebs_image_id cls.zone = CONF.aws.aws_zone + @decorators.idempotent_id('0ea1dee6-c2c3-4cad-9676-5bf6e7ae54a8') @testtools.skipUnless( CONF.aws.run_incompatible_tests, "Error from nova: " diff --git a/scenario/test_instance_restart.py b/scenario/test_instance_restart.py index 8e91b0b..70e2268 100644 --- a/scenario/test_instance_restart.py +++ b/scenario/test_instance_restart.py @@ -16,6 +16,7 @@ from oslo_log import log from tempest.lib.common import ssh from tempest.lib.common.utils import data_utils +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -28,6 +29,7 @@ LOG = log.getLogger(__name__) class InstanceRestartTest(scenario_base.BaseScenarioTest): + @decorators.idempotent_id('8ae801a5-3e4a-4a34-903a-45e34ff9eccd') @testtools.skipUnless(CONF.aws.run_ssh, 'SSH tests are disabled.') @testtools.skipUnless(CONF.aws.run_long_tests, 'Slow test has skipped.') @testtools.skipUnless(CONF.aws.image_id_ubuntu, @@ -60,6 +62,7 @@ class InstanceRestartTest(scenario_base.BaseScenarioTest): data = ssh_client.exec_command('last -x') self.assertIn("shutdown", data) + @decorators.idempotent_id('ae1cce79-882c-4f37-b9e9-2f7156712721') @testtools.skipUnless(CONF.aws.run_ssh, 'SSH tests are disabled.') @testtools.skipUnless(CONF.aws.run_long_tests, 'Slow test has skipped.') @testtools.skipUnless(CONF.aws.image_id_ubuntu, diff --git a/scenario/test_instances.py b/scenario/test_instances.py index 7ca30ca..fbd943e 100644 --- a/scenario/test_instances.py +++ b/scenario/test_instances.py @@ -20,6 +20,7 @@ from oslo_log import log import six from tempest.lib.common import ssh from tempest.lib.common.utils import data_utils +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -71,6 +72,7 @@ PUBLIC_KEY_MATERIAL = ( class InstancesTest(scenario_base.BaseScenarioTest): + @decorators.idempotent_id('c25defc4-b075-4794-9fa6-3b67353c4079') @testtools.skipUnless(CONF.aws.run_ssh, 'SSH tests are disabled.') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_metadata(self): @@ -109,6 +111,7 @@ class InstancesTest(scenario_base.BaseScenarioTest): # compare only keys. without 'sha-rsa' and owner self.assertEqual(PUBLIC_KEY_MATERIAL.split()[1], data.split()[1]) + @decorators.idempotent_id('9fd254b1-dad1-4bb6-959f-f2cf937873c7') @testtools.skipUnless(CONF.aws.run_ssh, 'SSH tests are disabled.') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_compare_console_output(self): @@ -137,6 +140,7 @@ class InstancesTest(scenario_base.BaseScenarioTest): waiter = base.EC2Waiter(_compare_console_output) waiter.wait_no_exception() + @decorators.idempotent_id('df1bb8f2-193c-46ba-aa99-3981bbc367db') @testtools.skipUnless(CONF.aws.run_ssh, 'SSH tests are disabled.') @testtools.skipUnless(CONF.aws.ami_image_location, "Image is absent in S3") def test_run_and_ping_registered_image(self): diff --git a/scenario/test_instances_in_vpc.py b/scenario/test_instances_in_vpc.py index 1139938..ce2c36a 100644 --- a/scenario/test_instances_in_vpc.py +++ b/scenario/test_instances_in_vpc.py @@ -17,6 +17,7 @@ import netaddr from oslo_log import log from tempest.lib.common import ssh from tempest.lib.common.utils import data_utils +from tempest.lib import decorators from tempest.lib import exceptions import testtools @@ -59,18 +60,21 @@ class InstancesInVPCTest(scenario_base.BaseScenarioTest): waiter.wait_no_exception('ping %s -c 1' % last_ip) @base.skip_without_vpc() + @decorators.idempotent_id('b986708e-9559-493d-aeb3-97fc992a65cf') @testtools.skipUnless(CONF.aws.run_ssh, 'SSH tests are disabled.') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_instances_in_min_subnet(self): self._test_instances(28) @base.skip_without_vpc() + @decorators.idempotent_id('7bf8e80c-cd05-4ccb-944a-e4b09825d151') @testtools.skipUnless(CONF.aws.run_ssh, 'SSH tests are disabled.') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_instances_in_max_subnet(self): self._test_instances(16) @base.skip_without_vpc() + @decorators.idempotent_id('9c3a8066-68b2-4bd0-85e0-6d4a0d7cb053') @testtools.skipUnless(CONF.aws.run_ssh, 'SSH tests are disabled.') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_default_gateway(self): diff --git a/scenario/test_paging.py b/scenario/test_paging.py index 62a1ce2..525e74b 100644 --- a/scenario/test_paging.py +++ b/scenario/test_paging.py @@ -18,6 +18,7 @@ import time import botocore.exceptions from oslo_log import log from tempest.lib.common.utils import data_utils +from tempest.lib import decorators from ec2api.tests.functional import base from ec2api.tests.functional import config @@ -56,6 +57,7 @@ class TagsPagingTest(scenario_base.BaseScenarioTest): return volume_id, keys + @decorators.idempotent_id('8df6e612-07cd-466d-99de-9f37954a6c9a') def test_simple_tags_paging_with_many_results(self): volume_id = self._create_volume_and_tags()[0] @@ -65,6 +67,7 @@ class TagsPagingTest(scenario_base.BaseScenarioTest): self.assertNotEmpty(data['Tags']) self.assertEqual(self.TAGS_COUNT, len(data['Tags'])) + @decorators.idempotent_id('683883d5-9a94-43f2-a1eb-d193db0e44e9') def test_simple_tags_paging_with_min_results(self): volume_id = self._create_volume_and_tags()[0] @@ -75,6 +78,7 @@ class TagsPagingTest(scenario_base.BaseScenarioTest): self.assertIn('NextToken', data) self.assertNotEmpty(data['Tags']) + @decorators.idempotent_id('1db8cc5a-d0b3-4e5f-b411-d84cfa4f21e0') def test_tags_paging_second_page_only_with_token(self): volume_id = self._create_volume_and_tags()[0] @@ -91,6 +95,7 @@ class TagsPagingTest(scenario_base.BaseScenarioTest): self.assertNotIn('NextToken', data) self.assertNotEmpty(data['Tags']) + @decorators.idempotent_id('a4d7b315-9616-4f9e-85b7-0f892e09a9a2') def test_tags_paging_with_const_filter(self): volume_id = self._create_volume_and_tags()[0] @@ -107,6 +112,7 @@ class TagsPagingTest(scenario_base.BaseScenarioTest): self.assertNotIn('NextToken', data) self.assertNotEmpty(data['Tags']) + @decorators.idempotent_id('ad4b793a-8231-4d30-8c26-43736b7b71e4') def test_tags_paging_with_differenet_filters(self): volume_id = self._create_volume_and_tags()[0] @@ -122,6 +128,7 @@ class TagsPagingTest(scenario_base.BaseScenarioTest): self.assertNotEmpty(data['Tags']) self.assertLessEqual(1, len(data['Tags'])) + @decorators.idempotent_id('ec6d68bb-37f3-4c5c-b4c5-000d73fbc1bf') def test_tags_paging_with_tags_deletion(self): volume_id, keys = self._create_volume_and_tags() @@ -137,6 +144,7 @@ class TagsPagingTest(scenario_base.BaseScenarioTest): self.assertNotIn('NextToken', data) self.assertEmpty(data['Tags']) + @decorators.idempotent_id('37eb0597-998f-4744-8462-d56e5599dcd8') def test_invalid_max_results(self): self.assertRaises('InvalidParameterValue', self.client.describe_tags, MaxResults=4) @@ -168,17 +176,20 @@ class VolumesPagingTest(scenario_base.BaseScenarioTest): for volume_id in cls.ids: cls.get_volume_waiter().wait_available(volume_id) + @decorators.idempotent_id('d44ea940-d9ae-42a4-b3ce-add296a1678c') def test_simple_volumes_paging_with_many_results(self): data = self.client.describe_volumes(MaxResults=500) self.assertNotIn('NextToken', data) self.assertNotEmpty(data['Volumes']) self.assertLessEqual(self.VOLUMES_COUNT, len(data['Volumes'])) + @decorators.idempotent_id('9780c871-ee90-411c-b6ec-1e2f1785926b') def test_simple_volumes_paging_with_min_results(self): data = self.client.describe_volumes(MaxResults=5) self.assertIn('NextToken', data) self.assertNotEmpty(data['Volumes']) + @decorators.idempotent_id('692684c4-62bc-457a-899a-07cc5382c9ab') def test_volumes_paging_second_page(self): data = self.client.describe_volumes(MaxResults=5) self.assertIn('NextToken', data) @@ -188,6 +199,7 @@ class VolumesPagingTest(scenario_base.BaseScenarioTest): self.assertNotIn('NextToken', data) self.assertNotEmpty(data['Volumes']) + @decorators.idempotent_id('83183fac-bb9b-4c36-8d23-84ed55c57015') def test_invalid_paging(self): self.assertRaises('InvalidParameterValue', self.client.describe_volumes, MaxResults=4) @@ -196,6 +208,7 @@ class VolumesPagingTest(scenario_base.BaseScenarioTest): self.client.describe_volumes, MaxResults=5, VolumeIds=[self.ids[0]]) + @decorators.idempotent_id('2a777d78-9f0b-4ab0-a841-73dbaafae0dd') def test_volumes_paging_with_filters(self): data = self.client.describe_volumes(MaxResults=5, Filters=[{'Name': 'volume-id', 'Values': [self.ids[0]]}]) @@ -258,6 +271,7 @@ class SnapshotPagingTest(scenario_base.BaseScenarioTest): final_set=('completed')) cls.ids.append(snapshot_id) + @decorators.idempotent_id('f44729b1-42d7-4f18-b5e0-f8dc2a03e624') def test_simple_snapshots_paging_with_many_results(self): data = self.client.describe_snapshots(MaxResults=500, OwnerIds=['self']) @@ -268,11 +282,13 @@ class SnapshotPagingTest(scenario_base.BaseScenarioTest): count += 1 self.assertEqual(self.SNAPSHOTS_COUNT, count) + @decorators.idempotent_id('3146c81d-84c0-4817-9318-328f92bece7f') def test_simple_snapshots_paging_with_min_results(self): data = self.client.describe_snapshots(MaxResults=5, OwnerIds=['self']) self.assertIn('NextToken', data) self.assertNotEmpty(data['Snapshots']) + @decorators.idempotent_id('fef90b60-0a46-4802-a822-98ccb58ff18c') def test_snapshots_paging(self): count = 0 max_results = 5 @@ -289,6 +305,7 @@ class SnapshotPagingTest(scenario_base.BaseScenarioTest): self.assertEqual(self.SNAPSHOTS_COUNT, count) + @decorators.idempotent_id('8379d875-2979-4573-858f-2fd331ae992c') def test_invalid_paging(self): self.assertRaises('InvalidParameterValue', self.client.describe_snapshots, MaxResults=4) @@ -333,6 +350,7 @@ class InstancePagingTest(scenario_base.BaseScenarioTest): cls.get_instance_waiter().wait_available(instance_id, final_set=('running')) + @decorators.idempotent_id('703da498-c73f-4fd1-a2be-2feddb5292d0') def test_simple_instances_paging_with_many_results(self): data = self.client.describe_instances(MaxResults=500) self.assertNotIn('NextToken', data) @@ -347,12 +365,14 @@ class InstancePagingTest(scenario_base.BaseScenarioTest): self._collect_own_instances(data, instances) self.assertEqual(count, len(instances)) + @decorators.idempotent_id('f494a2a8-6d75-4ef4-ae15-ac4fd1269107') def test_simple_instances_paging_with_min_results(self): max_results = 5 data = self.client.describe_instances(MaxResults=max_results) self.assertIn('NextToken', data) self.assertEqual(max_results, self._count_instances(data)) + @decorators.idempotent_id('429802be-d599-4732-a310-3ffe8274df54') def test_instances_paging(self): max_results = 5 kwargs = {'MaxResults': max_results} @@ -368,6 +388,7 @@ class InstancePagingTest(scenario_base.BaseScenarioTest): count = self.RESERVATIONS_COUNT * self.INSTANCES_IN_RESERVATIONS_COUNT self.assertEqual(count, len(instances)) + @decorators.idempotent_id('061d564d-6d3a-44a8-bec9-9dba04f6f362') def test_invalid_paging(self): self.assertRaises('InvalidParameterValue', self.client.describe_instances, MaxResults=4) diff --git a/scenario/test_vpc_addresses.py b/scenario/test_vpc_addresses.py index d2ea480..94ffc63 100644 --- a/scenario/test_vpc_addresses.py +++ b/scenario/test_vpc_addresses.py @@ -16,6 +16,7 @@ import time from oslo_log import log +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -29,6 +30,7 @@ LOG = log.getLogger(__name__) class VpcAddressTest(scenario_base.BaseScenarioTest): @base.skip_without_vpc() + @decorators.idempotent_id('aa667fc6-fd9e-4664-92b8-23263d643d9e') @testtools.skipUnless(CONF.aws.image_id, "image id is not defined") def test_auto_diassociate_address(self): vpc_id, subnet_id = self.create_vpc_and_subnet('10.3.0.0/20') diff --git a/scenario/test_vpn.py b/scenario/test_vpn.py index 7b0268d..b874e77 100644 --- a/scenario/test_vpn.py +++ b/scenario/test_vpn.py @@ -23,6 +23,7 @@ from oslo_log import log import paramiko from tempest.lib.common import ssh from tempest.lib.common.utils import data_utils +from tempest.lib import decorators import testtools from ec2api.tests.functional import base @@ -48,6 +49,7 @@ class VpnTest(scenario_base.BaseScenarioTest): raise cls.skipException('VPC is disabled') base.check_network_feature_enabled('vpnaas') + @decorators.idempotent_id('63c2ac38-cfee-45d3-b765-c9b43859660d') def test_vpn_routing(self): vpc_id, _subnet_id = self.create_vpc_and_subnet('10.42.0.0/20') @@ -70,6 +72,7 @@ class VpnTest(scenario_base.BaseScenarioTest): self.assertNotEmpty(data['PropagatingVgws']) self.assertEqual(vgw_id, data['PropagatingVgws'][0]['GatewayId']) + @decorators.idempotent_id('9e284d9e-8fee-43c7-bcfb-8ed0dfa27dbc') @testtools.skipUnless(CONF.aws.run_ssh, 'SSH tests are disabled.') @testtools.skipUnless(CONF.aws.run_long_tests, 'Slow test has skipped.') @testtools.skipUnless(CONF.aws.image_id_ubuntu,