Switch to use idempotent_id decorator from tempest.lib
Decorator idempotent_id() in tempest.test is deprecated and
tempest.lib.decorators.idempotent_id() should be used instead.
This patch switch all tempest tests to use new decorator.
Change-Id: I2df9c13fbb44b8807da6805761ad30bfd010dc55
diff --git a/neutron/tests/tempest/api/test_trunk.py b/neutron/tests/tempest/api/test_trunk.py
index 6763517..62290c9 100644
--- a/neutron/tests/tempest/api/test_trunk.py
+++ b/neutron/tests/tempest/api/test_trunk.py
@@ -14,6 +14,7 @@
from tempest.lib.common.utils import data_utils
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
@@ -81,15 +82,15 @@
observed_trunk = self._show_trunk(trunk['trunk']['id'])
self.assertEqual(trunk, observed_trunk)
- @test.idempotent_id('e1a6355c-4768-41f3-9bf8-0f1d192bd501')
+ @decorators.idempotent_id('e1a6355c-4768-41f3-9bf8-0f1d192bd501')
def test_create_trunk_empty_subports_list(self):
self._test_create_trunk([])
- @test.idempotent_id('382dfa39-ca03-4bd3-9a1c-91e36d2e3796')
+ @decorators.idempotent_id('382dfa39-ca03-4bd3-9a1c-91e36d2e3796')
def test_create_trunk_subports_not_specified(self):
self._test_create_trunk(None)
- @test.idempotent_id('7de46c22-e2b6-4959-ac5a-0e624632ab32')
+ @decorators.idempotent_id('7de46c22-e2b6-4959-ac5a-0e624632ab32')
def test_create_show_delete_trunk(self):
trunk = self._create_trunk_with_network_and_parent(None)
trunk_id = trunk['trunk']['id']
@@ -100,7 +101,7 @@
self.client.delete_trunk(trunk_id)
self.assertRaises(lib_exc.NotFound, self._show_trunk, trunk_id)
- @test.idempotent_id('8d83a6ca-662d-45b8-8062-d513077296aa')
+ @decorators.idempotent_id('8d83a6ca-662d-45b8-8062-d513077296aa')
@test.requires_ext(extension="project-id", service="network")
def test_show_trunk_has_project_id(self):
trunk = self._create_trunk_with_network_and_parent(None)
@@ -111,7 +112,7 @@
self.assertEqual(self.client.tenant_id, show_trunk['project_id'])
self.assertEqual(self.client.tenant_id, show_trunk['tenant_id'])
- @test.idempotent_id('4ce46c22-a2b6-4659-bc5a-0ef2463cab32')
+ @decorators.idempotent_id('4ce46c22-a2b6-4659-bc5a-0ef2463cab32')
def test_create_update_trunk(self):
trunk = self._create_trunk_with_network_and_parent(None)
self.assertEqual(1, trunk['trunk']['revision_number'])
@@ -129,7 +130,7 @@
# enable the trunk so that it can be managed
self.client.update_trunk(trunk_id, admin_state_up=True)
- @test.idempotent_id('5ff46c22-a2b6-5559-bc5a-0ef2463cab32')
+ @decorators.idempotent_id('5ff46c22-a2b6-5559-bc5a-0ef2463cab32')
def test_create_update_trunk_with_description(self):
trunk = self._create_trunk_with_network_and_parent(
None, description="foo description")
@@ -138,7 +139,7 @@
trunk = self.client.update_trunk(trunk_id, description='')
self.assertEqual('', trunk['trunk']['description'])
- @test.idempotent_id('73365f73-bed6-42cd-960b-ec04e0c99d85')
+ @decorators.idempotent_id('73365f73-bed6-42cd-960b-ec04e0c99d85')
def test_list_trunks(self):
trunk1 = self._create_trunk_with_network_and_parent(None)
trunk2 = self._create_trunk_with_network_and_parent(None)
@@ -150,7 +151,7 @@
for trunk in matched_trunks:
self.assertEqual(expected_trunks[trunk['id']], trunk)
- @test.idempotent_id('bb5fcead-09b5-484a-bbe6-46d1e06d6cc0')
+ @decorators.idempotent_id('bb5fcead-09b5-484a-bbe6-46d1e06d6cc0')
def test_add_subport(self):
trunk = self._create_trunk_with_network_and_parent([])
network = self.create_network()
@@ -165,7 +166,7 @@
created_subport = observed_subports[0]
self.assertEqual(subports[0], created_subport)
- @test.idempotent_id('ee5fcead-1abf-483a-bce6-43d1e06d6aa0')
+ @decorators.idempotent_id('ee5fcead-1abf-483a-bce6-43d1e06d6aa0')
def test_delete_trunk_with_subport_is_allowed(self):
network = self.create_network()
port = self.create_port(network)
@@ -175,7 +176,7 @@
trunk = self._create_trunk_with_network_and_parent(subports)
self.client.delete_trunk(trunk['trunk']['id'])
- @test.idempotent_id('96eea398-a03c-4c3e-a99e-864392c2ca53')
+ @decorators.idempotent_id('96eea398-a03c-4c3e-a99e-864392c2ca53')
def test_remove_subport(self):
subport_parent1 = self.create_port(self.create_network())
subport_parent2 = self.create_port(self.create_network())
@@ -206,7 +207,7 @@
self.assertEqual(1, len(observed_subports))
self.assertEqual(expected_subport, observed_subports[0])
- @test.idempotent_id('bb5fcaad-09b5-484a-dde6-4cd1ea6d6ff0')
+ @decorators.idempotent_id('bb5fcaad-09b5-484a-dde6-4cd1ea6d6ff0')
def test_get_subports(self):
network = self.create_network()
port = self.create_port(network)
@@ -256,7 +257,7 @@
class TrunkTestMtusJSON(TrunkTestMtusJSONBase):
- @test.idempotent_id('0f05d98e-41f5-4629-ac29-9aee269c9602')
+ @decorators.idempotent_id('0f05d98e-41f5-4629-ac29-9aee269c9602')
def test_create_trunk_with_mtu_greater_than_subport(self):
subports = [{'port_id': self.smaller_mtu_port['id'],
'segmentation_type': 'vlan',
@@ -265,7 +266,7 @@
trunk = self.client.create_trunk(self.larger_mtu_port['id'], subports)
self.trunks.append(trunk['trunk'])
- @test.idempotent_id('2004c5c6-e557-4c43-8100-c820ad4953e8')
+ @decorators.idempotent_id('2004c5c6-e557-4c43-8100-c820ad4953e8')
def test_add_subport_with_mtu_smaller_than_trunk(self):
subports = [{'port_id': self.smaller_mtu_port['id'],
'segmentation_type': 'vlan',
@@ -276,7 +277,7 @@
self.client.add_subports(trunk['trunk']['id'], subports)
- @test.idempotent_id('22725101-f4bc-4e00-84ec-4e02cd7e0500')
+ @decorators.idempotent_id('22725101-f4bc-4e00-84ec-4e02cd7e0500')
def test_create_trunk_with_mtu_equal_to_subport(self):
subports = [{'port_id': self.smaller_mtu_port['id'],
'segmentation_type': 'vlan',
@@ -286,7 +287,7 @@
subports)
self.trunks.append(trunk['trunk'])
- @test.idempotent_id('175b05ae-66ad-44c7-857a-a12d16f1058f')
+ @decorators.idempotent_id('175b05ae-66ad-44c7-857a-a12d16f1058f')
def test_add_subport_with_mtu_equal_to_trunk(self):
subports = [{'port_id': self.smaller_mtu_port['id'],
'segmentation_type': 'vlan',
@@ -324,38 +325,38 @@
trunks_cleanup(cls.client, cls.trunks)
super(TrunksSearchCriteriaTest, cls).resource_cleanup()
- @test.idempotent_id('fab73df4-960a-4ae3-87d3-60992b8d3e2d')
+ @decorators.idempotent_id('fab73df4-960a-4ae3-87d3-60992b8d3e2d')
def test_list_sorts_asc(self):
self._test_list_sorts_asc()
- @test.idempotent_id('a426671d-7270-430f-82ff-8f33eec93010')
+ @decorators.idempotent_id('a426671d-7270-430f-82ff-8f33eec93010')
def test_list_sorts_desc(self):
self._test_list_sorts_desc()
- @test.idempotent_id('b202fdc8-6616-45df-b6a0-463932de6f94')
+ @decorators.idempotent_id('b202fdc8-6616-45df-b6a0-463932de6f94')
def test_list_pagination(self):
self._test_list_pagination()
- @test.idempotent_id('c4723b8e-8186-4b9a-bf9e-57519967e048')
+ @decorators.idempotent_id('c4723b8e-8186-4b9a-bf9e-57519967e048')
def test_list_pagination_with_marker(self):
self._test_list_pagination_with_marker()
- @test.idempotent_id('dcd02a7a-f07e-4d5e-b0ca-b58e48927a9b')
+ @decorators.idempotent_id('dcd02a7a-f07e-4d5e-b0ca-b58e48927a9b')
def test_list_pagination_with_href_links(self):
self._test_list_pagination_with_href_links()
- @test.idempotent_id('eafe7024-77ab-4cfe-824b-0b2bf4217727')
+ @decorators.idempotent_id('eafe7024-77ab-4cfe-824b-0b2bf4217727')
def test_list_no_pagination_limit_0(self):
self._test_list_no_pagination_limit_0()
- @test.idempotent_id('f8857391-dc44-40cc-89b7-2800402e03ce')
+ @decorators.idempotent_id('f8857391-dc44-40cc-89b7-2800402e03ce')
def test_list_pagination_page_reverse_asc(self):
self._test_list_pagination_page_reverse_asc()
- @test.idempotent_id('ae51e9c9-ceae-4ec0-afd4-147569247699')
+ @decorators.idempotent_id('ae51e9c9-ceae-4ec0-afd4-147569247699')
def test_list_pagination_page_reverse_desc(self):
self._test_list_pagination_page_reverse_desc()
- @test.idempotent_id('b4293e59-d794-4a93-be09-38667199ef68')
+ @decorators.idempotent_id('b4293e59-d794-4a93-be09-38667199ef68')
def test_list_pagination_page_reverse_with_href_links(self):
self._test_list_pagination_page_reverse_with_href_links()