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/admin/test_servers.py b/tempest/api/compute/admin/test_servers.py
index 84c38c1..adeb64b 100644
--- a/tempest/api/compute/admin/test_servers.py
+++ b/tempest/api/compute/admin/test_servers.py
@@ -45,6 +45,7 @@
cls.s2_id = server['id']
@test.attr(type='gate')
+ @test.idempotent_id('51717b38-bdc1-458b-b636-1cf82d99f62f')
def test_list_servers_by_admin(self):
# Listing servers by admin user returns empty list by default
body = self.client.list_servers_with_detail()
@@ -52,6 +53,7 @@
self.assertEqual([], servers)
@test.attr(type='gate')
+ @test.idempotent_id('06f960bb-15bb-48dc-873d-f96e89be7870')
def test_list_servers_filter_by_error_status(self):
# Filter the list of servers by server error status
params = {'status': 'error'}
@@ -68,6 +70,7 @@
self.assertNotIn(self.s2_id, map(lambda x: x['id'], servers))
@test.attr(type='gate')
+ @test.idempotent_id('9f5579ae-19b4-4985-a091-2a5d56106580')
def test_list_servers_by_admin_with_all_tenants(self):
# Listing servers by admin user with all tenants parameter
# Here should be listed all servers
@@ -80,6 +83,7 @@
self.assertIn(self.s2_name, servers_name)
@test.attr(type='gate')
+ @test.idempotent_id('7e5d6b8f-454a-4ba1-8ae2-da857af8338b')
def test_list_servers_by_admin_with_specified_tenant(self):
# In nova v2, tenant_id is ignored unless all_tenants is specified
@@ -98,6 +102,7 @@
self.assertEqual([], servers)
@test.attr(type='gate')
+ @test.idempotent_id('86c7a8f7-50cf-43a9-9bac-5b985317134f')
def test_list_servers_filter_by_exist_host(self):
# Filter the list of servers by existent host
name = data_utils.rand_name('server')
@@ -120,6 +125,7 @@
map(lambda x: x['id'], nonexistent_servers))
@test.attr(type='gate')
+ @test.idempotent_id('ee8ae470-db70-474d-b752-690b7892cab1')
def test_reset_state_server(self):
# Reset server's state to 'error'
self.client.reset_state(self.s1_id)
@@ -137,6 +143,7 @@
@test.attr(type='gate')
@decorators.skip_because(bug="1240043")
+ @test.idempotent_id('31ff3486-b8a0-4f56-a6c0-aab460531db3')
def test_get_server_diagnostics_by_admin(self):
# Retrieve server diagnostics by admin user
diagnostic = self.client.get_server_diagnostics(self.s1_id)
@@ -147,6 +154,7 @@
self.assertIn(key, str(diagnostic.keys()))
@test.attr(type='gate')
+ @test.idempotent_id('682cb127-e5bb-4f53-87ce-cb9003604442')
def test_rebuild_server_in_error_state(self):
# The server in error state should be rebuilt using the provided
# image and changed to ACTIVE state
@@ -174,6 +182,7 @@
self.assertEqual(self.image_ref_alt, rebuilt_image_id)
@test.attr(type='gate')
+ @test.idempotent_id('7a1323b4-a6a2-497a-96cb-76c07b945c71')
def test_reset_network_inject_network_info(self):
# Reset Network of a Server
server = self.create_test_server(wait_until='ACTIVE')
@@ -182,6 +191,7 @@
self.client.inject_network_info(server['id'])
@test.attr(type='gate')
+ @test.idempotent_id('fdcd9b33-0903-4e00-a1f7-b5f6543068d6')
def test_create_server_with_scheduling_hint(self):
# Create a server with scheduler hints.
hints = {