Add UUIDs to all tempest tests and gate check
Adds uuid4 as a decorator of the form:
@test.idempotent_id('12345678-1234-1234-1234-123456789abc')
to every test in the Tempest tree. Includes a gate check to
ensure the existence and uniqueness of the ids.
Modify check tool to ignore Tempest unit tests.
Change-Id: I19e3c7dd555a3ea09d585fb9091c357a300e6559
Co-Authored-By: Sergey Slipushenko <sslypushenko@mirantis.com>
Implements: bp test-uuid
diff --git a/tempest/api/compute/servers/test_servers_negative.py b/tempest/api/compute/servers/test_servers_negative.py
index d973242..dd82893 100644
--- a/tempest/api/compute/servers/test_servers_negative.py
+++ b/tempest/api/compute/servers/test_servers_negative.py
@@ -50,6 +50,7 @@
cls.server_id = server['id']
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('dbbfd247-c40c-449e-8f6c-d2aa7c7da7cf')
def test_server_name_blank(self):
# Create a server with name parameter empty
@@ -58,6 +59,7 @@
name='')
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('b8a7235e-5246-4a8f-a08e-b34877c6586f')
def test_personality_file_contents_not_encoded(self):
# Use an unencoded file when creating a server with personality
@@ -70,6 +72,7 @@
personality=person)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('fcba1052-0a50-4cf3-b1ac-fae241edf02f')
def test_create_with_invalid_image(self):
# Create a server with an unknown image
@@ -78,6 +81,7 @@
image_id=-1)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('18f5227f-d155-4429-807c-ccb103887537')
def test_create_with_invalid_flavor(self):
# Create a server with an unknown flavor
@@ -86,6 +90,7 @@
flavor=-1,)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('7f70a4d1-608f-4794-9e56-cb182765972c')
def test_invalid_access_ip_v4_address(self):
# An access IPv4 address must match a valid address pattern
@@ -94,6 +99,7 @@
self.create_test_server, accessIPv4=IPv4)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('5226dd80-1e9c-4d8a-b5f9-b26ca4763fd0')
def test_invalid_ip_v6_address(self):
# An access IPv6 address must match a valid address pattern
@@ -102,6 +108,7 @@
self.assertRaises(lib_exc.BadRequest,
self.create_test_server, accessIPv6=IPv6)
+ @test.idempotent_id('7ea45b3e-e770-46fa-bfcc-9daaf6d987c0')
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
'Resize not available.')
@test.attr(type=['negative', 'gate'])
@@ -112,6 +119,7 @@
self.client.resize,
nonexistent_server, self.flavor_ref)
+ @test.idempotent_id('ced1a1d7-2ab6-45c9-b90f-b27d87b30efd')
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
'Resize not available.')
@test.attr(type=['negative', 'gate'])
@@ -121,6 +129,7 @@
self.assertRaises(lib_exc.BadRequest, self.client.resize,
self.server_id, flavor_ref=nonexistent_flavor)
+ @test.idempotent_id('45436a7d-a388-4a35-a9d8-3adc5d0d940b')
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
'Resize not available.')
@test.attr(type=['negative', 'gate'])
@@ -130,12 +139,14 @@
self.server_id, flavor_ref="")
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('d4c023a0-9c55-4747-9dd5-413b820143c7')
def test_reboot_non_existent_server(self):
# Reboot a non existent server
nonexistent_server = data_utils.rand_uuid()
self.assertRaises(lib_exc.NotFound, self.client.reboot,
nonexistent_server, 'SOFT')
+ @test.idempotent_id('d1417e7f-a509-41b5-a102-d5eed8613369')
@testtools.skipUnless(CONF.compute_feature_enabled.pause,
'Pause is not available.')
@test.attr(type=['negative', 'gate'])
@@ -149,6 +160,7 @@
self.client.unpause_server(self.server_id)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('98fa0458-1485-440f-873b-fe7f0d714930')
def test_rebuild_reboot_deleted_server(self):
# Rebuild and Reboot a deleted server
server = self.create_test_server()
@@ -162,6 +174,7 @@
server['id'], 'SOFT')
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('d86141a7-906e-4731-b187-d64a2ea61422')
def test_rebuild_non_existent_server(self):
# Rebuild a non existent server
nonexistent_server = data_utils.rand_uuid()
@@ -171,6 +184,7 @@
self.image_ref_alt)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('fd57f159-68d6-4c2a-902b-03070828a87e')
def test_create_numeric_server_name(self):
server_name = 12345
self.assertRaises(lib_exc.BadRequest,
@@ -178,6 +192,7 @@
name=server_name)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('c3e0fb12-07fc-4d76-a22e-37409887afe8')
def test_create_server_name_length_exceeds_256(self):
# Create a server with name length exceeding 256 characters
@@ -187,6 +202,7 @@
name=server_name)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('4e72dc2d-44c5-4336-9667-f7972e95c402')
def test_create_with_invalid_network_uuid(self):
# Pass invalid network uuid while creating a server
@@ -197,6 +213,7 @@
networks=networks)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('7a2efc39-530c-47de-b875-2dd01c8d39bd')
def test_create_with_non_existent_keypair(self):
# Pass a non-existent keypair while creating a server
@@ -206,6 +223,7 @@
key_name=key_name)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('7fc74810-0bd2-4cd7-8244-4f33a9db865a')
def test_create_server_metadata_exceeds_length_limit(self):
# Pass really long metadata while creating a server
@@ -215,6 +233,7 @@
meta=metadata)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('aa8eed43-e2cb-4ebf-930b-da14f6a21d81')
def test_update_name_of_non_existent_server(self):
# Update name of a non-existent server
@@ -225,6 +244,7 @@
server_name, name=new_name)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('38204696-17c6-44da-9590-40f87fb5a899')
def test_update_server_set_empty_name(self):
# Update name of the server to an empty string
@@ -235,6 +255,7 @@
server_name, name=new_name)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('543d84c1-dd2e-4c6d-8cb2-b9da0efaa384')
def test_update_server_of_another_tenant(self):
# Update name of a server that belongs to another tenant
@@ -244,6 +265,7 @@
name=new_name)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('5c8e244c-dada-4590-9944-749c455b431f')
def test_update_server_name_length_exceeds_256(self):
# Update name of server exceed the name length limit
@@ -254,6 +276,7 @@
name=new_name)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('1041b4e6-514b-4855-96a5-e974b60870a3')
def test_delete_non_existent_server(self):
# Delete a non existent server
@@ -262,6 +285,7 @@
nonexistent_server)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('5c75009d-3eea-423e-bea3-61b09fd25f9c')
def test_delete_a_server_of_another_tenant(self):
# Delete a server that belongs to another tenant
self.assertRaises(lib_exc.NotFound,
@@ -269,12 +293,14 @@
self.server_id)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('75f79124-277c-45e6-a373-a1d6803f4cc4')
def test_delete_server_pass_negative_id(self):
# Pass an invalid string parameter to delete server
self.assertRaises(lib_exc.NotFound, self.client.delete_server, -1)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('f4d7279b-5fd2-4bf2-9ba4-ae35df0d18c5')
def test_delete_server_pass_id_exceeding_length_limit(self):
# Pass a server ID that exceeds length limit to delete server
@@ -282,6 +308,7 @@
sys.maxint + 1)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('c5fa6041-80cd-483b-aa6d-4e45f19d093c')
def test_create_with_nonexistent_security_group(self):
# Create a server with a nonexistent security group
@@ -291,6 +318,7 @@
security_groups=security_groups)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('3436b02f-1b1e-4f03-881e-c6a602327439')
def test_get_non_existent_server(self):
# Get a non existent server details
nonexistent_server = data_utils.rand_uuid()
@@ -298,12 +326,14 @@
nonexistent_server)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('a31460a9-49e1-42aa-82ee-06e0bb7c2d03')
def test_stop_non_existent_server(self):
# Stop a non existent server
nonexistent_server = data_utils.rand_uuid()
self.assertRaises(lib_exc.NotFound, self.servers_client.stop,
nonexistent_server)
+ @test.idempotent_id('6a8dc0c6-6cd4-4c0a-9f32-413881828091')
@testtools.skipUnless(CONF.compute_feature_enabled.pause,
'Pause is not available.')
@test.attr(type=['negative', 'gate'])
@@ -313,6 +343,7 @@
self.assertRaises(lib_exc.NotFound, self.client.pause_server,
nonexistent_server)
+ @test.idempotent_id('705b8e3a-e8a7-477c-a19b-6868fc24ac75')
@testtools.skipUnless(CONF.compute_feature_enabled.pause,
'Pause is not available.')
@test.attr(type=['negative', 'gate'])
@@ -322,6 +353,7 @@
self.assertRaises(lib_exc.NotFound, self.client.unpause_server,
nonexistent_server)
+ @test.idempotent_id('c8e639a7-ece8-42dd-a2e0-49615917ba4f')
@testtools.skipUnless(CONF.compute_feature_enabled.pause,
'Pause is not available.')
@test.attr(type=['negative', 'gate'])
@@ -331,6 +363,7 @@
self.client.unpause_server,
self.server_id)
+ @test.idempotent_id('d1f032d5-7b6e-48aa-b252-d5f16dd994ca')
@testtools.skipUnless(CONF.compute_feature_enabled.suspend,
'Suspend is not available.')
@test.attr(type=['negative', 'gate'])
@@ -340,6 +373,7 @@
self.assertRaises(lib_exc.NotFound, self.client.suspend_server,
nonexistent_server)
+ @test.idempotent_id('7f323206-05a9-4bf8-996b-dd5b2036501b')
@testtools.skipUnless(CONF.compute_feature_enabled.suspend,
'Suspend is not available.')
@test.attr(type=['negative', 'gate'])
@@ -352,6 +386,7 @@
self.server_id)
self.client.resume_server(self.server_id)
+ @test.idempotent_id('221cd282-bddb-4837-a683-89c2487389b6')
@testtools.skipUnless(CONF.compute_feature_enabled.suspend,
'Suspend is not available.')
@test.attr(type=['negative', 'gate'])
@@ -361,6 +396,7 @@
self.assertRaises(lib_exc.NotFound, self.client.resume_server,
nonexistent_server)
+ @test.idempotent_id('ccb6294d-c4c9-498f-8a43-554c098bfadb')
@testtools.skipUnless(CONF.compute_feature_enabled.suspend,
'Suspend is not available.')
@test.attr(type=['negative', 'gate'])
@@ -371,6 +407,7 @@
self.server_id)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('7dd919e7-413f-4198-bebb-35e2a01b13e9')
def test_get_console_output_of_non_existent_server(self):
# get the console output for a non existent server
nonexistent_server = data_utils.rand_uuid()
@@ -379,6 +416,7 @@
nonexistent_server, 10)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('6f47992b-5144-4250-9f8b-f00aa33950f3')
def test_force_delete_nonexistent_server_id(self):
# force-delete a non existent server
nonexistent_server = data_utils.rand_uuid()
@@ -387,6 +425,7 @@
nonexistent_server)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('9c6d38cc-fcfb-437a-85b9-7b788af8bf01')
def test_restore_nonexistent_server_id(self):
# restore-delete a non existent server
nonexistent_server = data_utils.rand_uuid()
@@ -395,12 +434,14 @@
nonexistent_server)
@test.attr(type=['negative', 'gate'])
+ @test.idempotent_id('7fcadfab-bd6a-4753-8db7-4a51e51aade9')
def test_restore_server_invalid_state(self):
# we can only restore-delete a server in 'soft-delete' state
self.assertRaises(lib_exc.Conflict,
self.client.restore_soft_deleted_server,
self.server_id)
+ @test.idempotent_id('abca56e2-a892-48ea-b5e5-e07e69774816')
@testtools.skipUnless(CONF.compute_feature_enabled.shelve,
'Shelve is not available.')
@test.attr(type=['negative', 'gate'])
@@ -410,6 +451,7 @@
self.assertRaises(lib_exc.NotFound, self.client.shelve_server,
nonexistent_server)
+ @test.idempotent_id('443e4f9b-e6bf-4389-b601-3a710f15fddd')
@testtools.skipUnless(CONF.compute_feature_enabled.shelve,
'Shelve is not available.')
@test.attr(type=['negative', 'gate'])
@@ -439,6 +481,7 @@
self.client.unshelve_server(self.server_id)
+ @test.idempotent_id('23d23b37-afaf-40d7-aa5d-5726f82d8821')
@testtools.skipUnless(CONF.compute_feature_enabled.shelve,
'Shelve is not available.')
@test.attr(type=['negative', 'gate'])
@@ -448,6 +491,7 @@
self.assertRaises(lib_exc.NotFound, self.client.unshelve_server,
nonexistent_server)
+ @test.idempotent_id('8f198ded-1cca-4228-9e65-c6b449c54880')
@testtools.skipUnless(CONF.compute_feature_enabled.shelve,
'Shelve is not available.')
@test.attr(type=['negative', 'gate'])