Switch to decorators.idempotent_id on compute.admin
So many modules are using test.idempotent_id and this is the first
step for switching to decorators.idempotent_id.
Change-Id: I55a61d40f18f8fa0fea8423ad65302c1e3559205
Related-Bug: #1616913
diff --git a/tempest/api/compute/admin/test_aggregates_negative.py b/tempest/api/compute/admin/test_aggregates_negative.py
index 85aa301..deded73 100644
--- a/tempest/api/compute/admin/test_aggregates_negative.py
+++ b/tempest/api/compute/admin/test_aggregates_negative.py
@@ -16,6 +16,7 @@
from tempest.api.compute import base
from tempest.common import tempest_fixtures as fixtures
from tempest.common.utils import data_utils
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -48,7 +49,7 @@
return aggregate
@test.attr(type=['negative'])
- @test.idempotent_id('86a1cb14-da37-4a70-b056-903fd56dfe29')
+ @decorators.idempotent_id('86a1cb14-da37-4a70-b056-903fd56dfe29')
def test_aggregate_create_as_user(self):
# Regular user is not allowed to create an aggregate.
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
@@ -57,7 +58,7 @@
name=aggregate_name)
@test.attr(type=['negative'])
- @test.idempotent_id('3b8a1929-3793-4e92-bcb4-dfa572ee6c1d')
+ @decorators.idempotent_id('3b8a1929-3793-4e92-bcb4-dfa572ee6c1d')
def test_aggregate_create_aggregate_name_length_less_than_1(self):
# the length of aggregate name should >= 1 and <=255
self.assertRaises(lib_exc.BadRequest,
@@ -65,7 +66,7 @@
name='')
@test.attr(type=['negative'])
- @test.idempotent_id('4c194563-543b-4e70-a719-557bbe947fac')
+ @decorators.idempotent_id('4c194563-543b-4e70-a719-557bbe947fac')
def test_aggregate_create_aggregate_name_length_exceeds_255(self):
# the length of aggregate name should >= 1 and <=255
aggregate_name = 'a' * 256
@@ -74,7 +75,7 @@
name=aggregate_name)
@test.attr(type=['negative'])
- @test.idempotent_id('9c23a291-b0b1-487b-b464-132e061151b3')
+ @decorators.idempotent_id('9c23a291-b0b1-487b-b464-132e061151b3')
def test_aggregate_create_with_existent_aggregate_name(self):
# creating an aggregate with existent aggregate name is forbidden
aggregate = self._create_test_aggregate()
@@ -83,7 +84,7 @@
name=aggregate['name'])
@test.attr(type=['negative'])
- @test.idempotent_id('cd6de795-c15d-45f1-8d9e-813c6bb72a3d')
+ @decorators.idempotent_id('cd6de795-c15d-45f1-8d9e-813c6bb72a3d')
def test_aggregate_delete_as_user(self):
# Regular user is not allowed to delete an aggregate.
aggregate = self._create_test_aggregate()
@@ -92,14 +93,14 @@
aggregate['id'])
@test.attr(type=['negative'])
- @test.idempotent_id('b7d475a6-5dcd-4ff4-b70a-cd9de66a6672')
+ @decorators.idempotent_id('b7d475a6-5dcd-4ff4-b70a-cd9de66a6672')
def test_aggregate_list_as_user(self):
# Regular user is not allowed to list aggregates.
self.assertRaises(lib_exc.Forbidden,
self.user_client.list_aggregates)
@test.attr(type=['negative'])
- @test.idempotent_id('557cad12-34c9-4ff4-95f0-22f0dfbaf7dc')
+ @decorators.idempotent_id('557cad12-34c9-4ff4-95f0-22f0dfbaf7dc')
def test_aggregate_get_details_as_user(self):
# Regular user is not allowed to get aggregate details.
aggregate = self._create_test_aggregate()
@@ -108,21 +109,21 @@
aggregate['id'])
@test.attr(type=['negative'])
- @test.idempotent_id('c74f4bf1-4708-4ff2-95a0-f49eaca951bd')
+ @decorators.idempotent_id('c74f4bf1-4708-4ff2-95a0-f49eaca951bd')
def test_aggregate_delete_with_invalid_id(self):
# Delete an aggregate with invalid id should raise exceptions.
self.assertRaises(lib_exc.NotFound,
self.client.delete_aggregate, -1)
@test.attr(type=['negative'])
- @test.idempotent_id('3c916244-2c46-49a4-9b55-b20bb0ae512c')
+ @decorators.idempotent_id('3c916244-2c46-49a4-9b55-b20bb0ae512c')
def test_aggregate_get_details_with_invalid_id(self):
# Get aggregate details with invalid id should raise exceptions.
self.assertRaises(lib_exc.NotFound,
self.client.show_aggregate, -1)
@test.attr(type=['negative'])
- @test.idempotent_id('0ef07828-12b4-45ba-87cc-41425faf5711')
+ @decorators.idempotent_id('0ef07828-12b4-45ba-87cc-41425faf5711')
def test_aggregate_add_non_exist_host(self):
# Adding a non-exist host to an aggregate should raise exceptions.
hosts_all = self.os_adm.hosts_client.list_hosts()['hosts']
@@ -136,7 +137,7 @@
aggregate['id'], host=non_exist_host)
@test.attr(type=['negative'])
- @test.idempotent_id('7324c334-bd13-4c93-8521-5877322c3d51')
+ @decorators.idempotent_id('7324c334-bd13-4c93-8521-5877322c3d51')
def test_aggregate_add_host_as_user(self):
# Regular user is not allowed to add a host to an aggregate.
aggregate = self._create_test_aggregate()
@@ -145,7 +146,7 @@
aggregate['id'], host=self.host)
@test.attr(type=['negative'])
- @test.idempotent_id('19dd44e1-c435-4ee1-a402-88c4f90b5950')
+ @decorators.idempotent_id('19dd44e1-c435-4ee1-a402-88c4f90b5950')
def test_aggregate_add_existent_host(self):
self.useFixture(fixtures.LockFixture('availability_zone'))
aggregate = self._create_test_aggregate()
@@ -158,7 +159,7 @@
aggregate['id'], host=self.host)
@test.attr(type=['negative'])
- @test.idempotent_id('7a53af20-137a-4e44-a4ae-e19260e626d9')
+ @decorators.idempotent_id('7a53af20-137a-4e44-a4ae-e19260e626d9')
def test_aggregate_remove_host_as_user(self):
# Regular user is not allowed to remove a host from an aggregate.
self.useFixture(fixtures.LockFixture('availability_zone'))
@@ -173,7 +174,7 @@
aggregate['id'], host=self.host)
@test.attr(type=['negative'])
- @test.idempotent_id('95d6a6fa-8da9-4426-84d0-eec0329f2e4d')
+ @decorators.idempotent_id('95d6a6fa-8da9-4426-84d0-eec0329f2e4d')
def test_aggregate_remove_nonexistent_host(self):
aggregate = self._create_test_aggregate()