Merge "Snapshot v2 pagination tests"
diff --git a/tempest/api/compute/admin/test_agents.py b/tempest/api/compute/admin/test_agents.py
index 1c37cad..118ad60 100644
--- a/tempest/api/compute/admin/test_agents.py
+++ b/tempest/api/compute/admin/test_agents.py
@@ -14,7 +14,7 @@
from tempest.api.compute import base
from tempest.common.utils import data_utils
-from tempest import test
+from tempest.lib import decorators
class AgentsAdminTestJSON(base.BaseV2ComputeAdminTest):
@@ -44,7 +44,7 @@
kwargs[rand_key] = data_utils.rand_name(kwargs[rand_key])
return kwargs
- @test.idempotent_id('1fc6bdc8-0b6d-4cc7-9f30-9b04fabe5b90')
+ @decorators.idempotent_id('1fc6bdc8-0b6d-4cc7-9f30-9b04fabe5b90')
def test_create_agent(self):
# Create an agent.
params = self._param_helper(
@@ -56,7 +56,7 @@
for expected_item, value in params.items():
self.assertEqual(value, body[expected_item])
- @test.idempotent_id('dc9ffd51-1c50-4f0e-a820-ae6d2a568a9e')
+ @decorators.idempotent_id('dc9ffd51-1c50-4f0e-a820-ae6d2a568a9e')
def test_update_agent(self):
# Create and update an agent.
body = self.client.create_agent(**self.params_agent)['agent']
@@ -69,7 +69,7 @@
for expected_item, value in params.items():
self.assertEqual(value, body[expected_item])
- @test.idempotent_id('470e0b89-386f-407b-91fd-819737d0b335')
+ @decorators.idempotent_id('470e0b89-386f-407b-91fd-819737d0b335')
def test_delete_agent(self):
# Create an agent and delete it.
body = self.client.create_agent(**self.params_agent)['agent']
@@ -80,7 +80,7 @@
self.assertNotIn(body['agent_id'], map(lambda x: x['agent_id'],
agents))
- @test.idempotent_id('6a326c69-654b-438a-80a3-34bcc454e138')
+ @decorators.idempotent_id('6a326c69-654b-438a-80a3-34bcc454e138')
def test_list_agents(self):
# Create an agent and list all agents.
body = self.client.create_agent(**self.params_agent)['agent']
@@ -90,7 +90,7 @@
'Cannot get any agents.(%s)' % agents)
self.assertIn(body['agent_id'], map(lambda x: x['agent_id'], agents))
- @test.idempotent_id('eabadde4-3cd7-4ec4-a4b5-5a936d2d4408')
+ @decorators.idempotent_id('eabadde4-3cd7-4ec4-a4b5-5a936d2d4408')
def test_list_agents_with_filter(self):
# Create agents and list the agent builds by the filter.
body = self.client.create_agent(**self.params_agent)['agent']
diff --git a/tempest/api/compute/admin/test_aggregates.py b/tempest/api/compute/admin/test_aggregates.py
index 1233a2b..36ce975 100644
--- a/tempest/api/compute/admin/test_aggregates.py
+++ b/tempest/api/compute/admin/test_aggregates.py
@@ -20,7 +20,7 @@
from tempest.common.utils import data_utils
from tempest import config
from tempest.lib.common.utils import test_utils
-from tempest import test
+from tempest.lib import decorators
CONF = config.CONF
@@ -59,7 +59,7 @@
msg += " for hypervisor_type %s" % CONF.compute.hypervisor_type
raise testtools.TestCase.failureException(msg)
- @test.idempotent_id('0d148aa3-d54c-4317-aa8d-42040a475e20')
+ @decorators.idempotent_id('0d148aa3-d54c-4317-aa8d-42040a475e20')
def test_aggregate_create_delete(self):
# Create and delete an aggregate.
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
@@ -73,7 +73,7 @@
self.client.delete_aggregate(aggregate['id'])
self.client.wait_for_resource_deletion(aggregate['id'])
- @test.idempotent_id('5873a6f8-671a-43ff-8838-7ce430bb6d0b')
+ @decorators.idempotent_id('5873a6f8-671a-43ff-8838-7ce430bb6d0b')
def test_aggregate_create_delete_with_az(self):
# Create and delete an aggregate.
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
@@ -88,7 +88,7 @@
self.client.delete_aggregate(aggregate['id'])
self.client.wait_for_resource_deletion(aggregate['id'])
- @test.idempotent_id('68089c38-04b1-4758-bdf0-cf0daec4defd')
+ @decorators.idempotent_id('68089c38-04b1-4758-bdf0-cf0daec4defd')
def test_aggregate_create_verify_entry_in_list(self):
# Create an aggregate and ensure it is listed.
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
@@ -101,7 +101,7 @@
map(lambda x: (x['id'], x['availability_zone']),
aggregates))
- @test.idempotent_id('36ec92ca-7a73-43bc-b920-7531809e8540')
+ @decorators.idempotent_id('36ec92ca-7a73-43bc-b920-7531809e8540')
def test_aggregate_create_update_metadata_get_details(self):
# Create an aggregate and ensure its details are returned.
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
@@ -124,7 +124,7 @@
body = self.client.show_aggregate(aggregate['id'])['aggregate']
self.assertEqual(meta, body["metadata"])
- @test.idempotent_id('4d2b2004-40fa-40a1-aab2-66f4dab81beb')
+ @decorators.idempotent_id('4d2b2004-40fa-40a1-aab2-66f4dab81beb')
def test_aggregate_create_update_with_az(self):
# Update an aggregate and ensure properties are updated correctly
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
@@ -154,7 +154,7 @@
(x['id'], x['name'], x['availability_zone']),
aggregates))
- @test.idempotent_id('c8e85064-e79b-4906-9931-c11c24294d02')
+ @decorators.idempotent_id('c8e85064-e79b-4906-9931-c11c24294d02')
def test_aggregate_add_remove_host(self):
# Add a host to the given aggregate and remove.
self.useFixture(fixtures.LockFixture('availability_zone'))
@@ -177,7 +177,7 @@
body['availability_zone'])
self.assertNotIn(self.host, body['hosts'])
- @test.idempotent_id('7f6a1cc5-2446-4cdb-9baa-b6ae0a919b72')
+ @decorators.idempotent_id('7f6a1cc5-2446-4cdb-9baa-b6ae0a919b72')
def test_aggregate_add_host_list(self):
# Add a host to the given aggregate and list.
self.useFixture(fixtures.LockFixture('availability_zone'))
@@ -197,7 +197,7 @@
self.assertIsNone(agg['availability_zone'])
self.assertIn(self.host, agg['hosts'])
- @test.idempotent_id('eeef473c-7c52-494d-9f09-2ed7fc8fc036')
+ @decorators.idempotent_id('eeef473c-7c52-494d-9f09-2ed7fc8fc036')
def test_aggregate_add_host_get_details(self):
# Add a host to the given aggregate and get details.
self.useFixture(fixtures.LockFixture('availability_zone'))
@@ -214,7 +214,7 @@
self.assertIsNone(body['availability_zone'])
self.assertIn(self.host, body['hosts'])
- @test.idempotent_id('96be03c7-570d-409c-90f8-e4db3c646996')
+ @decorators.idempotent_id('96be03c7-570d-409c-90f8-e4db3c646996')
def test_aggregate_add_host_create_server_with_az(self):
# Add a host to the given aggregate and create a server.
self.useFixture(fixtures.LockFixture('availability_zone'))
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()
diff --git a/tempest/api/compute/admin/test_auto_allocate_network.py b/tempest/api/compute/admin/test_auto_allocate_network.py
index 08e4072..7fda732 100644
--- a/tempest/api/compute/admin/test_auto_allocate_network.py
+++ b/tempest/api/compute/admin/test_auto_allocate_network.py
@@ -19,6 +19,7 @@
from tempest.common import credentials_factory as credentials
from tempest import config
from tempest.lib.common.utils import test_utils
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_excs
from tempest import test
@@ -145,7 +146,7 @@
test_utils.call_and_ignore_notfound_exc(
cls.networks_client.delete_network, network['id'])
- @test.idempotent_id('5eb7b8fa-9c23-47a2-9d7d-02ed5809dd34')
+ @decorators.idempotent_id('5eb7b8fa-9c23-47a2-9d7d-02ed5809dd34')
def test_server_create_no_allocate(self):
"""Tests that no networking is allocated for the server."""
# create the server with no networking
@@ -158,7 +159,7 @@
# assert that there is no networking
self.assertEqual({}, addresses)
- @test.idempotent_id('2e6cf129-9e28-4e8a-aaaa-045ea826b2a6')
+ @decorators.idempotent_id('2e6cf129-9e28-4e8a-aaaa-045ea826b2a6')
def test_server_multi_create_auto_allocate(self):
"""Tests that networking is auto-allocated for multiple servers."""
diff --git a/tempest/api/compute/admin/test_availability_zone.py b/tempest/api/compute/admin/test_availability_zone.py
index 3470602..50dec28 100644
--- a/tempest/api/compute/admin/test_availability_zone.py
+++ b/tempest/api/compute/admin/test_availability_zone.py
@@ -14,7 +14,7 @@
# under the License.
from tempest.api.compute import base
-from tempest import test
+from tempest.lib import decorators
class AZAdminV2TestJSON(base.BaseV2ComputeAdminTest):
@@ -25,13 +25,13 @@
super(AZAdminV2TestJSON, cls).setup_clients()
cls.client = cls.availability_zone_admin_client
- @test.idempotent_id('d3431479-8a09-4f76-aa2d-26dc580cb27c')
+ @decorators.idempotent_id('d3431479-8a09-4f76-aa2d-26dc580cb27c')
def test_get_availability_zone_list(self):
# List of availability zone
availability_zone = self.client.list_availability_zones()
self.assertGreater(len(availability_zone['availabilityZoneInfo']), 0)
- @test.idempotent_id('ef726c58-530f-44c2-968c-c7bed22d5b8c')
+ @decorators.idempotent_id('ef726c58-530f-44c2-968c-c7bed22d5b8c')
def test_get_availability_zone_list_detail(self):
# List of availability zones and available services
availability_zone = self.client.list_availability_zones(detail=True)
diff --git a/tempest/api/compute/admin/test_availability_zone_negative.py b/tempest/api/compute/admin/test_availability_zone_negative.py
index c60de1e..faeb811 100644
--- a/tempest/api/compute/admin/test_availability_zone_negative.py
+++ b/tempest/api/compute/admin/test_availability_zone_negative.py
@@ -13,6 +13,7 @@
# under the License.
from tempest.api.compute import base
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -26,7 +27,7 @@
cls.non_adm_client = cls.availability_zone_client
@test.attr(type=['negative'])
- @test.idempotent_id('bf34dca2-fdc3-4073-9c02-7648d9eae0d7')
+ @decorators.idempotent_id('bf34dca2-fdc3-4073-9c02-7648d9eae0d7')
def test_get_availability_zone_list_detail_with_non_admin_user(self):
# List of availability zones and available services with
# non-administrator user
diff --git a/tempest/api/compute/admin/test_baremetal_nodes.py b/tempest/api/compute/admin/test_baremetal_nodes.py
index 722d9a6..7726ed4 100644
--- a/tempest/api/compute/admin/test_baremetal_nodes.py
+++ b/tempest/api/compute/admin/test_baremetal_nodes.py
@@ -14,6 +14,7 @@
from tempest.api.compute import base
from tempest import config
+from tempest.lib import decorators
from tempest import test
CONF = config.CONF
@@ -32,11 +33,11 @@
cls.ironic_client = cls.os_adm.baremetal_client
@test.attr(type=['baremetal'])
- @test.idempotent_id('e475aa6e-416d-4fa4-b3af-28d5e84250fb')
+ @decorators.idempotent_id('e475aa6e-416d-4fa4-b3af-28d5e84250fb')
def test_list_get_baremetal_nodes(self):
# Create some test nodes in Ironic directly
test_nodes = []
- for i in range(0, 3):
+ for _ in range(0, 3):
_, node = self.ironic_client.create_node()
test_nodes.append(node)
self.addCleanup(self.ironic_client.delete_node, node['uuid'])
diff --git a/tempest/api/compute/admin/test_fixed_ips.py b/tempest/api/compute/admin/test_fixed_ips.py
index 9cda0cd..10ed519 100644
--- a/tempest/api/compute/admin/test_fixed_ips.py
+++ b/tempest/api/compute/admin/test_fixed_ips.py
@@ -15,6 +15,7 @@
from tempest.api.compute import base
from tempest import config
+from tempest.lib import decorators
from tempest import test
CONF = config.CONF
@@ -47,18 +48,18 @@
if cls.ip:
break
- @test.idempotent_id('16b7d848-2f7c-4709-85a3-2dfb4576cc52')
+ @decorators.idempotent_id('16b7d848-2f7c-4709-85a3-2dfb4576cc52')
@test.services('network')
def test_list_fixed_ip_details(self):
fixed_ip = self.client.show_fixed_ip(self.ip)
self.assertEqual(fixed_ip['fixed_ip']['address'], self.ip)
- @test.idempotent_id('5485077b-7e46-4cec-b402-91dc3173433b')
+ @decorators.idempotent_id('5485077b-7e46-4cec-b402-91dc3173433b')
@test.services('network')
def test_set_reserve(self):
self.client.reserve_fixed_ip(self.ip, reserve="None")
- @test.idempotent_id('7476e322-b9ff-4710-bf82-49d51bac6e2e')
+ @decorators.idempotent_id('7476e322-b9ff-4710-bf82-49d51bac6e2e')
@test.services('network')
def test_set_unreserve(self):
self.client.reserve_fixed_ip(self.ip, unreserve="None")
diff --git a/tempest/api/compute/admin/test_fixed_ips_negative.py b/tempest/api/compute/admin/test_fixed_ips_negative.py
index 05bba21..073f152 100644
--- a/tempest/api/compute/admin/test_fixed_ips_negative.py
+++ b/tempest/api/compute/admin/test_fixed_ips_negative.py
@@ -14,6 +14,7 @@
from tempest.api.compute import base
from tempest import config
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -49,14 +50,14 @@
break
@test.attr(type=['negative'])
- @test.idempotent_id('9f17f47d-daad-4adc-986e-12370c93e407')
+ @decorators.idempotent_id('9f17f47d-daad-4adc-986e-12370c93e407')
@test.services('network')
def test_list_fixed_ip_details_with_non_admin_user(self):
self.assertRaises(lib_exc.Forbidden,
self.non_admin_client.show_fixed_ip, self.ip)
@test.attr(type=['negative'])
- @test.idempotent_id('ce60042c-fa60-4836-8d43-1c8e3359dc47')
+ @decorators.idempotent_id('ce60042c-fa60-4836-8d43-1c8e3359dc47')
@test.services('network')
def test_set_reserve_with_non_admin_user(self):
self.assertRaises(lib_exc.Forbidden,
@@ -64,7 +65,7 @@
self.ip, reserve="None")
@test.attr(type=['negative'])
- @test.idempotent_id('f1f7a35b-0390-48c5-9803-5f27461439db')
+ @decorators.idempotent_id('f1f7a35b-0390-48c5-9803-5f27461439db')
@test.services('network')
def test_set_unreserve_with_non_admin_user(self):
self.assertRaises(lib_exc.Forbidden,
@@ -72,7 +73,7 @@
self.ip, unreserve="None")
@test.attr(type=['negative'])
- @test.idempotent_id('f51cf464-7fc5-4352-bc3e-e75cfa2cb717')
+ @decorators.idempotent_id('f51cf464-7fc5-4352-bc3e-e75cfa2cb717')
@test.services('network')
def test_set_reserve_with_invalid_ip(self):
# NOTE(maurosr): since this exercises the same code snippet, we do it
@@ -85,7 +86,7 @@
"my.invalid.ip", reserve="None")
@test.attr(type=['negative'])
- @test.idempotent_id('fd26ef50-f135-4232-9d32-281aab3f9176')
+ @decorators.idempotent_id('fd26ef50-f135-4232-9d32-281aab3f9176')
@test.services('network')
def test_fixed_ip_with_invalid_action(self):
self.assertRaises(lib_exc.BadRequest,
diff --git a/tempest/api/compute/admin/test_flavors.py b/tempest/api/compute/admin/test_flavors.py
index fde5622..3fd1612 100644
--- a/tempest/api/compute/admin/test_flavors.py
+++ b/tempest/api/compute/admin/test_flavors.py
@@ -17,6 +17,7 @@
from tempest.api.compute import base
from tempest.common.utils import data_utils
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -83,19 +84,19 @@
return flavor['id']
- @test.idempotent_id('8b4330e1-12c4-4554-9390-e6639971f086')
+ @decorators.idempotent_id('8b4330e1-12c4-4554-9390-e6639971f086')
def test_create_flavor_with_int_id(self):
flavor_id = data_utils.rand_int_id(start=1000)
new_flavor_id = self._create_flavor(flavor_id)
self.assertEqual(new_flavor_id, str(flavor_id))
- @test.idempotent_id('94c9bb4e-2c2a-4f3c-bb1f-5f0daf918e6d')
+ @decorators.idempotent_id('94c9bb4e-2c2a-4f3c-bb1f-5f0daf918e6d')
def test_create_flavor_with_uuid_id(self):
flavor_id = data_utils.rand_uuid()
new_flavor_id = self._create_flavor(flavor_id)
self.assertEqual(new_flavor_id, flavor_id)
- @test.idempotent_id('f83fe669-6758-448a-a85e-32d351f36fe0')
+ @decorators.idempotent_id('f83fe669-6758-448a-a85e-32d351f36fe0')
def test_create_flavor_with_none_id(self):
# If nova receives a request with None as flavor_id,
# nova generates flavor_id of uuid.
@@ -103,7 +104,7 @@
new_flavor_id = self._create_flavor(flavor_id)
self.assertEqual(new_flavor_id, str(uuid.UUID(new_flavor_id)))
- @test.idempotent_id('8261d7b0-be58-43ec-a2e5-300573c3f6c5')
+ @decorators.idempotent_id('8261d7b0-be58-43ec-a2e5-300573c3f6c5')
def test_create_flavor_verify_entry_in_list_details(self):
# Create a flavor and ensure it's details are listed
# This operation requires the user to have 'admin' role
@@ -127,7 +128,7 @@
flag = True
self.assertTrue(flag)
- @test.idempotent_id('63dc64e6-2e79-4fdf-868f-85500d308d66')
+ @decorators.idempotent_id('63dc64e6-2e79-4fdf-868f-85500d308d66')
def test_create_list_flavor_without_extra_data(self):
# Create a flavor and ensure it is listed
# This operation requires the user to have 'admin' role
@@ -169,7 +170,7 @@
flag = True
self.assertTrue(flag)
- @test.idempotent_id('be6cc18c-7c5d-48c0-ac16-17eaf03c54eb')
+ @decorators.idempotent_id('be6cc18c-7c5d-48c0-ac16-17eaf03c54eb')
def test_list_non_public_flavor(self):
# Create a flavor with os-flavor-access:is_public false.
# The flavor should not be present in list_details as the
@@ -201,7 +202,7 @@
flag = True
self.assertFalse(flag)
- @test.idempotent_id('bcc418ef-799b-47cc-baa1-ce01368b8987')
+ @decorators.idempotent_id('bcc418ef-799b-47cc-baa1-ce01368b8987')
def test_create_server_with_non_public_flavor(self):
# Create a flavor with os-flavor-access:is_public false
flavor_name = data_utils.rand_name(self.flavor_name_prefix)
@@ -221,7 +222,7 @@
name='test', imageRef=self.image_ref,
flavorRef=flavor['id'])
- @test.idempotent_id('b345b196-bfbd-4231-8ac1-6d7fe15ff3a3')
+ @decorators.idempotent_id('b345b196-bfbd-4231-8ac1-6d7fe15ff3a3')
def test_list_public_flavor_with_other_user(self):
# Create a Flavor with public access.
# Try to List/Get flavor with another user
@@ -244,7 +245,7 @@
flag = True
self.assertTrue(flag)
- @test.idempotent_id('fb9cbde6-3a0e-41f2-a983-bdb0a823c44e')
+ @decorators.idempotent_id('fb9cbde6-3a0e-41f2-a983-bdb0a823c44e')
def test_is_public_string_variations(self):
flavor_id_not_public = data_utils.rand_int_id(start=1000)
flavor_name_not_public = data_utils.rand_name(self.flavor_name_prefix)
@@ -287,7 +288,7 @@
_test_string_variations(['t', 'true', 'yes', '1'],
flavor_name_public)
- @test.idempotent_id('3b541a2e-2ac2-4b42-8b8d-ba6e22fcd4da')
+ @decorators.idempotent_id('3b541a2e-2ac2-4b42-8b8d-ba6e22fcd4da')
def test_create_flavor_using_string_ram(self):
flavor_name = data_utils.rand_name(self.flavor_name_prefix)
new_flavor_id = data_utils.rand_int_id(start=1000)
diff --git a/tempest/api/compute/admin/test_flavors_access.py b/tempest/api/compute/admin/test_flavors_access.py
index 2063267..38ff4c0 100644
--- a/tempest/api/compute/admin/test_flavors_access.py
+++ b/tempest/api/compute/admin/test_flavors_access.py
@@ -15,6 +15,7 @@
from tempest.api.compute import base
from tempest.common.utils import data_utils
+from tempest.lib import decorators
from tempest import test
@@ -47,7 +48,7 @@
cls.vcpus = 1
cls.disk = 10
- @test.idempotent_id('ea2c2211-29fa-4db9-97c3-906d36fad3e0')
+ @decorators.idempotent_id('ea2c2211-29fa-4db9-97c3-906d36fad3e0')
def test_flavor_access_list_with_private_flavor(self):
# Test to make sure that list flavor access on a newly created
# private flavor will return an empty access list
@@ -63,7 +64,7 @@
['flavor_access'])
self.assertEqual(len(flavor_access), 0, str(flavor_access))
- @test.idempotent_id('59e622f6-bdf6-45e3-8ba8-fedad905a6b4')
+ @decorators.idempotent_id('59e622f6-bdf6-45e3-8ba8-fedad905a6b4')
def test_flavor_access_add_remove(self):
# Test to add and remove flavor access to a given tenant.
flavor_name = data_utils.rand_name(self.flavor_name_prefix)
diff --git a/tempest/api/compute/admin/test_flavors_access_negative.py b/tempest/api/compute/admin/test_flavors_access_negative.py
index 1b7eb12..2719cc4 100644
--- a/tempest/api/compute/admin/test_flavors_access_negative.py
+++ b/tempest/api/compute/admin/test_flavors_access_negative.py
@@ -15,6 +15,7 @@
from tempest.api.compute import base
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 @@
cls.disk = 10
@test.attr(type=['negative'])
- @test.idempotent_id('0621c53e-d45d-40e7-951d-43e5e257b272')
+ @decorators.idempotent_id('0621c53e-d45d-40e7-951d-43e5e257b272')
def test_flavor_access_list_with_public_flavor(self):
# Test to list flavor access with exceptions by querying public flavor
flavor_name = data_utils.rand_name(self.flavor_name_prefix)
@@ -64,7 +65,7 @@
new_flavor_id)
@test.attr(type=['negative'])
- @test.idempotent_id('41eaaade-6d37-4f28-9c74-f21b46ca67bd')
+ @decorators.idempotent_id('41eaaade-6d37-4f28-9c74-f21b46ca67bd')
def test_flavor_non_admin_add(self):
# Test to add flavor access as a user without admin privileges.
flavor_name = data_utils.rand_name(self.flavor_name_prefix)
@@ -81,7 +82,7 @@
self.tenant_id)
@test.attr(type=['negative'])
- @test.idempotent_id('073e79a6-c311-4525-82dc-6083d919cb3a')
+ @decorators.idempotent_id('073e79a6-c311-4525-82dc-6083d919cb3a')
def test_flavor_non_admin_remove(self):
# Test to remove flavor access as a user without admin privileges.
flavor_name = data_utils.rand_name(self.flavor_name_prefix)
@@ -102,7 +103,7 @@
self.tenant_id)
@test.attr(type=['negative'])
- @test.idempotent_id('f3592cc0-0306-483c-b210-9a7b5346eddc')
+ @decorators.idempotent_id('f3592cc0-0306-483c-b210-9a7b5346eddc')
def test_add_flavor_access_duplicate(self):
# Create a new flavor.
flavor_name = data_utils.rand_name(self.flavor_name_prefix)
@@ -127,7 +128,7 @@
self.tenant_id)
@test.attr(type=['negative'])
- @test.idempotent_id('1f710927-3bc7-4381-9f82-0ca6e42644b7')
+ @decorators.idempotent_id('1f710927-3bc7-4381-9f82-0ca6e42644b7')
def test_remove_flavor_access_not_found(self):
# Create a new flavor.
flavor_name = data_utils.rand_name(self.flavor_name_prefix)
diff --git a/tempest/api/compute/admin/test_flavors_extra_specs.py b/tempest/api/compute/admin/test_flavors_extra_specs.py
index 661cd18..70e662c 100644
--- a/tempest/api/compute/admin/test_flavors_extra_specs.py
+++ b/tempest/api/compute/admin/test_flavors_extra_specs.py
@@ -15,6 +15,7 @@
from tempest.api.compute import base
from tempest.common.utils import data_utils
+from tempest.lib import decorators
from tempest import test
@@ -63,7 +64,7 @@
cls.client.wait_for_resource_deletion(cls.flavor['id'])
super(FlavorsExtraSpecsTestJSON, cls).resource_cleanup()
- @test.idempotent_id('0b2f9d4b-1ca2-4b99-bb40-165d4bb94208')
+ @decorators.idempotent_id('0b2f9d4b-1ca2-4b99-bb40-165d4bb94208')
def test_flavor_set_get_update_show_unset_keys(self):
# Test to SET, GET, UPDATE, SHOW, UNSET flavor extra
# spec as a user with admin privileges.
@@ -95,7 +96,7 @@
self.client.unset_flavor_extra_spec(self.flavor['id'], "key1")
self.client.unset_flavor_extra_spec(self.flavor['id'], "key2")
- @test.idempotent_id('a99dad88-ae1c-4fba-aeb4-32f898218bd0')
+ @decorators.idempotent_id('a99dad88-ae1c-4fba-aeb4-32f898218bd0')
def test_flavor_non_admin_get_all_keys(self):
specs = {"key1": "value1", "key2": "value2"}
self.client.set_flavor_extra_spec(self.flavor['id'], **specs)
@@ -105,7 +106,7 @@
for key in specs:
self.assertEqual(body[key], specs[key])
- @test.idempotent_id('12805a7f-39a3-4042-b989-701d5cad9c90')
+ @decorators.idempotent_id('12805a7f-39a3-4042-b989-701d5cad9c90')
def test_flavor_non_admin_get_specific_key(self):
body = self.client.set_flavor_extra_spec(self.flavor['id'],
key1="value1",
diff --git a/tempest/api/compute/admin/test_flavors_extra_specs_negative.py b/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
index 7eb4bbf..767a1ca 100644
--- a/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
+++ b/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
@@ -16,6 +16,7 @@
from tempest.api.compute import base
from tempest.common.utils import data_utils
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -66,7 +67,7 @@
super(FlavorsExtraSpecsNegativeTestJSON, cls).resource_cleanup()
@test.attr(type=['negative'])
- @test.idempotent_id('a00a3b81-5641-45a8-ab2b-4a8ec41e1d7d')
+ @decorators.idempotent_id('a00a3b81-5641-45a8-ab2b-4a8ec41e1d7d')
def test_flavor_non_admin_set_keys(self):
# Test to SET flavor extra spec as a user without admin privileges.
self.assertRaises(lib_exc.Forbidden,
@@ -75,7 +76,7 @@
key1="value1", key2="value2")
@test.attr(type=['negative'])
- @test.idempotent_id('1ebf4ef8-759e-48fe-a801-d451d80476fb')
+ @decorators.idempotent_id('1ebf4ef8-759e-48fe-a801-d451d80476fb')
def test_flavor_non_admin_update_specific_key(self):
# non admin user is not allowed to update flavor extra spec
body = self.client.set_flavor_extra_spec(
@@ -89,7 +90,7 @@
key1='value1_new')
@test.attr(type=['negative'])
- @test.idempotent_id('28f12249-27c7-44c1-8810-1f382f316b11')
+ @decorators.idempotent_id('28f12249-27c7-44c1-8810-1f382f316b11')
def test_flavor_non_admin_unset_keys(self):
self.client.set_flavor_extra_spec(self.flavor['id'],
key1="value1", key2="value2")
@@ -100,7 +101,7 @@
'key1')
@test.attr(type=['negative'])
- @test.idempotent_id('440b9f3f-3c7f-4293-a106-0ceda350f8de')
+ @decorators.idempotent_id('440b9f3f-3c7f-4293-a106-0ceda350f8de')
def test_flavor_unset_nonexistent_key(self):
self.assertRaises(lib_exc.NotFound,
self.client.unset_flavor_extra_spec,
@@ -108,7 +109,7 @@
'nonexistent_key')
@test.attr(type=['negative'])
- @test.idempotent_id('329a7be3-54b2-48be-8052-bf2ce4afd898')
+ @decorators.idempotent_id('329a7be3-54b2-48be-8052-bf2ce4afd898')
def test_flavor_get_nonexistent_key(self):
self.assertRaises(lib_exc.NotFound,
self.flavors_client.show_flavor_extra_spec,
@@ -116,7 +117,7 @@
"nonexistent_key")
@test.attr(type=['negative'])
- @test.idempotent_id('25b822b8-9f49-44f6-80de-d99f0482e5cb')
+ @decorators.idempotent_id('25b822b8-9f49-44f6-80de-d99f0482e5cb')
def test_flavor_update_mismatch_key(self):
# the key will be updated should be match the key in the body
self.assertRaises(lib_exc.BadRequest,
@@ -126,7 +127,7 @@
key1="value")
@test.attr(type=['negative'])
- @test.idempotent_id('f5889590-bf66-41cc-b4b1-6e6370cfd93f')
+ @decorators.idempotent_id('f5889590-bf66-41cc-b4b1-6e6370cfd93f')
def test_flavor_update_more_key(self):
# there should be just one item in the request body
self.assertRaises(lib_exc.BadRequest,
diff --git a/tempest/api/compute/admin/test_floating_ips_bulk.py b/tempest/api/compute/admin/test_floating_ips_bulk.py
index a4695b0..f38af56 100644
--- a/tempest/api/compute/admin/test_floating_ips_bulk.py
+++ b/tempest/api/compute/admin/test_floating_ips_bulk.py
@@ -18,6 +18,7 @@
from tempest.api.compute import base
from tempest import config
from tempest.lib.common.utils import test_utils
+from tempest.lib import decorators
from tempest.lib import exceptions
from tempest import test
@@ -55,7 +56,7 @@
raise exceptions.InvalidConfiguration(msg)
return
- @test.idempotent_id('2c8f145f-8012-4cb8-ac7e-95a587f0e4ab')
+ @decorators.idempotent_id('2c8f145f-8012-4cb8-ac7e-95a587f0e4ab')
@test.services('network')
def test_create_list_delete_floating_ips_bulk(self):
# Create, List and delete the Floating IPs Bulk
diff --git a/tempest/api/compute/admin/test_hosts.py b/tempest/api/compute/admin/test_hosts.py
index 3797b29..b664955 100644
--- a/tempest/api/compute/admin/test_hosts.py
+++ b/tempest/api/compute/admin/test_hosts.py
@@ -14,7 +14,7 @@
from tempest.api.compute import base
from tempest.common import tempest_fixtures as fixtures
-from tempest import test
+from tempest.lib import decorators
class HostsAdminTestJSON(base.BaseV2ComputeAdminTest):
@@ -25,12 +25,12 @@
super(HostsAdminTestJSON, cls).setup_clients()
cls.client = cls.os_adm.hosts_client
- @test.idempotent_id('9bfaf98d-e2cb-44b0-a07e-2558b2821e4f')
+ @decorators.idempotent_id('9bfaf98d-e2cb-44b0-a07e-2558b2821e4f')
def test_list_hosts(self):
hosts = self.client.list_hosts()['hosts']
self.assertGreaterEqual(len(hosts), 2, str(hosts))
- @test.idempotent_id('5dc06f5b-d887-47a2-bb2a-67762ef3c6de')
+ @decorators.idempotent_id('5dc06f5b-d887-47a2-bb2a-67762ef3c6de')
def test_list_hosts_with_zone(self):
self.useFixture(fixtures.LockFixture('availability_zone'))
hosts = self.client.list_hosts()['hosts']
@@ -39,21 +39,21 @@
self.assertGreaterEqual(len(hosts), 1)
self.assertIn(host, hosts)
- @test.idempotent_id('9af3c171-fbf4-4150-a624-22109733c2a6')
+ @decorators.idempotent_id('9af3c171-fbf4-4150-a624-22109733c2a6')
def test_list_hosts_with_a_blank_zone(self):
# If send the request with a blank zone, the request will be successful
# and it will return all the hosts list
hosts = self.client.list_hosts(zone='')['hosts']
self.assertNotEqual(0, len(hosts))
- @test.idempotent_id('c6ddbadb-c94e-4500-b12f-8ffc43843ff8')
+ @decorators.idempotent_id('c6ddbadb-c94e-4500-b12f-8ffc43843ff8')
def test_list_hosts_with_nonexistent_zone(self):
# If send the request with a nonexistent zone, the request will be
# successful and no hosts will be returned
hosts = self.client.list_hosts(zone='xxx')['hosts']
self.assertEqual(0, len(hosts))
- @test.idempotent_id('38adbb12-aee2-4498-8aec-329c72423aa4')
+ @decorators.idempotent_id('38adbb12-aee2-4498-8aec-329c72423aa4')
def test_show_host_detail(self):
hosts = self.client.list_hosts()['hosts']
diff --git a/tempest/api/compute/admin/test_hosts_negative.py b/tempest/api/compute/admin/test_hosts_negative.py
index 3821b22..07ab8c5 100644
--- a/tempest/api/compute/admin/test_hosts_negative.py
+++ b/tempest/api/compute/admin/test_hosts_negative.py
@@ -13,6 +13,7 @@
# under the License.
from tempest.api.compute import base
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -35,26 +36,26 @@
cls.hostname = hosts[0]['host_name']
@test.attr(type=['negative'])
- @test.idempotent_id('dd032027-0210-4d9c-860e-69b1b8deed5f')
+ @decorators.idempotent_id('dd032027-0210-4d9c-860e-69b1b8deed5f')
def test_list_hosts_with_non_admin_user(self):
self.assertRaises(lib_exc.Forbidden,
self.non_admin_client.list_hosts)
@test.attr(type=['negative'])
- @test.idempotent_id('e75b0a1a-041f-47a1-8b4a-b72a6ff36d3f')
+ @decorators.idempotent_id('e75b0a1a-041f-47a1-8b4a-b72a6ff36d3f')
def test_show_host_detail_with_nonexistent_hostname(self):
self.assertRaises(lib_exc.NotFound,
self.client.show_host, 'nonexistent_hostname')
@test.attr(type=['negative'])
- @test.idempotent_id('19ebe09c-bfd4-4b7c-81a2-e2e0710f59cc')
+ @decorators.idempotent_id('19ebe09c-bfd4-4b7c-81a2-e2e0710f59cc')
def test_show_host_detail_with_non_admin_user(self):
self.assertRaises(lib_exc.Forbidden,
self.non_admin_client.show_host,
self.hostname)
@test.attr(type=['negative'])
- @test.idempotent_id('e40c72b1-0239-4ed6-ba21-81a184df1f7c')
+ @decorators.idempotent_id('e40c72b1-0239-4ed6-ba21-81a184df1f7c')
def test_update_host_with_non_admin_user(self):
self.assertRaises(lib_exc.Forbidden,
self.non_admin_client.update_host,
@@ -63,7 +64,7 @@
maintenance_mode='enable')
@test.attr(type=['negative'])
- @test.idempotent_id('fbe2bf3e-3246-4a95-a59f-94e4e298ec77')
+ @decorators.idempotent_id('fbe2bf3e-3246-4a95-a59f-94e4e298ec77')
def test_update_host_with_invalid_status(self):
# 'status' can only be 'enable' or 'disable'
self.assertRaises(lib_exc.BadRequest,
@@ -73,7 +74,7 @@
maintenance_mode='enable')
@test.attr(type=['negative'])
- @test.idempotent_id('ab1e230e-5e22-41a9-8699-82b9947915d4')
+ @decorators.idempotent_id('ab1e230e-5e22-41a9-8699-82b9947915d4')
def test_update_host_with_invalid_maintenance_mode(self):
# 'maintenance_mode' can only be 'enable' or 'disable'
self.assertRaises(lib_exc.BadRequest,
@@ -83,7 +84,7 @@
maintenance_mode='invalid')
@test.attr(type=['negative'])
- @test.idempotent_id('0cd85f75-6992-4a4a-b1bd-d11e37fd0eee')
+ @decorators.idempotent_id('0cd85f75-6992-4a4a-b1bd-d11e37fd0eee')
def test_update_host_without_param(self):
# 'status' or 'maintenance_mode' needed for host update
self.assertRaises(lib_exc.BadRequest,
@@ -91,7 +92,7 @@
self.hostname)
@test.attr(type=['negative'])
- @test.idempotent_id('23c92146-2100-4d68-b2d6-c7ade970c9c1')
+ @decorators.idempotent_id('23c92146-2100-4d68-b2d6-c7ade970c9c1')
def test_update_nonexistent_host(self):
self.assertRaises(lib_exc.NotFound,
self.client.update_host,
@@ -100,42 +101,42 @@
maintenance_mode='enable')
@test.attr(type=['negative'])
- @test.idempotent_id('0d981ac3-4320-4898-b674-82b61fbb60e4')
+ @decorators.idempotent_id('0d981ac3-4320-4898-b674-82b61fbb60e4')
def test_startup_nonexistent_host(self):
self.assertRaises(lib_exc.NotFound,
self.client.startup_host,
'nonexistent_hostname')
@test.attr(type=['negative'])
- @test.idempotent_id('9f4ebb7e-b2ae-4e5b-a38f-0fd1bb0ddfca')
+ @decorators.idempotent_id('9f4ebb7e-b2ae-4e5b-a38f-0fd1bb0ddfca')
def test_startup_host_with_non_admin_user(self):
self.assertRaises(lib_exc.Forbidden,
self.non_admin_client.startup_host,
self.hostname)
@test.attr(type=['negative'])
- @test.idempotent_id('9e637444-29cf-4244-88c8-831ae82c31b6')
+ @decorators.idempotent_id('9e637444-29cf-4244-88c8-831ae82c31b6')
def test_shutdown_nonexistent_host(self):
self.assertRaises(lib_exc.NotFound,
self.client.shutdown_host,
'nonexistent_hostname')
@test.attr(type=['negative'])
- @test.idempotent_id('a803529c-7e3f-4d3c-a7d6-8e1c203d27f6')
+ @decorators.idempotent_id('a803529c-7e3f-4d3c-a7d6-8e1c203d27f6')
def test_shutdown_host_with_non_admin_user(self):
self.assertRaises(lib_exc.Forbidden,
self.non_admin_client.shutdown_host,
self.hostname)
@test.attr(type=['negative'])
- @test.idempotent_id('f86bfd7b-0b13-4849-ae29-0322e83ee58b')
+ @decorators.idempotent_id('f86bfd7b-0b13-4849-ae29-0322e83ee58b')
def test_reboot_nonexistent_host(self):
self.assertRaises(lib_exc.NotFound,
self.client.reboot_host,
'nonexistent_hostname')
@test.attr(type=['negative'])
- @test.idempotent_id('02d79bb9-eb57-4612-abf6-2cb38897d2f8')
+ @decorators.idempotent_id('02d79bb9-eb57-4612-abf6-2cb38897d2f8')
def test_reboot_host_with_non_admin_user(self):
self.assertRaises(lib_exc.Forbidden,
self.non_admin_client.reboot_host,
diff --git a/tempest/api/compute/admin/test_hypervisor.py b/tempest/api/compute/admin/test_hypervisor.py
index 1f043dc..4637024 100644
--- a/tempest/api/compute/admin/test_hypervisor.py
+++ b/tempest/api/compute/admin/test_hypervisor.py
@@ -14,7 +14,7 @@
# under the License.
from tempest.api.compute import base
-from tempest import test
+from tempest.lib import decorators
class HypervisorAdminTestJSON(base.BaseV2ComputeAdminTest):
@@ -33,19 +33,19 @@
def assertHypervisors(self, hypers):
self.assertGreater(len(hypers), 0, "No hypervisors found: %s" % hypers)
- @test.idempotent_id('7f0ceacd-c64d-4e96-b8ee-d02943142cc5')
+ @decorators.idempotent_id('7f0ceacd-c64d-4e96-b8ee-d02943142cc5')
def test_get_hypervisor_list(self):
# List of hypervisor and available hypervisors hostname
hypers = self._list_hypervisors()
self.assertHypervisors(hypers)
- @test.idempotent_id('1e7fdac2-b672-4ad1-97a4-bad0e3030118')
+ @decorators.idempotent_id('1e7fdac2-b672-4ad1-97a4-bad0e3030118')
def test_get_hypervisor_list_details(self):
# Display the details of the all hypervisor
hypers = self.client.list_hypervisors(detail=True)['hypervisors']
self.assertHypervisors(hypers)
- @test.idempotent_id('94ff9eae-a183-428e-9cdb-79fde71211cc')
+ @decorators.idempotent_id('94ff9eae-a183-428e-9cdb-79fde71211cc')
def test_get_hypervisor_show_details(self):
# Display the details of the specified hypervisor
hypers = self._list_hypervisors()
@@ -56,7 +56,7 @@
self.assertEqual(details['hypervisor_hostname'],
hypers[0]['hypervisor_hostname'])
- @test.idempotent_id('e81bba3f-6215-4e39-a286-d52d2f906862')
+ @decorators.idempotent_id('e81bba3f-6215-4e39-a286-d52d2f906862')
def test_get_hypervisor_show_servers(self):
# Show instances about the specific hypervisors
hypers = self._list_hypervisors()
@@ -67,14 +67,14 @@
['hypervisors'])
self.assertGreater(len(hypervisors), 0)
- @test.idempotent_id('797e4f28-b6e0-454d-a548-80cc77c00816')
+ @decorators.idempotent_id('797e4f28-b6e0-454d-a548-80cc77c00816')
def test_get_hypervisor_stats(self):
# Verify the stats of the all hypervisor
stats = (self.client.show_hypervisor_statistics()
['hypervisor_statistics'])
self.assertGreater(len(stats), 0)
- @test.idempotent_id('91a50d7d-1c2b-4f24-b55a-a1fe20efca70')
+ @decorators.idempotent_id('91a50d7d-1c2b-4f24-b55a-a1fe20efca70')
def test_get_hypervisor_uptime(self):
# Verify that GET shows the specified hypervisor uptime
hypers = self._list_hypervisors()
@@ -113,7 +113,7 @@
has_valid_uptime,
"None of the hypervisors had a valid uptime: %s" % hypers)
- @test.idempotent_id('d7e1805b-3b14-4a3b-b6fd-50ec6d9f361f')
+ @decorators.idempotent_id('d7e1805b-3b14-4a3b-b6fd-50ec6d9f361f')
def test_search_hypervisor(self):
hypers = self._list_hypervisors()
self.assertHypervisors(hypers)
diff --git a/tempest/api/compute/admin/test_hypervisor_negative.py b/tempest/api/compute/admin/test_hypervisor_negative.py
index 0f35e14..1a37312 100644
--- a/tempest/api/compute/admin/test_hypervisor_negative.py
+++ b/tempest/api/compute/admin/test_hypervisor_negative.py
@@ -15,6 +15,7 @@
from tempest.api.compute import base
from tempest.common.utils import data_utils
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -34,7 +35,7 @@
return hypers
@test.attr(type=['negative'])
- @test.idempotent_id('c136086a-0f67-4b2b-bc61-8482bd68989f')
+ @decorators.idempotent_id('c136086a-0f67-4b2b-bc61-8482bd68989f')
def test_show_nonexistent_hypervisor(self):
nonexistent_hypervisor_id = data_utils.rand_uuid()
@@ -44,7 +45,7 @@
nonexistent_hypervisor_id)
@test.attr(type=['negative'])
- @test.idempotent_id('51e663d0-6b89-4817-a465-20aca0667d03')
+ @decorators.idempotent_id('51e663d0-6b89-4817-a465-20aca0667d03')
def test_show_hypervisor_with_non_admin_user(self):
hypers = self._list_hypervisors()
self.assertGreater(len(hypers), 0)
@@ -55,7 +56,7 @@
hypers[0]['id'])
@test.attr(type=['negative'])
- @test.idempotent_id('2a0a3938-832e-4859-95bf-1c57c236b924')
+ @decorators.idempotent_id('2a0a3938-832e-4859-95bf-1c57c236b924')
def test_show_servers_with_non_admin_user(self):
hypers = self._list_hypervisors()
self.assertGreater(len(hypers), 0)
@@ -66,7 +67,7 @@
hypers[0]['id'])
@test.attr(type=['negative'])
- @test.idempotent_id('02463d69-0ace-4d33-a4a8-93d7883a2bba')
+ @decorators.idempotent_id('02463d69-0ace-4d33-a4a8-93d7883a2bba')
def test_show_servers_with_nonexistent_hypervisor(self):
nonexistent_hypervisor_id = data_utils.rand_uuid()
@@ -76,14 +77,14 @@
nonexistent_hypervisor_id)
@test.attr(type=['negative'])
- @test.idempotent_id('e2b061bb-13f9-40d8-9d6e-d5bf17595849')
+ @decorators.idempotent_id('e2b061bb-13f9-40d8-9d6e-d5bf17595849')
def test_get_hypervisor_stats_with_non_admin_user(self):
self.assertRaises(
lib_exc.Forbidden,
self.non_adm_client.show_hypervisor_statistics)
@test.attr(type=['negative'])
- @test.idempotent_id('f60aa680-9a3a-4c7d-90e1-fae3a4891303')
+ @decorators.idempotent_id('f60aa680-9a3a-4c7d-90e1-fae3a4891303')
def test_get_nonexistent_hypervisor_uptime(self):
nonexistent_hypervisor_id = data_utils.rand_uuid()
@@ -93,7 +94,7 @@
nonexistent_hypervisor_id)
@test.attr(type=['negative'])
- @test.idempotent_id('6c3461f9-c04c-4e2a-bebb-71dc9cb47df2')
+ @decorators.idempotent_id('6c3461f9-c04c-4e2a-bebb-71dc9cb47df2')
def test_get_hypervisor_uptime_with_non_admin_user(self):
hypers = self._list_hypervisors()
self.assertGreater(len(hypers), 0)
@@ -104,7 +105,7 @@
hypers[0]['id'])
@test.attr(type=['negative'])
- @test.idempotent_id('51b3d536-9b14-409c-9bce-c6f7c794994e')
+ @decorators.idempotent_id('51b3d536-9b14-409c-9bce-c6f7c794994e')
def test_get_hypervisor_list_with_non_admin_user(self):
# List of hypervisor and available services with non admin user
self.assertRaises(
@@ -112,7 +113,7 @@
self.non_adm_client.list_hypervisors)
@test.attr(type=['negative'])
- @test.idempotent_id('dc02db05-e801-4c5f-bc8e-d915290ab345')
+ @decorators.idempotent_id('dc02db05-e801-4c5f-bc8e-d915290ab345')
def test_get_hypervisor_list_details_with_non_admin_user(self):
# List of hypervisor details and available services with non admin user
self.assertRaises(
@@ -120,7 +121,7 @@
self.non_adm_client.list_hypervisors, detail=True)
@test.attr(type=['negative'])
- @test.idempotent_id('19a45cc1-1000-4055-b6d2-28e8b2ec4faa')
+ @decorators.idempotent_id('19a45cc1-1000-4055-b6d2-28e8b2ec4faa')
def test_search_nonexistent_hypervisor(self):
self.assertRaises(
lib_exc.NotFound,
@@ -128,7 +129,7 @@
'nonexistent_hypervisor_name')
@test.attr(type=['negative'])
- @test.idempotent_id('5b6a6c79-5dc1-4fa5-9c58-9c8085948e74')
+ @decorators.idempotent_id('5b6a6c79-5dc1-4fa5-9c58-9c8085948e74')
def test_search_hypervisor_with_non_admin_user(self):
hypers = self._list_hypervisors()
self.assertGreater(len(hypers), 0)
diff --git a/tempest/api/compute/admin/test_instance_usage_audit_log.py b/tempest/api/compute/admin/test_instance_usage_audit_log.py
index 6976783..b613a26 100644
--- a/tempest/api/compute/admin/test_instance_usage_audit_log.py
+++ b/tempest/api/compute/admin/test_instance_usage_audit_log.py
@@ -18,7 +18,7 @@
from six.moves.urllib import parse as urllib
from tempest.api.compute import base
-from tempest import test
+from tempest.lib import decorators
class InstanceUsageAuditLogTestJSON(base.BaseV2ComputeAdminTest):
@@ -28,7 +28,7 @@
super(InstanceUsageAuditLogTestJSON, cls).setup_clients()
cls.adm_client = cls.os_adm.instance_usages_audit_log_client
- @test.idempotent_id('25319919-33d9-424f-9f99-2c203ee48b9d')
+ @decorators.idempotent_id('25319919-33d9-424f-9f99-2c203ee48b9d')
def test_list_instance_usage_audit_logs(self):
# list instance usage audit logs
body = (self.adm_client.list_instance_usage_audit_logs()
@@ -41,7 +41,7 @@
for item in expected_items:
self.assertIn(item, body)
- @test.idempotent_id('6e40459d-7c5f-400b-9e83-449fbc8e7feb')
+ @decorators.idempotent_id('6e40459d-7c5f-400b-9e83-449fbc8e7feb')
def test_get_instance_usage_audit_log(self):
# Get instance usage audit log before specified time
now = datetime.datetime.now()
diff --git a/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py b/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py
index b908502..16c39c4 100644
--- a/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py
+++ b/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py
@@ -18,6 +18,7 @@
from six.moves.urllib import parse as urllib
from tempest.api.compute import base
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -30,7 +31,7 @@
cls.adm_client = cls.os_adm.instance_usages_audit_log_client
@test.attr(type=['negative'])
- @test.idempotent_id('a9d33178-d2c9-4131-ad3b-f4ca8d0308a2')
+ @decorators.idempotent_id('a9d33178-d2c9-4131-ad3b-f4ca8d0308a2')
def test_instance_usage_audit_logs_with_nonadmin_user(self):
# the instance_usage_audit_logs API just can be accessed by admin user
self.assertRaises(lib_exc.Forbidden,
@@ -43,7 +44,7 @@
urllib.quote(now.strftime("%Y-%m-%d %H:%M:%S")))
@test.attr(type=['negative'])
- @test.idempotent_id('9b952047-3641-41c7-ba91-a809fc5974c8')
+ @decorators.idempotent_id('9b952047-3641-41c7-ba91-a809fc5974c8')
def test_get_instance_usage_audit_logs_with_invalid_time(self):
self.assertRaises(lib_exc.BadRequest,
self.adm_client.show_instance_usage_audit_log,
diff --git a/tempest/api/compute/admin/test_keypairs_v210.py b/tempest/api/compute/admin/test_keypairs_v210.py
index 9011433..82d3bae 100644
--- a/tempest/api/compute/admin/test_keypairs_v210.py
+++ b/tempest/api/compute/admin/test_keypairs_v210.py
@@ -15,7 +15,7 @@
from tempest.api.compute.keypairs import base
from tempest.common.utils import data_utils
-from tempest import test
+from tempest.lib import decorators
class KeyPairsV210TestJSON(base.BaseKeypairTest):
@@ -30,7 +30,7 @@
def _create_and_check_keypairs(self, user_id):
key_list = list()
- for i in range(2):
+ for _ in range(2):
k_name = data_utils.rand_name('keypair')
keypair = self.create_keypair(k_name,
keypair_type='ssh',
@@ -45,7 +45,7 @@
key_list.append(keypair)
return key_list
- @test.idempotent_id('3c8484af-cfb3-48f6-b8ba-d5d58bbf3eac')
+ @decorators.idempotent_id('3c8484af-cfb3-48f6-b8ba-d5d58bbf3eac')
def test_admin_manage_keypairs_for_other_users(self):
user_id = self.non_admin_client.user_id
key_list = self._create_and_check_keypairs(user_id)
diff --git a/tempest/api/compute/admin/test_live_migration.py b/tempest/api/compute/admin/test_live_migration.py
index ff84945..39797f7 100644
--- a/tempest/api/compute/admin/test_live_migration.py
+++ b/tempest/api/compute/admin/test_live_migration.py
@@ -117,23 +117,23 @@
self.assertEqual(target_host, self._get_host_for_server(server_id),
msg)
- @test.idempotent_id('1dce86b8-eb04-4c03-a9d8-9c1dc3ee0c7b')
+ @decorators.idempotent_id('1dce86b8-eb04-4c03-a9d8-9c1dc3ee0c7b')
def test_live_block_migration(self):
self._test_live_migration()
- @test.idempotent_id('1e107f21-61b2-4988-8f22-b196e938ab88')
+ @decorators.idempotent_id('1e107f21-61b2-4988-8f22-b196e938ab88')
@testtools.skipUnless(CONF.compute_feature_enabled.pause,
'Pause is not available.')
def test_live_block_migration_paused(self):
self._test_live_migration(state='PAUSED')
@decorators.skip_because(bug="1524898")
- @test.idempotent_id('5071cf17-3004-4257-ae61-73a84e28badd')
+ @decorators.idempotent_id('5071cf17-3004-4257-ae61-73a84e28badd')
@test.services('volume')
def test_volume_backed_live_migration(self):
self._test_live_migration(volume_backed=True)
- @test.idempotent_id('e19c0cc6-6720-4ed8-be83-b6603ed5c812')
+ @decorators.idempotent_id('e19c0cc6-6720-4ed8-be83-b6603ed5c812')
@testtools.skipIf(not CONF.compute_feature_enabled.
block_migration_for_live_migration,
'Block Live migration not available')
diff --git a/tempest/api/compute/admin/test_migrations.py b/tempest/api/compute/admin/test_migrations.py
index 2dd2e89..21f5c68 100644
--- a/tempest/api/compute/admin/test_migrations.py
+++ b/tempest/api/compute/admin/test_migrations.py
@@ -18,8 +18,8 @@
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
+from tempest.lib import decorators
from tempest.lib import exceptions
-from tempest import test
CONF = config.CONF
@@ -33,12 +33,12 @@
cls.flavors_admin_client = cls.os_adm.flavors_client
cls.admin_servers_client = cls.os_adm.servers_client
- @test.idempotent_id('75c0b83d-72a0-4cf8-a153-631e83e7d53f')
+ @decorators.idempotent_id('75c0b83d-72a0-4cf8-a153-631e83e7d53f')
def test_list_migrations(self):
# Admin can get the migrations list
self.client.list_migrations()
- @test.idempotent_id('1b512062-8093-438e-b47a-37d2f597cd64')
+ @decorators.idempotent_id('1b512062-8093-438e-b47a-37d2f597cd64')
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
'Resize not available.')
def test_list_migrations_in_flavor_resize_situation(self):
@@ -60,7 +60,7 @@
except exceptions.NotFound:
pass
- @test.idempotent_id('33f1fec3-ba18-4470-8e4e-1d888e7c3593')
+ @decorators.idempotent_id('33f1fec3-ba18-4470-8e4e-1d888e7c3593')
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
'Resize not available.')
def test_resize_server_revert_deleted_flavor(self):
@@ -127,13 +127,13 @@
server['id'])['server']['OS-EXT-SRV-ATTR:host']
assert_func(src_host, dst_host)
- @test.idempotent_id('4bf0be52-3b6f-4746-9a27-3143636fe30d')
+ @decorators.idempotent_id('4bf0be52-3b6f-4746-9a27-3143636fe30d')
@testtools.skipUnless(CONF.compute_feature_enabled.cold_migration,
'Cold migration not available.')
def test_cold_migration(self):
self._test_cold_migrate_server(revert=False)
- @test.idempotent_id('caa1aa8b-f4ef-4374-be0d-95f001c2ac2d')
+ @decorators.idempotent_id('caa1aa8b-f4ef-4374-be0d-95f001c2ac2d')
@testtools.skipUnless(CONF.compute_feature_enabled.cold_migration,
'Cold migration not available.')
def test_revert_cold_migration(self):
diff --git a/tempest/api/compute/admin/test_networks.py b/tempest/api/compute/admin/test_networks.py
index 8504840..12ae864 100644
--- a/tempest/api/compute/admin/test_networks.py
+++ b/tempest/api/compute/admin/test_networks.py
@@ -15,7 +15,7 @@
from tempest.api.compute import base
from tempest import config
-from tempest import test
+from tempest.lib import decorators
CONF = config.CONF
@@ -32,7 +32,7 @@
super(NetworksTest, cls).setup_clients()
cls.client = cls.os_adm.compute_networks_client
- @test.idempotent_id('d206d211-8912-486f-86e2-a9d090d1f416')
+ @decorators.idempotent_id('d206d211-8912-486f-86e2-a9d090d1f416')
def test_get_network(self):
networks = self.client.list_networks()['networks']
if CONF.compute.fixed_network_name:
@@ -53,7 +53,7 @@
['network'])
self.assertEqual(configured_network['label'], network['label'])
- @test.idempotent_id('df3d1046-6fa5-4b2c-ad0c-cfa46a351cb9')
+ @decorators.idempotent_id('df3d1046-6fa5-4b2c-ad0c-cfa46a351cb9')
def test_list_all_networks(self):
networks = self.client.list_networks()['networks']
# Check the configured network is in the list
@@ -61,5 +61,5 @@
configured_network = CONF.compute.fixed_network_name
self.assertIn(configured_network, [x['label'] for x in networks])
else:
- network_name = map(lambda x: x['label'], networks)
- self.assertGreaterEqual(len(network_name), 1)
+ network_labels = [x['label'] for x in networks]
+ self.assertGreaterEqual(len(network_labels), 1)
diff --git a/tempest/api/compute/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index 33b9bef..3e9dc79 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -19,7 +19,7 @@
from tempest.api.compute import base
from tempest.common import tempest_fixtures as fixtures
from tempest.common.utils import data_utils
-from tempest import test
+from tempest.lib import decorators
LOG = logging.getLogger(__name__)
@@ -53,7 +53,7 @@
'instances', 'security_group_rules',
'cores', 'security_groups'))
- @test.idempotent_id('3b0a7c8f-cf58-46b8-a60c-715a32a8ba7d')
+ @decorators.idempotent_id('3b0a7c8f-cf58-46b8-a60c-715a32a8ba7d')
def test_get_default_quotas(self):
# Admin can get the default resource quota set for a tenant
expected_quota_set = self.default_quota_set | set(['id'])
@@ -63,7 +63,7 @@
for quota in expected_quota_set:
self.assertIn(quota, quota_set.keys())
- @test.idempotent_id('55fbe2bf-21a9-435b-bbd2-4162b0ed799a')
+ @decorators.idempotent_id('55fbe2bf-21a9-435b-bbd2-4162b0ed799a')
def test_update_all_quota_resources_for_tenant(self):
# Admin can update all the resource quota limits for a tenant
default_quota_set = self.adm_client.show_default_quota_set(
@@ -88,7 +88,7 @@
self.assertIn(quota, quota_set.keys())
# TODO(afazekas): merge these test cases
- @test.idempotent_id('ce9e0815-8091-4abd-8345-7fe5b85faa1d')
+ @decorators.idempotent_id('ce9e0815-8091-4abd-8345-7fe5b85faa1d')
def test_get_updated_quotas(self):
# Verify that GET shows the updated quota set of project
project_name = data_utils.rand_name('cpu_quota_project')
@@ -120,7 +120,7 @@
project_id, user_id=user_id)['quota_set']
self.assertEqual(2048, quota_set['ram'])
- @test.idempotent_id('389d04f0-3a41-405f-9317-e5f86e3c44f0')
+ @decorators.idempotent_id('389d04f0-3a41-405f-9317-e5f86e3c44f0')
def test_delete_quota(self):
# Admin can delete the resource quota set for a project
project_name = data_utils.rand_name('ram_quota_project')
@@ -164,7 +164,7 @@
# global state, and possibly needs to be part of a set of
# tests that get run all by themselves at the end under a
# 'danger' flag.
- @test.idempotent_id('7932ab0f-5136-4075-b201-c0e2338df51a')
+ @decorators.idempotent_id('7932ab0f-5136-4075-b201-c0e2338df51a')
def test_update_default_quotas(self):
LOG.debug("get the current 'default' quota class values")
body = (self.adm_client.show_quota_class_set('default')
diff --git a/tempest/api/compute/admin/test_quotas_negative.py b/tempest/api/compute/admin/test_quotas_negative.py
index 015e14d..0850205 100644
--- a/tempest/api/compute/admin/test_quotas_negative.py
+++ b/tempest/api/compute/admin/test_quotas_negative.py
@@ -52,7 +52,7 @@
**{quota_item: default_quota_value})
@test.attr(type=['negative'])
- @test.idempotent_id('733abfe8-166e-47bb-8363-23dbd7ff3476')
+ @decorators.idempotent_id('733abfe8-166e-47bb-8363-23dbd7ff3476')
def test_update_quota_normal_user(self):
self.assertRaises(lib_exc.Forbidden,
self.client.update_quota_set,
@@ -62,7 +62,7 @@
# TODO(afazekas): Add dedicated tenant to the skipped quota tests.
# It can be moved into the setUpClass as well.
@test.attr(type=['negative'])
- @test.idempotent_id('91058876-9947-4807-9f22-f6eb17140d9b')
+ @decorators.idempotent_id('91058876-9947-4807-9f22-f6eb17140d9b')
def test_create_server_when_cpu_quota_is_full(self):
# Disallow server creation when tenant's vcpu quota is full
self._update_quota('cores', 0)
@@ -70,7 +70,7 @@
self.create_test_server)
@test.attr(type=['negative'])
- @test.idempotent_id('6fdd7012-584d-4327-a61c-49122e0d5864')
+ @decorators.idempotent_id('6fdd7012-584d-4327-a61c-49122e0d5864')
def test_create_server_when_memory_quota_is_full(self):
# Disallow server creation when tenant's memory quota is full
self._update_quota('ram', 0)
@@ -78,7 +78,7 @@
self.create_test_server)
@test.attr(type=['negative'])
- @test.idempotent_id('7c6be468-0274-449a-81c3-ac1c32ee0161')
+ @decorators.idempotent_id('7c6be468-0274-449a-81c3-ac1c32ee0161')
def test_create_server_when_instances_quota_is_full(self):
# Once instances quota limit is reached, disallow server creation
self._update_quota('instances', 0)
@@ -87,7 +87,7 @@
@decorators.skip_because(bug="1186354",
condition=CONF.service_available.neutron)
- @test.idempotent_id('7c6c8f3b-2bf6-4918-b240-57b136a66aa0')
+ @decorators.idempotent_id('7c6c8f3b-2bf6-4918-b240-57b136a66aa0')
@test.services('network')
def test_security_groups_exceed_limit(self):
# Negative test: Creation Security Groups over limit should FAIL
@@ -106,7 +106,7 @@
@decorators.skip_because(bug="1186354",
condition=CONF.service_available.neutron)
@test.attr(type=['negative'])
- @test.idempotent_id('6e9f436d-f1ed-4f8e-a493-7275dfaa4b4d')
+ @decorators.idempotent_id('6e9f436d-f1ed-4f8e-a493-7275dfaa4b4d')
@test.services('network')
def test_security_groups_rules_exceed_limit(self):
# Negative test: Creation of Security Group Rules should FAIL
diff --git a/tempest/api/compute/admin/test_security_group_default_rules.py b/tempest/api/compute/admin/test_security_group_default_rules.py
index ce350b6..ab97bd4 100644
--- a/tempest/api/compute/admin/test_security_group_default_rules.py
+++ b/tempest/api/compute/admin/test_security_group_default_rules.py
@@ -16,8 +16,8 @@
from tempest.api.compute import base
from tempest import config
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
-from tempest import test
CONF = config.CONF
@@ -55,7 +55,7 @@
self.assertEqual(cidr, rule['ip_range']['cidr'])
return rule
- @test.idempotent_id('6d880615-eec3-4d29-97c5-7a074dde239d')
+ @decorators.idempotent_id('6d880615-eec3-4d29-97c5-7a074dde239d')
def test_create_delete_security_group_default_rules(self):
# Create and delete Security Group default rule
ip_protocols = ['tcp', 'udp', 'icmp']
@@ -67,7 +67,7 @@
self.adm_client.show_security_group_default_rule,
rule['id'])
- @test.idempotent_id('4d752e0a-33a1-4c3a-b498-ff8667ca22e5')
+ @decorators.idempotent_id('4d752e0a-33a1-4c3a-b498-ff8667ca22e5')
def test_create_security_group_default_rule_without_cidr(self):
ip_protocol = 'udp'
from_port = 80
@@ -81,7 +81,7 @@
self.assertNotEqual(0, rule['id'])
self.assertEqual('0.0.0.0/0', rule['ip_range']['cidr'])
- @test.idempotent_id('29f2d218-69b0-4a95-8f3d-6bd0ef732b3a')
+ @decorators.idempotent_id('29f2d218-69b0-4a95-8f3d-6bd0ef732b3a')
def test_create_security_group_default_rule_with_blank_cidr(self):
ip_protocol = 'icmp'
from_port = 10
@@ -97,7 +97,7 @@
self.assertNotEqual(0, rule['id'])
self.assertEqual('0.0.0.0/0', rule['ip_range']['cidr'])
- @test.idempotent_id('6e6de55e-9146-4ae0-89f2-3569586e0b9b')
+ @decorators.idempotent_id('6e6de55e-9146-4ae0-89f2-3569586e0b9b')
def test_security_group_default_rules_list(self):
ip_protocol = 'tcp'
from_port = 22
@@ -114,7 +114,7 @@
self.assertNotEqual(0, len(rules))
self.assertIn(rule, rules)
- @test.idempotent_id('15cbb349-86b4-4f71-a048-04b7ef3f150b')
+ @decorators.idempotent_id('15cbb349-86b4-4f71-a048-04b7ef3f150b')
def test_default_security_group_default_rule_show(self):
ip_protocol = 'tcp'
from_port = 22
diff --git a/tempest/api/compute/admin/test_security_groups.py b/tempest/api/compute/admin/test_security_groups.py
index e329869..2efe755 100644
--- a/tempest/api/compute/admin/test_security_groups.py
+++ b/tempest/api/compute/admin/test_security_groups.py
@@ -15,6 +15,7 @@
from tempest.api.compute import base
from tempest.common.utils import data_utils
+from tempest.lib import decorators
from tempest import test
@@ -32,14 +33,14 @@
else:
self.client.delete_security_group(securitygroup_id)
- @test.idempotent_id('49667619-5af9-4c63-ab5d-2cfdd1c8f7f1')
+ @decorators.idempotent_id('49667619-5af9-4c63-ab5d-2cfdd1c8f7f1')
@test.services('network')
def test_list_security_groups_list_all_tenants_filter(self):
# Admin can list security groups of all tenants
# List of all security groups created
security_group_list = []
# Create two security groups for a non-admin tenant
- for i in range(2):
+ for _ in range(2):
name = data_utils.rand_name('securitygroup')
description = data_utils.rand_name('description')
securitygroup = self.client.create_security_group(
@@ -50,7 +51,7 @@
client_tenant_id = securitygroup['tenant_id']
# Create two security groups for admin tenant
- for i in range(2):
+ for _ in range(2):
name = data_utils.rand_name('securitygroup')
description = data_utils.rand_name('description')
adm_securitygroup = self.adm_client.create_security_group(
diff --git a/tempest/api/compute/admin/test_servers.py b/tempest/api/compute/admin/test_servers.py
index a8a8b83..85c7fba 100644
--- a/tempest/api/compute/admin/test_servers.py
+++ b/tempest/api/compute/admin/test_servers.py
@@ -18,7 +18,6 @@
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest.lib import decorators
-from tempest import test
class ServersAdminTestJSON(base.BaseV2ComputeAdminTest):
@@ -44,7 +43,7 @@
wait_until='ACTIVE')
cls.s2_id = server['id']
- @test.idempotent_id('06f960bb-15bb-48dc-873d-f96e89be7870')
+ @decorators.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'}
@@ -60,14 +59,14 @@
self.assertIn(self.s1_id, map(lambda x: x['id'], servers))
self.assertNotIn(self.s2_id, map(lambda x: x['id'], servers))
- @test.idempotent_id('d56e9540-73ed-45e0-9b88-98fc419087eb')
+ @decorators.idempotent_id('d56e9540-73ed-45e0-9b88-98fc419087eb')
def test_list_servers_detailed_filter_by_invalid_status(self):
params = {'status': 'invalid_status'}
body = self.client.list_servers(detail=True, **params)
servers = body['servers']
self.assertEqual([], servers)
- @test.idempotent_id('51717b38-bdc1-458b-b636-1cf82d99f62f')
+ @decorators.idempotent_id('51717b38-bdc1-458b-b636-1cf82d99f62f')
def test_list_servers_by_admin(self):
# Listing servers by admin user returns a list which doesn't
# contain the other tenants' server by default
@@ -80,7 +79,7 @@
self.assertNotIn(self.s1_name, servers_name)
self.assertNotIn(self.s2_name, servers_name)
- @test.idempotent_id('9f5579ae-19b4-4985-a091-2a5d56106580')
+ @decorators.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
@@ -92,7 +91,7 @@
self.assertIn(self.s1_name, servers_name)
self.assertIn(self.s2_name, servers_name)
- @test.idempotent_id('7e5d6b8f-454a-4ba1-8ae2-da857af8338b')
+ @decorators.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
@@ -101,7 +100,7 @@
params = {'tenant_id': tenant_id}
body = self.client.list_servers(detail=True, **params)
servers = body['servers']
- servers_name = map(lambda x: x['name'], servers)
+ servers_name = [x['name'] for x in servers]
self.assertNotIn(self.s1_name, servers_name)
self.assertNotIn(self.s2_name, servers_name)
@@ -109,7 +108,7 @@
params = {'all_tenants': '', 'tenant_id': tenant_id}
body = self.client.list_servers(detail=True, **params)
servers = body['servers']
- servers_name = map(lambda x: x['name'], servers)
+ servers_name = [x['name'] for x in servers]
self.assertIn(self.s1_name, servers_name)
self.assertIn(self.s2_name, servers_name)
@@ -118,11 +117,11 @@
params = {'all_tenants': '', 'tenant_id': admin_tenant_id}
body = self.client.list_servers(detail=True, **params)
servers = body['servers']
- servers_name = map(lambda x: x['name'], servers)
+ servers_name = [x['name'] for x in servers]
self.assertNotIn(self.s1_name, servers_name)
self.assertNotIn(self.s2_name, servers_name)
- @test.idempotent_id('86c7a8f7-50cf-43a9-9bac-5b985317134f')
+ @decorators.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(self.__class__.__name__ + '-server')
@@ -147,7 +146,7 @@
self.assertNotIn(test_server['id'],
map(lambda x: x['id'], nonexistent_servers))
- @test.idempotent_id('ee8ae470-db70-474d-b752-690b7892cab1')
+ @decorators.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, state='error')
@@ -164,7 +163,7 @@
self.assertEqual(server['status'], 'ACTIVE')
@decorators.skip_because(bug="1240043")
- @test.idempotent_id('31ff3486-b8a0-4f56-a6c0-aab460531db3')
+ @decorators.idempotent_id('31ff3486-b8a0-4f56-a6c0-aab460531db3')
def test_get_server_diagnostics_by_admin(self):
# Retrieve server diagnostics by admin user
diagnostic = self.client.show_server_diagnostics(self.s1_id)
@@ -174,7 +173,7 @@
for key in basic_attrs:
self.assertIn(key, str(diagnostic.keys()))
- @test.idempotent_id('682cb127-e5bb-4f53-87ce-cb9003604442')
+ @decorators.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
@@ -202,7 +201,7 @@
rebuilt_image_id = server['image']['id']
self.assertEqual(self.image_ref_alt, rebuilt_image_id)
- @test.idempotent_id('7a1323b4-a6a2-497a-96cb-76c07b945c71')
+ @decorators.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')
@@ -210,7 +209,7 @@
# Inject the Network Info into Server
self.client.inject_network_info(server['id'])
- @test.idempotent_id('fdcd9b33-0903-4e00-a1f7-b5f6543068d6')
+ @decorators.idempotent_id('fdcd9b33-0903-4e00-a1f7-b5f6543068d6')
def test_create_server_with_scheduling_hint(self):
# Create a server with scheduler hints.
hints = {
diff --git a/tempest/api/compute/admin/test_servers_negative.py b/tempest/api/compute/admin/test_servers_negative.py
index 206260f..1283629 100644
--- a/tempest/api/compute/admin/test_servers_negative.py
+++ b/tempest/api/compute/admin/test_servers_negative.py
@@ -19,6 +19,7 @@
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -56,7 +57,7 @@
flavor_id = data_utils.rand_int_id(start=1000)
return flavor_id
- @test.idempotent_id('28dcec23-f807-49da-822c-56a92ea3c687')
+ @decorators.idempotent_id('28dcec23-f807-49da-822c-56a92ea3c687')
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
'Resize not available.')
@test.attr(type=['negative'])
@@ -84,7 +85,7 @@
self.servers[0]['id'],
flavor_ref['id'])
- @test.idempotent_id('7368a427-2f26-4ad9-9ba9-911a0ec2b0db')
+ @decorators.idempotent_id('7368a427-2f26-4ad9-9ba9-911a0ec2b0db')
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
'Resize not available.')
@test.attr(type=['negative'])
@@ -113,27 +114,27 @@
flavor_ref['id'])
@test.attr(type=['negative'])
- @test.idempotent_id('b0b4d8af-1256-41ef-9ee7-25f1c19dde80')
+ @decorators.idempotent_id('b0b4d8af-1256-41ef-9ee7-25f1c19dde80')
def test_reset_state_server_invalid_state(self):
self.assertRaises(lib_exc.BadRequest,
self.client.reset_state, self.s1_id,
state='invalid')
@test.attr(type=['negative'])
- @test.idempotent_id('4cdcc984-fab0-4577-9a9d-6d558527ee9d')
+ @decorators.idempotent_id('4cdcc984-fab0-4577-9a9d-6d558527ee9d')
def test_reset_state_server_invalid_type(self):
self.assertRaises(lib_exc.BadRequest,
self.client.reset_state, self.s1_id,
state=1)
@test.attr(type=['negative'])
- @test.idempotent_id('e741298b-8df2-46f0-81cb-8f814ff2504c')
+ @decorators.idempotent_id('e741298b-8df2-46f0-81cb-8f814ff2504c')
def test_reset_state_server_nonexistent_server(self):
self.assertRaises(lib_exc.NotFound,
self.client.reset_state, '999', state='error')
@test.attr(type=['negative'])
- @test.idempotent_id('e84e2234-60d2-42fa-8b30-e2d3049724ac')
+ @decorators.idempotent_id('e84e2234-60d2-42fa-8b30-e2d3049724ac')
def test_get_server_diagnostics_by_non_admin(self):
# Non-admin user can not view server diagnostics according to policy
self.assertRaises(lib_exc.Forbidden,
@@ -141,14 +142,14 @@
self.s1_id)
@test.attr(type=['negative'])
- @test.idempotent_id('46a4e1ca-87ae-4d28-987a-1b6b136a0221')
+ @decorators.idempotent_id('46a4e1ca-87ae-4d28-987a-1b6b136a0221')
def test_migrate_non_existent_server(self):
# migrate a non existent server
self.assertRaises(lib_exc.NotFound,
self.client.migrate_server,
data_utils.rand_uuid())
- @test.idempotent_id('b0b17f83-d14e-4fc4-8f31-bcc9f3cfa629')
+ @decorators.idempotent_id('b0b17f83-d14e-4fc4-8f31-bcc9f3cfa629')
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
'Resize not available.')
@testtools.skipUnless(CONF.compute_feature_enabled.suspend,
diff --git a/tempest/api/compute/admin/test_servers_on_multinodes.py b/tempest/api/compute/admin/test_servers_on_multinodes.py
index 1bbde98..6b92273 100644
--- a/tempest/api/compute/admin/test_servers_on_multinodes.py
+++ b/tempest/api/compute/admin/test_servers_on_multinodes.py
@@ -16,6 +16,7 @@
from tempest.api.compute import base
from tempest import config
+from tempest.lib import decorators
from tempest import test
CONF = config.CONF
@@ -35,7 +36,7 @@
return self.os_adm.servers_client.show_server(
server_id)['server']['OS-EXT-SRV-ATTR:host']
- @test.idempotent_id('26a9d5df-6890-45f2-abc4-a659290cb130')
+ @decorators.idempotent_id('26a9d5df-6890-45f2-abc4-a659290cb130')
@testtools.skipUnless(
test.is_scheduler_filter_enabled("SameHostFilter"),
'SameHostFilter is not available.')
@@ -49,7 +50,7 @@
host02 = self._get_host(server02)
self.assertEqual(host01, host02)
- @test.idempotent_id('cc7ca884-6e3e-42a3-a92f-c522fcf25e8e')
+ @decorators.idempotent_id('cc7ca884-6e3e-42a3-a92f-c522fcf25e8e')
@testtools.skipUnless(
test.is_scheduler_filter_enabled("DifferentHostFilter"),
'DifferentHostFilter is not available.')
@@ -63,7 +64,7 @@
host02 = self._get_host(server02)
self.assertNotEqual(host01, host02)
- @test.idempotent_id('7869cc84-d661-4e14-9f00-c18cdc89cf57')
+ @decorators.idempotent_id('7869cc84-d661-4e14-9f00-c18cdc89cf57')
@testtools.skipUnless(
test.is_scheduler_filter_enabled("DifferentHostFilter"),
'DifferentHostFilter is not available.')
diff --git a/tempest/api/compute/admin/test_services.py b/tempest/api/compute/admin/test_services.py
index 8648b9f..c1c1c82 100644
--- a/tempest/api/compute/admin/test_services.py
+++ b/tempest/api/compute/admin/test_services.py
@@ -15,7 +15,7 @@
# under the License.
from tempest.api.compute import base
-from tempest import test
+from tempest.lib import decorators
class ServicesAdminTestJSON(base.BaseV2ComputeAdminTest):
@@ -26,12 +26,12 @@
super(ServicesAdminTestJSON, cls).setup_clients()
cls.client = cls.os_adm.services_client
- @test.idempotent_id('5be41ef4-53d1-41cc-8839-5c2a48a1b283')
+ @decorators.idempotent_id('5be41ef4-53d1-41cc-8839-5c2a48a1b283')
def test_list_services(self):
services = self.client.list_services()['services']
self.assertNotEqual(0, len(services))
- @test.idempotent_id('f345b1ec-bc6e-4c38-a527-3ca2bc00bef5')
+ @decorators.idempotent_id('f345b1ec-bc6e-4c38-a527-3ca2bc00bef5')
def test_get_service_by_service_binary_name(self):
binary_name = 'nova-compute'
services = self.client.list_services(binary=binary_name)['services']
@@ -39,7 +39,7 @@
for service in services:
self.assertEqual(binary_name, service['binary'])
- @test.idempotent_id('affb42d5-5b4b-43c8-8b0b-6dca054abcca')
+ @decorators.idempotent_id('affb42d5-5b4b-43c8-8b0b-6dca054abcca')
def test_get_service_by_host_name(self):
services = self.client.list_services()['services']
host_name = services[0]['host']
@@ -57,7 +57,7 @@
# on order.
self.assertEqual(sorted(s1), sorted(s2))
- @test.idempotent_id('39397f6f-37b8-4234-8671-281e44c74025')
+ @decorators.idempotent_id('39397f6f-37b8-4234-8671-281e44c74025')
def test_get_service_by_service_and_host_name(self):
services = self.client.list_services()['services']
host_name = services[0]['host']
diff --git a/tempest/api/compute/admin/test_services_negative.py b/tempest/api/compute/admin/test_services_negative.py
index 710cac4..9447a09 100644
--- a/tempest/api/compute/admin/test_services_negative.py
+++ b/tempest/api/compute/admin/test_services_negative.py
@@ -13,6 +13,7 @@
# under the License.
from tempest.api.compute import base
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -27,13 +28,13 @@
cls.non_admin_client = cls.services_client
@test.attr(type=['negative'])
- @test.idempotent_id('1126d1f8-266e-485f-a687-adc547492646')
+ @decorators.idempotent_id('1126d1f8-266e-485f-a687-adc547492646')
def test_list_services_with_non_admin_user(self):
self.assertRaises(lib_exc.Forbidden,
self.non_admin_client.list_services)
@test.attr(type=['negative'])
- @test.idempotent_id('d0884a69-f693-4e79-a9af-232d15643bf7')
+ @decorators.idempotent_id('d0884a69-f693-4e79-a9af-232d15643bf7')
def test_get_service_by_invalid_params(self):
# return all services if send the request with invalid parameter
services = self.client.list_services()['services']
@@ -42,7 +43,7 @@
self.assertEqual(len(services), len(services_xxx))
@test.attr(type=['negative'])
- @test.idempotent_id('1e966d4a-226e-47c7-b601-0b18a27add54')
+ @decorators.idempotent_id('1e966d4a-226e-47c7-b601-0b18a27add54')
def test_get_service_by_invalid_service_and_valid_host(self):
services = self.client.list_services()['services']
host_name = services[0]['host']
@@ -51,7 +52,7 @@
self.assertEqual(0, len(services))
@test.attr(type=['negative'])
- @test.idempotent_id('64e7e7fb-69e8-4cb6-a71d-8d5eb0c98655')
+ @decorators.idempotent_id('64e7e7fb-69e8-4cb6-a71d-8d5eb0c98655')
def test_get_service_with_valid_service_and_invalid_host(self):
services = self.client.list_services()['services']
binary_name = services[0]['binary']
diff --git a/tempest/api/compute/admin/test_simple_tenant_usage.py b/tempest/api/compute/admin/test_simple_tenant_usage.py
index dbc22e0..ef55584 100644
--- a/tempest/api/compute/admin/test_simple_tenant_usage.py
+++ b/tempest/api/compute/admin/test_simple_tenant_usage.py
@@ -17,8 +17,8 @@
from tempest.api.compute import base
from tempest.lib.common.utils import test_utils
+from tempest.lib import decorators
from tempest.lib import exceptions as e
-from tempest import test
# Time that waits for until returning valid response
# TODO(takmatsu): Ideally this value would come from configuration.
@@ -65,7 +65,7 @@
func.__name__, duration))
return self.resp
- @test.idempotent_id('062c8ae9-9912-4249-8b51-e38d664e926e')
+ @decorators.idempotent_id('062c8ae9-9912-4249-8b51-e38d664e926e')
def test_list_usage_all_tenants(self):
# Get usage for all tenants
tenant_usage = self.call_until_valid(
@@ -73,7 +73,7 @@
start=self.start, end=self.end, detailed="1")['tenant_usages'][0]
self.assertEqual(len(tenant_usage), 8)
- @test.idempotent_id('94135049-a4c5-4934-ad39-08fa7da4f22e')
+ @decorators.idempotent_id('94135049-a4c5-4934-ad39-08fa7da4f22e')
def test_get_usage_tenant(self):
# Get usage for a specific tenant
tenant_usage = self.call_until_valid(
@@ -82,7 +82,7 @@
self.assertEqual(len(tenant_usage), 8)
- @test.idempotent_id('9d00a412-b40e-4fd9-8eba-97b496316116')
+ @decorators.idempotent_id('9d00a412-b40e-4fd9-8eba-97b496316116')
def test_get_usage_tenant_with_non_admin_user(self):
# Get usage for a specific tenant with non admin user
tenant_usage = self.call_until_valid(
diff --git a/tempest/api/compute/admin/test_simple_tenant_usage_negative.py b/tempest/api/compute/admin/test_simple_tenant_usage_negative.py
index 315116e..35762d6 100644
--- a/tempest/api/compute/admin/test_simple_tenant_usage_negative.py
+++ b/tempest/api/compute/admin/test_simple_tenant_usage_negative.py
@@ -16,6 +16,7 @@
import datetime
from tempest.api.compute import base
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -41,7 +42,7 @@
return at.strftime('%Y-%m-%dT%H:%M:%S.%f')
@test.attr(type=['negative'])
- @test.idempotent_id('8b21e135-d94b-4991-b6e9-87059609c8ed')
+ @decorators.idempotent_id('8b21e135-d94b-4991-b6e9-87059609c8ed')
def test_get_usage_tenant_with_empty_tenant_id(self):
# Get usage for a specific tenant empty
params = {'start': self.start,
@@ -51,7 +52,7 @@
'', **params)
@test.attr(type=['negative'])
- @test.idempotent_id('4079dd2a-9e8d-479f-869d-6fa985ce45b6')
+ @decorators.idempotent_id('4079dd2a-9e8d-479f-869d-6fa985ce45b6')
def test_get_usage_tenant_with_invalid_date(self):
# Get usage for tenant with invalid date
params = {'start': self.end,
@@ -61,7 +62,7 @@
self.client.tenant_id, **params)
@test.attr(type=['negative'])
- @test.idempotent_id('bbe6fe2c-15d8-404c-a0a2-44fad0ad5cc7')
+ @decorators.idempotent_id('bbe6fe2c-15d8-404c-a0a2-44fad0ad5cc7')
def test_list_usage_all_tenants_with_non_admin_user(self):
# Get usage for all tenants with non admin user
params = {'start': self.start,
diff --git a/tempest/api/compute/admin/test_volume_swap.py b/tempest/api/compute/admin/test_volume_swap.py
index f603abd..5f2444a 100644
--- a/tempest/api/compute/admin/test_volume_swap.py
+++ b/tempest/api/compute/admin/test_volume_swap.py
@@ -13,6 +13,7 @@
from tempest.api.compute import base
from tempest.common import waiters
from tempest import config
+from tempest.lib import decorators
from tempest import test
CONF = config.CONF
@@ -43,7 +44,7 @@
# We need the admin client for performing the update (swap) volume call
cls.servers_admin_client = cls.os_adm.servers_client
- @test.idempotent_id('1769f00d-a693-4d67-a631-6a3496773813')
+ @decorators.idempotent_id('1769f00d-a693-4d67-a631-6a3496773813')
@test.services('volume')
def test_volume_swap(self):
# Create two volumes.
diff --git a/tempest/api/compute/admin/test_volumes_negative.py b/tempest/api/compute/admin/test_volumes_negative.py
index 26b8742..1f85c18 100644
--- a/tempest/api/compute/admin/test_volumes_negative.py
+++ b/tempest/api/compute/admin/test_volumes_negative.py
@@ -15,6 +15,7 @@
from tempest.api.compute import base
from tempest.common.utils import data_utils
from tempest import config
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -40,7 +41,7 @@
super(VolumesAdminNegativeTest, cls).resource_setup()
cls.server = cls.create_test_server(wait_until='ACTIVE')
- @test.idempotent_id('309b5ecd-0585-4a7e-a36f-d2b2bf55259d')
+ @decorators.idempotent_id('309b5ecd-0585-4a7e-a36f-d2b2bf55259d')
def test_update_attached_volume_with_nonexistent_volume_in_uri(self):
volume = self.create_volume()
nonexistent_volume = data_utils.rand_uuid()
@@ -50,7 +51,7 @@
volumeId=volume['id'])
@test.related_bug('1629110', status_code=400)
- @test.idempotent_id('7dcac15a-b107-46d3-a5f6-cb863f4e454a')
+ @decorators.idempotent_id('7dcac15a-b107-46d3-a5f6-cb863f4e454a')
def test_update_attached_volume_with_nonexistent_volume_in_body(self):
volume = self.create_volume()
self.attach_volume(self.server, volume)
diff --git a/tempest/api/compute/floating_ips/test_list_floating_ips.py b/tempest/api/compute/floating_ips/test_list_floating_ips.py
index 222bf18..5617e8a 100644
--- a/tempest/api/compute/floating_ips/test_list_floating_ips.py
+++ b/tempest/api/compute/floating_ips/test_list_floating_ips.py
@@ -33,7 +33,7 @@
super(FloatingIPDetailsTestJSON, cls).resource_setup()
cls.floating_ip = []
cls.floating_ip_id = []
- for i in range(3):
+ for _ in range(3):
body = cls.client.create_floating_ip(
pool=CONF.network.floating_network_name)['floating_ip']
cls.floating_ip.append(body)
diff --git a/tempest/api/compute/images/test_images_oneserver.py b/tempest/api/compute/images/test_images_oneserver.py
index 0b4a2a8..7768596 100644
--- a/tempest/api/compute/images/test_images_oneserver.py
+++ b/tempest/api/compute/images/test_images_oneserver.py
@@ -89,7 +89,7 @@
# We use a string with 3 byte utf-8 character due to bug
# #1370954 in glance which will 500 if mysql is used as the
# backend and it attempts to store a 4 byte utf-8 character
- utf8_name = data_utils.rand_name('\xe2\x82\xa1')
+ utf8_name = data_utils.rand_name(b'\xe2\x82\xa1'.decode('utf-8'))
body = self.client.create_image(server_id, name=utf8_name)
image_id = data_utils.parse_image_id(body.response['location'])
self.addCleanup(self.client.delete_image, image_id)
diff --git a/tempest/api/compute/keypairs/test_keypairs.py b/tempest/api/compute/keypairs/test_keypairs.py
index 8acc25a..30222f4 100644
--- a/tempest/api/compute/keypairs/test_keypairs.py
+++ b/tempest/api/compute/keypairs/test_keypairs.py
@@ -26,7 +26,7 @@
# Keypairs created should be available in the response list
# Create 3 keypairs
key_list = list()
- for i in range(3):
+ for _ in range(3):
keypair = self.create_keypair()
# Need to pop these keys so that our compare doesn't fail later,
# as the keypair dicts from list API doesn't have them.
diff --git a/tempest/api/compute/security_groups/test_security_groups.py b/tempest/api/compute/security_groups/test_security_groups.py
index 4184afa..b667898 100644
--- a/tempest/api/compute/security_groups/test_security_groups.py
+++ b/tempest/api/compute/security_groups/test_security_groups.py
@@ -34,7 +34,7 @@
# Positive test:Should return the list of Security Groups
# Create 3 Security Groups
security_group_list = []
- for i in range(3):
+ for _ in range(3):
body = self.create_security_group()
security_group_list.append(body)
# Fetch all Security Groups and verify the list
diff --git a/tempest/api/compute/servers/test_attach_interfaces.py b/tempest/api/compute/servers/test_attach_interfaces.py
index 1731bf3..9bba733 100644
--- a/tempest/api/compute/servers/test_attach_interfaces.py
+++ b/tempest/api/compute/servers/test_attach_interfaces.py
@@ -184,7 +184,7 @@
self.assertEqual(sorted(list1), sorted(list2))
- @test.idempotent_id('73fe8f02-590d-4bf1-b184-e9ca81065051')
+ @decorators.idempotent_id('73fe8f02-590d-4bf1-b184-e9ca81065051')
@test.services('network')
def test_create_list_show_delete_interfaces(self):
server, ifs = self._create_server_get_interfaces()
@@ -221,7 +221,7 @@
self.assertEqual(len(ifs) - 1, len(_ifs))
@test.attr(type='smoke')
- @test.idempotent_id('c7e0e60b-ee45-43d0-abeb-8596fd42a2f9')
+ @decorators.idempotent_id('c7e0e60b-ee45-43d0-abeb-8596fd42a2f9')
@test.services('network')
def test_add_remove_fixed_ip(self):
# Add and Remove the fixed IP to server.
@@ -246,7 +246,7 @@
self.servers_client.remove_fixed_ip(server['id'], address=fixed_ip)
@decorators.skip_because(bug='1607714')
- @test.idempotent_id('2f3a0127-95c7-4977-92d2-bc5aec602fb4')
+ @decorators.idempotent_id('2f3a0127-95c7-4977-92d2-bc5aec602fb4')
def test_reassign_port_between_servers(self):
"""Tests the following:
diff --git a/tempest/api/compute/servers/test_availability_zone.py b/tempest/api/compute/servers/test_availability_zone.py
index 00df86b..82e74ed 100644
--- a/tempest/api/compute/servers/test_availability_zone.py
+++ b/tempest/api/compute/servers/test_availability_zone.py
@@ -14,7 +14,7 @@
# under the License.
from tempest.api.compute import base
-from tempest import test
+from tempest.lib import decorators
class AZV2TestJSON(base.BaseV2ComputeTest):
@@ -25,7 +25,7 @@
super(AZV2TestJSON, cls).setup_clients()
cls.client = cls.availability_zone_client
- @test.idempotent_id('a8333aa2-205c-449f-a828-d38c2489bf25')
+ @decorators.idempotent_id('a8333aa2-205c-449f-a828-d38c2489bf25')
def test_get_availability_zone_list_with_non_admin_user(self):
# List of availability zone with non-administrator user
availability_zone = self.client.list_availability_zones()
diff --git a/tempest/api/compute/servers/test_create_server.py b/tempest/api/compute/servers/test_create_server.py
index 2dcacb7..5ddae5e 100644
--- a/tempest/api/compute/servers/test_create_server.py
+++ b/tempest/api/compute/servers/test_create_server.py
@@ -20,6 +20,7 @@
from tempest.common.utils import data_utils
from tempest.common.utils.linux import remote_client
from tempest import config
+from tempest.lib import decorators
from tempest import test
CONF = config.CONF
@@ -77,7 +78,7 @@
return net
@test.attr(type='smoke')
- @test.idempotent_id('5de47127-9977-400a-936f-abcfbec1218f')
+ @decorators.idempotent_id('5de47127-9977-400a-936f-abcfbec1218f')
def test_verify_server_details(self):
# Verify the specified server attributes are set correctly
self.assertEqual(self.accessIPv4, self.server['accessIPv4'])
@@ -91,7 +92,7 @@
self.assertEqual(self.meta, self.server['metadata'])
@test.attr(type='smoke')
- @test.idempotent_id('9a438d88-10c6-4bcd-8b5b-5b6e25e1346f')
+ @decorators.idempotent_id('9a438d88-10c6-4bcd-8b5b-5b6e25e1346f')
def test_list_servers(self):
# The created server should be in the list of all servers
body = self.client.list_servers()
@@ -99,7 +100,7 @@
found = any([i for i in servers if i['id'] == self.server['id']])
self.assertTrue(found)
- @test.idempotent_id('585e934c-448e-43c4-acbf-d06a9b899997')
+ @decorators.idempotent_id('585e934c-448e-43c4-acbf-d06a9b899997')
def test_list_servers_with_detail(self):
# The created server should be in the detailed list of all servers
body = self.client.list_servers(detail=True)
@@ -107,7 +108,7 @@
found = any([i for i in servers if i['id'] == self.server['id']])
self.assertTrue(found)
- @test.idempotent_id('cbc0f52f-05aa-492b-bdc1-84b575ca294b')
+ @decorators.idempotent_id('cbc0f52f-05aa-492b-bdc1-84b575ca294b')
@testtools.skipUnless(CONF.validation.run_validation,
'Instance validation tests are disabled.')
def test_verify_created_server_vcpus(self):
@@ -123,7 +124,7 @@
servers_client=self.client)
self.assertEqual(flavor['vcpus'], linux_client.get_number_of_vcpus())
- @test.idempotent_id('ac1ad47f-984b-4441-9274-c9079b7a0666')
+ @decorators.idempotent_id('ac1ad47f-984b-4441-9274-c9079b7a0666')
@testtools.skipUnless(CONF.validation.run_validation,
'Instance validation tests are disabled.')
def test_host_name_is_same_as_server_name(self):
@@ -140,7 +141,7 @@
'hostname "%s" but got "%s".' % (self.name, hostname))
self.assertEqual(self.name.lower(), hostname, msg)
- @test.idempotent_id('ed20d3fb-9d1f-4329-b160-543fbd5d9811')
+ @decorators.idempotent_id('ed20d3fb-9d1f-4329-b160-543fbd5d9811')
@testtools.skipUnless(
test.is_scheduler_filter_enabled("ServerGroupAffinityFilter"),
'ServerGroupAffinityFilter is not available.')
@@ -156,7 +157,7 @@
['server_group'])
self.assertIn(server['id'], server_group['members'])
- @test.idempotent_id('0578d144-ed74-43f8-8e57-ab10dbf9b3c2')
+ @decorators.idempotent_id('0578d144-ed74-43f8-8e57-ab10dbf9b3c2')
@testtools.skipUnless(CONF.service_available.neutron,
'Neutron service must be available.')
def test_verify_multiple_nics_order(self):
@@ -194,7 +195,7 @@
for address, network in zip(addr, networks):
self.assertIn(address, network)
- @test.idempotent_id('1678d144-ed74-43f8-8e57-ab10dbf9b3c2')
+ @decorators.idempotent_id('1678d144-ed74-43f8-8e57-ab10dbf9b3c2')
@testtools.skipUnless(CONF.service_available.neutron,
'Neutron service must be available.')
def test_verify_duplicate_network_nics(self):
@@ -244,7 +245,7 @@
super(ServersWithSpecificFlavorTestJSON, cls).resource_setup()
- @test.idempotent_id('b3c7bcfc-bb5b-4e22-b517-c7f686b802ca')
+ @decorators.idempotent_id('b3c7bcfc-bb5b-4e22-b517-c7f686b802ca')
@testtools.skipUnless(CONF.validation.run_validation,
'Instance validation tests are disabled.')
def test_verify_created_server_ephemeral_disk(self):
diff --git a/tempest/api/compute/servers/test_delete_server.py b/tempest/api/compute/servers/test_delete_server.py
index 07f46c5..83b2e1b 100644
--- a/tempest/api/compute/servers/test_delete_server.py
+++ b/tempest/api/compute/servers/test_delete_server.py
@@ -19,6 +19,7 @@
from tempest.common import compute
from tempest.common import waiters
from tempest import config
+from tempest.lib import decorators
from tempest import test
CONF = config.CONF
@@ -34,21 +35,21 @@
super(DeleteServersTestJSON, cls).setup_clients()
cls.client = cls.servers_client
- @test.idempotent_id('9e6e0c87-3352-42f7-9faf-5d6210dbd159')
+ @decorators.idempotent_id('9e6e0c87-3352-42f7-9faf-5d6210dbd159')
def test_delete_server_while_in_building_state(self):
# Delete a server while it's VM state is Building
server = self.create_test_server(wait_until='BUILD')
self.client.delete_server(server['id'])
waiters.wait_for_server_termination(self.client, server['id'])
- @test.idempotent_id('925fdfb4-5b13-47ea-ac8a-c36ae6fddb05')
+ @decorators.idempotent_id('925fdfb4-5b13-47ea-ac8a-c36ae6fddb05')
def test_delete_active_server(self):
# Delete a server while it's VM state is Active
server = self.create_test_server(wait_until='ACTIVE')
self.client.delete_server(server['id'])
waiters.wait_for_server_termination(self.client, server['id'])
- @test.idempotent_id('546d368c-bb6c-4645-979a-83ed16f3a6be')
+ @decorators.idempotent_id('546d368c-bb6c-4645-979a-83ed16f3a6be')
def test_delete_server_while_in_shutoff_state(self):
# Delete a server while it's VM state is Shutoff
server = self.create_test_server(wait_until='ACTIVE')
@@ -57,7 +58,7 @@
self.client.delete_server(server['id'])
waiters.wait_for_server_termination(self.client, server['id'])
- @test.idempotent_id('943bd6e8-4d7a-4904-be83-7a6cc2d4213b')
+ @decorators.idempotent_id('943bd6e8-4d7a-4904-be83-7a6cc2d4213b')
@testtools.skipUnless(CONF.compute_feature_enabled.pause,
'Pause is not available.')
def test_delete_server_while_in_pause_state(self):
@@ -68,7 +69,7 @@
self.client.delete_server(server['id'])
waiters.wait_for_server_termination(self.client, server['id'])
- @test.idempotent_id('1f82ebd3-8253-4f4e-b93f-de9b7df56d8b')
+ @decorators.idempotent_id('1f82ebd3-8253-4f4e-b93f-de9b7df56d8b')
@testtools.skipUnless(CONF.compute_feature_enabled.suspend,
'Suspend is not available.')
def test_delete_server_while_in_suspended_state(self):
@@ -79,7 +80,7 @@
self.client.delete_server(server['id'])
waiters.wait_for_server_termination(self.client, server['id'])
- @test.idempotent_id('bb0cb402-09dd-4947-b6e5-5e7e1cfa61ad')
+ @decorators.idempotent_id('bb0cb402-09dd-4947-b6e5-5e7e1cfa61ad')
@testtools.skipUnless(CONF.compute_feature_enabled.shelve,
'Shelve is not available.')
def test_delete_server_while_in_shelved_state(self):
@@ -90,7 +91,7 @@
self.client.delete_server(server['id'])
waiters.wait_for_server_termination(self.client, server['id'])
- @test.idempotent_id('ab0c38b4-cdd8-49d3-9b92-0cb898723c01')
+ @decorators.idempotent_id('ab0c38b4-cdd8-49d3-9b92-0cb898723c01')
@testtools.skipIf(not CONF.compute_feature_enabled.resize,
'Resize not available.')
def test_delete_server_while_in_verify_resize_state(self):
@@ -102,7 +103,7 @@
self.client.delete_server(server['id'])
waiters.wait_for_server_termination(self.client, server['id'])
- @test.idempotent_id('d0f3f0d6-d9b6-4a32-8da4-23015dcab23c')
+ @decorators.idempotent_id('d0f3f0d6-d9b6-4a32-8da4-23015dcab23c')
@test.services('volume')
def test_delete_server_while_in_attached_volume(self):
# Delete a server while a volume is attached to it
@@ -128,7 +129,7 @@
cls.non_admin_client = cls.servers_client
cls.admin_client = cls.os_adm.servers_client
- @test.idempotent_id('99774678-e072-49d1-9d2a-49a59bc56063')
+ @decorators.idempotent_id('99774678-e072-49d1-9d2a-49a59bc56063')
def test_delete_server_while_in_error_state(self):
# Delete a server while it's VM state is error
server = self.create_test_server(wait_until='ACTIVE')
@@ -141,7 +142,7 @@
server['id'],
ignore_error=True)
- @test.idempotent_id('73177903-6737-4f27-a60c-379e8ae8cf48')
+ @decorators.idempotent_id('73177903-6737-4f27-a60c-379e8ae8cf48')
def test_admin_delete_servers_of_others(self):
# Administrator can delete servers of others
server = self.create_test_server(wait_until='ACTIVE')
diff --git a/tempest/api/compute/servers/test_device_tagging.py b/tempest/api/compute/servers/test_device_tagging.py
index 1d502be..ae8f47d 100644
--- a/tempest/api/compute/servers/test_device_tagging.py
+++ b/tempest/api/compute/servers/test_device_tagging.py
@@ -20,6 +20,7 @@
from tempest.common.utils import data_utils
from tempest.common.utils.linux import remote_client
from tempest import config
+from tempest.lib import decorators
from tempest.lib import exceptions
from tempest import test
@@ -83,7 +84,7 @@
'net-2-100', 'net-2-200',
'boot', 'other'])
- @test.idempotent_id('a2e65a6c-66f1-4442-aaa8-498c31778d96')
+ @decorators.idempotent_id('a2e65a6c-66f1-4442-aaa8-498c31778d96')
@test.services('network', 'volume', 'image')
def test_device_tagging(self):
# Create volumes
diff --git a/tempest/api/compute/servers/test_disk_config.py b/tempest/api/compute/servers/test_disk_config.py
index ff8ea6e..4709180 100644
--- a/tempest/api/compute/servers/test_disk_config.py
+++ b/tempest/api/compute/servers/test_disk_config.py
@@ -18,7 +18,7 @@
from tempest.api.compute import base
from tempest.common import waiters
from tempest import config
-from tempest import test
+from tempest.lib import decorators
CONF = config.CONF
@@ -46,7 +46,7 @@
server = self.client.show_server(server['id'])['server']
self.assertEqual(disk_config, server['OS-DCF:diskConfig'])
- @test.idempotent_id('bef56b09-2e8c-4883-a370-4950812f430e')
+ @decorators.idempotent_id('bef56b09-2e8c-4883-a370-4950812f430e')
def test_rebuild_server_with_manual_disk_config(self):
# A server should be rebuilt using the manual disk config option
server = self.create_test_server(wait_until='ACTIVE')
@@ -65,7 +65,7 @@
server = self.client.show_server(server['id'])['server']
self.assertEqual('MANUAL', server['OS-DCF:diskConfig'])
- @test.idempotent_id('9c9fae77-4feb-402f-8450-bf1c8b609713')
+ @decorators.idempotent_id('9c9fae77-4feb-402f-8450-bf1c8b609713')
def test_rebuild_server_with_auto_disk_config(self):
# A server should be rebuilt using the auto disk config option
server = self.create_test_server(wait_until='ACTIVE')
@@ -84,7 +84,7 @@
server = self.client.show_server(server['id'])['server']
self.assertEqual('AUTO', server['OS-DCF:diskConfig'])
- @test.idempotent_id('414e7e93-45b5-44bc-8e03-55159c6bfc97')
+ @decorators.idempotent_id('414e7e93-45b5-44bc-8e03-55159c6bfc97')
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
'Resize not available.')
def test_resize_server_from_manual_to_auto(self):
@@ -100,7 +100,7 @@
server = self.client.show_server(server['id'])['server']
self.assertEqual('AUTO', server['OS-DCF:diskConfig'])
- @test.idempotent_id('693d16f3-556c-489a-8bac-3d0ca2490bad')
+ @decorators.idempotent_id('693d16f3-556c-489a-8bac-3d0ca2490bad')
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
'Resize not available.')
def test_resize_server_from_auto_to_manual(self):
@@ -116,7 +116,7 @@
server = self.client.show_server(server['id'])['server']
self.assertEqual('MANUAL', server['OS-DCF:diskConfig'])
- @test.idempotent_id('5ef18867-358d-4de9-b3c9-94d4ba35742f')
+ @decorators.idempotent_id('5ef18867-358d-4de9-b3c9-94d4ba35742f')
def test_update_server_from_auto_to_manual(self):
# A server should be updated from auto to manual disk config
server = self.create_test_server(wait_until='ACTIVE')
diff --git a/tempest/api/compute/servers/test_instance_actions.py b/tempest/api/compute/servers/test_instance_actions.py
index e50881f..b916a42 100644
--- a/tempest/api/compute/servers/test_instance_actions.py
+++ b/tempest/api/compute/servers/test_instance_actions.py
@@ -15,7 +15,7 @@
from tempest.api.compute import base
from tempest.common import waiters
-from tempest import test
+from tempest.lib import decorators
class InstanceActionsTestJSON(base.BaseV2ComputeTest):
@@ -31,7 +31,7 @@
cls.server = cls.create_test_server(wait_until='ACTIVE')
cls.request_id = cls.server.response['x-compute-request-id']
- @test.idempotent_id('77ca5cc5-9990-45e0-ab98-1de8fead201a')
+ @decorators.idempotent_id('77ca5cc5-9990-45e0-ab98-1de8fead201a')
def test_list_instance_actions(self):
# List actions of the provided server
self.client.reboot_server(self.server['id'], type='HARD')
@@ -44,7 +44,7 @@
self.assertEqual(sorted([i['action'] for i in body]),
['create', 'reboot'])
- @test.idempotent_id('aacc71ca-1d70-4aa5-bbf6-0ff71470e43c')
+ @decorators.idempotent_id('aacc71ca-1d70-4aa5-bbf6-0ff71470e43c')
def test_get_instance_action(self):
# Get the action details of the provided server
body = self.client.show_instance_action(
@@ -63,7 +63,7 @@
super(InstanceActionsV221TestJSON, cls).setup_clients()
cls.client = cls.servers_client
- @test.idempotent_id('0a0f85d4-10fa-41f6-bf80-a54fb4aa2ae1')
+ @decorators.idempotent_id('0a0f85d4-10fa-41f6-bf80-a54fb4aa2ae1')
def test_get_list_deleted_instance_actions(self):
# List actions of the deleted server
diff --git a/tempest/api/compute/servers/test_instance_actions_negative.py b/tempest/api/compute/servers/test_instance_actions_negative.py
index 33fed08..85e3281 100644
--- a/tempest/api/compute/servers/test_instance_actions_negative.py
+++ b/tempest/api/compute/servers/test_instance_actions_negative.py
@@ -15,6 +15,7 @@
from tempest.api.compute import base
from tempest.common.utils import data_utils
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -32,7 +33,7 @@
cls.server = cls.create_test_server(wait_until='ACTIVE')
@test.attr(type=['negative'])
- @test.idempotent_id('67e1fce6-7ec2-45c6-92d4-0a8f1a632910')
+ @decorators.idempotent_id('67e1fce6-7ec2-45c6-92d4-0a8f1a632910')
def test_list_instance_actions_non_existent_server(self):
# List actions of the non-existent server id
non_existent_server_id = data_utils.rand_uuid()
@@ -41,7 +42,7 @@
non_existent_server_id)
@test.attr(type=['negative'])
- @test.idempotent_id('0269f40a-6f18-456c-b336-c03623c897f1')
+ @decorators.idempotent_id('0269f40a-6f18-456c-b336-c03623c897f1')
def test_get_instance_action_invalid_request(self):
# Get the action details of the provided server with invalid request
self.assertRaises(lib_exc.NotFound, self.client.show_instance_action,
diff --git a/tempest/api/compute/servers/test_list_server_filters.py b/tempest/api/compute/servers/test_list_server_filters.py
index 611d5a2..c0a8eae 100644
--- a/tempest/api/compute/servers/test_list_server_filters.py
+++ b/tempest/api/compute/servers/test_list_server_filters.py
@@ -19,7 +19,6 @@
from tempest.common import waiters
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
-from tempest import test
class ListServerFiltersTestJSON(base.BaseV2ComputeTest):
@@ -84,7 +83,7 @@
flavor=cls.flavor_ref_alt,
wait_until='ACTIVE')
- @test.idempotent_id('05e8a8e7-9659-459a-989d-92c2f501f4ba')
+ @decorators.idempotent_id('05e8a8e7-9659-459a-989d-92c2f501f4ba')
@decorators.skip_unless_attr('multiple_images', 'Only one image found')
def test_list_servers_filter_by_image(self):
# Filter the list of servers by image
@@ -96,7 +95,7 @@
self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
- @test.idempotent_id('573637f5-7325-47bb-9144-3476d0416908')
+ @decorators.idempotent_id('573637f5-7325-47bb-9144-3476d0416908')
def test_list_servers_filter_by_flavor(self):
# Filter the list of servers by flavor
params = {'flavor': self.flavor_ref_alt}
@@ -107,7 +106,7 @@
self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
- @test.idempotent_id('9b067a7b-7fee-4f6a-b29c-be43fe18fc5a')
+ @decorators.idempotent_id('9b067a7b-7fee-4f6a-b29c-be43fe18fc5a')
def test_list_servers_filter_by_server_name(self):
# Filter the list of servers by server name
params = {'name': self.s1_name}
@@ -118,7 +117,7 @@
self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
- @test.idempotent_id('ca78e20e-fddb-4ce6-b7f7-bcbf8605e66e')
+ @decorators.idempotent_id('ca78e20e-fddb-4ce6-b7f7-bcbf8605e66e')
def test_list_servers_filter_by_active_status(self):
# Filter the list of servers by server active status
params = {'status': 'active'}
@@ -129,7 +128,7 @@
self.assertIn(self.s2['id'], map(lambda x: x['id'], servers))
self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
- @test.idempotent_id('451dbbb2-f330-4a9f-b0e1-5f5d2cb0f34c')
+ @decorators.idempotent_id('451dbbb2-f330-4a9f-b0e1-5f5d2cb0f34c')
def test_list_servers_filter_by_shutoff_status(self):
# Filter the list of servers by server shutoff status
params = {'status': 'shutoff'}
@@ -146,21 +145,21 @@
self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
self.assertNotIn(self.s3['id'], map(lambda x: x['id'], servers))
- @test.idempotent_id('614cdfc1-d557-4bac-915b-3e67b48eee76')
+ @decorators.idempotent_id('614cdfc1-d557-4bac-915b-3e67b48eee76')
def test_list_servers_filter_by_limit(self):
# Verify only the expected number of servers are returned
params = {'limit': 1}
servers = self.client.list_servers(**params)
self.assertEqual(1, len([x for x in servers['servers'] if 'id' in x]))
- @test.idempotent_id('b1495414-2d93-414c-8019-849afe8d319e')
+ @decorators.idempotent_id('b1495414-2d93-414c-8019-849afe8d319e')
def test_list_servers_filter_by_zero_limit(self):
# Verify only the expected number of servers are returned
params = {'limit': 0}
servers = self.client.list_servers(**params)
self.assertEqual(0, len(servers['servers']))
- @test.idempotent_id('37791bbd-90c0-4de0-831e-5f38cba9c6b3')
+ @decorators.idempotent_id('37791bbd-90c0-4de0-831e-5f38cba9c6b3')
def test_list_servers_filter_by_exceed_limit(self):
# Verify only the expected number of servers are returned
params = {'limit': 100000}
@@ -169,7 +168,7 @@
self.assertEqual(len([x for x in all_servers['servers'] if 'id' in x]),
len([x for x in servers['servers'] if 'id' in x]))
- @test.idempotent_id('b3304c3b-97df-46d2-8cd3-e2b6659724e7')
+ @decorators.idempotent_id('b3304c3b-97df-46d2-8cd3-e2b6659724e7')
@decorators.skip_unless_attr('multiple_images', 'Only one image found')
def test_list_servers_detailed_filter_by_image(self):
# Filter the detailed list of servers by image
@@ -181,7 +180,7 @@
self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
- @test.idempotent_id('80c574cc-0925-44ba-8602-299028357dd9')
+ @decorators.idempotent_id('80c574cc-0925-44ba-8602-299028357dd9')
def test_list_servers_detailed_filter_by_flavor(self):
# Filter the detailed list of servers by flavor
params = {'flavor': self.flavor_ref_alt}
@@ -192,7 +191,7 @@
self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
- @test.idempotent_id('f9eb2b70-735f-416c-b260-9914ac6181e4')
+ @decorators.idempotent_id('f9eb2b70-735f-416c-b260-9914ac6181e4')
def test_list_servers_detailed_filter_by_server_name(self):
# Filter the detailed list of servers by server name
params = {'name': self.s1_name}
@@ -203,7 +202,7 @@
self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
- @test.idempotent_id('de2612ab-b7dd-4044-b0b1-d2539601911f')
+ @decorators.idempotent_id('de2612ab-b7dd-4044-b0b1-d2539601911f')
def test_list_servers_detailed_filter_by_server_status(self):
# Filter the detailed list of servers by server status
params = {'status': 'active'}
@@ -217,7 +216,7 @@
self.assertEqual(['ACTIVE'] * 3, [x['status'] for x in servers
if x['id'] in test_ids])
- @test.idempotent_id('e9f624ee-92af-4562-8bec-437945a18dcb')
+ @decorators.idempotent_id('e9f624ee-92af-4562-8bec-437945a18dcb')
def test_list_servers_filtered_by_name_wildcard(self):
# List all servers that contains '-instance' in name
params = {'name': '-instance'}
@@ -239,7 +238,7 @@
self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
- @test.idempotent_id('24a89b0c-0d55-4a28-847f-45075f19b27b')
+ @decorators.idempotent_id('24a89b0c-0d55-4a28-847f-45075f19b27b')
def test_list_servers_filtered_by_name_regex(self):
# list of regex that should match s1, s2 and s3
regexes = ['^.*\-instance\-[0-9]+$', '^.*\-instance\-.*$']
@@ -263,7 +262,7 @@
self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
- @test.idempotent_id('43a1242e-7b31-48d1-88f2-3f72aa9f2077')
+ @decorators.idempotent_id('43a1242e-7b31-48d1-88f2-3f72aa9f2077')
def test_list_servers_filtered_by_ip(self):
# Filter servers by ip
# Here should be listed 1 server
@@ -282,7 +281,7 @@
self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
@decorators.skip_because(bug="1540645")
- @test.idempotent_id('a905e287-c35e-42f2-b132-d02b09f3654a')
+ @decorators.idempotent_id('a905e287-c35e-42f2-b132-d02b09f3654a')
def test_list_servers_filtered_by_ip_regex(self):
# Filter servers by regex ip
# List all servers filtered by part of ip address.
@@ -312,7 +311,7 @@
"%s not found in %s, all servers %s" %
(self.s3_name, servers, all_servers))
- @test.idempotent_id('67aec2d0-35fe-4503-9f92-f13272b867ed')
+ @decorators.idempotent_id('67aec2d0-35fe-4503-9f92-f13272b867ed')
def test_list_servers_detailed_limit_results(self):
# Verify only the expected number of detailed results are returned
params = {'limit': 1}
diff --git a/tempest/api/compute/servers/test_list_servers_negative.py b/tempest/api/compute/servers/test_list_servers_negative.py
index 3e408d2..594c5c9 100644
--- a/tempest/api/compute/servers/test_list_servers_negative.py
+++ b/tempest/api/compute/servers/test_list_servers_negative.py
@@ -15,6 +15,7 @@
from tempest.api.compute import base
from tempest.common import waiters
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -36,7 +37,7 @@
# tearDownClass method of the super-class.
cls.existing_fixtures = []
cls.deleted_fixtures = []
- for x in range(2):
+ for _ in range(2):
srv = cls.create_test_server(wait_until='ACTIVE')
cls.existing_fixtures.append(srv)
@@ -46,7 +47,7 @@
cls.deleted_fixtures.append(srv)
@test.attr(type=['negative'])
- @test.idempotent_id('24a26f1a-1ddc-4eea-b0d7-a90cc874ad8f')
+ @decorators.idempotent_id('24a26f1a-1ddc-4eea-b0d7-a90cc874ad8f')
def test_list_servers_with_a_deleted_server(self):
# Verify deleted servers do not show by default in list servers
# List servers and verify server not returned
@@ -58,7 +59,7 @@
self.assertEqual([], actual)
@test.attr(type=['negative'])
- @test.idempotent_id('ff01387d-c7ad-47b4-ae9e-64fa214638fe')
+ @decorators.idempotent_id('ff01387d-c7ad-47b4-ae9e-64fa214638fe')
def test_list_servers_by_non_existing_image(self):
# Listing servers for a non existing image returns empty list
body = self.client.list_servers(image='non_existing_image')
@@ -66,7 +67,7 @@
self.assertEqual([], servers)
@test.attr(type=['negative'])
- @test.idempotent_id('5913660b-223b-44d4-a651-a0fbfd44ca75')
+ @decorators.idempotent_id('5913660b-223b-44d4-a651-a0fbfd44ca75')
def test_list_servers_by_non_existing_flavor(self):
# Listing servers by non existing flavor returns empty list
body = self.client.list_servers(flavor='non_existing_flavor')
@@ -74,7 +75,7 @@
self.assertEqual([], servers)
@test.attr(type=['negative'])
- @test.idempotent_id('e2c77c4a-000a-4af3-a0bd-629a328bde7c')
+ @decorators.idempotent_id('e2c77c4a-000a-4af3-a0bd-629a328bde7c')
def test_list_servers_by_non_existing_server_name(self):
# Listing servers for a non existent server name returns empty list
body = self.client.list_servers(name='non_existing_server_name')
@@ -82,21 +83,21 @@
self.assertEqual([], servers)
@test.attr(type=['negative'])
- @test.idempotent_id('fcdf192d-0f74-4d89-911f-1ec002b822c4')
+ @decorators.idempotent_id('fcdf192d-0f74-4d89-911f-1ec002b822c4')
def test_list_servers_status_non_existing(self):
# Return an empty list when invalid status is specified
body = self.client.list_servers(status='non_existing_status')
servers = body['servers']
self.assertEqual([], servers)
- @test.idempotent_id('12c80a9f-2dec-480e-882b-98ba15757659')
+ @decorators.idempotent_id('12c80a9f-2dec-480e-882b-98ba15757659')
def test_list_servers_by_limits(self):
# List servers by specifying limits
body = self.client.list_servers(limit=1)
self.assertEqual(1, len([x for x in body['servers'] if 'id' in x]))
@test.attr(type=['negative'])
- @test.idempotent_id('d47c17fb-eebd-4287-8e95-f20a7e627b18')
+ @decorators.idempotent_id('d47c17fb-eebd-4287-8e95-f20a7e627b18')
def test_list_servers_by_limits_greater_than_actual_count(self):
# Gather the complete list of servers in the project for reference
full_list = self.client.list_servers()['servers']
@@ -106,21 +107,21 @@
self.assertEqual(len(full_list), len(body['servers']))
@test.attr(type=['negative'])
- @test.idempotent_id('679bc053-5e70-4514-9800-3dfab1a380a6')
+ @decorators.idempotent_id('679bc053-5e70-4514-9800-3dfab1a380a6')
def test_list_servers_by_limits_pass_string(self):
# Return an error if a string value is passed for limit
self.assertRaises(lib_exc.BadRequest, self.client.list_servers,
limit='testing')
@test.attr(type=['negative'])
- @test.idempotent_id('62610dd9-4713-4ee0-8beb-fd2c1aa7f950')
+ @decorators.idempotent_id('62610dd9-4713-4ee0-8beb-fd2c1aa7f950')
def test_list_servers_by_limits_pass_negative_value(self):
# Return an error if a negative value for limit is passed
self.assertRaises(lib_exc.BadRequest, self.client.list_servers,
limit=-1)
@test.attr(type=['negative'])
- @test.idempotent_id('87d12517-e20a-4c9c-97b6-dd1628d6d6c9')
+ @decorators.idempotent_id('87d12517-e20a-4c9c-97b6-dd1628d6d6c9')
def test_list_servers_by_changes_since_invalid_date(self):
# Return an error when invalid date format is passed
params = {'changes-since': '2011/01/01'}
@@ -128,7 +129,7 @@
**params)
@test.attr(type=['negative'])
- @test.idempotent_id('74745ad8-b346-45b5-b9b8-509d7447fc1f')
+ @decorators.idempotent_id('74745ad8-b346-45b5-b9b8-509d7447fc1f')
def test_list_servers_by_changes_since_future_date(self):
# Return an empty list when a date in the future is passed
changes_since = {'changes-since': '2051-01-01T12:34:00Z'}
@@ -136,7 +137,7 @@
self.assertEqual(0, len(body['servers']))
@test.attr(type=['negative'])
- @test.idempotent_id('93055106-2d34-46fe-af68-d9ddbf7ee570')
+ @decorators.idempotent_id('93055106-2d34-46fe-af68-d9ddbf7ee570')
def test_list_servers_detail_server_is_deleted(self):
# Server details are not listed for a deleted server
deleted_ids = [s['id'] for s in self.deleted_fixtures]
diff --git a/tempest/api/compute/servers/test_multiple_create.py b/tempest/api/compute/servers/test_multiple_create.py
index 9fc30f9..7e55b12 100644
--- a/tempest/api/compute/servers/test_multiple_create.py
+++ b/tempest/api/compute/servers/test_multiple_create.py
@@ -14,12 +14,12 @@
# under the License.
from tempest.api.compute import base
-from tempest import test
+from tempest.lib import decorators
class MultipleCreateTestJSON(base.BaseV2ComputeTest):
- @test.idempotent_id('61e03386-89c3-449c-9bb1-a06f423fd9d1')
+ @decorators.idempotent_id('61e03386-89c3-449c-9bb1-a06f423fd9d1')
def test_multiple_create(self):
body = self.create_test_server(wait_until='ACTIVE',
min_count=1,
@@ -29,7 +29,7 @@
# contains return_reservation_id=False
self.assertNotIn('reservation_id', body)
- @test.idempotent_id('864777fb-2f1e-44e3-b5b9-3eb6fa84f2f7')
+ @decorators.idempotent_id('864777fb-2f1e-44e3-b5b9-3eb6fa84f2f7')
def test_multiple_create_with_reservation_return(self):
body = self.create_test_server(wait_until='ACTIVE',
min_count=1,
diff --git a/tempest/api/compute/servers/test_multiple_create_negative.py b/tempest/api/compute/servers/test_multiple_create_negative.py
index d9fb4ca..675cbee 100644
--- a/tempest/api/compute/servers/test_multiple_create_negative.py
+++ b/tempest/api/compute/servers/test_multiple_create_negative.py
@@ -14,6 +14,7 @@
# under the License.
from tempest.api.compute import base
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -21,35 +22,35 @@
class MultipleCreateNegativeTestJSON(base.BaseV2ComputeTest):
@test.attr(type=['negative'])
- @test.idempotent_id('daf29d8d-e928-4a01-9a8c-b129603f3fc0')
+ @decorators.idempotent_id('daf29d8d-e928-4a01-9a8c-b129603f3fc0')
def test_min_count_less_than_one(self):
invalid_min_count = 0
self.assertRaises(lib_exc.BadRequest, self.create_test_server,
min_count=invalid_min_count)
@test.attr(type=['negative'])
- @test.idempotent_id('999aa722-d624-4423-b813-0d1ac9884d7a')
+ @decorators.idempotent_id('999aa722-d624-4423-b813-0d1ac9884d7a')
def test_min_count_non_integer(self):
invalid_min_count = 2.5
self.assertRaises(lib_exc.BadRequest, self.create_test_server,
min_count=invalid_min_count)
@test.attr(type=['negative'])
- @test.idempotent_id('a6f9c2ab-e060-4b82-b23c-4532cb9390ff')
+ @decorators.idempotent_id('a6f9c2ab-e060-4b82-b23c-4532cb9390ff')
def test_max_count_less_than_one(self):
invalid_max_count = 0
self.assertRaises(lib_exc.BadRequest, self.create_test_server,
max_count=invalid_max_count)
@test.attr(type=['negative'])
- @test.idempotent_id('9c5698d1-d7af-4c80-b971-9d403135eea2')
+ @decorators.idempotent_id('9c5698d1-d7af-4c80-b971-9d403135eea2')
def test_max_count_non_integer(self):
invalid_max_count = 2.5
self.assertRaises(lib_exc.BadRequest, self.create_test_server,
max_count=invalid_max_count)
@test.attr(type=['negative'])
- @test.idempotent_id('476da616-f1ef-4271-a9b1-b9fc87727cdf')
+ @decorators.idempotent_id('476da616-f1ef-4271-a9b1-b9fc87727cdf')
def test_max_count_less_than_min_count(self):
min_count = 3
max_count = 2
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index 0334eff..6160024 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -75,7 +75,7 @@
super(ServerActionsTestJSON, cls).resource_setup()
cls.server_id = cls.rebuild_server(None, validatable=True)
- @test.idempotent_id('6158df09-4b82-4ab3-af6d-29cf36af858d')
+ @decorators.idempotent_id('6158df09-4b82-4ab3-af6d-29cf36af858d')
@testtools.skipUnless(CONF.compute_feature_enabled.change_password,
'Change password not available.')
def test_change_server_password(self):
@@ -134,13 +134,13 @@
'%s > %s' % (new_boot_time, boot_time))
@test.attr(type='smoke')
- @test.idempotent_id('2cb1baf6-ac8d-4429-bf0d-ba8a0ba53e32')
+ @decorators.idempotent_id('2cb1baf6-ac8d-4429-bf0d-ba8a0ba53e32')
def test_reboot_server_hard(self):
# The server should be power cycled
self._test_reboot_server('HARD')
@decorators.skip_because(bug="1014647")
- @test.idempotent_id('4640e3ef-a5df-482e-95a1-ceeeb0faa84d')
+ @decorators.idempotent_id('4640e3ef-a5df-482e-95a1-ceeeb0faa84d')
def test_reboot_server_soft(self):
# The server should be signaled to reboot gracefully
self._test_reboot_server('SOFT')
@@ -154,7 +154,7 @@
.format(image_ref, rebuilt_server['image']['id']))
self.assertEqual(image_ref, rebuilt_server['image']['id'], msg)
- @test.idempotent_id('aaa6cdf3-55a7-461a-add9-1c8596b9a07c')
+ @decorators.idempotent_id('aaa6cdf3-55a7-461a-add9-1c8596b9a07c')
def test_rebuild_server(self):
# The server should be rebuilt using the provided image and data
meta = {'rebuild': 'server'}
@@ -202,7 +202,7 @@
servers_client=self.client)
linux_client.validate_authentication()
- @test.idempotent_id('30449a88-5aff-4f9b-9866-6ee9b17f906d')
+ @decorators.idempotent_id('30449a88-5aff-4f9b-9866-6ee9b17f906d')
def test_rebuild_server_in_stop_state(self):
# The server in stop state should be rebuilt using the provided
# image and remain in SHUTOFF state
@@ -234,7 +234,7 @@
self.client.start_server(self.server_id)
- @test.idempotent_id('b68bd8d6-855d-4212-b59b-2e704044dace')
+ @decorators.idempotent_id('b68bd8d6-855d-4212-b59b-2e704044dace')
@test.services('volume')
def test_rebuild_server_with_volume_attached(self):
# create a new volume and attach it to the server
@@ -281,19 +281,19 @@
# NOTE(mriedem): tearDown requires the server to be started.
self.client.start_server(self.server_id)
- @test.idempotent_id('1499262a-9328-4eda-9068-db1ac57498d2')
+ @decorators.idempotent_id('1499262a-9328-4eda-9068-db1ac57498d2')
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
'Resize not available.')
def test_resize_server_confirm(self):
self._test_resize_server_confirm(stop=False)
- @test.idempotent_id('138b131d-66df-48c9-a171-64f45eb92962')
+ @decorators.idempotent_id('138b131d-66df-48c9-a171-64f45eb92962')
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
'Resize not available.')
def test_resize_server_confirm_from_stopped(self):
self._test_resize_server_confirm(stop=True)
- @test.idempotent_id('c03aab19-adb1-44f5-917d-c419577e9e68')
+ @decorators.idempotent_id('c03aab19-adb1-44f5-917d-c419577e9e68')
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
'Resize not available.')
def test_resize_server_revert(self):
@@ -313,7 +313,7 @@
server = self.client.show_server(self.server_id)['server']
self.assertEqual(self.flavor_ref, server['flavor']['id'])
- @test.idempotent_id('b963d4f1-94b3-4c40-9e97-7b583f46e470')
+ @decorators.idempotent_id('b963d4f1-94b3-4c40-9e97-7b583f46e470')
@testtools.skipUnless(CONF.compute_feature_enabled.snapshot,
'Snapshotting not available, backup not possible.')
@test.services('image')
@@ -428,7 +428,7 @@
lines = len(output.split('\n'))
self.assertEqual(lines, 10)
- @test.idempotent_id('4b8867e6-fffa-4d54-b1d1-6fdda57be2f3')
+ @decorators.idempotent_id('4b8867e6-fffa-4d54-b1d1-6fdda57be2f3')
@testtools.skipUnless(CONF.compute_feature_enabled.console_output,
'Console output not supported.')
def test_get_console_output(self):
@@ -444,7 +444,7 @@
waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
self.wait_for(self._get_output)
- @test.idempotent_id('89104062-69d8-4b19-a71b-f47b7af093d7')
+ @decorators.idempotent_id('89104062-69d8-4b19-a71b-f47b7af093d7')
@testtools.skipUnless(CONF.compute_feature_enabled.console_output,
'Console output not supported.')
def test_get_console_output_with_unlimited_size(self):
@@ -462,7 +462,7 @@
self.wait_for(_check_full_length_console_log)
- @test.idempotent_id('5b65d4e7-4ecd-437c-83c0-d6b79d927568')
+ @decorators.idempotent_id('5b65d4e7-4ecd-437c-83c0-d6b79d927568')
@testtools.skipUnless(CONF.compute_feature_enabled.console_output,
'Console output not supported.')
def test_get_console_output_server_id_in_shutoff_status(self):
@@ -479,7 +479,7 @@
waiters.wait_for_server_status(self.client, temp_server_id, 'SHUTOFF')
self.wait_for(self._get_output)
- @test.idempotent_id('bd61a9fd-062f-4670-972b-2d6c3e3b9e73')
+ @decorators.idempotent_id('bd61a9fd-062f-4670-972b-2d6c3e3b9e73')
@testtools.skipUnless(CONF.compute_feature_enabled.pause,
'Pause is not available.')
def test_pause_unpause_server(self):
@@ -488,7 +488,7 @@
self.client.unpause_server(self.server_id)
waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
- @test.idempotent_id('0d8ee21e-b749-462d-83da-b85b41c86c7f')
+ @decorators.idempotent_id('0d8ee21e-b749-462d-83da-b85b41c86c7f')
@testtools.skipUnless(CONF.compute_feature_enabled.suspend,
'Suspend is not available.')
def test_suspend_resume_server(self):
@@ -498,7 +498,7 @@
self.client.resume_server(self.server_id)
waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
- @test.idempotent_id('77eba8e0-036e-4635-944b-f7a8f3b78dc9')
+ @decorators.idempotent_id('77eba8e0-036e-4635-944b-f7a8f3b78dc9')
@testtools.skipUnless(CONF.compute_feature_enabled.shelve,
'Shelve is not available.')
def test_shelve_unshelve_server(self):
@@ -515,14 +515,14 @@
self.client.unshelve_server(self.server_id)
waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
- @test.idempotent_id('af8eafd4-38a7-4a4b-bdbc-75145a580560')
+ @decorators.idempotent_id('af8eafd4-38a7-4a4b-bdbc-75145a580560')
def test_stop_start_server(self):
self.client.stop_server(self.server_id)
waiters.wait_for_server_status(self.client, self.server_id, 'SHUTOFF')
self.client.start_server(self.server_id)
waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
- @test.idempotent_id('80a8094c-211e-440a-ab88-9e59d556c7ee')
+ @decorators.idempotent_id('80a8094c-211e-440a-ab88-9e59d556c7ee')
def test_lock_unlock_server(self):
# Lock the server,try server stop(exceptions throw),unlock it and retry
self.client.lock_server(self.server_id)
@@ -545,7 +545,7 @@
self.assertNotEqual('None', parsed_url.hostname)
self.assertIn(parsed_url.scheme, valid_scheme)
- @test.idempotent_id('c6bc11bf-592e-4015-9319-1c98dc64daf5')
+ @decorators.idempotent_id('c6bc11bf-592e-4015-9319-1c98dc64daf5')
@testtools.skipUnless(CONF.compute_feature_enabled.vnc_console,
'VNC Console feature is disabled.')
def test_get_vnc_console(self):
diff --git a/tempest/api/compute/servers/test_server_addresses.py b/tempest/api/compute/servers/test_server_addresses.py
index 549ba03..dfda51b 100644
--- a/tempest/api/compute/servers/test_server_addresses.py
+++ b/tempest/api/compute/servers/test_server_addresses.py
@@ -14,6 +14,7 @@
# under the License.
from tempest.api.compute import base
+from tempest.lib import decorators
from tempest import test
@@ -37,7 +38,7 @@
cls.server = cls.create_test_server(wait_until='ACTIVE')
@test.attr(type='smoke')
- @test.idempotent_id('6eb718c0-02d9-4d5e-acd1-4e0c269cef39')
+ @decorators.idempotent_id('6eb718c0-02d9-4d5e-acd1-4e0c269cef39')
@test.services('network')
def test_list_server_addresses(self):
# All public and private addresses for
@@ -55,7 +56,7 @@
self.assertTrue(address['version'])
@test.attr(type='smoke')
- @test.idempotent_id('87bbc374-5538-4f64-b673-2b0e4443cc30')
+ @decorators.idempotent_id('87bbc374-5538-4f64-b673-2b0e4443cc30')
@test.services('network')
def test_list_server_addresses_by_network(self):
# Providing a network type should filter
diff --git a/tempest/api/compute/servers/test_server_addresses_negative.py b/tempest/api/compute/servers/test_server_addresses_negative.py
index b4753e1..1884e4f 100644
--- a/tempest/api/compute/servers/test_server_addresses_negative.py
+++ b/tempest/api/compute/servers/test_server_addresses_negative.py
@@ -14,6 +14,7 @@
# under the License.
from tempest.api.compute import base
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -36,7 +37,7 @@
cls.server = cls.create_test_server(wait_until='ACTIVE')
@test.attr(type=['negative'])
- @test.idempotent_id('02c3f645-2d2e-4417-8525-68c0407d001b')
+ @decorators.idempotent_id('02c3f645-2d2e-4417-8525-68c0407d001b')
@test.services('network')
def test_list_server_addresses_invalid_server_id(self):
# List addresses request should fail if server id not in system
@@ -44,7 +45,7 @@
'999')
@test.attr(type=['negative'])
- @test.idempotent_id('a2ab5144-78c0-4942-a0ed-cc8edccfd9ba')
+ @decorators.idempotent_id('a2ab5144-78c0-4942-a0ed-cc8edccfd9ba')
@test.services('network')
def test_list_server_addresses_by_network_neg(self):
# List addresses by network should fail if network name not valid
diff --git a/tempest/api/compute/servers/test_server_group.py b/tempest/api/compute/servers/test_server_group.py
index bc49e7b..6679b58 100644
--- a/tempest/api/compute/servers/test_server_group.py
+++ b/tempest/api/compute/servers/test_server_group.py
@@ -15,6 +15,7 @@
from tempest.api.compute import base
from tempest.common.utils import data_utils
+from tempest.lib import decorators
from tempest import test
@@ -67,23 +68,23 @@
server_group = self._create_server_group(name, policy)
self._delete_server_group(server_group)
- @test.idempotent_id('5dc57eda-35b7-4af7-9e5f-3c2be3d2d68b')
+ @decorators.idempotent_id('5dc57eda-35b7-4af7-9e5f-3c2be3d2d68b')
def test_create_delete_server_group_with_affinity_policy(self):
# Create and Delete the server-group with affinity policy
self._create_delete_server_group(self.policy)
- @test.idempotent_id('3645a102-372f-4140-afad-13698d850d23')
+ @decorators.idempotent_id('3645a102-372f-4140-afad-13698d850d23')
def test_create_delete_server_group_with_anti_affinity_policy(self):
# Create and Delete the server-group with anti-affinity policy
policy = ['anti-affinity']
self._create_delete_server_group(policy)
- @test.idempotent_id('154dc5a4-a2fe-44b5-b99e-f15806a4a113')
+ @decorators.idempotent_id('154dc5a4-a2fe-44b5-b99e-f15806a4a113')
def test_create_delete_multiple_server_groups_with_same_name_policy(self):
# Create and Delete the server-groups with same name and same policy
server_groups = []
server_group_name = data_utils.rand_name('server-group')
- for i in range(0, 2):
+ for _ in range(0, 2):
server_groups.append(self._create_server_group(server_group_name,
self.policy))
for key in ['name', 'policies']:
@@ -93,14 +94,14 @@
for i in range(0, 2):
self._delete_server_group(server_groups[i])
- @test.idempotent_id('b3545034-dd78-48f0-bdc2-a4adfa6d0ead')
+ @decorators.idempotent_id('b3545034-dd78-48f0-bdc2-a4adfa6d0ead')
def test_show_server_group(self):
# Get the server-group
body = self.client.show_server_group(
self.created_server_group['id'])['server_group']
self.assertEqual(self.created_server_group, body)
- @test.idempotent_id('d4874179-27b4-4d7d-80e4-6c560cdfe321')
+ @decorators.idempotent_id('d4874179-27b4-4d7d-80e4-6c560cdfe321')
def test_list_server_groups(self):
# List the server-group
body = self.client.list_server_groups()['server_groups']
diff --git a/tempest/api/compute/servers/test_server_metadata.py b/tempest/api/compute/servers/test_server_metadata.py
index 847b7a1..f77e7d3 100644
--- a/tempest/api/compute/servers/test_server_metadata.py
+++ b/tempest/api/compute/servers/test_server_metadata.py
@@ -14,7 +14,7 @@
# under the License.
from tempest.api.compute import base
-from tempest import test
+from tempest.lib import decorators
class ServerMetadataTestJSON(base.BaseV2ComputeTest):
@@ -34,7 +34,7 @@
meta = {'key1': 'value1', 'key2': 'value2'}
self.client.set_server_metadata(self.server['id'], meta)['metadata']
- @test.idempotent_id('479da087-92b3-4dcf-aeb3-fd293b2d14ce')
+ @decorators.idempotent_id('479da087-92b3-4dcf-aeb3-fd293b2d14ce')
def test_list_server_metadata(self):
# All metadata key/value pairs for a server should be returned
resp_metadata = (self.client.list_server_metadata(self.server['id'])
@@ -44,7 +44,7 @@
expected = {'key1': 'value1', 'key2': 'value2'}
self.assertEqual(expected, resp_metadata)
- @test.idempotent_id('211021f6-21de-4657-a68f-908878cfe251')
+ @decorators.idempotent_id('211021f6-21de-4657-a68f-908878cfe251')
def test_set_server_metadata(self):
# The server's metadata should be replaced with the provided values
# Create a new set of metadata for the server
@@ -58,7 +58,7 @@
['metadata'])
self.assertEqual(resp_metadata, req_metadata)
- @test.idempotent_id('344d981e-0c33-4997-8a5d-6c1d803e4134')
+ @decorators.idempotent_id('344d981e-0c33-4997-8a5d-6c1d803e4134')
def test_update_server_metadata(self):
# The server's metadata values should be updated to the
# provided values
@@ -71,7 +71,7 @@
expected = {'key1': 'alt1', 'key2': 'value2', 'key3': 'value3'}
self.assertEqual(expected, resp_metadata)
- @test.idempotent_id('0f58d402-e34a-481d-8af8-b392b17426d9')
+ @decorators.idempotent_id('0f58d402-e34a-481d-8af8-b392b17426d9')
def test_update_metadata_empty_body(self):
# The original metadata should not be lost if empty metadata body is
# passed
@@ -82,14 +82,14 @@
expected = {'key1': 'value1', 'key2': 'value2'}
self.assertEqual(expected, resp_metadata)
- @test.idempotent_id('3043c57d-7e0e-49a6-9a96-ad569c265e6a')
+ @decorators.idempotent_id('3043c57d-7e0e-49a6-9a96-ad569c265e6a')
def test_get_server_metadata_item(self):
# The value for a specific metadata key should be returned
meta = self.client.show_server_metadata_item(self.server['id'],
'key2')['meta']
self.assertEqual('value2', meta['key2'])
- @test.idempotent_id('58c02d4f-5c67-40be-8744-d3fa5982eb1c')
+ @decorators.idempotent_id('58c02d4f-5c67-40be-8744-d3fa5982eb1c')
def test_set_server_metadata_item(self):
# The item's value should be updated to the provided value
# Update the metadata value
@@ -102,7 +102,7 @@
expected = {'key1': 'value1', 'key2': 'value2', 'nova': 'alt'}
self.assertEqual(expected, resp_metadata)
- @test.idempotent_id('127642d6-4c7b-4486-b7cd-07265a378658')
+ @decorators.idempotent_id('127642d6-4c7b-4486-b7cd-07265a378658')
def test_delete_server_metadata_item(self):
# The metadata value/key pair should be deleted from the server
self.client.delete_server_metadata_item(self.server['id'], 'key1')
diff --git a/tempest/api/compute/servers/test_server_metadata_negative.py b/tempest/api/compute/servers/test_server_metadata_negative.py
index 62b8962..92ffa86 100644
--- a/tempest/api/compute/servers/test_server_metadata_negative.py
+++ b/tempest/api/compute/servers/test_server_metadata_negative.py
@@ -15,6 +15,7 @@
from tempest.api.compute import base
from tempest.common.utils import data_utils
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -33,7 +34,7 @@
cls.server = cls.create_test_server(metadata={}, wait_until='ACTIVE')
@test.attr(type=['negative'])
- @test.idempotent_id('fe114a8f-3a57-4eff-9ee2-4e14628df049')
+ @decorators.idempotent_id('fe114a8f-3a57-4eff-9ee2-4e14628df049')
def test_server_create_metadata_key_too_long(self):
# Attempt to start a server with a meta-data key that is > 255
# characters
@@ -49,7 +50,7 @@
# no teardown - all creates should fail
@test.attr(type=['negative'])
- @test.idempotent_id('92431555-4d8b-467c-b95b-b17daa5e57ff')
+ @decorators.idempotent_id('92431555-4d8b-467c-b95b-b17daa5e57ff')
def test_create_server_metadata_blank_key(self):
# Blank key should trigger an error.
meta = {'': 'data1'}
@@ -58,7 +59,7 @@
metadata=meta)
@test.attr(type=['negative'])
- @test.idempotent_id('4d9cd7a3-2010-4b41-b8fe-3bbf0b169466')
+ @decorators.idempotent_id('4d9cd7a3-2010-4b41-b8fe-3bbf0b169466')
def test_server_metadata_non_existent_server(self):
# GET on a non-existent server should not succeed
non_existent_server_id = data_utils.rand_uuid()
@@ -68,7 +69,7 @@
'test2')
@test.attr(type=['negative'])
- @test.idempotent_id('f408e78e-3066-4097-9299-3b0182da812e')
+ @decorators.idempotent_id('f408e78e-3066-4097-9299-3b0182da812e')
def test_list_server_metadata_non_existent_server(self):
# List metadata on a non-existent server should not succeed
non_existent_server_id = data_utils.rand_uuid()
@@ -77,7 +78,7 @@
non_existent_server_id)
@test.attr(type=['negative'])
- @test.idempotent_id('0025fbd6-a4ba-4cde-b8c2-96805dcfdabc')
+ @decorators.idempotent_id('0025fbd6-a4ba-4cde-b8c2-96805dcfdabc')
def test_wrong_key_passed_in_body(self):
# Raise BadRequest if key in uri does not match
# the key passed in body.
@@ -87,7 +88,7 @@
self.server['id'], 'key', meta)
@test.attr(type=['negative'])
- @test.idempotent_id('0df38c2a-3d4e-4db5-98d8-d4d9fa843a12')
+ @decorators.idempotent_id('0df38c2a-3d4e-4db5-98d8-d4d9fa843a12')
def test_set_metadata_non_existent_server(self):
# Set metadata on a non-existent server should not succeed
non_existent_server_id = data_utils.rand_uuid()
@@ -98,7 +99,7 @@
meta)
@test.attr(type=['negative'])
- @test.idempotent_id('904b13dc-0ef2-4e4c-91cd-3b4a0f2f49d8')
+ @decorators.idempotent_id('904b13dc-0ef2-4e4c-91cd-3b4a0f2f49d8')
def test_update_metadata_non_existent_server(self):
# An update should not happen for a non-existent server
non_existent_server_id = data_utils.rand_uuid()
@@ -109,7 +110,7 @@
meta)
@test.attr(type=['negative'])
- @test.idempotent_id('a452f38c-05c2-4b47-bd44-a4f0bf5a5e48')
+ @decorators.idempotent_id('a452f38c-05c2-4b47-bd44-a4f0bf5a5e48')
def test_update_metadata_with_blank_key(self):
# Blank key should trigger an error
meta = {'': 'data1'}
@@ -118,7 +119,7 @@
self.server['id'], meta=meta)
@test.attr(type=['negative'])
- @test.idempotent_id('6bbd88e1-f8b3-424d-ba10-ae21c45ada8d')
+ @decorators.idempotent_id('6bbd88e1-f8b3-424d-ba10-ae21c45ada8d')
def test_delete_metadata_non_existent_server(self):
# Should not be able to delete metadata item from a non-existent server
non_existent_server_id = data_utils.rand_uuid()
@@ -128,7 +129,7 @@
'd')
@test.attr(type=['negative'])
- @test.idempotent_id('d8c0a210-a5c3-4664-be04-69d96746b547')
+ @decorators.idempotent_id('d8c0a210-a5c3-4664-be04-69d96746b547')
def test_metadata_items_limit(self):
# A 403 Forbidden or 413 Overlimit (old behaviour) exception
# will be raised while exceeding metadata items limit for
@@ -154,7 +155,7 @@
self.server['id'], req_metadata)
@test.attr(type=['negative'])
- @test.idempotent_id('96100343-7fa9-40d8-80fa-d29ef588ce1c')
+ @decorators.idempotent_id('96100343-7fa9-40d8-80fa-d29ef588ce1c')
def test_set_server_metadata_blank_key(self):
# Raise a bad request error for blank key.
# set_server_metadata will replace all metadata with new value
@@ -164,7 +165,7 @@
self.server['id'], meta=meta)
@test.attr(type=['negative'])
- @test.idempotent_id('64a91aee-9723-4863-be44-4c9d9f1e7d0e')
+ @decorators.idempotent_id('64a91aee-9723-4863-be44-4c9d9f1e7d0e')
def test_set_server_metadata_missing_metadata(self):
# Raise a bad request error for a missing metadata field
# set_server_metadata will replace all metadata with new value
diff --git a/tempest/api/compute/servers/test_server_password.py b/tempest/api/compute/servers/test_server_password.py
index 9b41708..e7591a5 100644
--- a/tempest/api/compute/servers/test_server_password.py
+++ b/tempest/api/compute/servers/test_server_password.py
@@ -15,7 +15,7 @@
from tempest.api.compute import base
-from tempest import test
+from tempest.lib import decorators
class ServerPasswordTestJSON(base.BaseV2ComputeTest):
@@ -30,10 +30,10 @@
super(ServerPasswordTestJSON, cls).resource_setup()
cls.server = cls.create_test_server(wait_until="ACTIVE")
- @test.idempotent_id('f83b582f-62a8-4f22-85b0-0dee50ff783a')
+ @decorators.idempotent_id('f83b582f-62a8-4f22-85b0-0dee50ff783a')
def test_get_server_password(self):
self.client.show_password(self.server['id'])
- @test.idempotent_id('f8229e8b-b625-4493-800a-bde86ac611ea')
+ @decorators.idempotent_id('f8229e8b-b625-4493-800a-bde86ac611ea')
def test_delete_server_password(self):
self.client.delete_password(self.server['id'])
diff --git a/tempest/api/compute/servers/test_server_personality.py b/tempest/api/compute/servers/test_server_personality.py
index ab291b4..957d24a 100644
--- a/tempest/api/compute/servers/test_server_personality.py
+++ b/tempest/api/compute/servers/test_server_personality.py
@@ -20,8 +20,8 @@
from tempest.common import waiters
from tempest import config
from tempest.lib.common.utils import data_utils
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
-from tempest import test
CONF = config.CONF
@@ -50,7 +50,7 @@
cls.client = cls.servers_client
cls.user_client = cls.limits_client
- @test.idempotent_id('3cfe87fd-115b-4a02-b942-7dc36a337fdf')
+ @decorators.idempotent_id('3cfe87fd-115b-4a02-b942-7dc36a337fdf')
def test_create_server_with_personality(self):
file_contents = 'This is a test file.'
file_path = '/test.txt'
@@ -73,7 +73,7 @@
linux_client.exec_command(
'sudo cat %s' % file_path))
- @test.idempotent_id('128966d8-71fc-443c-8cab-08e24114ecc9')
+ @decorators.idempotent_id('128966d8-71fc-443c-8cab-08e24114ecc9')
def test_rebuild_server_with_personality(self):
server = self.create_test_server(wait_until='ACTIVE', validatable=True)
server_id = server['id']
@@ -87,7 +87,7 @@
self.assertEqual(self.image_ref_alt,
rebuilt_server['server']['image']['id'])
- @test.idempotent_id('176cd8c9-b9e8-48ee-a480-180beab292bf')
+ @decorators.idempotent_id('176cd8c9-b9e8-48ee-a480-180beab292bf')
def test_personality_files_exceed_limit(self):
# Server creation should fail if greater than the maximum allowed
# number of files are injected into the server.
@@ -107,7 +107,7 @@
self.assertRaises((lib_exc.Forbidden, lib_exc.OverLimit),
self.create_test_server, personality=personality)
- @test.idempotent_id('52f12ee8-5180-40cc-b417-31572ea3d555')
+ @decorators.idempotent_id('52f12ee8-5180-40cc-b417-31572ea3d555')
def test_can_create_server_with_max_number_personality_files(self):
# Server should be created successfully if maximum allowed number of
# files is injected into the server during creation.
diff --git a/tempest/api/compute/servers/test_server_rescue.py b/tempest/api/compute/servers/test_server_rescue.py
index 9834d02..5db7f4f 100644
--- a/tempest/api/compute/servers/test_server_rescue.py
+++ b/tempest/api/compute/servers/test_server_rescue.py
@@ -17,7 +17,7 @@
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
-from tempest import test
+from tempest.lib import decorators
CONF = config.CONF
@@ -74,7 +74,7 @@
waiters.wait_for_server_status(self.servers_client, server_id,
'ACTIVE')
- @test.idempotent_id('fd032140-714c-42e4-a8fd-adcd8df06be6')
+ @decorators.idempotent_id('fd032140-714c-42e4-a8fd-adcd8df06be6')
def test_rescue_unrescue_instance(self):
self.servers_client.rescue_server(
self.server_id, adminPass=self.password)
@@ -84,7 +84,7 @@
waiters.wait_for_server_status(self.servers_client, self.server_id,
'ACTIVE')
- @test.idempotent_id('4842e0cf-e87d-4d9d-b61f-f4791da3cacc')
+ @decorators.idempotent_id('4842e0cf-e87d-4d9d-b61f-f4791da3cacc')
def test_rescued_vm_associate_dissociate_floating_ip(self):
# Rescue the server
self.servers_client.rescue_server(
@@ -102,7 +102,7 @@
client.disassociate_floating_ip_from_server(self.floating_ip,
self.server_id)
- @test.idempotent_id('affca41f-7195-492d-8065-e09eee245404')
+ @decorators.idempotent_id('affca41f-7195-492d-8065-e09eee245404')
def test_rescued_vm_add_remove_security_group(self):
# Rescue the server
self.servers_client.rescue_server(
diff --git a/tempest/api/compute/servers/test_server_rescue_negative.py b/tempest/api/compute/servers/test_server_rescue_negative.py
index 41b648c..c3a8c36 100644
--- a/tempest/api/compute/servers/test_server_rescue_negative.py
+++ b/tempest/api/compute/servers/test_server_rescue_negative.py
@@ -19,6 +19,7 @@
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -70,7 +71,7 @@
waiters.wait_for_server_status(self.servers_client,
server_id, 'ACTIVE')
- @test.idempotent_id('cc3a883f-43c0-4fb6-a9bb-5579d64984ed')
+ @decorators.idempotent_id('cc3a883f-43c0-4fb6-a9bb-5579d64984ed')
@testtools.skipUnless(CONF.compute_feature_enabled.pause,
'Pause is not available.')
@test.attr(type=['negative'])
@@ -85,13 +86,13 @@
self.server_id)
@test.attr(type=['negative'])
- @test.idempotent_id('db22b618-f157-4566-a317-1b6d467a8094')
+ @decorators.idempotent_id('db22b618-f157-4566-a317-1b6d467a8094')
def test_rescued_vm_reboot(self):
self.assertRaises(lib_exc.Conflict, self.servers_client.reboot_server,
self.rescue_id, type='HARD')
@test.attr(type=['negative'])
- @test.idempotent_id('6dfc0a55-3a77-4564-a144-1587b7971dde')
+ @decorators.idempotent_id('6dfc0a55-3a77-4564-a144-1587b7971dde')
def test_rescue_non_existent_server(self):
# Rescue a non-existing server
non_existent_server = data_utils.rand_uuid()
@@ -100,14 +101,14 @@
non_existent_server)
@test.attr(type=['negative'])
- @test.idempotent_id('70cdb8a1-89f8-437d-9448-8844fd82bf46')
+ @decorators.idempotent_id('70cdb8a1-89f8-437d-9448-8844fd82bf46')
def test_rescued_vm_rebuild(self):
self.assertRaises(lib_exc.Conflict,
self.servers_client.rebuild_server,
self.rescue_id,
self.image_ref_alt)
- @test.idempotent_id('d0ccac79-0091-4cf4-a1ce-26162d0cc55f')
+ @decorators.idempotent_id('d0ccac79-0091-4cf4-a1ce-26162d0cc55f')
@test.services('volume')
@test.attr(type=['negative'])
def test_rescued_vm_attach_volume(self):
@@ -127,7 +128,7 @@
volumeId=volume['id'],
device='/dev/%s' % self.device)
- @test.idempotent_id('f56e465b-fe10-48bf-b75d-646cda3a8bc9')
+ @decorators.idempotent_id('f56e465b-fe10-48bf-b75d-646cda3a8bc9')
@test.services('volume')
@test.attr(type=['negative'])
def test_rescued_vm_detach_volume(self):
diff --git a/tempest/api/compute/servers/test_servers.py b/tempest/api/compute/servers/test_servers.py
index 5aeba4e..b463726 100644
--- a/tempest/api/compute/servers/test_servers.py
+++ b/tempest/api/compute/servers/test_servers.py
@@ -19,7 +19,7 @@
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
-from tempest import test
+from tempest.lib import decorators
CONF = config.CONF
@@ -35,7 +35,7 @@
self.clear_servers()
super(ServersTestJSON, self).tearDown()
- @test.idempotent_id('b92d5ec7-b1dd-44a2-87e4-45e888c46ef0')
+ @decorators.idempotent_id('b92d5ec7-b1dd-44a2-87e4-45e888c46ef0')
@testtools.skipUnless(CONF.compute_feature_enabled.
enable_instance_password,
'Instance password not available.')
@@ -47,7 +47,7 @@
# Verify the password is set correctly in the response
self.assertEqual('testpassword', server['adminPass'])
- @test.idempotent_id('8fea6be7-065e-47cf-89b8-496e6f96c699')
+ @decorators.idempotent_id('8fea6be7-065e-47cf-89b8-496e6f96c699')
def test_create_with_existing_server_name(self):
# Creating a server with a name that already exists is allowed
@@ -67,7 +67,7 @@
name2 = server['name']
self.assertEqual(name1, name2)
- @test.idempotent_id('f9e15296-d7f9-4e62-b53f-a04e89160833')
+ @decorators.idempotent_id('f9e15296-d7f9-4e62-b53f-a04e89160833')
def test_create_specify_keypair(self):
# Specify a keypair while creating a server
@@ -94,7 +94,7 @@
self.assertEqual(new_name, server['name'])
return server
- @test.idempotent_id('5e6ccff8-349d-4852-a8b3-055df7988dd2')
+ @decorators.idempotent_id('5e6ccff8-349d-4852-a8b3-055df7988dd2')
def test_update_server_name(self):
# The server name should be changed to the provided value
server = self.create_test_server(wait_until='ACTIVE')
@@ -102,7 +102,7 @@
prefix_name = u'\u00CD\u00F1st\u00E1\u00F1c\u00E9'
self._update_server_name(server['id'], 'ACTIVE', prefix_name)
- @test.idempotent_id('6ac19cb1-27a3-40ec-b350-810bdc04c08e')
+ @decorators.idempotent_id('6ac19cb1-27a3-40ec-b350-810bdc04c08e')
def test_update_server_name_in_stop_state(self):
# The server name should be changed to the provided value
server = self.create_test_server(wait_until='ACTIVE')
@@ -115,7 +115,7 @@
prefix_name)
self.assertNotIn('progress', updated_server)
- @test.idempotent_id('89b90870-bc13-4b73-96af-f9d4f2b70077')
+ @decorators.idempotent_id('89b90870-bc13-4b73-96af-f9d4f2b70077')
def test_update_access_server_address(self):
# The server's access addresses should reflect the provided values
server = self.create_test_server(wait_until='ACTIVE')
@@ -131,7 +131,7 @@
self.assertEqual('1.1.1.1', server['accessIPv4'])
self.assertEqual('::babe:202:202', server['accessIPv6'])
- @test.idempotent_id('38fb1d02-c3c5-41de-91d3-9bc2025a75eb')
+ @decorators.idempotent_id('38fb1d02-c3c5-41de-91d3-9bc2025a75eb')
def test_create_server_with_ipv6_addr_only(self):
# Create a server without an IPv4 address(only IPv6 address).
server = self.create_test_server(accessIPv6='2001:2001::3')
diff --git a/tempest/api/compute/servers/test_servers_negative.py b/tempest/api/compute/servers/test_servers_negative.py
index 2b4cee7..853d2ff 100644
--- a/tempest/api/compute/servers/test_servers_negative.py
+++ b/tempest/api/compute/servers/test_servers_negative.py
@@ -22,6 +22,7 @@
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -54,7 +55,7 @@
cls.server_id = server['id']
@test.attr(type=['negative'])
- @test.idempotent_id('dbbfd247-c40c-449e-8f6c-d2aa7c7da7cf')
+ @decorators.idempotent_id('dbbfd247-c40c-449e-8f6c-d2aa7c7da7cf')
def test_server_name_blank(self):
# Create a server with name parameter empty
@@ -63,7 +64,7 @@
name='')
@test.attr(type=['negative'])
- @test.idempotent_id('b8a7235e-5246-4a8f-a08e-b34877c6586f')
+ @decorators.idempotent_id('b8a7235e-5246-4a8f-a08e-b34877c6586f')
@testtools.skipUnless(CONF.compute_feature_enabled.personality,
'Nova personality feature disabled')
def test_personality_file_contents_not_encoded(self):
@@ -78,7 +79,7 @@
personality=person)
@test.attr(type=['negative'])
- @test.idempotent_id('fcba1052-0a50-4cf3-b1ac-fae241edf02f')
+ @decorators.idempotent_id('fcba1052-0a50-4cf3-b1ac-fae241edf02f')
def test_create_with_invalid_image(self):
# Create a server with an unknown image
@@ -87,7 +88,7 @@
image_id=-1)
@test.attr(type=['negative'])
- @test.idempotent_id('18f5227f-d155-4429-807c-ccb103887537')
+ @decorators.idempotent_id('18f5227f-d155-4429-807c-ccb103887537')
def test_create_with_invalid_flavor(self):
# Create a server with an unknown flavor
@@ -96,7 +97,7 @@
flavor=-1,)
@test.attr(type=['negative'])
- @test.idempotent_id('7f70a4d1-608f-4794-9e56-cb182765972c')
+ @decorators.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
@@ -105,7 +106,7 @@
self.create_test_server, accessIPv4=IPv4)
@test.attr(type=['negative'])
- @test.idempotent_id('5226dd80-1e9c-4d8a-b5f9-b26ca4763fd0')
+ @decorators.idempotent_id('5226dd80-1e9c-4d8a-b5f9-b26ca4763fd0')
def test_invalid_ip_v6_address(self):
# An access IPv6 address must match a valid address pattern
@@ -114,7 +115,7 @@
self.assertRaises(lib_exc.BadRequest,
self.create_test_server, accessIPv6=IPv6)
- @test.idempotent_id('7ea45b3e-e770-46fa-bfcc-9daaf6d987c0')
+ @decorators.idempotent_id('7ea45b3e-e770-46fa-bfcc-9daaf6d987c0')
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
'Resize not available.')
@test.attr(type=['negative'])
@@ -125,7 +126,7 @@
self.client.resize_server,
nonexistent_server, self.flavor_ref)
- @test.idempotent_id('ced1a1d7-2ab6-45c9-b90f-b27d87b30efd')
+ @decorators.idempotent_id('ced1a1d7-2ab6-45c9-b90f-b27d87b30efd')
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
'Resize not available.')
@test.attr(type=['negative'])
@@ -135,7 +136,7 @@
self.assertRaises(lib_exc.BadRequest, self.client.resize_server,
self.server_id, flavor_ref=nonexistent_flavor)
- @test.idempotent_id('45436a7d-a388-4a35-a9d8-3adc5d0d940b')
+ @decorators.idempotent_id('45436a7d-a388-4a35-a9d8-3adc5d0d940b')
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
'Resize not available.')
@test.attr(type=['negative'])
@@ -145,14 +146,14 @@
self.server_id, flavor_ref="")
@test.attr(type=['negative'])
- @test.idempotent_id('d4c023a0-9c55-4747-9dd5-413b820143c7')
+ @decorators.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_server,
nonexistent_server, type='SOFT')
- @test.idempotent_id('d1417e7f-a509-41b5-a102-d5eed8613369')
+ @decorators.idempotent_id('d1417e7f-a509-41b5-a102-d5eed8613369')
@testtools.skipUnless(CONF.compute_feature_enabled.pause,
'Pause is not available.')
@test.attr(type=['negative'])
@@ -166,7 +167,7 @@
self.client.unpause_server(self.server_id)
@test.attr(type=['negative'])
- @test.idempotent_id('98fa0458-1485-440f-873b-fe7f0d714930')
+ @decorators.idempotent_id('98fa0458-1485-440f-873b-fe7f0d714930')
def test_rebuild_deleted_server(self):
# Rebuild a deleted server
server = self.create_test_server()
@@ -178,7 +179,7 @@
server['id'], self.image_ref_alt)
@test.attr(type=['negative'])
- @test.idempotent_id('581a397d-5eab-486f-9cf9-1014bbd4c984')
+ @decorators.idempotent_id('581a397d-5eab-486f-9cf9-1014bbd4c984')
def test_reboot_deleted_server(self):
# Reboot a deleted server
server = self.create_test_server()
@@ -189,7 +190,7 @@
server['id'], type='SOFT')
@test.attr(type=['negative'])
- @test.idempotent_id('d86141a7-906e-4731-b187-d64a2ea61422')
+ @decorators.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()
@@ -199,7 +200,7 @@
self.image_ref_alt)
@test.attr(type=['negative'])
- @test.idempotent_id('fd57f159-68d6-4c2a-902b-03070828a87e')
+ @decorators.idempotent_id('fd57f159-68d6-4c2a-902b-03070828a87e')
def test_create_numeric_server_name(self):
server_name = 12345
self.assertRaises(lib_exc.BadRequest,
@@ -207,7 +208,7 @@
name=server_name)
@test.attr(type=['negative'])
- @test.idempotent_id('c3e0fb12-07fc-4d76-a22e-37409887afe8')
+ @decorators.idempotent_id('c3e0fb12-07fc-4d76-a22e-37409887afe8')
def test_create_server_name_length_exceeds_256(self):
# Create a server with name length exceeding 255 characters
@@ -218,7 +219,7 @@
@test.attr(type=['negative'])
@test.related_bug('1651064', status_code=500)
- @test.idempotent_id('12146ac1-d7df-4928-ad25-b1f99e5286cd')
+ @decorators.idempotent_id('12146ac1-d7df-4928-ad25-b1f99e5286cd')
def test_create_server_invalid_bdm_in_2nd_dict(self):
volume = self.create_volume()
bdm_1st = {"source_type": "image",
@@ -237,7 +238,7 @@
block_device_mapping_v2=bdm)
@test.attr(type=['negative'])
- @test.idempotent_id('4e72dc2d-44c5-4336-9667-f7972e95c402')
+ @decorators.idempotent_id('4e72dc2d-44c5-4336-9667-f7972e95c402')
def test_create_with_invalid_network_uuid(self):
# Pass invalid network uuid while creating a server
@@ -248,7 +249,7 @@
networks=networks)
@test.attr(type=['negative'])
- @test.idempotent_id('7a2efc39-530c-47de-b875-2dd01c8d39bd')
+ @decorators.idempotent_id('7a2efc39-530c-47de-b875-2dd01c8d39bd')
def test_create_with_non_existent_keypair(self):
# Pass a non-existent keypair while creating a server
@@ -258,7 +259,7 @@
key_name=key_name)
@test.attr(type=['negative'])
- @test.idempotent_id('7fc74810-0bd2-4cd7-8244-4f33a9db865a')
+ @decorators.idempotent_id('7fc74810-0bd2-4cd7-8244-4f33a9db865a')
def test_create_server_metadata_exceeds_length_limit(self):
# Pass really long metadata while creating a server
@@ -268,7 +269,7 @@
metadata=metadata)
@test.attr(type=['negative'])
- @test.idempotent_id('aa8eed43-e2cb-4ebf-930b-da14f6a21d81')
+ @decorators.idempotent_id('aa8eed43-e2cb-4ebf-930b-da14f6a21d81')
def test_update_name_of_non_existent_server(self):
# Update name of a non-existent server
@@ -280,7 +281,7 @@
nonexistent_server, name=new_name)
@test.attr(type=['negative'])
- @test.idempotent_id('38204696-17c6-44da-9590-40f87fb5a899')
+ @decorators.idempotent_id('38204696-17c6-44da-9590-40f87fb5a899')
def test_update_server_set_empty_name(self):
# Update name of the server to an empty string
@@ -290,7 +291,7 @@
self.server_id, name=new_name)
@test.attr(type=['negative'])
- @test.idempotent_id('5c8e244c-dada-4590-9944-749c455b431f')
+ @decorators.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
@@ -301,7 +302,7 @@
name=new_name)
@test.attr(type=['negative'])
- @test.idempotent_id('1041b4e6-514b-4855-96a5-e974b60870a3')
+ @decorators.idempotent_id('1041b4e6-514b-4855-96a5-e974b60870a3')
def test_delete_non_existent_server(self):
# Delete a non existent server
@@ -310,14 +311,14 @@
nonexistent_server)
@test.attr(type=['negative'])
- @test.idempotent_id('75f79124-277c-45e6-a373-a1d6803f4cc4')
+ @decorators.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'])
- @test.idempotent_id('f4d7279b-5fd2-4bf2-9ba4-ae35df0d18c5')
+ @decorators.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
@@ -325,7 +326,7 @@
sys.maxsize + 1)
@test.attr(type=['negative'])
- @test.idempotent_id('c5fa6041-80cd-483b-aa6d-4e45f19d093c')
+ @decorators.idempotent_id('c5fa6041-80cd-483b-aa6d-4e45f19d093c')
def test_create_with_nonexistent_security_group(self):
# Create a server with a nonexistent security group
@@ -335,7 +336,7 @@
security_groups=security_groups)
@test.attr(type=['negative'])
- @test.idempotent_id('3436b02f-1b1e-4f03-881e-c6a602327439')
+ @decorators.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()
@@ -343,14 +344,14 @@
nonexistent_server)
@test.attr(type=['negative'])
- @test.idempotent_id('a31460a9-49e1-42aa-82ee-06e0bb7c2d03')
+ @decorators.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_server,
nonexistent_server)
- @test.idempotent_id('6a8dc0c6-6cd4-4c0a-9f32-413881828091')
+ @decorators.idempotent_id('6a8dc0c6-6cd4-4c0a-9f32-413881828091')
@testtools.skipUnless(CONF.compute_feature_enabled.pause,
'Pause is not available.')
@test.attr(type=['negative'])
@@ -360,7 +361,7 @@
self.assertRaises(lib_exc.NotFound, self.client.pause_server,
nonexistent_server)
- @test.idempotent_id('705b8e3a-e8a7-477c-a19b-6868fc24ac75')
+ @decorators.idempotent_id('705b8e3a-e8a7-477c-a19b-6868fc24ac75')
@testtools.skipUnless(CONF.compute_feature_enabled.pause,
'Pause is not available.')
@test.attr(type=['negative'])
@@ -370,7 +371,7 @@
self.assertRaises(lib_exc.NotFound, self.client.unpause_server,
nonexistent_server)
- @test.idempotent_id('c8e639a7-ece8-42dd-a2e0-49615917ba4f')
+ @decorators.idempotent_id('c8e639a7-ece8-42dd-a2e0-49615917ba4f')
@testtools.skipUnless(CONF.compute_feature_enabled.pause,
'Pause is not available.')
@test.attr(type=['negative'])
@@ -380,7 +381,7 @@
self.client.unpause_server,
self.server_id)
- @test.idempotent_id('d1f032d5-7b6e-48aa-b252-d5f16dd994ca')
+ @decorators.idempotent_id('d1f032d5-7b6e-48aa-b252-d5f16dd994ca')
@testtools.skipUnless(CONF.compute_feature_enabled.suspend,
'Suspend is not available.')
@test.attr(type=['negative'])
@@ -390,7 +391,7 @@
self.assertRaises(lib_exc.NotFound, self.client.suspend_server,
nonexistent_server)
- @test.idempotent_id('7f323206-05a9-4bf8-996b-dd5b2036501b')
+ @decorators.idempotent_id('7f323206-05a9-4bf8-996b-dd5b2036501b')
@testtools.skipUnless(CONF.compute_feature_enabled.suspend,
'Suspend is not available.')
@test.attr(type=['negative'])
@@ -404,7 +405,7 @@
self.server_id)
self.client.resume_server(self.server_id)
- @test.idempotent_id('221cd282-bddb-4837-a683-89c2487389b6')
+ @decorators.idempotent_id('221cd282-bddb-4837-a683-89c2487389b6')
@testtools.skipUnless(CONF.compute_feature_enabled.suspend,
'Suspend is not available.')
@test.attr(type=['negative'])
@@ -414,7 +415,7 @@
self.assertRaises(lib_exc.NotFound, self.client.resume_server,
nonexistent_server)
- @test.idempotent_id('ccb6294d-c4c9-498f-8a43-554c098bfadb')
+ @decorators.idempotent_id('ccb6294d-c4c9-498f-8a43-554c098bfadb')
@testtools.skipUnless(CONF.compute_feature_enabled.suspend,
'Suspend is not available.')
@test.attr(type=['negative'])
@@ -425,7 +426,7 @@
self.server_id)
@test.attr(type=['negative'])
- @test.idempotent_id('7dd919e7-413f-4198-bebb-35e2a01b13e9')
+ @decorators.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()
@@ -434,7 +435,7 @@
nonexistent_server, length=10)
@test.attr(type=['negative'])
- @test.idempotent_id('6f47992b-5144-4250-9f8b-f00aa33950f3')
+ @decorators.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()
@@ -443,7 +444,7 @@
nonexistent_server)
@test.attr(type=['negative'])
- @test.idempotent_id('9c6d38cc-fcfb-437a-85b9-7b788af8bf01')
+ @decorators.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()
@@ -452,14 +453,14 @@
nonexistent_server)
@test.attr(type=['negative'])
- @test.idempotent_id('7fcadfab-bd6a-4753-8db7-4a51e51aade9')
+ @decorators.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')
+ @decorators.idempotent_id('abca56e2-a892-48ea-b5e5-e07e69774816')
@testtools.skipUnless(CONF.compute_feature_enabled.shelve,
'Shelve is not available.')
@test.attr(type=['negative'])
@@ -469,7 +470,7 @@
self.assertRaises(lib_exc.NotFound, self.client.shelve_server,
nonexistent_server)
- @test.idempotent_id('443e4f9b-e6bf-4389-b601-3a710f15fddd')
+ @decorators.idempotent_id('443e4f9b-e6bf-4389-b601-3a710f15fddd')
@testtools.skipUnless(CONF.compute_feature_enabled.shelve,
'Shelve is not available.')
@test.attr(type=['negative'])
@@ -490,7 +491,7 @@
self.client.unshelve_server(self.server_id)
- @test.idempotent_id('23d23b37-afaf-40d7-aa5d-5726f82d8821')
+ @decorators.idempotent_id('23d23b37-afaf-40d7-aa5d-5726f82d8821')
@testtools.skipUnless(CONF.compute_feature_enabled.shelve,
'Shelve is not available.')
@test.attr(type=['negative'])
@@ -500,7 +501,7 @@
self.assertRaises(lib_exc.NotFound, self.client.unshelve_server,
nonexistent_server)
- @test.idempotent_id('8f198ded-1cca-4228-9e65-c6b449c54880')
+ @decorators.idempotent_id('8f198ded-1cca-4228-9e65-c6b449c54880')
@testtools.skipUnless(CONF.compute_feature_enabled.shelve,
'Shelve is not available.')
@test.attr(type=['negative'])
@@ -511,7 +512,7 @@
self.server_id)
@test.attr(type=['negative'])
- @test.idempotent_id('74085be3-a370-4ca2-bc51-2d0e10e0f573')
+ @decorators.idempotent_id('74085be3-a370-4ca2-bc51-2d0e10e0f573')
@test.services('volume', 'image')
def test_create_server_from_non_bootable_volume(self):
# Create a volume
@@ -565,7 +566,7 @@
cls.server_id = server['id']
@test.attr(type=['negative'])
- @test.idempotent_id('543d84c1-dd2e-4c6d-8cb2-b9da0efaa384')
+ @decorators.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
@@ -575,7 +576,7 @@
name=new_name)
@test.attr(type=['negative'])
- @test.idempotent_id('5c75009d-3eea-423e-bea3-61b09fd25f9c')
+ @decorators.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,
diff --git a/tempest/api/compute/servers/test_virtual_interfaces.py b/tempest/api/compute/servers/test_virtual_interfaces.py
index 08c34d3..610121b 100644
--- a/tempest/api/compute/servers/test_virtual_interfaces.py
+++ b/tempest/api/compute/servers/test_virtual_interfaces.py
@@ -18,6 +18,7 @@
from tempest.api.compute import base
from tempest import config
+from tempest.lib import decorators
from tempest.lib import exceptions
from tempest import test
@@ -42,7 +43,7 @@
super(VirtualInterfacesTestJSON, cls).resource_setup()
cls.server = cls.create_test_server(wait_until='ACTIVE')
- @test.idempotent_id('96c4e2ef-5e4d-4d7f-87f5-fed6dca18016')
+ @decorators.idempotent_id('96c4e2ef-5e4d-4d7f-87f5-fed6dca18016')
@test.services('network')
def test_list_virtual_interfaces(self):
# Positive test:Should be able to GET the virtual interfaces list
diff --git a/tempest/api/compute/servers/test_virtual_interfaces_negative.py b/tempest/api/compute/servers/test_virtual_interfaces_negative.py
index 912b0a1..b1374d2 100644
--- a/tempest/api/compute/servers/test_virtual_interfaces_negative.py
+++ b/tempest/api/compute/servers/test_virtual_interfaces_negative.py
@@ -15,6 +15,7 @@
from tempest.api.compute import base
from tempest.lib.common.utils import data_utils
+from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -33,7 +34,7 @@
cls.client = cls.servers_client
@test.attr(type=['negative'])
- @test.idempotent_id('64ebd03c-1089-4306-93fa-60f5eb5c803c')
+ @decorators.idempotent_id('64ebd03c-1089-4306-93fa-60f5eb5c803c')
@test.services('network')
def test_list_virtual_interfaces_invalid_server_id(self):
# Negative test: Should not be able to GET virtual interfaces
diff --git a/tempest/api/compute/volumes/test_volumes_list.py b/tempest/api/compute/volumes/test_volumes_list.py
index 82cc653..0481570 100644
--- a/tempest/api/compute/volumes/test_volumes_list.py
+++ b/tempest/api/compute/volumes/test_volumes_list.py
@@ -45,7 +45,7 @@
# Create 3 Volumes
cls.volume_list = []
cls.volume_id_list = []
- for i in range(3):
+ for _ in range(3):
metadata = {'Type': 'work'}
volume = cls.create_volume(metadata=metadata)
volume = cls.client.show_volume(volume['id'])['volume']
diff --git a/tempest/api/identity/admin/v2/test_endpoints.py b/tempest/api/identity/admin/v2/test_endpoints.py
index 651a316..0da579c 100644
--- a/tempest/api/identity/admin/v2/test_endpoints.py
+++ b/tempest/api/identity/admin/v2/test_endpoints.py
@@ -34,7 +34,7 @@
cls.service_ids.append(cls.service_id)
# Create endpoints so as to use for LIST and GET test cases
cls.setup_endpoints = list()
- for i in range(2):
+ for _ in range(2):
region = data_utils.rand_name('region')
url = data_utils.rand_url()
endpoint = cls.endpoints_client.create_endpoint(
diff --git a/tempest/api/identity/admin/v3/test_credentials.py b/tempest/api/identity/admin/v3/test_credentials.py
index a0d8748..d4fe32d 100644
--- a/tempest/api/identity/admin/v3/test_credentials.py
+++ b/tempest/api/identity/admin/v3/test_credentials.py
@@ -31,7 +31,7 @@
u_desc = '%s description' % u_name
u_email = '%s@testmail.tm' % u_name
u_password = data_utils.rand_password()
- for i in range(2):
+ for _ in range(2):
cls.project = cls.projects_client.create_project(
data_utils.rand_name('project'),
description=data_utils.rand_name('project-desc'))['project']
@@ -92,7 +92,7 @@
created_cred_ids = list()
fetched_cred_ids = list()
- for i in range(2):
+ for _ in range(2):
blob = '{"access": "%s", "secret": "%s"}' % (
data_utils.rand_name('Access'), data_utils.rand_name('Secret'))
cred = self.creds_client.create_credential(
diff --git a/tempest/api/identity/admin/v3/test_endpoints.py b/tempest/api/identity/admin/v3/test_endpoints.py
index 655e4ef..ef450a2 100644
--- a/tempest/api/identity/admin/v3/test_endpoints.py
+++ b/tempest/api/identity/admin/v3/test_endpoints.py
@@ -40,7 +40,7 @@
cls.service_ids.append(cls.service_id)
# Create endpoints so as to use for LIST and GET test cases
cls.setup_endpoints = list()
- for i in range(2):
+ for _ in range(2):
region = data_utils.rand_name('region')
url = data_utils.rand_url()
interface = 'public'
diff --git a/tempest/api/identity/admin/v3/test_groups.py b/tempest/api/identity/admin/v3/test_groups.py
index 3cbcc1f..34b4468 100644
--- a/tempest/api/identity/admin/v3/test_groups.py
+++ b/tempest/api/identity/admin/v3/test_groups.py
@@ -80,7 +80,7 @@
self.addCleanup(self.groups_client.delete_group, group['id'])
# add user into group
users = []
- for i in range(3):
+ for _ in range(3):
name = data_utils.rand_name('User')
password = data_utils.rand_password()
user = self.users_client.create_user(name=name,
@@ -110,7 +110,7 @@
self.addCleanup(self.users_client.delete_user, user['id'])
# create two groups, and add user into them
groups = []
- for i in range(2):
+ for _ in range(2):
name = data_utils.rand_name('Group')
group = self.groups_client.create_group(
name=name, domain_id=self.domain['id'])['group']
diff --git a/tempest/api/identity/admin/v3/test_regions.py b/tempest/api/identity/admin/v3/test_regions.py
index 95894a6..b5ea90d 100644
--- a/tempest/api/identity/admin/v3/test_regions.py
+++ b/tempest/api/identity/admin/v3/test_regions.py
@@ -30,7 +30,7 @@
def resource_setup(cls):
super(RegionsTestJSON, cls).resource_setup()
cls.setup_regions = list()
- for i in range(2):
+ for _ in range(2):
r_description = data_utils.rand_name('description')
region = cls.client.create_region(
description=r_description)['region']
diff --git a/tempest/api/identity/admin/v3/test_users.py b/tempest/api/identity/admin/v3/test_users.py
index 3ec4ff1..54c62c7 100644
--- a/tempest/api/identity/admin/v3/test_users.py
+++ b/tempest/api/identity/admin/v3/test_users.py
@@ -125,7 +125,7 @@
user = self.users_client.show_user(user_body['id'])['user']
role = self.roles_client.show_role(role_body['id'])['role']
- for i in range(2):
+ for _ in range(2):
# Creating project so as to assign role
project_body = self.projects_client.create_project(
data_utils.rand_name('project'),
diff --git a/tempest/api/identity/v2/test_users.py b/tempest/api/identity/v2/test_users.py
index bafb1f2..06730f8 100644
--- a/tempest/api/identity/v2/test_users.py
+++ b/tempest/api/identity/v2/test_users.py
@@ -58,7 +58,7 @@
if CONF.identity_feature_enabled.security_compliance:
# First we need to clear the password history
unique_count = CONF.identity.user_unique_last_password_count
- for i in range(unique_count):
+ for _ in range(unique_count):
random_pass = data_utils.rand_password()
self._update_password(
user_id, original_password=new_pass, password=random_pass)
diff --git a/tempest/api/identity/v3/test_users.py b/tempest/api/identity/v3/test_users.py
index f389a8f..9592cb9 100644
--- a/tempest/api/identity/v3/test_users.py
+++ b/tempest/api/identity/v3/test_users.py
@@ -60,7 +60,7 @@
if CONF.identity_feature_enabled.security_compliance:
# First we need to clear the password history
unique_count = CONF.identity.user_unique_last_password_count
- for i in range(unique_count):
+ for _ in range(unique_count):
random_pass = data_utils.rand_password()
self._update_password(
original_password=new_pass, password=random_pass)
@@ -142,7 +142,7 @@
# Lock user account by using the wrong password to login
bad_password = data_utils.rand_password()
- for i in range(CONF.identity.user_lockout_failure_attempts):
+ for _ in range(CONF.identity.user_lockout_failure_attempts):
self.assertRaises(exceptions.Unauthorized,
self.non_admin_token.auth,
user_id=self.user_id,
diff --git a/tempest/api/image/v2/test_images.py b/tempest/api/image/v2/test_images.py
index cdf0b23..36dc6c3 100644
--- a/tempest/api/image/v2/test_images.py
+++ b/tempest/api/image/v2/test_images.py
@@ -126,11 +126,12 @@
self.assertEqual(new_image_name, body['name'])
-class ListImagesTest(base.BaseV2ImageTest):
+class ListUserImagesTest(base.BaseV2ImageTest):
+ """Here we test the listing of image information"""
@classmethod
def resource_setup(cls):
- super(ListImagesTest, cls).resource_setup()
+ super(ListUserImagesTest, cls).resource_setup()
# We add a few images here to test the listing functionality of
# the images API
container_fmts = CONF.image.container_formats
@@ -166,10 +167,6 @@
return image['id']
-
-class ListUserImagesTest(ListImagesTest):
- """Here we test the listing of image information"""
-
def _list_by_param_value_and_assert(self, params):
"""Perform list action with given params and validates result."""
# Retrieve the list of images that meet the filter
@@ -323,7 +320,7 @@
self.assertEqual("images", body['name'])
-class ListSharedImagesTest(ListImagesTest):
+class ListSharedImagesTest(base.BaseV2ImageTest):
"""Here we test the listing of a shared image information"""
credentials = ['primary', 'alt']
diff --git a/tempest/api/object_storage/test_container_acl.py b/tempest/api/object_storage/test_container_acl.py
index ffdd1de..e555fd9 100644
--- a/tempest/api/object_storage/test_container_acl.py
+++ b/tempest/api/object_storage/test_container_acl.py
@@ -26,17 +26,6 @@
credentials = [['operator', CONF.object_storage.operator_role],
['operator_alt', CONF.object_storage.operator_role]]
- @classmethod
- def setup_credentials(cls):
- super(ObjectTestACLs, cls).setup_credentials()
- cls.os = cls.os_roles_operator
- cls.os_operator = cls.os_roles_operator_alt
-
- @classmethod
- def resource_setup(cls):
- super(ObjectTestACLs, cls).resource_setup()
- cls.test_auth_data = cls.os_operator.auth_provider.auth_data
-
def setUp(self):
super(ObjectTestACLs, self).setUp()
self.container_name = self.create_container()
@@ -49,24 +38,26 @@
def test_read_object_with_rights(self):
# attempt to read object using authorized user
# update X-Container-Read metadata ACL
- tenant_name = self.os_operator.credentials.tenant_name
- username = self.os_operator.credentials.username
+ tenant_name = self.os_roles_operator_alt.credentials.tenant_name
+ username = self.os_roles_operator_alt.credentials.username
cont_headers = {'X-Container-Read': tenant_name + ':' + username}
- resp_meta, body = self.container_client.update_container_metadata(
- self.container_name, metadata=cont_headers,
- metadata_prefix='')
+ resp_meta, body = self.os_roles_operator.container_client.\
+ update_container_metadata(
+ self.container_name, metadata=cont_headers,
+ metadata_prefix='')
self.assertHeaders(resp_meta, 'Container', 'POST')
# create object
object_name = data_utils.rand_name(name='Object')
- resp, _ = self.object_client.create_object(self.container_name,
- object_name, 'data')
+ resp, _ = self.os_roles_operator.object_client.create_object(
+ self.container_name, object_name, 'data')
self.assertHeaders(resp, 'Object', 'PUT')
- # Trying to read the object with rights
- self.object_client.auth_provider.set_alt_auth_data(
+ # set alternative authentication data; cannot simply use the
+ # other object client.
+ self.os_roles_operator.object_client.auth_provider.set_alt_auth_data(
request_part='headers',
- auth_data=self.test_auth_data
- )
- resp, _ = self.object_client.get_object(
+ auth_data=self.os_roles_operator_alt.object_client.auth_provider.
+ auth_data)
+ resp, _ = self.os_roles_operator.object_client.get_object(
self.container_name, object_name)
self.assertHeaders(resp, 'Object', 'GET')
@@ -74,20 +65,23 @@
def test_write_object_with_rights(self):
# attempt to write object using authorized user
# update X-Container-Write metadata ACL
- tenant_name = self.os_operator.credentials.tenant_name
- username = self.os_operator.credentials.username
+ tenant_name = self.os_roles_operator_alt.credentials.tenant_name
+ username = self.os_roles_operator_alt.credentials.username
cont_headers = {'X-Container-Write': tenant_name + ':' + username}
- resp_meta, body = self.container_client.update_container_metadata(
- self.container_name, metadata=cont_headers,
- metadata_prefix='')
+ resp_meta, body = self.os_roles_operator.container_client.\
+ update_container_metadata(self.container_name,
+ metadata=cont_headers,
+ metadata_prefix='')
self.assertHeaders(resp_meta, 'Container', 'POST')
- # Trying to write the object with rights
- self.object_client.auth_provider.set_alt_auth_data(
+ # set alternative authentication data; cannot simply use the
+ # other object client.
+ self.os_roles_operator.object_client.auth_provider.set_alt_auth_data(
request_part='headers',
- auth_data=self.test_auth_data
- )
+ auth_data=self.os_roles_operator_alt.object_client.auth_provider.
+ auth_data)
+ # Trying to write the object with rights
object_name = data_utils.rand_name(name='Object')
- resp, _ = self.object_client.create_object(
+ resp, _ = self.os_roles_operator.object_client.create_object(
self.container_name,
object_name, 'data', headers={})
self.assertHeaders(resp, 'Object', 'PUT')
diff --git a/tempest/api/volume/admin/test_volume_retype_with_migration.py b/tempest/api/volume/admin/test_volume_retype_with_migration.py
new file mode 100644
index 0000000..8a69ea3
--- /dev/null
+++ b/tempest/api/volume/admin/test_volume_retype_with_migration.py
@@ -0,0 +1,109 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+
+from oslo_log import log as logging
+
+from tempest.api.volume import base
+from tempest.common import waiters
+from tempest import config
+from tempest import test
+
+CONF = config.CONF
+
+LOG = logging.getLogger(__name__)
+
+
+class VolumeRetypeWithMigrationV2Test(base.BaseVolumeAdminTest):
+
+ @classmethod
+ def skip_checks(cls):
+ super(VolumeRetypeWithMigrationV2Test, cls).skip_checks()
+
+ if not CONF.volume_feature_enabled.multi_backend:
+ raise cls.skipException("Cinder multi-backend feature disabled.")
+
+ if len(set(CONF.volume.backend_names)) < 2:
+ raise cls.skipException("Requires at least two different "
+ "backend names")
+
+ @classmethod
+ def resource_setup(cls):
+ super(VolumeRetypeWithMigrationV2Test, cls).resource_setup()
+ # read backend name from a list.
+ cls.backend_src = CONF.volume.backend_names[0]
+ cls.backend_dst = CONF.volume.backend_names[1]
+
+ extra_specs_src = {"volume_backend_name": cls.backend_src}
+ extra_specs_dst = {"volume_backend_name": cls.backend_dst}
+
+ cls.src_vol_type = cls.create_volume_type(extra_specs=extra_specs_src)
+ cls.dst_vol_type = cls.create_volume_type(extra_specs=extra_specs_dst)
+
+ cls.src_vol = cls.create_volume(volume_type=cls.src_vol_type['name'])
+
+ @classmethod
+ def resource_cleanup(cls):
+ # When retyping a volume, Cinder creates an internal volume in the
+ # target backend. The volume in the source backend is deleted after
+ # the migration, so we need to wait for Cinder delete this volume
+ # before deleting the types we've created.
+
+ # This list should return 2 volumes until the copy and cleanup
+ # process is finished.
+ fetched_list = cls.admin_volume_client.list_volumes(
+ params={'all_tenants': True,
+ 'display_name': cls.src_vol['name']})['volumes']
+
+ for fetched_vol in fetched_list:
+ if fetched_vol['id'] != cls.src_vol['id']:
+ # This is the Cinder internal volume
+ LOG.debug('Waiting for internal volume %s deletion',
+ fetched_vol['id'])
+ cls.admin_volume_client.wait_for_resource_deletion(
+ fetched_vol['id'])
+ break
+
+ super(VolumeRetypeWithMigrationV2Test, cls).resource_cleanup()
+
+ @test.idempotent_id('a1a41f3f-9dad-493e-9f09-3ff197d477cd')
+ def test_available_volume_retype_with_migration(self):
+
+ keys_with_no_change = ('id', 'size', 'description', 'name', 'user_id',
+ 'os-vol-tenant-attr:tenant_id')
+ keys_with_change = ('volume_type', 'os-vol-host-attr:host')
+
+ volume_source = self.admin_volume_client.show_volume(
+ self.src_vol['id'])['volume']
+
+ # TODO(erlon): change this to volumes_client client after Bug
+ # #1657806 is fixed
+ self.admin_volume_client.retype_volume(
+ self.src_vol['id'],
+ new_type=self.dst_vol_type['name'],
+ migration_policy='on-demand')
+
+ waiters.wait_for_volume_retype(self.volumes_client, self.src_vol['id'],
+ self.dst_vol_type['name'])
+ volume_dest = self.admin_volume_client.show_volume(
+ self.src_vol['id'])['volume']
+
+ # Check the volume information after the migration.
+ self.assertEqual('success',
+ volume_dest['os-vol-mig-status-attr:migstat'])
+ self.assertEqual('success', volume_dest['migration_status'])
+
+ for key in keys_with_no_change:
+ self.assertEqual(volume_source[key], volume_dest[key])
+
+ for key in keys_with_change:
+ self.assertNotEqual(volume_source[key], volume_dest[key])
diff --git a/tempest/api/volume/admin/test_volume_types.py b/tempest/api/volume/admin/test_volume_types.py
index 6b2acc6..16be463 100644
--- a/tempest/api/volume/admin/test_volume_types.py
+++ b/tempest/api/volume/admin/test_volume_types.py
@@ -42,7 +42,7 @@
extra_specs = {"storage_protocol": proto,
"vendor_name": vendor}
# Create two volume_types
- for i in range(2):
+ for _ in range(2):
vol_type = self.create_volume_type(
extra_specs=extra_specs)
volume_types.append(vol_type)
@@ -84,7 +84,6 @@
@test.idempotent_id('4e955c3b-49db-4515-9590-0c99f8e471ad')
def test_volume_type_create_get_delete(self):
# Create/get volume type.
- body = {}
name = data_utils.rand_name(self.__class__.__name__ + '-volume-type')
description = data_utils.rand_name("volume-type-description")
proto = CONF.volume.storage_protocol
diff --git a/tempest/api/volume/admin/test_volume_types_negative.py b/tempest/api/volume/admin/test_volume_types_negative.py
index 857e7d2..5332f1e 100644
--- a/tempest/api/volume/admin/test_volume_types_negative.py
+++ b/tempest/api/volume/admin/test_volume_types_negative.py
@@ -51,6 +51,14 @@
self.admin_volume_types_client.delete_volume_type,
data_utils.rand_uuid())
+ @test.idempotent_id('8c09f849-f225-4d78-ba87-bffd9a5e0c6f')
+ def test_create_volume_with_private_volume_type(self):
+ # Should not be able to create volume with private volume type.
+ params = {'os-volume-type-access:is_public': False}
+ volume_type = self.create_volume_type(**params)
+ self.assertRaises(lib_exc.NotFound,
+ self.create_volume, volume_type=volume_type['id'])
+
class VolumeTypesNegativeV1Test(VolumeTypesNegativeV2Test):
_api_version = 1
diff --git a/tempest/api/volume/admin/v2/test_backends_capabilities.py b/tempest/api/volume/admin/v2/test_backends_capabilities.py
index fc9066c..9751845 100644
--- a/tempest/api/volume/admin/v2/test_backends_capabilities.py
+++ b/tempest/api/volume/admin/v2/test_backends_capabilities.py
@@ -72,8 +72,8 @@
]
# Returns a tuple of VOLUME_STATS values
- expected_list = map(operator.itemgetter(*VOLUME_STATS),
- cinder_pools)
- observed_list = map(operator.itemgetter(*VOLUME_STATS),
- capabilities)
+ expected_list = list(map(operator.itemgetter(*VOLUME_STATS),
+ cinder_pools))
+ observed_list = list(map(operator.itemgetter(*VOLUME_STATS),
+ capabilities))
self.assertEqual(expected_list, observed_list)
diff --git a/tempest/api/volume/admin/v2/test_volumes_list.py b/tempest/api/volume/admin/v2/test_volumes_list.py
index cdd9df9..fd36d0a 100644
--- a/tempest/api/volume/admin/v2/test_volumes_list.py
+++ b/tempest/api/volume/admin/v2/test_volumes_list.py
@@ -32,7 +32,7 @@
# NOTE(zhufl): When using pre-provisioned credentials, the project
# may have volumes other than those created below.
cls.volume_list = cls.volumes_client.list_volumes()['volumes']
- for i in range(3):
+ for _ in range(3):
volume = cls.create_volume()
# Fetch volume details
volume_details = cls.volumes_client.show_volume(
diff --git a/tempest/api/volume/test_volumes_list.py b/tempest/api/volume/test_volumes_list.py
index 030ea6c..5e3f49f 100644
--- a/tempest/api/volume/test_volumes_list.py
+++ b/tempest/api/volume/test_volumes_list.py
@@ -61,7 +61,7 @@
# Create 3 test volumes
cls.volume_list = []
cls.metadata = {'Type': 'work'}
- for i in range(3):
+ for _ in range(3):
volume = cls.create_volume(metadata=cls.metadata)
volume = cls.volumes_client.show_volume(volume['id'])['volume']
cls.volume_list.append(volume)
diff --git a/tempest/api/volume/test_volumes_snapshots_list.py b/tempest/api/volume/test_volumes_snapshots_list.py
index 4416bef..b831252 100644
--- a/tempest/api/volume/test_volumes_snapshots_list.py
+++ b/tempest/api/volume/test_volumes_snapshots_list.py
@@ -105,12 +105,6 @@
# List returns zero elements
self._list_snapshots_by_param_limit(limit=0, expected_elements=0)
- def cleanup_snapshot(self, snapshot):
- # Delete the snapshot
- self.snapshots_client.delete_snapshot(snapshot['id'])
- self.snapshots_client.wait_for_resource_deletion(snapshot['id'])
- self.snapshots.remove(snapshot)
-
class VolumesV1SnapshotLimitTestJSON(VolumesV2SnapshotListTestJSON):
_api_version = 1
diff --git a/tempest/api/volume/v2/test_volumes_list.py b/tempest/api/volume/v2/test_volumes_list.py
index fb8c65d..28ba941 100644
--- a/tempest/api/volume/v2/test_volumes_list.py
+++ b/tempest/api/volume/v2/test_volumes_list.py
@@ -42,7 +42,7 @@
# may have volumes other than those created below.
existing_volumes = cls.volumes_client.list_volumes()['volumes']
cls.volume_id_list = [vol['id'] for vol in existing_volumes]
- for i in range(3):
+ for _ in range(3):
volume = cls.create_volume(metadata=cls.metadata)
cls.volume_id_list.append(volume['id'])
diff --git a/tempest/lib/api_schema/response/compute/v2_1/hosts.py b/tempest/lib/api_schema/response/compute/v2_1/hosts.py
index ae70ff1..cae3435 100644
--- a/tempest/lib/api_schema/response/compute/v2_1/hosts.py
+++ b/tempest/lib/api_schema/response/compute/v2_1/hosts.py
@@ -111,6 +111,9 @@
'status': {'enum': ['enabled', 'disabled']}
},
'additionalProperties': False,
- 'required': ['host', 'maintenance_mode', 'status']
+ 'anyOf': [
+ {'required': ['host', 'status']},
+ {'required': ['host', 'maintenance_mode']}
+ ]
}
}
diff --git a/tempest/lib/cmd/check_uuid.py b/tempest/lib/cmd/check_uuid.py
index 88ce775..2fe957b 100755
--- a/tempest/lib/cmd/check_uuid.py
+++ b/tempest/lib/cmd/check_uuid.py
@@ -26,7 +26,10 @@
from oslo_utils import uuidutils
import six.moves.urllib.parse as urlparse
-DECORATOR_MODULE = 'test'
+# TODO(oomichi): Need to remove this after switching all modules to decorators
+OLD_DECORATOR_MODULE = 'test'
+
+DECORATOR_MODULE = 'decorators'
DECORATOR_NAME = 'idempotent_id'
DECORATOR_IMPORT = 'tempest.%s' % DECORATOR_MODULE
IMPORT_LINE = 'from tempest import %s' % DECORATOR_MODULE
@@ -124,7 +127,8 @@
hasattr(decorator.func, 'attr') and
decorator.func.attr == DECORATOR_NAME and
hasattr(decorator.func, 'value') and
- decorator.func.value.id == DECORATOR_MODULE):
+ (decorator.func.value.id == DECORATOR_MODULE or
+ decorator.func.value.id == OLD_DECORATOR_MODULE)):
for arg in decorator.args:
idempotent_id = ast.literal_eval(arg)
return idempotent_id
diff --git a/tempest/lib/cmd/skip_tracker.py b/tempest/lib/cmd/skip_tracker.py
index d95aa46..07b811d 100755
--- a/tempest/lib/cmd/skip_tracker.py
+++ b/tempest/lib/cmd/skip_tracker.py
@@ -21,16 +21,18 @@
"""
import argparse
-import logging
import os
import re
+from oslo_log import log as logging
+
try:
from launchpadlib import launchpad
except ImportError:
launchpad = None
LPCACHEDIR = os.path.expanduser('~/.launchpadlib/cache')
+LOG = logging.getLogger(__name__)
def parse_args():
@@ -40,11 +42,11 @@
def info(msg, *args, **kwargs):
- logging.info(msg, *args, **kwargs)
+ LOG.info(msg, *args, **kwargs)
def debug(msg, *args, **kwargs):
- logging.debug(msg, *args, **kwargs)
+ LOG.debug(msg, *args, **kwargs)
def find_skips(start):
@@ -110,8 +112,6 @@
def main():
- logging.basicConfig(format='%(levelname)s: %(message)s',
- level=logging.INFO)
parser = parse_args()
results = find_skips(parser.test_path)
unique_bugs = sorted(set([bug for (method, bug) in get_results(results)]))
diff --git a/tempest/scenario/test_server_basic_ops.py b/tempest/scenario/test_server_basic_ops.py
index 2d2f7df..4a938f9 100644
--- a/tempest/scenario/test_server_basic_ops.py
+++ b/tempest/scenario/test_server_basic_ops.py
@@ -18,6 +18,7 @@
from tempest.common import waiters
from tempest import config
+from tempest.lib.common.utils import data_utils
from tempest.lib.common.utils import test_utils
from tempest.lib import exceptions
from tempest.scenario import manager
@@ -79,6 +80,14 @@
'verify metadata on server. '
'%s is empty.' % md_url)
+ # Also, test a POST
+ md_url = 'http://169.254.169.254/openstack/2013-10-17/password'
+ data = data_utils.arbitrary_string(100)
+ cmd = 'curl -X POST -d ' + data + ' ' + md_url
+ self.ssh_client.exec_command(cmd)
+ result = self.servers_client.show_password(self.instance['id'])
+ self.assertEqual(data, result['password'])
+
def _mount_config_drive(self):
cmd_blkid = 'blkid | grep -i config-2'
result = self.ssh_client.exec_command(cmd_blkid)
diff --git a/tempest/tests/lib/services/identity/v3/test_roles_client.py b/tempest/tests/lib/services/identity/v3/test_roles_client.py
index bad1ef9..4f70b47 100644
--- a/tempest/tests/lib/services/identity/v3/test_roles_client.py
+++ b/tempest/tests/lib/services/identity/v3/test_roles_client.py
@@ -18,32 +18,40 @@
class TestRolesClient(base.BaseServiceTest):
+
+ FAKE_ROLE_ID = "1"
+ FAKE_ROLE_NAME = "test"
+ FAKE_DOMAIN_ID = "1"
+
+ FAKE_ROLE_ID_2 = "2"
+ FAKE_ROLE_NAME_2 = "test2"
+
FAKE_ROLE_INFO = {
"role": {
- "domain_id": "1",
- "id": "1",
- "name": "test",
- "links": "example.com"
+ "domain_id": FAKE_DOMAIN_ID,
+ "id": FAKE_ROLE_ID,
+ "name": FAKE_ROLE_NAME,
+ "links": {
+ "self": "http://example.com/identity/v3/roles/%s" % (
+ FAKE_ROLE_ID)
+ }
}
}
- FAKE_LIST_ROLES = {
- "roles": [
- {
- "domain_id": "1",
- "id": "1",
- "name": "test",
- "links": "example.com"
- },
- {
- "domain_id": "2",
- "id": "2",
- "name": "test2",
- "links": "example.com"
+ FAKE_ROLE_INFO_2 = {
+ "role": {
+ "domain_id": FAKE_DOMAIN_ID,
+ "id": FAKE_ROLE_ID_2,
+ "name": FAKE_ROLE_NAME_2,
+ "links": {
+ "self": "http://example.com/identity/v3/roles/%s" % (
+ FAKE_ROLE_ID_2)
}
- ]
+ }
}
+ FAKE_LIST_ROLES = {"roles": [FAKE_ROLE_INFO, FAKE_ROLE_INFO_2]}
+
def setUp(self):
super(TestRolesClient, self).setUp()
fake_auth = fake_auth_provider.FakeAuthProvider()
@@ -56,8 +64,8 @@
'tempest.lib.common.rest_client.RestClient.post',
self.FAKE_ROLE_INFO,
bytes_body,
- domain_id="1",
- name="test",
+ domain_id=self.FAKE_DOMAIN_ID,
+ name=self.FAKE_ROLE_NAME,
status=201)
def _test_show_role(self, bytes_body=False):
@@ -66,7 +74,7 @@
'tempest.lib.common.rest_client.RestClient.get',
self.FAKE_ROLE_INFO,
bytes_body,
- role_id="1")
+ role_id=self.FAKE_ROLE_ID)
def _test_list_roles(self, bytes_body=False):
self.check_service_client_function(
@@ -81,8 +89,8 @@
'tempest.lib.common.rest_client.RestClient.patch',
self.FAKE_ROLE_INFO,
bytes_body,
- role_id="1",
- name="test")
+ role_id=self.FAKE_ROLE_ID,
+ name=self.FAKE_ROLE_NAME)
def _test_create_user_role_on_project(self, bytes_body=False):
self.check_service_client_function(
@@ -193,7 +201,7 @@
self.client.delete_role,
'tempest.lib.common.rest_client.RestClient.delete',
{},
- role_id="1",
+ role_id=self.FAKE_ROLE_ID,
status=204)
def test_create_user_role_on_project_with_str_body(self):
diff --git a/tools/skip_tracker.py b/tools/skip_tracker.py
index 55f41a6..9735f77 100755
--- a/tools/skip_tracker.py
+++ b/tools/skip_tracker.py
@@ -20,23 +20,25 @@
is fixed but a skip is still in the Tempest test code
"""
-import logging
import os
import re
from launchpadlib import launchpad
+from oslo_log import log as logging
BASEDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
TESTDIR = os.path.join(BASEDIR, 'tempest')
LPCACHEDIR = os.path.expanduser('~/.launchpadlib/cache')
+LOG = logging.getLogger(__name__)
+
def info(msg, *args, **kwargs):
- logging.info(msg, *args, **kwargs)
+ LOG.info(msg, *args, **kwargs)
def debug(msg, *args, **kwargs):
- logging.debug(msg, *args, **kwargs)
+ LOG.debug(msg, *args, **kwargs)
def find_skips(start=TESTDIR):
@@ -102,8 +104,6 @@
if __name__ == '__main__':
- logging.basicConfig(format='%(levelname)s: %(message)s',
- level=logging.INFO)
results = find_skips()
unique_bugs = sorted(set([bug for (method, bug) in get_results(results)]))
unskips = []