Merge "Merge flavor response schema into one file"
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index fae24c4..1010ba5 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -253,10 +253,6 @@
# image. (string value)
#image_alt_ssh_user = root
-# Password used to authenticate to an instance using the alternate
-# image. (string value)
-#image_alt_ssh_password = password
-
# Time in seconds between build status checks. (integer value)
#build_interval = 1
@@ -269,16 +265,16 @@
#run_ssh = false
# Auth method used for authenticate to the instance. Valid choices
-# are: keypair, configured, adminpass. keypair: start the servers with
-# an ssh keypair. configured: use the configured user and password.
-# adminpass: use the injected adminPass. disabled: avoid using ssh
-# when it is an option. (string value)
+# are: keypair, configured, adminpass and disabled. Keypair: start the
+# servers with a ssh keypair. Configured: use the configured user and
+# password. Adminpass: use the injected adminPass. Disabled: avoid
+# using ssh when it is an option. (string value)
#ssh_auth_method = keypair
# How to connect to the instance? fixed: using the first ip belongs
-# the fixed network floating: creating and using a floating ip (string
-# value)
-#ssh_connect_method = fixed
+# the fixed network floating: creating and using a floating ip.
+# (string value)
+#ssh_connect_method = floating
# User name used to authenticate to an instance. (string value)
#ssh_user = root
@@ -286,6 +282,14 @@
# Timeout in seconds to wait for ping to succeed. (integer value)
#ping_timeout = 120
+# The packet size for ping packets originating from remote linux hosts
+# (integer value)
+#ping_size = 56
+
+# The number of ping packets originating from remote linux hosts
+# (integer value)
+#ping_count = 1
+
# Timeout in seconds to wait for authentication to succeed. (integer
# value)
#ssh_timeout = 300
@@ -301,7 +305,8 @@
# Name of the fixed network that is visible to all test tenants. If
# multiple networks are available for a tenant this is the network
# which will be used for creating servers if tempest does not create a
-# network or a network is not specified elsewhere (string value)
+# network or a network is not specified elsewhere. It may be used for
+# ssh validation only if floating IPs are disabled. (string value)
#fixed_network_name = <None>
# Network used for SSH connections. Ignored if
@@ -326,10 +331,6 @@
# Allowed values: public, admin, internal, publicURL, adminURL, internalURL
#endpoint_type = publicURL
-# Path to a private key file for SSH access to remote hosts (string
-# value)
-#path_to_private_key = <None>
-
# Expected device name when a volume is attached to an instance
# (string value)
#volume_device_name = vdb
@@ -667,7 +668,7 @@
#non_ssh_image_regex = ^.*[Ww]in.*$
# List of user mapped to regex to matching image names. (string value)
-#ssh_user_regex = [["^.*[Cc]irros.*$", "root"]]
+#ssh_user_regex = [["^.*[Cc]irros.*$", "cirros"]]
[messaging]
@@ -746,14 +747,19 @@
# The mask bits for tenant ipv6 subnets (integer value)
#tenant_network_v6_mask_bits = 64
-# Whether tenant network connectivity should be evaluated directly
-# (boolean value)
+# Whether tenant networks can be reached directly from the test
+# client. This must be set to True when the 'fixed' ssh_connect_method
+# is selected. (boolean value)
#tenant_networks_reachable = false
# Id of the public network that provides external connectivity (string
# value)
#public_network_id =
+# Default floating network name. Used to allocate floating IPs when
+# neutron is enabled. (string value)
+#floating_network_name = <None>
+
# Id of the public router that provides external connectivity. This
# should only be used when Neutron's 'allow_overlapping_ips' is set to
# 'False' in neutron.conf. usually not needed past 'Grizzly' release
@@ -1071,6 +1077,38 @@
#too_slow_to_test = true
+[validation]
+
+#
+# From tempest.config
+#
+
+# Default IP type used for validation: -fixed: uses the first IP
+# belonging to the fixed network -floating: creates and uses a
+# floating IP (string value)
+# Allowed values: fixed, floating
+#connect_method = floating
+
+# Default authentication method to the instance. Only ssh via keypair
+# is supported for now. Additional methods will be handled in a
+# separate spec. (string value)
+# Allowed values: keypair
+#auth_method = keypair
+
+# Default IP version for ssh connections. (integer value)
+#ip_version_for_ssh = 4
+
+# Timeout in seconds to wait for ping to succeed. (integer value)
+#ping_timeout = 120
+
+# Timeout in seconds to wait for the TCP connection to be successful.
+# (integer value)
+#connect_timeout = 60
+
+# Timeout in seconds to wait for the ssh banner. (integer value)
+#ssh_timeout = 300
+
+
[volume]
#
diff --git a/requirements.txt b/requirements.txt
index 35b5144..bf7471e 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -12,7 +12,6 @@
python-glanceclient>=0.15.0
python-cinderclient>=1.1.0
python-heatclient>=0.3.0
-python-saharaclient>=0.8.0
python-swiftclient>=2.2.0
testrepository>=0.0.18
oslo.concurrency>=1.8.0,<1.9.0 # Apache-2.0
diff --git a/tempest/api/compute/test_live_block_migration.py b/tempest/api/compute/admin/test_live_migration.py
similarity index 100%
rename from tempest/api/compute/test_live_block_migration.py
rename to tempest/api/compute/admin/test_live_migration.py
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 4995209..9f1a548 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -352,10 +352,10 @@
@classmethod
def skip_checks(cls):
+ super(BaseComputeAdminTest, cls).skip_checks()
if not credentials.is_admin_available():
msg = ("Missing Identity Admin API credentials in configuration.")
raise cls.skipException(msg)
- super(BaseComputeAdminTest, cls).skip_checks()
@classmethod
def setup_credentials(cls):
diff --git a/tempest/api/identity/admin/v3/test_domains.py b/tempest/api/identity/admin/v3/test_domains.py
index c6d379c..5af9187 100644
--- a/tempest/api/identity/admin/v3/test_domains.py
+++ b/tempest/api/identity/admin/v3/test_domains.py
@@ -96,3 +96,15 @@
self.assertEqual(d_name, domain['name'])
self.assertFalse(domain['enabled'])
self.assertEqual(d_desc, domain['description'])
+
+ @test.attr(type='smoke')
+ @test.idempotent_id('2abf8764-309a-4fa9-bc58-201b799817ad')
+ def test_create_domain_without_description(self):
+ # Create domain only with name
+ d_name = data_utils.rand_name('domain-')
+ domain = self.client.create_domain(d_name)
+ self.addCleanup(self._delete_domain, domain['id'])
+ self.assertIn('id', domain)
+ expected_data = {'name': d_name, 'enabled': True}
+ self.assertIsNone(domain['description'])
+ self.assertDictContainsSubset(expected_data, domain)
diff --git a/tempest/api/network/admin/test_l3_agent_scheduler.py b/tempest/api/network/admin/test_l3_agent_scheduler.py
index ad121b0..fca57c6 100644
--- a/tempest/api/network/admin/test_l3_agent_scheduler.py
+++ b/tempest/api/network/admin/test_l3_agent_scheduler.py
@@ -18,8 +18,16 @@
from tempest import exceptions
from tempest import test
+AGENT_TYPE = 'L3 agent'
+AGENT_MODES = (
+ 'legacy',
+ 'dvr_snat'
+)
+
class L3AgentSchedulerTestJSON(base.BaseAdminNetworkTest):
+ _agent_mode = 'legacy'
+
"""
Tests the following operations in the Neutron API using the REST client for
Neutron:
@@ -46,12 +54,32 @@
body = cls.admin_client.list_agents()
agents = body['agents']
for agent in agents:
- if agent['agent_type'] == 'L3 agent':
+ # TODO(armax): falling back on default _agent_mode can be
+ # dropped as soon as Icehouse is dropped.
+ agent_mode = (
+ agent['configurations'].get('agent_mode', cls._agent_mode))
+ if agent['agent_type'] == AGENT_TYPE and agent_mode in AGENT_MODES:
cls.agent = agent
break
else:
msg = "L3 Agent Scheduler enabled in conf, but L3 Agent not found"
raise exceptions.InvalidConfiguration(msg)
+ cls.router = cls.create_router(data_utils.rand_name('router'))
+ # NOTE(armax): If DVR is an available extension, and the created router
+ # is indeed a distributed one, more resources need to be provisioned
+ # in order to bind the router to the L3 agent.
+ # That said, let's preserve the existing test logic, where the extra
+ # query and setup steps are only required if the extension is available
+ # and only if the router's default type is distributed.
+ if test.is_extension_enabled('dvr', 'network'):
+ is_dvr_router = cls.admin_client.show_router(
+ cls.router['id'])['router'].get('distributed', False)
+ if is_dvr_router:
+ cls.network = cls.create_network()
+ cls.create_subnet(cls.network)
+ cls.port = cls.create_port(cls.network)
+ cls.client.add_router_interface_with_port_id(
+ cls.router['id'], cls.port['id'])
@test.attr(type='smoke')
@test.idempotent_id('b7ce6e89-e837-4ded-9b78-9ed3c9c6a45a')
@@ -62,22 +90,18 @@
@test.idempotent_id('9464e5e7-8625-49c3-8fd1-89c52be59d66')
def test_add_list_remove_router_on_l3_agent(self):
l3_agent_ids = list()
- name = data_utils.rand_name('router1-')
- router = self.client.create_router(name)
- self.addCleanup(self.client.delete_router, router['router']['id'])
self.admin_client.add_router_to_l3_agent(
self.agent['id'],
- router['router']['id'])
- body = self.admin_client.list_l3_agents_hosting_router(
- router['router']['id'])
+ self.router['id'])
+ body = (
+ self.admin_client.list_l3_agents_hosting_router(self.router['id']))
for agent in body['agents']:
l3_agent_ids.append(agent['id'])
self.assertIn('agent_type', agent)
self.assertEqual('L3 agent', agent['agent_type'])
self.assertIn(self.agent['id'], l3_agent_ids)
- del l3_agent_ids[:]
body = self.admin_client.remove_router_from_l3_agent(
self.agent['id'],
- router['router']['id'])
+ self.router['id'])
# NOTE(afazekas): The deletion not asserted, because neutron
# is not forbidden to reschedule the router to the same agent
diff --git a/tempest/api/orchestration/base.py b/tempest/api/orchestration/base.py
index 59fdec0..d4b107e 100644
--- a/tempest/api/orchestration/base.py
+++ b/tempest/api/orchestration/base.py
@@ -199,5 +199,5 @@
for r in resources)
def get_stack_output(self, stack_identifier, output_key):
- body = self.client.get_stack(stack_identifier)
+ body = self.client.show_stack(stack_identifier)
return self.stack_output(body, output_key)
diff --git a/tempest/api/orchestration/stacks/test_neutron_resources.py b/tempest/api/orchestration/stacks/test_neutron_resources.py
index bcf091a..81e6e82 100644
--- a/tempest/api/orchestration/stacks/test_neutron_resources.py
+++ b/tempest/api/orchestration/stacks/test_neutron_resources.py
@@ -81,8 +81,8 @@
# attempt to log the server console to help with debugging
# the cause of the server not signalling the waitcondition
# to heat.
- body = cls.client.get_resource(cls.stack_identifier,
- 'Server')
+ body = cls.client.show_resource(cls.stack_identifier,
+ 'Server')
server_id = body['physical_resource_id']
LOG.debug('Console output for %s', server_id)
output = cls.servers_client.get_console_output(
diff --git a/tempest/api/orchestration/stacks/test_non_empty_stack.py b/tempest/api/orchestration/stacks/test_non_empty_stack.py
index 9c5a6d5..5f96de3 100644
--- a/tempest/api/orchestration/stacks/test_non_empty_stack.py
+++ b/tempest/api/orchestration/stacks/test_non_empty_stack.py
@@ -66,7 +66,7 @@
@test.idempotent_id('992f96e3-41ee-4ff6-91c7-bcfb670c0919')
def test_stack_show(self):
"""Getting details about created stack should be possible."""
- stack = self.client.get_stack(self.stack_name)
+ stack = self.client.show_stack(self.stack_name)
self.assertIsInstance(stack, dict)
self.assert_fields_in_dict(stack, 'stack_name', 'id', 'links',
'parameters', 'outputs', 'disable_rollback',
@@ -105,8 +105,8 @@
@test.idempotent_id('2aba03b3-392f-4237-900b-1f5a5e9bd962')
def test_show_resource(self):
"""Getting details about created resource should be possible."""
- resource = self.client.get_resource(self.stack_identifier,
- self.resource_name)
+ resource = self.client.show_resource(self.stack_identifier,
+ self.resource_name)
self.assertIsInstance(resource, dict)
self.assert_fields_in_dict(resource, 'resource_name', 'description',
'links', 'logical_resource_id',
diff --git a/tempest/api/orchestration/stacks/test_nova_keypair_resources.py b/tempest/api/orchestration/stacks/test_nova_keypair_resources.py
index 28ef5a5..acdd4c7 100644
--- a/tempest/api/orchestration/stacks/test_nova_keypair_resources.py
+++ b/tempest/api/orchestration/stacks/test_nova_keypair_resources.py
@@ -73,7 +73,7 @@
@test.attr(type='gate')
@test.idempotent_id('8d77dec7-91fd-45a6-943d-5abd45e338a4')
def test_stack_keypairs_output(self):
- stack = self.client.get_stack(self.stack_name)
+ stack = self.client.show_stack(self.stack_name)
self.assertIsInstance(stack, dict)
output_map = {}
diff --git a/tempest/api/orchestration/stacks/test_resource_types.py b/tempest/api/orchestration/stacks/test_resource_types.py
index 32b0b8e..8f15f9c 100644
--- a/tempest/api/orchestration/stacks/test_resource_types.py
+++ b/tempest/api/orchestration/stacks/test_resource_types.py
@@ -32,7 +32,7 @@
self.assertNotEmpty(resource_types)
for resource_type in resource_types:
- type_schema = self.client.get_resource_type(resource_type)
+ type_schema = self.client.show_resource_type(resource_type)
self.assert_fields_in_dict(type_schema, 'properties',
'attributes', 'resource_type')
self.assertEqual(resource_type, type_schema['resource_type'])
@@ -41,7 +41,7 @@
@test.idempotent_id('8401821d-65fe-4d43-9fa3-57d5ce3a35c7')
def test_resource_type_template(self):
"""Verify it is possible to get template about resource types."""
- type_template = self.client.get_resource_type_template(
+ type_template = self.client.show_resource_type_template(
'OS::Nova::Server')
self.assert_fields_in_dict(
type_template,
diff --git a/tempest/api/orchestration/stacks/test_soft_conf.py b/tempest/api/orchestration/stacks/test_soft_conf.py
index 649bf47..13f0a6c 100644
--- a/tempest/api/orchestration/stacks/test_soft_conf.py
+++ b/tempest/api/orchestration/stacks/test_soft_conf.py
@@ -71,28 +71,28 @@
self.client.delete_software_deploy(deploy_id)
# Testing that it is really gone
self.assertRaises(
- lib_exc.NotFound, self.client.get_software_deploy,
+ lib_exc.NotFound, self.client.show_software_deployment,
self.deployment_id)
def _config_delete(self, config_id):
self.client.delete_software_config(config_id)
# Testing that it is really gone
self.assertRaises(
- lib_exc.NotFound, self.client.get_software_config, config_id)
+ lib_exc.NotFound, self.client.show_software_config, config_id)
@test.attr(type='smoke')
@test.idempotent_id('136162ed-9445-4b9c-b7fc-306af8b5da99')
def test_get_software_config(self):
"""Testing software config get."""
for conf in self.configs:
- api_config = self.client.get_software_config(conf['id'])
+ api_config = self.client.show_software_config(conf['id'])
self._validate_config(conf, api_config)
@test.attr(type='smoke')
@test.idempotent_id('1275c835-c967-4a2c-8d5d-ad533447ed91')
def test_get_deployment_list(self):
"""Getting a list of all deployments"""
- deploy_list = self.client.get_software_deploy_list()
+ deploy_list = self.client.list_software_deployments()
deploy_ids = [deploy['id'] for deploy in
deploy_list['software_deployments']]
self.assertIn(self.deployment_id, deploy_ids)
@@ -101,12 +101,13 @@
@test.idempotent_id('fe7cd9f9-54b1-429c-a3b7-7df8451db913')
def test_get_deployment_metadata(self):
"""Testing deployment metadata get"""
- metadata = self.client.get_software_deploy_meta(self.server_id)
+ metadata = self.client.show_software_deployment_metadata(
+ self.server_id)
conf_ids = [conf['id'] for conf in metadata['metadata']]
self.assertIn(self.configs[0]['id'], conf_ids)
def _validate_deployment(self, action, status, reason, config_id):
- deployment = self.client.get_software_deploy(self.deployment_id)
+ deployment = self.client.show_software_deployment(self.deployment_id)
self.assertEqual(action, deployment['software_deployment']['action'])
self.assertEqual(status, deployment['software_deployment']['status'])
self.assertEqual(reason,
@@ -131,7 +132,8 @@
@test.idempotent_id('2ac43ab3-34f2-415d-be2e-eabb4d14ee32')
def test_software_deployment_update_no_metadata_change(self):
"""Testing software deployment update without metadata change."""
- metadata = self.client.get_software_deploy_meta(self.server_id)
+ metadata = self.client.show_software_deployment_metadata(
+ self.server_id)
# Updating values without changing the configuration ID
new_action = 'ACTION_1'
new_status = 'STATUS_1'
@@ -145,7 +147,8 @@
new_reason, self.configs[0]['id'])
# Metadata should not be changed at this point
- test_metadata = self.client.get_software_deploy_meta(self.server_id)
+ test_metadata = self.client.show_software_deployment_metadata(
+ self.server_id)
for key in metadata['metadata'][0]:
self.assertEqual(
metadata['metadata'][0][key],
@@ -155,7 +158,8 @@
@test.idempotent_id('92c48944-d79d-4595-a840-8e1a581c1a72')
def test_software_deployment_update_with_metadata_change(self):
"""Testing software deployment update with metadata change."""
- metadata = self.client.get_software_deploy_meta(self.server_id)
+ metadata = self.client.show_software_deployment_metadata(
+ self.server_id)
self.client.update_software_deploy(
self.deployment_id, self.server_id, self.configs[1]['id'],
self.action, self.status, self.input_values,
@@ -163,7 +167,8 @@
self._validate_deployment(self.action, self.status,
self.status_reason, self.configs[1]['id'])
# Metadata should now be changed
- new_metadata = self.client.get_software_deploy_meta(self.server_id)
+ new_metadata = self.client.show_software_deployment_metadata(
+ self.server_id)
# Its enough to test the ID in this case
meta_id = metadata['metadata'][0]['id']
test_id = new_metadata['metadata'][0]['id']
diff --git a/tempest/api/orchestration/stacks/test_stacks.py b/tempest/api/orchestration/stacks/test_stacks.py
index 147f456..9ce8ebeb 100644
--- a/tempest/api/orchestration/stacks/test_stacks.py
+++ b/tempest/api/orchestration/stacks/test_stacks.py
@@ -52,15 +52,15 @@
self.assertIn(stack_id, list_ids)
# fetch the stack
- stack = self.client.get_stack(stack_identifier)
+ stack = self.client.show_stack(stack_identifier)
self.assertEqual('CREATE_COMPLETE', stack['stack_status'])
# fetch the stack by name
- stack = self.client.get_stack(stack_name)
+ stack = self.client.show_stack(stack_name)
self.assertEqual('CREATE_COMPLETE', stack['stack_status'])
# fetch the stack by id
- stack = self.client.get_stack(stack_id)
+ stack = self.client.show_stack(stack_id)
self.assertEqual('CREATE_COMPLETE', stack['stack_status'])
# delete the stack
diff --git a/tempest/api/orchestration/stacks/test_volumes.py b/tempest/api/orchestration/stacks/test_volumes.py
index 5f03e16..2b1ec12 100644
--- a/tempest/api/orchestration/stacks/test_volumes.py
+++ b/tempest/api/orchestration/stacks/test_volumes.py
@@ -34,7 +34,7 @@
def _cinder_verify(self, volume_id, template):
self.assertIsNotNone(volume_id)
- volume = self.volumes_client.get_volume(volume_id)
+ volume = self.volumes_client.show_volume(volume_id)
self.assertEqual('available', volume.get('status'))
self.assertEqual(template['resources']['volume']['properties'][
'size'], volume.get('size'))
@@ -76,7 +76,7 @@
self.client.delete_stack(stack_identifier)
self.client.wait_for_stack_status(stack_identifier, 'DELETE_COMPLETE')
self.assertRaises(lib_exc.NotFound,
- self.volumes_client.get_volume,
+ self.volumes_client.show_volume,
volume_id)
def _cleanup_volume(self, volume_id):
diff --git a/tempest/api/volume/admin/test_multi_backend.py b/tempest/api/volume/admin/test_multi_backend.py
index ad5eb7d..db2d143 100644
--- a/tempest/api/volume/admin/test_multi_backend.py
+++ b/tempest/api/volume/admin/test_multi_backend.py
@@ -139,7 +139,7 @@
# the multi backend feature has been enabled
# if multi-backend is enabled: os-vol-attr:host should be like:
# host@backend_name
- volume = self.admin_volume_client.get_volume(volume_id)
+ volume = self.admin_volume_client.show_volume(volume_id)
volume1_host = volume['os-vol-host-attr:host']
msg = ("multi-backend reporting incorrect values for volume %s" %
@@ -150,10 +150,10 @@
# this test checks that the two volumes created at setUp don't
# belong to the same backend (if they are, than the
# volume backend distinction is not working properly)
- volume = self.admin_volume_client.get_volume(volume1_id)
+ volume = self.admin_volume_client.show_volume(volume1_id)
volume1_host = volume['os-vol-host-attr:host']
- volume = self.admin_volume_client.get_volume(volume2_id)
+ volume = self.admin_volume_client.show_volume(volume2_id)
volume2_host = volume['os-vol-host-attr:host']
msg = ("volumes %s and %s were created in the same backend" %
diff --git a/tempest/api/volume/admin/test_snapshots_actions.py b/tempest/api/volume/admin/test_snapshots_actions.py
index db026c1..d6e3f3e 100644
--- a/tempest/api/volume/admin/test_snapshots_actions.py
+++ b/tempest/api/volume/admin/test_snapshots_actions.py
@@ -89,7 +89,7 @@
self.admin_snapshots_client.\
reset_snapshot_status(self.snapshot['id'], status)
snapshot_get \
- = self.admin_snapshots_client.get_snapshot(self.snapshot['id'])
+ = self.admin_snapshots_client.show_snapshot(self.snapshot['id'])
self.assertEqual(status, snapshot_get['status'])
@test.attr(type='gate')
@@ -107,7 +107,7 @@
self.client.update_snapshot_status(self.snapshot['id'],
status, progress)
snapshot_get \
- = self.admin_snapshots_client.get_snapshot(self.snapshot['id'])
+ = self.admin_snapshots_client.show_snapshot(self.snapshot['id'])
self.assertEqual(status, snapshot_get['status'])
self.assertEqual(progress, snapshot_get[progress_alias])
diff --git a/tempest/api/volume/admin/test_volume_quotas.py b/tempest/api/volume/admin/test_volume_quotas.py
index 86d90f6..3ec3219 100644
--- a/tempest/api/volume/admin/test_volume_quotas.py
+++ b/tempest/api/volume/admin/test_volume_quotas.py
@@ -32,14 +32,14 @@
@test.attr(type='gate')
@test.idempotent_id('59eada70-403c-4cef-a2a3-a8ce2f1b07a0')
def test_list_quotas(self):
- quotas = self.quotas_client.get_quota_set(self.demo_tenant_id)
+ quotas = self.quotas_client.show_quota_set(self.demo_tenant_id)
for key in QUOTA_KEYS:
self.assertIn(key, quotas)
@test.attr(type='gate')
@test.idempotent_id('2be020a2-5fdd-423d-8d35-a7ffbc36e9f7')
def test_list_default_quotas(self):
- quotas = self.quotas_client.get_default_quota_set(
+ quotas = self.quotas_client.show_default_quota_set(
self.demo_tenant_id)
for key in QUOTA_KEYS:
self.assertIn(key, quotas)
@@ -48,7 +48,7 @@
@test.idempotent_id('3d45c99e-cc42-4424-a56e-5cbd212b63a6')
def test_update_all_quota_resources_for_tenant(self):
# Admin can update all the resource quota limits for a tenant
- default_quota_set = self.quotas_client.get_default_quota_set(
+ default_quota_set = self.quotas_client.show_default_quota_set(
self.demo_tenant_id)
new_quota_set = {'gigabytes': 1009,
'volumes': 11,
@@ -72,7 +72,7 @@
@test.attr(type='gate')
@test.idempotent_id('18c51ae9-cb03-48fc-b234-14a19374dbed')
def test_show_quota_usage(self):
- quota_usage = self.quotas_client.get_quota_usage(
+ quota_usage = self.quotas_client.show_quota_usage(
self.os_adm.credentials.tenant_id)
for key in QUOTA_KEYS:
self.assertIn(key, quota_usage)
@@ -82,14 +82,14 @@
@test.attr(type='gate')
@test.idempotent_id('ae8b6091-48ad-4bfa-a188-bbf5cc02115f')
def test_quota_usage(self):
- quota_usage = self.quotas_client.get_quota_usage(
+ quota_usage = self.quotas_client.show_quota_usage(
self.demo_tenant_id)
volume = self.create_volume()
self.addCleanup(self.admin_volume_client.delete_volume,
volume['id'])
- new_quota_usage = self.quotas_client.get_quota_usage(
+ new_quota_usage = self.quotas_client.show_quota_usage(
self.demo_tenant_id)
self.assertEqual(quota_usage['volumes']['in_use'] + 1,
@@ -108,7 +108,7 @@
tenant = identity_client.create_tenant(tenant_name)
tenant_id = tenant['id']
self.addCleanup(identity_client.delete_tenant, tenant_id)
- quota_set_default = self.quotas_client.get_default_quota_set(
+ quota_set_default = self.quotas_client.show_default_quota_set(
tenant_id)
volume_default = quota_set_default['volumes']
@@ -116,7 +116,7 @@
volumes=(int(volume_default) + 5))
self.quotas_client.delete_quota_set(tenant_id)
- quota_set_new = self.quotas_client.get_quota_set(tenant_id)
+ quota_set_new = self.quotas_client.show_quota_set(tenant_id)
self.assertEqual(volume_default, quota_set_new['volumes'])
diff --git a/tempest/api/volume/admin/test_volume_types.py b/tempest/api/volume/admin/test_volume_types.py
index 681a48a..048b02c 100644
--- a/tempest/api/volume/admin/test_volume_types.py
+++ b/tempest/api/volume/admin/test_volume_types.py
@@ -77,7 +77,7 @@
self.volumes_client.wait_for_volume_status(volume['id'], 'available')
# Get volume details and Verify
- fetched_volume = self.volumes_client.get_volume(volume['id'])
+ fetched_volume = self.volumes_client.show_volume(volume['id'])
self.assertEqual(volume_types[1]['name'],
fetched_volume['volume_type'],
'The fetched Volume type is different '
@@ -110,7 +110,7 @@
"to the requested name")
self.assertTrue(body['id'] is not None,
"Field volume_type id is empty or not found.")
- fetched_volume_type = self.volume_types_client.get_volume_type(
+ fetched_volume_type = self.volume_types_client.show_volume_type(
body['id'])
self.assertEqual(name, fetched_volume_type['name'],
'The fetched Volume_type is different '
@@ -146,7 +146,7 @@
# Get encryption type
fetched_encryption_type = (
- self.volume_types_client.get_encryption_type(
+ self.volume_types_client.show_encryption_type(
encryption_type['volume_type_id']))
self.assertEqual(provider,
fetched_encryption_type['provider'],
@@ -164,7 +164,7 @@
"type": "encryption-type"}
self.volume_types_client.wait_for_resource_deletion(resource)
deleted_encryption_type = (
- self.volume_types_client.get_encryption_type(
+ self.volume_types_client.show_encryption_type(
encryption_type['volume_type_id']))
self.assertEmpty(deleted_encryption_type)
diff --git a/tempest/api/volume/admin/test_volume_types_extra_specs.py b/tempest/api/volume/admin/test_volume_types_extra_specs.py
index f382a67..0f4dbe5 100644
--- a/tempest/api/volume/admin/test_volume_types_extra_specs.py
+++ b/tempest/api/volume/admin/test_volume_types_extra_specs.py
@@ -77,7 +77,7 @@
self.assertEqual(extra_specs, body,
"Volume type extra spec incorrectly created")
- self.volume_types_client.get_volume_type_extra_specs(
+ self.volume_types_client.show_volume_type_extra_specs(
self.volume_type['id'],
extra_specs.keys()[0])
self.assertEqual(extra_specs, body,
diff --git a/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py b/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
index 7775025..e861c5f 100644
--- a/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
+++ b/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
@@ -137,7 +137,7 @@
extra_specs = {"spec1": "val1"}
self.assertRaises(
lib_exc.NotFound,
- self.volume_types_client.get_volume_type_extra_specs,
+ self.volume_types_client.show_volume_type_extra_specs,
str(uuid.uuid4()), extra_specs.keys()[0])
@test.attr(type='gate')
@@ -147,7 +147,7 @@
# id.
self.assertRaises(
lib_exc.NotFound,
- self.volume_types_client.get_volume_type_extra_specs,
+ self.volume_types_client.show_volume_type_extra_specs,
self.volume_type['id'], str(uuid.uuid4()))
diff --git a/tempest/api/volume/admin/test_volume_types_negative.py b/tempest/api/volume/admin/test_volume_types_negative.py
index d2bf777..d9be337 100644
--- a/tempest/api/volume/admin/test_volume_types_negative.py
+++ b/tempest/api/volume/admin/test_volume_types_negative.py
@@ -45,7 +45,7 @@
def test_get_nonexistent_type_id(self):
# Should not be able to get volume type with nonexistent type id.
self.assertRaises(lib_exc.NotFound,
- self.volume_types_client.get_volume_type,
+ self.volume_types_client.show_volume_type,
str(uuid.uuid4()))
@test.attr(type='gate')
diff --git a/tempest/api/volume/admin/test_volumes_actions.py b/tempest/api/volume/admin/test_volumes_actions.py
index 1b69549..feb46a3 100644
--- a/tempest/api/volume/admin/test_volumes_actions.py
+++ b/tempest/api/volume/admin/test_volumes_actions.py
@@ -79,7 +79,7 @@
def test_volume_reset_status(self):
# test volume reset status : available->error->available
self._reset_volume_status(self.volume['id'], 'error')
- volume_get = self.admin_volume_client.get_volume(
+ volume_get = self.admin_volume_client.show_volume(
self.volume['id'])
self.assertEqual('error', volume_get['status'])
diff --git a/tempest/api/volume/admin/test_volumes_backup.py b/tempest/api/volume/admin/test_volumes_backup.py
index 6fd2a5e..2d830c8 100644
--- a/tempest/api/volume/admin/test_volumes_backup.py
+++ b/tempest/api/volume/admin/test_volumes_backup.py
@@ -55,11 +55,11 @@
'available')
# Get a given backup
- backup = self.backups_adm_client.get_backup(backup['id'])
+ backup = self.backups_adm_client.show_backup(backup['id'])
self.assertEqual(backup_name, backup['name'])
# Get all backups with detail
- backups = self.backups_adm_client.list_backups_with_detail()
+ backups = self.backups_adm_client.list_backups(detail=True)
self.assertIn((backup['name'], backup['id']),
[(m['name'], m['id']) for m in backups])
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index 1f76b1c..28676b0 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -18,6 +18,7 @@
from tempest_lib import exceptions as lib_exc
from tempest import clients
+from tempest.common import credentials
from tempest.common import fixed_network
from tempest import config
from tempest import exceptions
@@ -175,14 +176,17 @@
"""Base test case class for all Volume Admin API tests."""
@classmethod
+ def skip_checks(cls):
+ super(BaseVolumeAdminTest, cls).skip_checks()
+ if not credentials.is_admin_available():
+ msg = ("Missing Identity Admin API credentials in configuration.")
+ raise cls.skipException(msg)
+
+ @classmethod
def setup_credentials(cls):
super(BaseVolumeAdminTest, cls).setup_credentials()
- try:
- cls.adm_creds = cls.isolated_creds.get_admin_creds()
- cls.os_adm = clients.Manager(credentials=cls.adm_creds)
- except NotImplementedError:
- msg = "Missing Volume Admin API credentials in configuration."
- raise cls.skipException(msg)
+ cls.adm_creds = cls.isolated_creds.get_admin_creds()
+ cls.os_adm = clients.Manager(credentials=cls.adm_creds)
@classmethod
def setup_clients(cls):
diff --git a/tempest/api/volume/test_availability_zone.py b/tempest/api/volume/test_availability_zone.py
index e63cfcd..d544821 100644
--- a/tempest/api/volume/test_availability_zone.py
+++ b/tempest/api/volume/test_availability_zone.py
@@ -32,7 +32,7 @@
@test.idempotent_id('01f1ae88-eba9-4c6b-a011-6f7ace06b725')
def test_get_availability_zone_list(self):
# List of availability zone
- availability_zone = self.client.get_availability_zone_list()
+ availability_zone = self.client.list_availability_zones()
self.assertTrue(len(availability_zone) > 0)
diff --git a/tempest/api/volume/test_qos.py b/tempest/api/volume/test_qos.py
index f806790..edece79 100644
--- a/tempest/api/volume/test_qos.py
+++ b/tempest/api/volume/test_qos.py
@@ -64,7 +64,7 @@
self.created_qos['id'], vol_type_id)
def _test_get_association_qos(self):
- body = self.volume_qos_client.get_association_qos(
+ body = self.volume_qos_client.show_association_qos(
self.created_qos['id'])
associations = []
@@ -102,7 +102,7 @@
@test.idempotent_id('7aa214cc-ac1a-4397-931f-3bb2e83bb0fd')
def test_get_qos(self):
"""Tests the detail of a given qos-specs"""
- body = self.volume_qos_client.get_qos(self.created_qos['id'])
+ body = self.volume_qos_client.show_qos(self.created_qos['id'])
self.assertEqual(self.qos_name, body['name'])
self.assertEqual(self.qos_consumer, body['consumer'])
@@ -121,7 +121,7 @@
body = self.volume_qos_client.set_qos_key(self.created_qos['id'],
iops_bytes='500')
self.assertEqual(args, body)
- body = self.volume_qos_client.get_qos(self.created_qos['id'])
+ body = self.volume_qos_client.show_qos(self.created_qos['id'])
self.assertEqual(args['iops_bytes'], body['specs']['iops_bytes'])
# test the deletion of a specs key from qos-specs
@@ -130,7 +130,7 @@
operation = 'qos-key-unset'
self.volume_qos_client.wait_for_qos_operations(self.created_qos['id'],
operation, keys)
- body = self.volume_qos_client.get_qos(self.created_qos['id'])
+ body = self.volume_qos_client.show_qos(self.created_qos['id'])
self.assertNotIn(keys[0], body['specs'])
@test.attr(type='smoke')
diff --git a/tempest/api/volume/test_snapshot_metadata.py b/tempest/api/volume/test_snapshot_metadata.py
index d4efc2a..536648d 100644
--- a/tempest/api/volume/test_snapshot_metadata.py
+++ b/tempest/api/volume/test_snapshot_metadata.py
@@ -50,12 +50,12 @@
body = self.client.create_snapshot_metadata(self.snapshot_id,
metadata)
# Get the metadata of the snapshot
- body = self.client.get_snapshot_metadata(self.snapshot_id)
+ body = self.client.show_snapshot_metadata(self.snapshot_id)
self.assertEqual(metadata, body)
# Delete one item metadata of the snapshot
self.client.delete_snapshot_metadata_item(
self.snapshot_id, "key1")
- body = self.client.get_snapshot_metadata(self.snapshot_id)
+ body = self.client.show_snapshot_metadata(self.snapshot_id)
self.assertEqual(expected, body)
@test.attr(type='gate')
@@ -71,13 +71,13 @@
body = self.client.create_snapshot_metadata(self.snapshot_id,
metadata)
# Get the metadata of the snapshot
- body = self.client.get_snapshot_metadata(self.snapshot_id)
+ body = self.client.show_snapshot_metadata(self.snapshot_id)
self.assertEqual(metadata, body)
# Update metadata item
body = self.client.update_snapshot_metadata(
self.snapshot_id, update)
# Get the metadata of the snapshot
- body = self.client.get_snapshot_metadata(self.snapshot_id)
+ body = self.client.show_snapshot_metadata(self.snapshot_id)
self.assertEqual(update, body)
@test.attr(type='gate')
@@ -95,13 +95,13 @@
body = self.client.create_snapshot_metadata(self.snapshot_id,
metadata)
# Get the metadata of the snapshot
- body = self.client.get_snapshot_metadata(self.snapshot_id)
+ body = self.client.show_snapshot_metadata(self.snapshot_id)
self.assertEqual(metadata, body)
# Update metadata item
body = self.client.update_snapshot_metadata_item(
self.snapshot_id, "key3", update_item)
# Get the metadata of the snapshot
- body = self.client.get_snapshot_metadata(self.snapshot_id)
+ body = self.client.show_snapshot_metadata(self.snapshot_id)
self.assertEqual(expect, body)
diff --git a/tempest/api/volume/test_volume_metadata.py b/tempest/api/volume/test_volume_metadata.py
index e601349..a0e1161 100644
--- a/tempest/api/volume/test_volume_metadata.py
+++ b/tempest/api/volume/test_volume_metadata.py
@@ -45,12 +45,12 @@
body = self.volumes_client.create_volume_metadata(self.volume_id,
metadata)
# Get the metadata of the volume
- body = self.volumes_client.get_volume_metadata(self.volume_id)
+ body = self.volumes_client.show_volume_metadata(self.volume_id)
self.assertThat(body.items(), matchers.ContainsAll(metadata.items()))
# Delete one item metadata of the volume
self.volumes_client.delete_volume_metadata_item(
self.volume_id, "key1")
- body = self.volumes_client.get_volume_metadata(self.volume_id)
+ body = self.volumes_client.show_volume_metadata(self.volume_id)
self.assertNotIn("key1", body)
del metadata["key1"]
self.assertThat(body.items(), matchers.ContainsAll(metadata.items()))
@@ -70,13 +70,13 @@
body = self.volumes_client.create_volume_metadata(
self.volume_id, metadata)
# Get the metadata of the volume
- body = self.volumes_client.get_volume_metadata(self.volume_id)
+ body = self.volumes_client.show_volume_metadata(self.volume_id)
self.assertThat(body.items(), matchers.ContainsAll(metadata.items()))
# Update metadata
body = self.volumes_client.update_volume_metadata(
self.volume_id, update)
# Get the metadata of the volume
- body = self.volumes_client.get_volume_metadata(self.volume_id)
+ body = self.volumes_client.show_volume_metadata(self.volume_id)
self.assertThat(body.items(), matchers.ContainsAll(update.items()))
@test.attr(type='gate')
@@ -98,7 +98,7 @@
body = self.volumes_client.update_volume_metadata_item(
self.volume_id, "key3", update_item)
# Get the metadata of the volume
- body = self.volumes_client.get_volume_metadata(self.volume_id)
+ body = self.volumes_client.show_volume_metadata(self.volume_id)
self.assertThat(body.items(), matchers.ContainsAll(expect.items()))
diff --git a/tempest/api/volume/test_volume_transfers.py b/tempest/api/volume/test_volume_transfers.py
index 40947df..4acab39 100644
--- a/tempest/api/volume/test_volume_transfers.py
+++ b/tempest/api/volume/test_volume_transfers.py
@@ -71,7 +71,7 @@
'awaiting-transfer')
# Get a volume transfer
- body = self.client.get_volume_transfer(transfer_id)
+ body = self.client.show_volume_transfer(transfer_id)
self.assertEqual(volume['id'], body['volume_id'])
# List volume transfers, the result should be greater than
diff --git a/tempest/api/volume/test_volumes_actions.py b/tempest/api/volume/test_volumes_actions.py
index 1872ec7..fecb98b 100644
--- a/tempest/api/volume/test_volumes_actions.py
+++ b/tempest/api/volume/test_volumes_actions.py
@@ -86,7 +86,7 @@
self.volume['id'],
'available')
self.addCleanup(self.client.detach_volume, self.volume['id'])
- volume = self.client.get_volume(self.volume['id'])
+ volume = self.client.show_volume(self.volume['id'])
self.assertIn('attachments', volume)
attachment = self.client.get_attachment_from_volume(volume)
self.assertEqual(mountpoint, attachment['device'])
@@ -117,12 +117,12 @@
# Mark volume as reserved.
body = self.client.reserve_volume(self.volume['id'])
# To get the volume info
- body = self.client.get_volume(self.volume['id'])
+ body = self.client.show_volume(self.volume['id'])
self.assertIn('attaching', body['status'])
# Unmark volume as reserved.
body = self.client.unreserve_volume(self.volume['id'])
# To get the volume info
- body = self.client.get_volume(self.volume['id'])
+ body = self.client.show_volume(self.volume['id'])
self.assertIn('available', body['status'])
def _is_true(self, val):
@@ -136,7 +136,7 @@
self.client.update_volume_readonly(self.volume['id'],
readonly)
# Get Volume information
- fetched_volume = self.client.get_volume(self.volume['id'])
+ fetched_volume = self.client.show_volume(self.volume['id'])
bool_flag = self._is_true(fetched_volume['metadata']['readonly'])
self.assertEqual(True, bool_flag)
@@ -145,7 +145,7 @@
self.client.update_volume_readonly(self.volume['id'], readonly)
# Get Volume information
- fetched_volume = self.client.get_volume(self.volume['id'])
+ fetched_volume = self.client.show_volume(self.volume['id'])
bool_flag = self._is_true(fetched_volume['metadata']['readonly'])
self.assertEqual(False, bool_flag)
diff --git a/tempest/api/volume/test_volumes_extend.py b/tempest/api/volume/test_volumes_extend.py
index 35c12bc..38bb748 100644
--- a/tempest/api/volume/test_volumes_extend.py
+++ b/tempest/api/volume/test_volumes_extend.py
@@ -35,7 +35,7 @@
extend_size = int(self.volume['size']) + 1
self.client.extend_volume(self.volume['id'], extend_size)
self.client.wait_for_volume_status(self.volume['id'], 'available')
- volume = self.client.get_volume(self.volume['id'])
+ volume = self.client.show_volume(self.volume['id'])
self.assertEqual(int(volume['size']), extend_size)
diff --git a/tempest/api/volume/test_volumes_get.py b/tempest/api/volume/test_volumes_get.py
index 1fa1d5f..1027f48 100644
--- a/tempest/api/volume/test_volumes_get.py
+++ b/tempest/api/volume/test_volumes_get.py
@@ -60,7 +60,7 @@
self.assertTrue(volume['id'] is not None,
"Field volume id is empty or not found.")
# Get Volume information
- fetched_volume = self.client.get_volume(volume['id'])
+ fetched_volume = self.client.show_volume(volume['id'])
self.assertEqual(v_name,
fetched_volume[self.name_field],
'The fetched Volume name is different '
@@ -92,8 +92,8 @@
# Assert response body for update_volume method
self.assertEqual(new_v_name, update_volume[self.name_field])
self.assertEqual(new_desc, update_volume[self.descrip_field])
- # Assert response body for get_volume method
- updated_volume = self.client.get_volume(volume['id'])
+ # Assert response body for show_volume method
+ updated_volume = self.client.show_volume(volume['id'])
self.assertEqual(volume['id'], updated_volume['id'])
self.assertEqual(new_v_name, updated_volume[self.name_field])
self.assertEqual(new_desc, updated_volume[self.descrip_field])
diff --git a/tempest/api/volume/test_volumes_list.py b/tempest/api/volume/test_volumes_list.py
index 29e3324..1c7b1c8 100644
--- a/tempest/api/volume/test_volumes_list.py
+++ b/tempest/api/volume/test_volumes_list.py
@@ -70,7 +70,7 @@
cls.metadata = {'Type': 'work'}
for i in range(3):
volume = cls.create_volume(metadata=cls.metadata)
- volume = cls.client.get_volume(volume['id'])
+ volume = cls.client.show_volume(volume['id'])
cls.volume_list.append(volume)
cls.volume_id_list.append(volume['id'])
@@ -89,7 +89,7 @@
"""
if with_detail:
fetched_vol_list = \
- self.client.list_volumes_with_detail(params=params)
+ self.client.list_volumes(detail=True, params=params)
else:
fetched_vol_list = self.client.list_volumes(params=params)
@@ -125,7 +125,7 @@
def test_volume_list_with_details(self):
# Get a list of Volumes with details
# Fetch all Volumes
- fetched_list = self.client.list_volumes_with_detail()
+ fetched_list = self.client.list_volumes(detail=True)
self.assertVolumesIn(fetched_list, self.volume_list)
@test.attr(type='gate')
@@ -133,7 +133,7 @@
def test_volume_list_by_name(self):
volume = self.volume_list[data_utils.rand_int_id(0, 2)]
params = {self.name: volume[self.name]}
- fetched_vol = self.client.list_volumes(params)
+ fetched_vol = self.client.list_volumes(params=params)
self.assertEqual(1, len(fetched_vol), str(fetched_vol))
self.assertEqual(fetched_vol[0][self.name],
volume[self.name])
@@ -143,7 +143,7 @@
def test_volume_list_details_by_name(self):
volume = self.volume_list[data_utils.rand_int_id(0, 2)]
params = {self.name: volume[self.name]}
- fetched_vol = self.client.list_volumes_with_detail(params)
+ fetched_vol = self.client.list_volumes(detail=True, params=params)
self.assertEqual(1, len(fetched_vol), str(fetched_vol))
self.assertEqual(fetched_vol[0][self.name],
volume[self.name])
@@ -152,7 +152,7 @@
@test.idempotent_id('39654e13-734c-4dab-95ce-7613bf8407ce')
def test_volumes_list_by_status(self):
params = {'status': 'available'}
- fetched_list = self.client.list_volumes(params)
+ fetched_list = self.client.list_volumes(params=params)
self._list_by_param_value_and_assert(params)
self.assertVolumesIn(fetched_list, self.volume_list,
fields=self.VOLUME_FIELDS)
@@ -161,7 +161,7 @@
@test.idempotent_id('2943f712-71ec-482a-bf49-d5ca06216b9f')
def test_volumes_list_details_by_status(self):
params = {'status': 'available'}
- fetched_list = self.client.list_volumes_with_detail(params)
+ fetched_list = self.client.list_volumes(detail=True, params=params)
for volume in fetched_list:
self.assertEqual('available', volume['status'])
self.assertVolumesIn(fetched_list, self.volume_list)
@@ -172,7 +172,7 @@
volume = self.volume_list[data_utils.rand_int_id(0, 2)]
zone = volume['availability_zone']
params = {'availability_zone': zone}
- fetched_list = self.client.list_volumes(params)
+ fetched_list = self.client.list_volumes(params=params)
self._list_by_param_value_and_assert(params)
self.assertVolumesIn(fetched_list, self.volume_list,
fields=self.VOLUME_FIELDS)
@@ -183,7 +183,7 @@
volume = self.volume_list[data_utils.rand_int_id(0, 2)]
zone = volume['availability_zone']
params = {'availability_zone': zone}
- fetched_list = self.client.list_volumes_with_detail(params)
+ fetched_list = self.client.list_volumes(detail=True, params=params)
for volume in fetched_list:
self.assertEqual(zone, volume['availability_zone'])
self.assertVolumesIn(fetched_list, self.volume_list)
diff --git a/tempest/api/volume/test_volumes_negative.py b/tempest/api/volume/test_volumes_negative.py
index a47e964..aba245a 100644
--- a/tempest/api/volume/test_volumes_negative.py
+++ b/tempest/api/volume/test_volumes_negative.py
@@ -43,7 +43,7 @@
@test.idempotent_id('f131c586-9448-44a4-a8b0-54ca838aa43e')
def test_volume_get_nonexistent_volume_id(self):
# Should not be able to get a non-existent volume
- self.assertRaises(lib_exc.NotFound, self.client.get_volume,
+ self.assertRaises(lib_exc.NotFound, self.client.show_volume,
str(uuid.uuid4()))
@test.attr(type=['negative', 'gate'])
@@ -152,14 +152,14 @@
@test.idempotent_id('30799cfd-7ee4-446c-b66c-45b383ed211b')
def test_get_invalid_volume_id(self):
# Should not be able to get volume with invalid id
- self.assertRaises(lib_exc.NotFound, self.client.get_volume,
+ self.assertRaises(lib_exc.NotFound, self.client.show_volume,
'#$%%&^&^')
@test.attr(type=['negative', 'gate'])
@test.idempotent_id('c6c3db06-29ad-4e91-beb0-2ab195fe49e3')
def test_get_volume_without_passing_volume_id(self):
# Should not be able to get volume when empty ID is passed
- self.assertRaises(lib_exc.NotFound, self.client.get_volume, '')
+ self.assertRaises(lib_exc.NotFound, self.client.show_volume, '')
@test.attr(type=['negative', 'gate'])
@test.idempotent_id('1f035827-7c32-4019-9240-b4ec2dbd9dfd')
@@ -266,7 +266,7 @@
def test_list_volumes_with_nonexistent_name(self):
v_name = data_utils.rand_name('Volume')
params = {self.name_field: v_name}
- fetched_volume = self.client.list_volumes(params)
+ fetched_volume = self.client.list_volumes(params=params)
self.assertEqual(0, len(fetched_volume))
@test.attr(type=['negative', 'gate'])
@@ -275,14 +275,14 @@
v_name = data_utils.rand_name('Volume')
params = {self.name_field: v_name}
fetched_volume = \
- self.client.list_volumes_with_detail(params)
+ self.client.list_volumes(detail=True, params=params)
self.assertEqual(0, len(fetched_volume))
@test.attr(type=['negative', 'gate'])
@test.idempotent_id('143b279b-7522-466b-81be-34a87d564a7c')
def test_list_volumes_with_invalid_status(self):
params = {'status': 'null'}
- fetched_volume = self.client.list_volumes(params)
+ fetched_volume = self.client.list_volumes(params=params)
self.assertEqual(0, len(fetched_volume))
@test.attr(type=['negative', 'gate'])
@@ -290,7 +290,7 @@
def test_list_volumes_detail_with_invalid_status(self):
params = {'status': 'null'}
fetched_volume = \
- self.client.list_volumes_with_detail(params)
+ self.client.list_volumes(detail=True, params=params)
self.assertEqual(0, len(fetched_volume))
diff --git a/tempest/api/volume/test_volumes_snapshots.py b/tempest/api/volume/test_volumes_snapshots.py
index b277390..2c15f92 100644
--- a/tempest/api/volume/test_volumes_snapshots.py
+++ b/tempest/api/volume/test_volumes_snapshots.py
@@ -50,7 +50,7 @@
if with_detail:
fetched_snap_list = \
self.snapshots_client.\
- list_snapshots_with_detail(params=params)
+ list_snapshots(detail=True, params=params)
else:
fetched_snap_list = \
self.snapshots_client.list_snapshots(params=params)
@@ -98,7 +98,7 @@
snapshot = self.create_snapshot(self.volume_origin['id'], **params)
# Get the snap and check for some of its details
- snap_get = self.snapshots_client.get_snapshot(snapshot['id'])
+ snap_get = self.snapshots_client.show_snapshot(snapshot['id'])
self.assertEqual(self.volume_origin['id'],
snap_get['volume_id'],
"Referred volume origin mismatch")
@@ -119,9 +119,9 @@
# Assert response body for update_snapshot method
self.assertEqual(new_s_name, update_snapshot[self.name_field])
self.assertEqual(new_desc, update_snapshot[self.descrip_field])
- # Assert response body for get_snapshot method
+ # Assert response body for show_snapshot method
updated_snapshot = \
- self.snapshots_client.get_snapshot(snapshot['id'])
+ self.snapshots_client.show_snapshot(snapshot['id'])
self.assertEqual(new_s_name, updated_snapshot[self.name_field])
self.assertEqual(new_desc, updated_snapshot[self.descrip_field])
diff --git a/tempest/api/volume/v2/test_volumes_list.py b/tempest/api/volume/v2/test_volumes_list.py
index f6b52a9..04ea361 100644
--- a/tempest/api/volume/v2/test_volumes_list.py
+++ b/tempest/api/volume/v2/test_volumes_list.py
@@ -45,7 +45,7 @@
cls.metadata = {'Type': 'work'}
for i in range(3):
volume = cls.create_volume(metadata=cls.metadata)
- volume = cls.client.get_volume(volume['id'])
+ volume = cls.client.show_volume(volume['id'])
cls.volume_list.append(volume)
cls.volume_id_list.append(volume['id'])
@@ -70,7 +70,8 @@
'sort_dir': sort_dir,
'sort_key': sort_key
}
- fetched_volume = self.client.list_volumes_with_detail(params)
+ fetched_volume = self.client.list_volumes(detail=True,
+ params=params)
self.assertEqual(limit, len(fetched_volume),
"The count of volumes is %s, expected:%s " %
(len(fetched_volume), limit))
diff --git a/tempest/api_schema/response/compute/hosts.py b/tempest/api_schema/response/compute/hosts.py
deleted file mode 100644
index 2596c27..0000000
--- a/tempest/api_schema/response/compute/hosts.py
+++ /dev/null
@@ -1,85 +0,0 @@
-# Copyright 2014 NEC Corporation. All rights reserved.
-#
-# 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.
-
-common_start_up_body = {
- 'type': 'object',
- 'properties': {
- 'host': {'type': 'string'},
- 'power_action': {'enum': ['startup']}
- },
- 'required': ['host', 'power_action']
-}
-
-list_hosts = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'hosts': {
- 'type': 'array',
- 'items': {
- 'type': 'object',
- 'properties': {
- 'host_name': {'type': 'string'},
- 'service': {'type': 'string'},
- 'zone': {'type': 'string'}
- },
- 'required': ['host_name', 'service', 'zone']
- }
- }
- },
- 'required': ['hosts']
- }
-}
-
-show_host_detail = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'host': {
- 'type': 'array',
- 'item': {
- 'type': 'object',
- 'properties': {
- 'resource': {
- 'type': 'object',
- 'properties': {
- 'cpu': {'type': 'integer'},
- 'disk_gb': {'type': 'integer'},
- 'host': {'type': 'string'},
- 'memory_mb': {'type': 'integer'},
- 'project': {'type': 'string'}
- },
- 'required': ['cpu', 'disk_gb', 'host',
- 'memory_mb', 'project']
- }
- },
- 'required': ['resource']
- }
- }
- },
- 'required': ['host']
- }
-}
-
-update_host_common = {
- 'type': 'object',
- 'properties': {
- 'host': {'type': 'string'},
- 'maintenance_mode': {'enum': ['on_maintenance', 'off_maintenance']},
- 'status': {'enum': ['enabled', 'disabled']}
- },
- 'required': ['host', 'maintenance_mode', 'status']
-}
diff --git a/tempest/api_schema/response/compute/hypervisors.py b/tempest/api_schema/response/compute/hypervisors.py
deleted file mode 100644
index d6f2bd1..0000000
--- a/tempest/api_schema/response/compute/hypervisors.py
+++ /dev/null
@@ -1,225 +0,0 @@
-# Copyright 2014 NEC Corporation. All rights reserved.
-#
-# 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.
-
-import copy
-
-hypervisor_statistics = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'hypervisor_statistics': {
- 'type': 'object',
- 'properties': {
- 'count': {'type': 'integer'},
- 'current_workload': {'type': 'integer'},
- 'disk_available_least': {'type': ['integer', 'null']},
- 'free_disk_gb': {'type': 'integer'},
- 'free_ram_mb': {'type': 'integer'},
- 'local_gb': {'type': 'integer'},
- 'local_gb_used': {'type': 'integer'},
- 'memory_mb': {'type': 'integer'},
- 'memory_mb_used': {'type': 'integer'},
- 'running_vms': {'type': 'integer'},
- 'vcpus': {'type': 'integer'},
- 'vcpus_used': {'type': 'integer'}
- },
- 'required': ['count', 'current_workload',
- 'disk_available_least', 'free_disk_gb',
- 'free_ram_mb', 'local_gb', 'local_gb_used',
- 'memory_mb', 'memory_mb_used', 'running_vms',
- 'vcpus', 'vcpus_used']
- }
- },
- 'required': ['hypervisor_statistics']
- }
-}
-
-common_list_hypervisors_detail = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'hypervisors': {
- 'type': 'array',
- 'items': {
- 'type': 'object',
- 'properties': {
- 'status': {'type': 'string'},
- 'state': {'type': 'string'},
- 'cpu_info': {'type': 'string'},
- 'current_workload': {'type': 'integer'},
- 'disk_available_least': {'type': ['integer', 'null']},
- 'host_ip': {
- 'type': 'string',
- 'format': 'ip-address'
- },
- 'free_disk_gb': {'type': 'integer'},
- 'free_ram_mb': {'type': 'integer'},
- 'hypervisor_hostname': {'type': 'string'},
- 'hypervisor_type': {'type': 'string'},
- 'hypervisor_version': {'type': 'integer'},
- 'id': {'type': ['integer', 'string']},
- 'local_gb': {'type': 'integer'},
- 'local_gb_used': {'type': 'integer'},
- 'memory_mb': {'type': 'integer'},
- 'memory_mb_used': {'type': 'integer'},
- 'running_vms': {'type': 'integer'},
- 'service': {
- 'type': 'object',
- 'properties': {
- 'host': {'type': 'string'},
- 'id': {'type': ['integer', 'string']},
- 'disabled_reason': {'type': ['string', 'null']}
- },
- # NOTE(gmann): 'disabled_reason' is updated in
- # 'service' dict if 'os-hypervisor-status'
- # extension is loaded. So this is not required.
- 'required': ['host', 'id']
- },
- 'vcpus': {'type': 'integer'},
- 'vcpus_used': {'type': 'integer'}
- },
- # NOTE: When loading os-hypervisor-status extension,
- # a response contains status and state. So these params
- # should not be required.
- 'required': ['cpu_info', 'current_workload',
- 'disk_available_least', 'host_ip',
- 'free_disk_gb', 'free_ram_mb',
- 'hypervisor_hostname', 'hypervisor_type',
- 'hypervisor_version', 'id', 'local_gb',
- 'local_gb_used', 'memory_mb',
- 'memory_mb_used', 'running_vms', 'service',
- 'vcpus', 'vcpus_used']
- }
- }
- },
- 'required': ['hypervisors']
- }
-}
-
-common_show_hypervisor = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'hypervisor': {
- 'type': 'object',
- 'properties': {
- 'status': {'type': 'string'},
- 'state': {'type': 'string'},
- 'cpu_info': {'type': 'string'},
- 'current_workload': {'type': 'integer'},
- 'disk_available_least': {'type': ['integer', 'null']},
- 'host_ip': {
- 'type': 'string',
- 'format': 'ip-address'
- },
- 'free_disk_gb': {'type': 'integer'},
- 'free_ram_mb': {'type': 'integer'},
- 'hypervisor_hostname': {'type': 'string'},
- 'hypervisor_type': {'type': 'string'},
- 'hypervisor_version': {'type': 'integer'},
- 'id': {'type': ['integer', 'string']},
- 'local_gb': {'type': 'integer'},
- 'local_gb_used': {'type': 'integer'},
- 'memory_mb': {'type': 'integer'},
- 'memory_mb_used': {'type': 'integer'},
- 'running_vms': {'type': 'integer'},
- 'service': {
- 'type': 'object',
- 'properties': {
- 'host': {'type': 'string'},
- 'id': {'type': ['integer', 'string']},
- 'disabled_reason': {'type': ['string', 'null']}
- },
- # NOTE: 'disabled_reason' is updated in 'service'
- # dict if os-hypervisor-status' extension is loaded.
- # So this is not required.
- 'required': ['host', 'id']
- },
- 'vcpus': {'type': 'integer'},
- 'vcpus_used': {'type': 'integer'}
- },
- # NOTE: When loading os-hypervisor-status extension,
- # a response contains status and state. So these params
- # should not be required.
- 'required': ['cpu_info', 'current_workload',
- 'disk_available_least', 'host_ip',
- 'free_disk_gb', 'free_ram_mb',
- 'hypervisor_hostname', 'hypervisor_type',
- 'hypervisor_version', 'id', 'local_gb',
- 'local_gb_used', 'memory_mb', 'memory_mb_used',
- 'running_vms', 'service', 'vcpus', 'vcpus_used']
- }
- },
- 'required': ['hypervisor']
- }
-}
-
-common_hypervisors_detail = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'hypervisors': {
- 'type': 'array',
- 'items': {
- 'type': 'object',
- 'properties': {
- 'status': {'type': 'string'},
- 'state': {'type': 'string'},
- 'id': {'type': ['integer', 'string']},
- 'hypervisor_hostname': {'type': 'string'}
- },
- # NOTE: When loading os-hypervisor-status extension,
- # a response contains status and state. So these params
- # should not be required.
- 'required': ['id', 'hypervisor_hostname']
- }
- }
- },
- 'required': ['hypervisors']
- }
-}
-
-common_hypervisors_info = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'hypervisor': {
- 'type': 'object',
- 'properties': {
- 'status': {'type': 'string'},
- 'state': {'type': 'string'},
- 'id': {'type': ['integer', 'string']},
- 'hypervisor_hostname': {'type': 'string'},
- },
- # NOTE: When loading os-hypervisor-status extension,
- # a response contains status and state. So these params
- # should not be required.
- 'required': ['id', 'hypervisor_hostname']
- }
- },
- 'required': ['hypervisor']
- }
-}
-
-
-hypervisor_uptime = copy.deepcopy(common_hypervisors_info)
-hypervisor_uptime['response_body']['properties']['hypervisor'][
- 'properties']['uptime'] = {'type': 'string'}
-hypervisor_uptime['response_body']['properties']['hypervisor'][
- 'required'] = ['id', 'hypervisor_hostname', 'uptime']
diff --git a/tempest/api_schema/response/compute/keypairs.py b/tempest/api_schema/response/compute/keypairs.py
deleted file mode 100644
index 2ae410c..0000000
--- a/tempest/api_schema/response/compute/keypairs.py
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright 2014 NEC Corporation. All rights reserved.
-#
-# 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.
-
-list_keypairs = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'keypairs': {
- 'type': 'array',
- 'items': {
- 'type': 'object',
- 'properties': {
- 'keypair': {
- 'type': 'object',
- 'properties': {
- 'public_key': {'type': 'string'},
- 'name': {'type': 'string'},
- 'fingerprint': {'type': 'string'}
- },
- 'required': ['public_key', 'name', 'fingerprint']
- }
- },
- 'required': ['keypair']
- }
- }
- },
- 'required': ['keypairs']
- }
-}
-
-create_keypair = {
- 'type': 'object',
- 'properties': {
- 'keypair': {
- 'type': 'object',
- 'properties': {
- 'fingerprint': {'type': 'string'},
- 'name': {'type': 'string'},
- 'public_key': {'type': 'string'},
- 'user_id': {'type': 'string'},
- 'private_key': {'type': 'string'}
- },
- # When create keypair API is being called with 'Public key'
- # (Importing keypair) then, response body does not contain
- # 'private_key' So it is not defined as 'required'
- 'required': ['fingerprint', 'name', 'public_key', 'user_id']
- }
- },
- 'required': ['keypair']
-}
diff --git a/tempest/api_schema/response/compute/quotas.py b/tempest/api_schema/response/compute/quotas.py
deleted file mode 100644
index 863104c..0000000
--- a/tempest/api_schema/response/compute/quotas.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 2014 NEC Corporation. All rights reserved.
-#
-# 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.
-
-common_quota_set = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'quota_set': {
- 'type': 'object',
- 'properties': {
- 'instances': {'type': 'integer'},
- 'cores': {'type': 'integer'},
- 'ram': {'type': 'integer'},
- 'floating_ips': {'type': 'integer'},
- 'fixed_ips': {'type': 'integer'},
- 'metadata_items': {'type': 'integer'},
- 'key_pairs': {'type': 'integer'},
- 'security_groups': {'type': 'integer'},
- 'security_group_rules': {'type': 'integer'},
- 'server_group_members': {'type': 'integer'},
- 'server_groups': {'type': 'integer'},
- },
- # NOTE: server_group_members and server_groups are represented
- # when enabling quota_server_group extension. So they should
- # not be required.
- 'required': ['instances', 'cores', 'ram',
- 'floating_ips', 'fixed_ips',
- 'metadata_items', 'key_pairs',
- 'security_groups', 'security_group_rules']
- }
- },
- 'required': ['quota_set']
- }
-}
diff --git a/tempest/api_schema/response/compute/v2_1/hosts.py b/tempest/api_schema/response/compute/v2_1/hosts.py
index 0944792..72d5a07 100644
--- a/tempest/api_schema/response/compute/v2_1/hosts.py
+++ b/tempest/api_schema/response/compute/v2_1/hosts.py
@@ -14,12 +14,70 @@
import copy
-from tempest.api_schema.response.compute import hosts
+list_hosts = {
+ 'status_code': [200],
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'hosts': {
+ 'type': 'array',
+ 'items': {
+ 'type': 'object',
+ 'properties': {
+ 'host_name': {'type': 'string'},
+ 'service': {'type': 'string'},
+ 'zone': {'type': 'string'}
+ },
+ 'required': ['host_name', 'service', 'zone']
+ }
+ }
+ },
+ 'required': ['hosts']
+ }
+}
+
+get_host_detail = {
+ 'status_code': [200],
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'host': {
+ 'type': 'array',
+ 'item': {
+ 'type': 'object',
+ 'properties': {
+ 'resource': {
+ 'type': 'object',
+ 'properties': {
+ 'cpu': {'type': 'integer'},
+ 'disk_gb': {'type': 'integer'},
+ 'host': {'type': 'string'},
+ 'memory_mb': {'type': 'integer'},
+ 'project': {'type': 'string'}
+ },
+ 'required': ['cpu', 'disk_gb', 'host',
+ 'memory_mb', 'project']
+ }
+ },
+ 'required': ['resource']
+ }
+ }
+ },
+ 'required': ['host']
+ }
+}
startup_host = {
'status_code': [200],
- 'response_body': hosts.common_start_up_body
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'host': {'type': 'string'},
+ 'power_action': {'enum': ['startup']}
+ },
+ 'required': ['host', 'power_action']
+ }
}
# The 'power_action' attribute of 'shutdown_host' API is 'shutdown'
@@ -38,5 +96,14 @@
update_host = {
'status_code': [200],
- 'response_body': hosts.update_host_common
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'host': {'type': 'string'},
+ 'maintenance_mode': {'enum': ['on_maintenance',
+ 'off_maintenance']},
+ 'status': {'enum': ['enabled', 'disabled']}
+ },
+ 'required': ['host', 'maintenance_mode', 'status']
+ }
}
diff --git a/tempest/api_schema/response/compute/v2_1/hypervisors.py b/tempest/api_schema/response/compute/v2_1/hypervisors.py
index cbb7698..3efa46b 100644
--- a/tempest/api_schema/response/compute/v2_1/hypervisors.py
+++ b/tempest/api_schema/response/compute/v2_1/hypervisors.py
@@ -14,13 +14,163 @@
import copy
-from tempest.api_schema.response.compute import hypervisors
+get_hypervisor_statistics = {
+ 'status_code': [200],
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'hypervisor_statistics': {
+ 'type': 'object',
+ 'properties': {
+ 'count': {'type': 'integer'},
+ 'current_workload': {'type': 'integer'},
+ 'disk_available_least': {'type': ['integer', 'null']},
+ 'free_disk_gb': {'type': 'integer'},
+ 'free_ram_mb': {'type': 'integer'},
+ 'local_gb': {'type': 'integer'},
+ 'local_gb_used': {'type': 'integer'},
+ 'memory_mb': {'type': 'integer'},
+ 'memory_mb_used': {'type': 'integer'},
+ 'running_vms': {'type': 'integer'},
+ 'vcpus': {'type': 'integer'},
+ 'vcpus_used': {'type': 'integer'}
+ },
+ 'required': ['count', 'current_workload',
+ 'disk_available_least', 'free_disk_gb',
+ 'free_ram_mb', 'local_gb', 'local_gb_used',
+ 'memory_mb', 'memory_mb_used', 'running_vms',
+ 'vcpus', 'vcpus_used']
+ }
+ },
+ 'required': ['hypervisor_statistics']
+ }
+}
-hypervisors_servers = copy.deepcopy(hypervisors.common_hypervisors_detail)
+hypervisor_detail = {
+ 'type': 'object',
+ 'properties': {
+ 'status': {'type': 'string'},
+ 'state': {'type': 'string'},
+ 'cpu_info': {'type': 'string'},
+ 'current_workload': {'type': 'integer'},
+ 'disk_available_least': {'type': ['integer', 'null']},
+ 'host_ip': {
+ 'type': 'string',
+ 'format': 'ip-address'
+ },
+ 'free_disk_gb': {'type': 'integer'},
+ 'free_ram_mb': {'type': 'integer'},
+ 'hypervisor_hostname': {'type': 'string'},
+ 'hypervisor_type': {'type': 'string'},
+ 'hypervisor_version': {'type': 'integer'},
+ 'id': {'type': ['integer', 'string']},
+ 'local_gb': {'type': 'integer'},
+ 'local_gb_used': {'type': 'integer'},
+ 'memory_mb': {'type': 'integer'},
+ 'memory_mb_used': {'type': 'integer'},
+ 'running_vms': {'type': 'integer'},
+ 'service': {
+ 'type': 'object',
+ 'properties': {
+ 'host': {'type': 'string'},
+ 'id': {'type': ['integer', 'string']},
+ 'disabled_reason': {'type': ['string', 'null']}
+ },
+ 'required': ['host', 'id']
+ },
+ 'vcpus': {'type': 'integer'},
+ 'vcpus_used': {'type': 'integer'}
+ },
+ # NOTE: When loading os-hypervisor-status extension,
+ # a response contains status and state. So these params
+ # should not be required.
+ 'required': ['cpu_info', 'current_workload',
+ 'disk_available_least', 'host_ip',
+ 'free_disk_gb', 'free_ram_mb',
+ 'hypervisor_hostname', 'hypervisor_type',
+ 'hypervisor_version', 'id', 'local_gb',
+ 'local_gb_used', 'memory_mb', 'memory_mb_used',
+ 'running_vms', 'service', 'vcpus', 'vcpus_used']
+}
-# Defining extra attributes for V3 show hypervisor schema
-hypervisors_servers['response_body']['properties']['hypervisors']['items'][
+list_hypervisors_detail = {
+ 'status_code': [200],
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'hypervisors': {
+ 'type': 'array',
+ 'items': hypervisor_detail
+ }
+ },
+ 'required': ['hypervisors']
+ }
+}
+
+get_hypervisor = {
+ 'status_code': [200],
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'hypervisor': hypervisor_detail
+ },
+ 'required': ['hypervisor']
+ }
+}
+
+list_search_hypervisors = {
+ 'status_code': [200],
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'hypervisors': {
+ 'type': 'array',
+ 'items': {
+ 'type': 'object',
+ 'properties': {
+ 'status': {'type': 'string'},
+ 'state': {'type': 'string'},
+ 'id': {'type': ['integer', 'string']},
+ 'hypervisor_hostname': {'type': 'string'}
+ },
+ # NOTE: When loading os-hypervisor-status extension,
+ # a response contains status and state. So these params
+ # should not be required.
+ 'required': ['id', 'hypervisor_hostname']
+ }
+ }
+ },
+ 'required': ['hypervisors']
+ }
+}
+
+get_hypervisor_uptime = {
+ 'status_code': [200],
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'hypervisor': {
+ 'type': 'object',
+ 'properties': {
+ 'status': {'type': 'string'},
+ 'state': {'type': 'string'},
+ 'id': {'type': ['integer', 'string']},
+ 'hypervisor_hostname': {'type': 'string'},
+ 'uptime': {'type': 'string'}
+ },
+ # NOTE: When loading os-hypervisor-status extension,
+ # a response contains status and state. So these params
+ # should not be required.
+ 'required': ['id', 'hypervisor_hostname', 'uptime']
+ }
+ },
+ 'required': ['hypervisor']
+ }
+}
+
+get_hypervisors_servers = copy.deepcopy(list_search_hypervisors)
+get_hypervisors_servers['response_body']['properties']['hypervisors']['items'][
'properties']['servers'] = {
'type': 'array',
'items': {
diff --git a/tempest/api_schema/response/compute/v2_1/keypairs.py b/tempest/api_schema/response/compute/v2_1/keypairs.py
index ec26fa0..ceae6cf 100644
--- a/tempest/api_schema/response/compute/v2_1/keypairs.py
+++ b/tempest/api_schema/response/compute/v2_1/keypairs.py
@@ -12,8 +12,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest.api_schema.response.compute import keypairs
-
get_keypair = {
'status_code': [200],
'response_body': {
@@ -47,9 +45,56 @@
create_keypair = {
'status_code': [200],
- 'response_body': keypairs.create_keypair
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'keypair': {
+ 'type': 'object',
+ 'properties': {
+ 'fingerprint': {'type': 'string'},
+ 'name': {'type': 'string'},
+ 'public_key': {'type': 'string'},
+ 'user_id': {'type': 'string'},
+ 'private_key': {'type': 'string'}
+ },
+ # When create keypair API is being called with 'Public key'
+ # (Importing keypair) then, response body does not contain
+ # 'private_key' So it is not defined as 'required'
+ 'required': ['fingerprint', 'name', 'public_key', 'user_id']
+ }
+ },
+ 'required': ['keypair']
+ }
}
delete_keypair = {
'status_code': [202],
}
+
+list_keypairs = {
+ 'status_code': [200],
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'keypairs': {
+ 'type': 'array',
+ 'items': {
+ 'type': 'object',
+ 'properties': {
+ 'keypair': {
+ 'type': 'object',
+ 'properties': {
+ 'public_key': {'type': 'string'},
+ 'name': {'type': 'string'},
+ 'fingerprint': {'type': 'string'}
+ },
+ 'required': ['public_key', 'name', 'fingerprint']
+ }
+ },
+ 'required': ['keypair']
+ }
+ }
+ },
+ 'required': ['keypairs']
+ }
+}
diff --git a/tempest/api_schema/response/compute/v2_1/quota_classes.py b/tempest/api_schema/response/compute/v2_1/quota_classes.py
index a7374df..a0cdaf5 100644
--- a/tempest/api_schema/response/compute/v2_1/quota_classes.py
+++ b/tempest/api_schema/response/compute/v2_1/quota_classes.py
@@ -20,12 +20,12 @@
# NOTE(mriedem): os-quota-class-sets responses are the same as os-quota-sets
# except for the key in the response body is quota_class_set instead of
# quota_set, so update this copy of the schema from os-quota-sets.
-quota_set = copy.deepcopy(quotas.quota_set)
-quota_set['response_body']['properties']['quota_class_set'] = (
- quota_set['response_body']['properties'].pop('quota_set'))
-quota_set['response_body']['required'] = ['quota_class_set']
+get_quota_class_set = copy.deepcopy(quotas.get_quota_set)
+get_quota_class_set['response_body']['properties']['quota_class_set'] = (
+ get_quota_class_set['response_body']['properties'].pop('quota_set'))
+get_quota_class_set['response_body']['required'] = ['quota_class_set']
-quota_set_update = copy.deepcopy(quotas.quota_set_update)
-quota_set_update['response_body']['properties']['quota_class_set'] = (
- quota_set_update['response_body']['properties'].pop('quota_set'))
-quota_set_update['response_body']['required'] = ['quota_class_set']
+update_quota_class_set = copy.deepcopy(quotas.update_quota_set)
+update_quota_class_set['response_body']['properties']['quota_class_set'] = (
+ update_quota_class_set['response_body']['properties'].pop('quota_set'))
+update_quota_class_set['response_body']['required'] = ['quota_class_set']
diff --git a/tempest/api_schema/response/compute/v2_1/quotas.py b/tempest/api_schema/response/compute/v2_1/quotas.py
index 630b227..9141f7e 100644
--- a/tempest/api_schema/response/compute/v2_1/quotas.py
+++ b/tempest/api_schema/response/compute/v2_1/quotas.py
@@ -14,34 +14,49 @@
import copy
-from tempest.api_schema.response.compute import quotas
+update_quota_set = {
+ 'status_code': [200],
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'quota_set': {
+ 'type': 'object',
+ 'properties': {
+ 'instances': {'type': 'integer'},
+ 'cores': {'type': 'integer'},
+ 'ram': {'type': 'integer'},
+ 'floating_ips': {'type': 'integer'},
+ 'fixed_ips': {'type': 'integer'},
+ 'metadata_items': {'type': 'integer'},
+ 'key_pairs': {'type': 'integer'},
+ 'security_groups': {'type': 'integer'},
+ 'security_group_rules': {'type': 'integer'},
+ 'server_group_members': {'type': 'integer'},
+ 'server_groups': {'type': 'integer'},
+ 'injected_files': {'type': 'integer'},
+ 'injected_file_content_bytes': {'type': 'integer'},
+ 'injected_file_path_bytes': {'type': 'integer'}
+ },
+ # NOTE: server_group_members and server_groups are represented
+ # when enabling quota_server_group extension. So they should
+ # not be required.
+ 'required': ['instances', 'cores', 'ram',
+ 'floating_ips', 'fixed_ips',
+ 'metadata_items', 'key_pairs',
+ 'security_groups', 'security_group_rules',
+ 'injected_files', 'injected_file_content_bytes',
+ 'injected_file_path_bytes']
+ }
+ },
+ 'required': ['quota_set']
+ }
+}
-quota_set = copy.deepcopy(quotas.common_quota_set)
-quota_set['response_body']['properties']['quota_set']['properties'][
+get_quota_set = copy.deepcopy(update_quota_set)
+get_quota_set['response_body']['properties']['quota_set']['properties'][
'id'] = {'type': 'string'}
-quota_set['response_body']['properties']['quota_set']['properties'][
- 'injected_files'] = {'type': 'integer'}
-quota_set['response_body']['properties']['quota_set']['properties'][
- 'injected_file_content_bytes'] = {'type': 'integer'}
-quota_set['response_body']['properties']['quota_set']['properties'][
- 'injected_file_path_bytes'] = {'type': 'integer'}
-quota_set['response_body']['properties']['quota_set']['required'].extend([
- 'id',
- 'injected_files',
- 'injected_file_content_bytes',
- 'injected_file_path_bytes'])
-
-quota_set_update = copy.deepcopy(quotas.common_quota_set)
-quota_set_update['response_body']['properties']['quota_set']['properties'][
- 'injected_files'] = {'type': 'integer'}
-quota_set_update['response_body']['properties']['quota_set']['properties'][
- 'injected_file_content_bytes'] = {'type': 'integer'}
-quota_set_update['response_body']['properties']['quota_set']['properties'][
- 'injected_file_path_bytes'] = {'type': 'integer'}
-quota_set_update['response_body']['properties']['quota_set'][
- 'required'].extend(['injected_files',
- 'injected_file_content_bytes',
- 'injected_file_path_bytes'])
+get_quota_set['response_body']['properties']['quota_set']['required'].extend([
+ 'id'])
delete_quota = {
'status_code': [202]
diff --git a/tempest/cli/simple_read_only/data_processing/__init__.py b/tempest/cli/simple_read_only/data_processing/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/cli/simple_read_only/data_processing/__init__.py
+++ /dev/null
diff --git a/tempest/cli/simple_read_only/data_processing/test_sahara.py b/tempest/cli/simple_read_only/data_processing/test_sahara.py
deleted file mode 100644
index 153dbd2..0000000
--- a/tempest/cli/simple_read_only/data_processing/test_sahara.py
+++ /dev/null
@@ -1,191 +0,0 @@
-# Copyright (c) 2013 Mirantis Inc.
-#
-# 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.
-import logging
-import re
-
-from tempest_lib import exceptions
-import testtools
-
-from tempest import cli
-from tempest import config
-from tempest import test
-
-CONF = config.CONF
-
-LOG = logging.getLogger(__name__)
-
-
-class SimpleReadOnlySaharaClientTest(cli.ClientTestBase):
- """Basic, read-only tests for Sahara CLI client.
-
- Checks return values and output of read-only commands.
- These tests do not presume any content, nor do they create
- their own. They only verify the structure of output if present.
- """
-
- @classmethod
- def resource_setup(cls):
- if not CONF.service_available.sahara:
- msg = "Skipping all Sahara cli tests because it is not available"
- raise cls.skipException(msg)
- super(SimpleReadOnlySaharaClientTest, cls).resource_setup()
-
- def sahara(self, *args, **kwargs):
- return self.clients.sahara(
- *args, endpoint_type=CONF.data_processing.endpoint_type, **kwargs)
-
- @test.attr(type='negative')
- @test.idempotent_id('c8809259-710f-43f9-b452-54b2be3115a9')
- def test_sahara_fake_action(self):
- self.assertRaises(exceptions.CommandFailed,
- self.sahara,
- 'this-does-not-exist')
-
- @test.idempotent_id('39afe90c-0fd8-456e-89e2-da6de9680fff')
- def test_sahara_plugins_list(self):
- plugins = self.parser.listing(self.sahara('plugin-list'))
- self.assertTableStruct(plugins, [
- 'name',
- 'versions',
- 'title'
- ])
-
- @test.idempotent_id('3eb36fd8-bb06-4004-9e90-84ddf4dbcf5b')
- @testtools.skipUnless(CONF.data_processing_feature_enabled.plugins,
- 'No plugins defined')
- def test_sahara_plugins_show(self):
- name_param = '--name %s' % \
- (CONF.data_processing_feature_enabled.plugins[0])
- result = self.sahara('plugin-show', params=name_param)
- plugin = self.parser.listing(result)
- self.assertTableStruct(plugin, [
- 'Property',
- 'Value'
- ])
-
- @test.idempotent_id('502b684b-3d41-4619-aa6c-4db3465ae79d')
- def test_sahara_node_group_template_list(self):
- result = self.sahara('node-group-template-list')
- node_group_templates = self.parser.listing(result)
- self.assertTableStruct(node_group_templates, [
- 'name',
- 'id',
- 'plugin_name',
- 'node_processes',
- 'description'
- ])
-
- @test.idempotent_id('6c36fe4d-3b88-4b0d-b702-2a051db7dae7')
- def test_sahara_cluster_template_list(self):
- result = self.sahara('cluster-template-list')
- cluster_templates = self.parser.listing(result)
- self.assertTableStruct(cluster_templates, [
- 'name',
- 'id',
- 'plugin_name',
- 'node_groups',
- 'description'
- ])
-
- @test.idempotent_id('b951949d-b9a6-49db-add5-8a18ac533810')
- def test_sahara_cluster_list(self):
- result = self.sahara('cluster-list')
- clusters = self.parser.listing(result)
- self.assertTableStruct(clusters, [
- 'name',
- 'id',
- 'status',
- 'node_count'
- ])
-
- @test.idempotent_id('dbc83a8c-15b6-4aa8-b274-5896577397e1')
- def test_sahara_data_source_list(self):
- result = self.sahara('data-source-list')
- data_sources = self.parser.listing(result)
- self.assertTableStruct(data_sources, [
- 'name',
- 'id',
- 'type',
- 'description'
- ])
-
- @test.idempotent_id('a8f77e05-d4bf-45c3-8245-57835d0de37b')
- def test_sahara_job_binary_data_list(self):
- result = self.sahara('job-binary-data-list')
- job_binary_data_list = self.parser.listing(result)
- self.assertTableStruct(job_binary_data_list, [
- 'id',
- 'name'
- ])
-
- @test.idempotent_id('a8f4d0f3-fa1c-49ce-b73f-d624d89dc381')
- def test_sahara_job_binary_list(self):
- result = self.sahara('job-binary-list')
- job_binaries = self.parser.listing(result)
- self.assertTableStruct(job_binaries, [
- 'id',
- 'name',
- 'description'
- ])
-
- @test.idempotent_id('91164ca4-d049-49e0-a52a-686b408196ff')
- def test_sahara_job_template_list(self):
- result = self.sahara('job-template-list')
- job_templates = self.parser.listing(result)
- self.assertTableStruct(job_templates, [
- 'id',
- 'name',
- 'description'
- ])
-
- @test.idempotent_id('6829c251-a8b6-449d-af86-7dd98b69a7ce')
- def test_sahara_job_list(self):
- result = self.sahara('job-list')
- jobs = self.parser.listing(result)
- self.assertTableStruct(jobs, [
- 'id',
- 'cluster_id',
- 'status'
- ])
-
- @test.idempotent_id('e4bd5d3b-474b-4b7a-82ab-f6bb0bc89faf')
- def test_sahara_bash_completion(self):
- self.sahara('bash-completion')
-
- # Optional arguments
- @test.idempotent_id('699c14e5-632e-46b8-91e5-6bff8c8307e5')
- def test_sahara_help(self):
- help_text = self.sahara('help')
- lines = help_text.split('\n')
- self.assertFirstLineStartsWith(lines, 'usage: sahara')
-
- commands = []
- cmds_start = lines.index('Positional arguments:')
- cmds_end = lines.index('Optional arguments:')
- command_pattern = re.compile('^ {4}([a-z0-9\-\_]+)')
- for line in lines[cmds_start:cmds_end]:
- match = command_pattern.match(line)
- if match:
- commands.append(match.group(1))
- commands = set(commands)
- wanted_commands = set(('cluster-create', 'data-source-create',
- 'image-unregister', 'job-binary-create',
- 'plugin-list', 'job-binary-create', 'help'))
- self.assertFalse(wanted_commands - commands)
-
- @test.idempotent_id('84a18ea6-6379-4024-af6b-0e938f60dfc2')
- def test_sahara_version(self):
- version = self.sahara('', flags='--version')
- self.assertTrue(re.search('[0-9.]+', version))
diff --git a/tempest/cmd/javelin.py b/tempest/cmd/javelin.py
index e970249..f84771f 100755
--- a/tempest/cmd/javelin.py
+++ b/tempest/cmd/javelin.py
@@ -77,7 +77,8 @@
- name: javelin_cirros
owner: javelin
file: cirros-0.3.2-x86_64-blank.img
- format: ami
+ disk_format: ami
+ container_format: ami
aki: cirros-0.3.2-x86_64-vmlinuz
ari: cirros-0.3.2-x86_64-initrd
@@ -86,6 +87,7 @@
owner: javelin
flavor: m1.small
image: javelin_cirros
+ floating_ip_pool: public
- name: hoplite
owner: javelin
flavor: m1.medium
@@ -306,10 +308,10 @@
return tenants
-def _assign_swift_role(user):
+def _assign_swift_role(user, swift_role):
admin = keystone_admin()
roles = admin.identity.list_roles()
- role = next(r for r in roles if r['name'] == 'Member')
+ role = next(r for r in roles if r['name'] == swift_role)
LOG.debug(USERS[user])
try:
admin.identity.assign_user_role(
@@ -583,7 +585,8 @@
LOG.info("Creating objects")
for obj in objects:
LOG.debug("Object %s" % obj)
- _assign_swift_role(obj['owner'])
+ swift_role = obj.get('swift_role', 'Member')
+ _assign_swift_role(obj['owner'], swift_role)
client = client_for_user(obj['owner'])
client.containers.create_container(obj['container'])
client.objects.create_object(
@@ -627,6 +630,15 @@
for image in images:
client = client_for_user(image['owner'])
+ # DEPRECATED: 'format' was used for ami images
+ # Use 'disk_format' and 'container_format' instead
+ if 'format' in image:
+ LOG.warning("Deprecated: 'format' is deprecated for images "
+ "description. Please use 'disk_format' and 'container_"
+ "format' instead.")
+ image['disk_format'] = image['format']
+ image['container_format'] = image['format']
+
# only upload a new image if the name isn't there
if _get_image_by_name(client, image['name']):
LOG.info("Image '%s' already exists" % image['name'])
@@ -634,7 +646,7 @@
# special handling for 3 part image
extras = {}
- if image['format'] == 'ami':
+ if image['disk_format'] == 'ami':
name, fname = _resolve_image(image, 'aki')
aki = client.images.create_image(
'javelin_' + name, 'aki', 'aki')
@@ -649,7 +661,8 @@
_, fname = _resolve_image(image, 'file')
body = client.images.create_image(
- image['name'], image['format'], image['format'], **extras)
+ image['name'], image['container_format'],
+ image['disk_format'], **extras)
image_id = body.get('id')
client.images.store_image(image_id, open(fname, 'r'))
@@ -858,7 +871,9 @@
for secgroup in server['secgroups']:
client.servers.add_security_group(server_id, secgroup)
if CONF.compute.use_floatingip_for_ssh:
- floating_ip = client.floating_ips.create_floating_ip()
+ floating_ip_pool = server.get('floating_ip_pool')
+ floating_ip = client.floating_ips.create_floating_ip(
+ pool_name=floating_ip_pool)
client.floating_ips.associate_floating_ip_to_server(
floating_ip['ip'], server_id)
@@ -992,9 +1007,13 @@
add_router_interface(RES['routers'])
create_secgroups(RES['secgroups'])
- create_servers(RES['servers'])
create_volumes(RES['volumes'])
- attach_volumes(RES['volumes'])
+
+ # Only attempt attaching the volumes if servers are defined in the
+ # resourcefile
+ if 'servers' in RES:
+ create_servers(RES['servers'])
+ attach_volumes(RES['volumes'])
def destroy_resources():
diff --git a/tempest/cmd/verify_tempest_config.py b/tempest/cmd/verify_tempest_config.py
index 909de96..b61f286 100755
--- a/tempest/cmd/verify_tempest_config.py
+++ b/tempest/cmd/verify_tempest_config.py
@@ -24,6 +24,7 @@
from six import moves
from tempest import clients
+from tempest.common import credentials
from tempest import config
@@ -253,10 +254,13 @@
'database': 'trove'
}
# Get catalog list for endpoints to use for validation
- endpoints = os.endpoints_client.list_endpoints()
- for endpoint in endpoints:
- service = os.service_client.get_service(endpoint['service_id'])
- services.append(service['type'])
+ _token, auth_data = os.auth_provider.get_auth()
+ if os.auth_version == 'v2':
+ catalog_key = 'serviceCatalog'
+ else:
+ catalog_key = 'catalog'
+ for entry in auth_data[catalog_key]:
+ services.append(entry['type'])
# Pull all catalog types from config file and compare against endpoint list
for cfgname in dir(CONF._config):
cfg = getattr(CONF, cfgname)
@@ -330,7 +334,8 @@
CONF_PARSER = moves.configparser.SafeConfigParser()
CONF_PARSER.optionxform = str
CONF_PARSER.readfp(conf_file)
- os = clients.AdminManager()
+ icreds = credentials.get_isolated_credentials('verify_tempest_config')
+ os = clients.Manager(icreds.get_primary_creds())
services = check_service_availability(os, update)
results = {}
for service in ['nova', 'cinder', 'neutron', 'swift']:
diff --git a/tempest/common/accounts.py b/tempest/common/accounts.py
index fc8e6a5..1d5516f 100644
--- a/tempest/common/accounts.py
+++ b/tempest/common/accounts.py
@@ -38,7 +38,8 @@
def __init__(self, identity_version=None, name=None):
super(Accounts, self).__init__(identity_version=identity_version,
name=name)
- if os.path.isfile(CONF.auth.test_accounts_file):
+ if (CONF.auth.test_accounts_file and
+ os.path.isfile(CONF.auth.test_accounts_file)):
accounts = read_accounts_yaml(CONF.auth.test_accounts_file)
self.use_default_creds = False
else:
@@ -189,8 +190,15 @@
def get_hash(self, creds):
for _hash in self.hash_dict['creds']:
# Comparing on the attributes that are expected in the YAML
- if all([getattr(creds, k) == self.hash_dict['creds'][_hash][k] for
- k in creds.get_init_attributes()]):
+ init_attributes = creds.get_init_attributes()
+ hash_attributes = self.hash_dict['creds'][_hash].copy()
+ if ('user_domain_name' in init_attributes and 'user_domain_name'
+ not in hash_attributes):
+ # Allow for the case of domain_name populated from config
+ domain_name = CONF.identity.admin_domain_name
+ hash_attributes['user_domain_name'] = domain_name
+ if all([getattr(creds, k) == hash_attributes[k] for
+ k in init_attributes]):
return _hash
raise AttributeError('Invalid credentials %s' % creds)
diff --git a/tempest/common/cred_provider.py b/tempest/common/cred_provider.py
index 9630d1c..3223027 100644
--- a/tempest/common/cred_provider.py
+++ b/tempest/common/cred_provider.py
@@ -84,6 +84,8 @@
domain_fields = set(x for x in auth.KeystoneV3Credentials.ATTRIBUTES
if 'domain' in x)
if not domain_fields.intersection(kwargs.keys()):
+ # TODO(andreaf) It might be better here to use a dedicated config
+ # option such as CONF.auth.tenant_isolation_domain_name
params['user_domain_name'] = CONF.identity.admin_domain_name
auth_url = CONF.identity.uri_v3
else:
@@ -147,3 +149,25 @@
@abc.abstractmethod
def is_role_available(self, role):
return
+
+
+class TestResources(object):
+ """Readonly Credentials, with network resources added."""
+
+ def __init__(self, credentials):
+ self._credentials = credentials
+ self.network = None
+ self.subnet = None
+ self.router = None
+
+ def __getattr__(self, item):
+ return getattr(self._credentials, item)
+
+ def set_resources(self, **kwargs):
+ for key in kwargs.keys():
+ if hasattr(self, key):
+ setattr(self, key, kwargs[key])
+
+ @property
+ def credentials(self):
+ return self._credentials
diff --git a/tempest/common/credentials.py b/tempest/common/credentials.py
index f3ddab9..c34df48 100644
--- a/tempest/common/credentials.py
+++ b/tempest/common/credentials.py
@@ -38,7 +38,8 @@
network_resources=network_resources,
identity_version=identity_version)
else:
- if os.path.isfile(CONF.auth.test_accounts_file):
+ if (CONF.auth.test_accounts_file and
+ os.path.isfile(CONF.auth.test_accounts_file)):
# Most params are not relevant for pre-created accounts
return accounts.Accounts(name=name,
identity_version=identity_version)
@@ -56,7 +57,8 @@
if CONF.auth.allow_tenant_isolation:
return is_admin
# Check whether test accounts file has the admin specified or not
- elif os.path.isfile(CONF.auth.test_accounts_file):
+ elif (CONF.auth.test_accounts_file and
+ os.path.isfile(CONF.auth.test_accounts_file)):
check_accounts = accounts.Accounts(name='check_admin')
if not check_accounts.admin_available():
is_admin = False
diff --git a/tempest/common/fixed_network.py b/tempest/common/fixed_network.py
index b06ddf2..67fbab1 100644
--- a/tempest/common/fixed_network.py
+++ b/tempest/common/fixed_network.py
@@ -15,6 +15,7 @@
from tempest_lib import exceptions as lib_exc
+from tempest.common import isolated_creds
from tempest import config
from tempest import exceptions
@@ -38,10 +39,11 @@
network = None
# NOTE(andreaf) get_primary_network will always be available once
# bp test-accounts-continued is implemented
- if (CONF.auth.allow_tenant_isolation and
+ if (isinstance(creds_provider, isolated_creds.IsolatedCreds) and
(CONF.service_available.neutron and
not CONF.service_available.ironic)):
- network = creds_provider.get_primary_network()
+ # tenant_allow_isolation == True, so network is defined
+ network = creds_provider.get_primary_creds().network
else:
if fixed_network_name:
try:
diff --git a/tempest/common/isolated_creds.py b/tempest/common/isolated_creds.py
index 22fc9c3..1f85872 100644
--- a/tempest/common/isolated_creds.py
+++ b/tempest/common/isolated_creds.py
@@ -142,7 +142,6 @@
network_resources)
self.network_resources = network_resources
self.isolated_creds = {}
- self.isolated_net_resources = {}
self.ports = []
self.password = password
self.default_admin_creds = cred_provider.get_configured_credentials(
@@ -207,7 +206,8 @@
if roles:
for role in roles:
self.creds_client.assign_user_role(user, project, role)
- return self.creds_client.get_credentials(user, project, self.password)
+ creds = self.creds_client.get_credentials(user, project, self.password)
+ return cred_provider.TestResources(creds)
def _create_network_resources(self, tenant_id):
network = None
@@ -297,33 +297,6 @@
self.network_admin_client.add_router_interface_with_subnet_id(
router_id, subnet_id)
- def get_primary_network(self):
- return self.isolated_net_resources.get('primary')[0]
-
- def get_primary_subnet(self):
- return self.isolated_net_resources.get('primary')[1]
-
- def get_primary_router(self):
- return self.isolated_net_resources.get('primary')[2]
-
- def get_admin_network(self):
- return self.isolated_net_resources.get('admin')[0]
-
- def get_admin_subnet(self):
- return self.isolated_net_resources.get('admin')[1]
-
- def get_admin_router(self):
- return self.isolated_net_resources.get('admin')[2]
-
- def get_alt_network(self):
- return self.isolated_net_resources.get('alt')[0]
-
- def get_alt_subnet(self):
- return self.isolated_net_resources.get('alt')[1]
-
- def get_alt_router(self):
- return self.isolated_net_resources.get('alt')[2]
-
def get_credentials(self, credential_type):
if self.isolated_creds.get(str(credential_type)):
credentials = self.isolated_creds[str(credential_type)]
@@ -341,8 +314,8 @@
not CONF.baremetal.driver_enabled):
network, subnet, router = self._create_network_resources(
credentials.tenant_id)
- self.isolated_net_resources[str(credential_type)] = (
- network, subnet, router,)
+ credentials.set_resources(network=network, subnet=subnet,
+ router=router)
LOG.info("Created isolated network resources for : \n"
+ " credentials: %s" % credentials)
return credentials
@@ -368,12 +341,6 @@
new_index = str(roles) + '-' + str(len(self.isolated_creds))
self.isolated_creds[new_index] = exist_creds
del self.isolated_creds[str(roles)]
- # Handle isolated neutron resouces if they exist too
- if CONF.service_available.neutron:
- exist_net = self.isolated_net_resources.get(str(roles))
- if exist_net:
- self.isolated_net_resources[new_index] = exist_net
- del self.isolated_net_resources[str(roles)]
return self.get_credentials(roles)
def _clear_isolated_router(self, router_id, router_name):
@@ -414,27 +381,33 @@
def _clear_isolated_net_resources(self):
net_client = self.network_admin_client
- for cred in self.isolated_net_resources:
- network, subnet, router = self.isolated_net_resources.get(cred)
+ for cred in self.isolated_creds:
+ creds = self.isolated_creds.get(cred)
+ if (not creds or not any([creds.router, creds.network,
+ creds.subnet])):
+ continue
LOG.debug("Clearing network: %(network)s, "
"subnet: %(subnet)s, router: %(router)s",
- {'network': network, 'subnet': subnet, 'router': router})
+ {'network': creds.network, 'subnet': creds.subnet,
+ 'router': creds.router})
if (not self.network_resources or
- self.network_resources.get('router')):
+ (self.network_resources.get('router') and creds.subnet)):
try:
net_client.remove_router_interface_with_subnet_id(
- router['id'], subnet['id'])
+ creds.router['id'], creds.subnet['id'])
except lib_exc.NotFound:
LOG.warn('router with name: %s not found for delete' %
- router['name'])
- self._clear_isolated_router(router['id'], router['name'])
+ creds.router['name'])
+ self._clear_isolated_router(creds.router['id'],
+ creds.router['name'])
if (not self.network_resources or
self.network_resources.get('subnet')):
- self._clear_isolated_subnet(subnet['id'], subnet['name'])
+ self._clear_isolated_subnet(creds.subnet['id'],
+ creds.subnet['name'])
if (not self.network_resources or
self.network_resources.get('network')):
- self._clear_isolated_network(network['id'], network['name'])
- self.isolated_net_resources = {}
+ self._clear_isolated_network(creds.network['id'],
+ creds.network['name'])
def clear_isolated_creds(self):
if not self.isolated_creds:
diff --git a/tempest/common/utils/linux/remote_client.py b/tempest/common/utils/linux/remote_client.py
index b19faef..29fb493 100644
--- a/tempest/common/utils/linux/remote_client.py
+++ b/tempest/common/utils/linux/remote_client.py
@@ -87,10 +87,11 @@
cmd = 'sudo sh -c "echo \\"%s\\" >/dev/console"' % message
return self.exec_command(cmd)
- def ping_host(self, host):
+ def ping_host(self, host, count=CONF.compute.ping_count,
+ size=CONF.compute.ping_size):
addr = netaddr.IPAddress(host)
cmd = 'ping6' if addr.version == 6 else 'ping'
- cmd += ' -c1 -w1 {0}'.format(host)
+ cmd += ' -c{0} -w{0} -s{1} {2}'.format(count, size, host)
return self.exec_command(cmd)
def get_mac_address(self):
diff --git a/tempest/config.py b/tempest/config.py
index 9577f2d..6b8113e 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -23,6 +23,13 @@
from oslo_log import log as logging
+# TODO(marun) Replace use of oslo_config's global ConfigOpts
+# (cfg.CONF) instance with a local instance (cfg.ConfigOpts()) once
+# the cli tests move to the clients. The cli tests rely on oslo
+# incubator modules that use the global cfg.CONF.
+_CONF = cfg.CONF
+
+
def register_opt_group(conf, opt_group, options):
conf.register_group(opt_group)
for opt in options:
@@ -180,10 +187,6 @@
default="root",
help="User name used to authenticate to an instance using "
"the alternate image."),
- cfg.StrOpt('image_alt_ssh_password',
- default="password",
- help="Password used to authenticate to an instance using "
- "the alternate image."),
cfg.IntOpt('build_interval',
default=1,
help="Time in seconds between build status checks."),
@@ -198,16 +201,17 @@
cfg.StrOpt('ssh_auth_method',
default='keypair',
help="Auth method used for authenticate to the instance. "
- "Valid choices are: keypair, configured, adminpass. "
- "keypair: start the servers with an ssh keypair. "
- "configured: use the configured user and password. "
- "adminpass: use the injected adminPass. "
- "disabled: avoid using ssh when it is an option."),
+ "Valid choices are: keypair, configured, adminpass "
+ "and disabled. "
+ "Keypair: start the servers with a ssh keypair. "
+ "Configured: use the configured user and password. "
+ "Adminpass: use the injected adminPass. "
+ "Disabled: avoid using ssh when it is an option."),
cfg.StrOpt('ssh_connect_method',
- default='fixed',
+ default='floating',
help="How to connect to the instance? "
"fixed: using the first ip belongs the fixed network "
- "floating: creating and using a floating ip"),
+ "floating: creating and using a floating ip."),
cfg.StrOpt('ssh_user',
default='root',
help="User name used to authenticate to an instance."),
@@ -215,6 +219,14 @@
default=120,
help="Timeout in seconds to wait for ping to "
"succeed."),
+ cfg.IntOpt('ping_size',
+ default=56,
+ help="The packet size for ping packets originating "
+ "from remote linux hosts"),
+ cfg.IntOpt('ping_count',
+ default=1,
+ help="The number of ping packets originating from remote "
+ "linux hosts"),
cfg.IntOpt('ssh_timeout',
default=300,
help="Timeout in seconds to wait for authentication to "
@@ -232,7 +244,8 @@
"tenants. If multiple networks are available for a tenant"
" this is the network which will be used for creating "
"servers if tempest does not create a network or a "
- "network is not specified elsewhere"),
+ "network is not specified elsewhere. It may be used for "
+ "ssh validation only if floating IPs are disabled."),
cfg.StrOpt('network_for_ssh',
default='public',
help="Network used for SSH connections. Ignored if "
@@ -257,9 +270,6 @@
choices=['public', 'admin', 'internal',
'publicURL', 'adminURL', 'internalURL'],
help="The endpoint type to use for the compute service."),
- cfg.StrOpt('path_to_private_key',
- help="Path to a private key file for SSH access to remote "
- "hosts"),
cfg.StrOpt('volume_device_name',
default='vdb',
help="Expected device name when a volume is attached to "
@@ -442,12 +452,16 @@
help="The mask bits for tenant ipv6 subnets"),
cfg.BoolOpt('tenant_networks_reachable',
default=False,
- help="Whether tenant network connectivity should be "
- "evaluated directly"),
+ help="Whether tenant networks can be reached directly from "
+ "the test client. This must be set to True when the "
+ "'fixed' ssh_connect_method is selected."),
cfg.StrOpt('public_network_id',
default="",
help="Id of the public network that provides external "
"connectivity"),
+ cfg.StrOpt('floating_network_name',
+ help="Default floating network name. Used to allocate floating "
+ "IPs when neutron is enabled."),
cfg.StrOpt('public_router_id',
default="",
help="Id of the public router that provides external "
@@ -529,6 +543,37 @@
help='The maximum grace period for a claim'),
]
+validation_group = cfg.OptGroup(name='validation',
+ title='SSH Validation options')
+
+ValidationGroup = [
+ cfg.StrOpt('connect_method',
+ default='floating',
+ choices=['fixed', 'floating'],
+ help='Default IP type used for validation: '
+ '-fixed: uses the first IP belonging to the fixed network '
+ '-floating: creates and uses a floating IP'),
+ cfg.StrOpt('auth_method',
+ default='keypair',
+ choices=['keypair'],
+ help='Default authentication method to the instance. '
+ 'Only ssh via keypair is supported for now. '
+ 'Additional methods will be handled in a separate spec.'),
+ cfg.IntOpt('ip_version_for_ssh',
+ default=4,
+ help='Default IP version for ssh connections.'),
+ cfg.IntOpt('ping_timeout',
+ default=120,
+ help='Timeout in seconds to wait for ping to succeed.'),
+ cfg.IntOpt('connect_timeout',
+ default=60,
+ help='Timeout in seconds to wait for the TCP connection to be '
+ 'successful.'),
+ cfg.IntOpt('ssh_timeout',
+ default=300,
+ help='Timeout in seconds to wait for the ssh banner.'),
+]
+
volume_group = cfg.OptGroup(name='volume',
title='Block Storage Options')
@@ -995,7 +1040,7 @@
help="SSH verification in tests is skipped"
"for matching images"),
cfg.StrOpt('ssh_user_regex',
- default="[[\"^.*[Cc]irros.*$\", \"root\"]]",
+ default="[[\"^.*[Cc]irros.*$\", \"cirros\"]]",
help="List of user mapped to regex "
"to matching image names."),
]
@@ -1081,6 +1126,7 @@
(network_group, NetworkGroup),
(network_feature_group, NetworkFeaturesGroup),
(messaging_group, MessagingGroup),
+ (validation_group, ValidationGroup),
(volume_group, VolumeGroup),
(volume_feature_group, VolumeFeaturesGroup),
(object_storage_group, ObjectStoreGroup),
@@ -1105,7 +1151,7 @@
def register_opts():
for g, o in _opts:
- register_opt_group(cfg.CONF, g, o)
+ register_opt_group(_CONF, g, o)
def list_opts():
@@ -1129,45 +1175,45 @@
def __getattr__(self, attr):
# Handles config options from the default group
- return getattr(cfg.CONF, attr)
+ return getattr(_CONF, attr)
def _set_attrs(self):
- self.auth = cfg.CONF.auth
- self.compute = cfg.CONF.compute
- self.compute_feature_enabled = cfg.CONF['compute-feature-enabled']
- self.identity = cfg.CONF.identity
- self.identity_feature_enabled = cfg.CONF['identity-feature-enabled']
- self.image = cfg.CONF.image
- self.image_feature_enabled = cfg.CONF['image-feature-enabled']
- self.network = cfg.CONF.network
- self.network_feature_enabled = cfg.CONF['network-feature-enabled']
- self.volume = cfg.CONF.volume
- self.volume_feature_enabled = cfg.CONF['volume-feature-enabled']
- self.object_storage = cfg.CONF['object-storage']
- self.object_storage_feature_enabled = cfg.CONF[
+ self.auth = _CONF.auth
+ self.compute = _CONF.compute
+ self.compute_feature_enabled = _CONF['compute-feature-enabled']
+ self.identity = _CONF.identity
+ self.identity_feature_enabled = _CONF['identity-feature-enabled']
+ self.image = _CONF.image
+ self.image_feature_enabled = _CONF['image-feature-enabled']
+ self.network = _CONF.network
+ self.network_feature_enabled = _CONF['network-feature-enabled']
+ self.validation = _CONF.validation
+ self.volume = _CONF.volume
+ self.volume_feature_enabled = _CONF['volume-feature-enabled']
+ self.object_storage = _CONF['object-storage']
+ self.object_storage_feature_enabled = _CONF[
'object-storage-feature-enabled']
- self.database = cfg.CONF.database
- self.orchestration = cfg.CONF.orchestration
- self.messaging = cfg.CONF.messaging
- self.telemetry = cfg.CONF.telemetry
- self.dashboard = cfg.CONF.dashboard
- self.data_processing = cfg.CONF.data_processing
- self.data_processing_feature_enabled = cfg.CONF[
+ self.database = _CONF.database
+ self.orchestration = _CONF.orchestration
+ self.messaging = _CONF.messaging
+ self.telemetry = _CONF.telemetry
+ self.dashboard = _CONF.dashboard
+ self.data_processing = _CONF.data_processing
+ self.data_processing_feature_enabled = _CONF[
'data_processing-feature-enabled']
- self.boto = cfg.CONF.boto
- self.stress = cfg.CONF.stress
- self.scenario = cfg.CONF.scenario
- self.service_available = cfg.CONF.service_available
- self.debug = cfg.CONF.debug
- self.baremetal = cfg.CONF.baremetal
- self.input_scenario = cfg.CONF['input-scenario']
- self.cli = cfg.CONF.cli
- self.negative = cfg.CONF.negative
- cfg.CONF.set_default('domain_name', self.identity.admin_domain_name,
- group='identity')
- cfg.CONF.set_default('alt_domain_name',
- self.identity.admin_domain_name,
- group='identity')
+ self.boto = _CONF.boto
+ self.stress = _CONF.stress
+ self.scenario = _CONF.scenario
+ self.service_available = _CONF.service_available
+ self.debug = _CONF.debug
+ self.baremetal = _CONF.baremetal
+ self.input_scenario = _CONF['input-scenario']
+ self.cli = _CONF.cli
+ self.negative = _CONF.negative
+ _CONF.set_default('domain_name', self.identity.admin_domain_name,
+ group='identity')
+ _CONF.set_default('alt_domain_name', self.identity.admin_domain_name,
+ group='identity')
def __init__(self, parse_conf=True, config_path=None):
"""Initialize a configuration from a conf directory and conf file."""
@@ -1193,18 +1239,18 @@
# to remove an issue with the config file up to date checker.
if parse_conf:
config_files.append(path)
- logging.register_options(cfg.CONF)
+ logging.register_options(_CONF)
if os.path.isfile(path):
- cfg.CONF([], project='tempest', default_config_files=config_files)
+ _CONF([], project='tempest', default_config_files=config_files)
else:
- cfg.CONF([], project='tempest')
- logging.setup(cfg.CONF, 'tempest')
+ _CONF([], project='tempest')
+ logging.setup(_CONF, 'tempest')
LOG = logging.getLogger('tempest')
LOG.info("Using tempest config file %s" % path)
register_opts()
self._set_attrs()
if parse_conf:
- cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)
+ _CONF.log_opt_values(LOG, std_logging.DEBUG)
class TempestConfigProxy(object):
diff --git a/tempest/manager.py b/tempest/manager.py
index a256f25..025ce65 100644
--- a/tempest/manager.py
+++ b/tempest/manager.py
@@ -46,8 +46,14 @@
# Check if passed or default credentials are valid
if not self.credentials.is_valid():
raise exceptions.InvalidCredentials()
+ # Tenant isolation creates TestResources, but Accounts and some tests
+ # creates Credentials
+ if isinstance(credentials, cred_provider.TestResources):
+ creds = self.credentials.credentials
+ else:
+ creds = self.credentials
# Creates an auth provider for the credentials
- self.auth_provider = get_auth_provider(self.credentials)
+ self.auth_provider = get_auth_provider(creds)
# FIXME(andreaf) unused
self.client_attr_names = []
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index bae8296..d2c41f0 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -186,7 +186,8 @@
if create_kwargs is None:
create_kwargs = {}
network = self.get_tenant_network()
- fixed_network.set_networks_kwarg(network, create_kwargs)
+ create_kwargs = fixed_network.set_networks_kwarg(network,
+ create_kwargs)
LOG.debug("Creating a server (name: %s, image: %s, flavor: %s)",
name, image, flavor)
@@ -234,7 +235,7 @@
self.volumes_client.wait_for_volume_status(volume['id'], 'available')
# The volume retrieved on creation has a non-up-to-date status.
# Retrieval after it becomes active ensures correct details.
- volume = self.volumes_client.get_volume(volume['id'])
+ volume = self.volumes_client.show_volume(volume['id'])
return volume
def _create_loginable_secgroup_rule(self, secgroup_id=None):
@@ -308,8 +309,13 @@
if isinstance(server_or_ip, six.string_types):
ip = server_or_ip
else:
- addr = server_or_ip['addresses'][CONF.compute.network_for_ssh][0]
- ip = addr['addr']
+ addrs = server_or_ip['addresses'][CONF.compute.network_for_ssh]
+ try:
+ ip = (addr['addr'] for addr in addrs if
+ netaddr.valid_ipv4(addr['addr'])).next()
+ except StopIteration:
+ raise lib_exc.NotFound("No IPv4 addresses to use for SSH to "
+ "remote server.")
if username is None:
username = CONF.scenario.ssh_user
@@ -401,7 +407,7 @@
# Compute client
_images_client = self.images_client
if name is None:
- name = data_utils.rand_name('scenario-snapshot-')
+ name = data_utils.rand_name('scenario-snapshot')
LOG.debug("Creating a snapshot image for server: %s", server['name'])
image = _images_client.create_image(server['id'], name)
image_id = image.response['location'].split('images/')[1]
@@ -425,14 +431,14 @@
self.assertEqual(self.volume['id'], volume['id'])
self.volumes_client.wait_for_volume_status(volume['id'], 'in-use')
# Refresh the volume after the attachment
- self.volume = self.volumes_client.get_volume(volume['id'])
+ self.volume = self.volumes_client.show_volume(volume['id'])
def nova_volume_detach(self):
self.servers_client.detach_volume(self.server['id'], self.volume['id'])
self.volumes_client.wait_for_volume_status(self.volume['id'],
'available')
- volume = self.volumes_client.get_volume(self.volume['id'])
+ volume = self.volumes_client.show_volume(self.volume['id'])
self.assertEqual('available', volume['status'])
def rebuild_server(self, server_id, image=None,
@@ -680,6 +686,8 @@
def _get_network_by_name(self, network_name):
net = self._list_networks(name=network_name)
+ self.assertNotEqual(len(net), 0,
+ "Unable to get network by name: %s" % network_name)
return net_resources.AttributeDict(net[0])
def create_floating_ip(self, thing, external_network_id=None,
@@ -1049,6 +1057,9 @@
# not (the current baremetal case). Likely can be removed when
# test account mgmt is reworked:
# https://blueprints.launchpad.net/tempest/+spec/test-accounts
+ if not CONF.compute.fixed_network_name:
+ m = 'fixed_network_name must be specified in config'
+ raise exceptions.InvalidConfiguration(m)
network = self._get_network_by_name(
CONF.compute.fixed_network_name)
router = None
@@ -1317,7 +1328,7 @@
client = self.admin_volume_types_client
if not name:
name = 'generic'
- randomized_name = data_utils.rand_name('scenario-type-' + name + '-')
+ randomized_name = data_utils.rand_name('scenario-type-' + name)
LOG.debug("Creating a volume type: %s", randomized_name)
body = client.create_volume_type(
randomized_name)
diff --git a/tempest/scenario/test_aggregates_basic_ops.py b/tempest/scenario/test_aggregates_basic_ops.py
index 92e6c74..c5e8012 100644
--- a/tempest/scenario/test_aggregates_basic_ops.py
+++ b/tempest/scenario/test_aggregates_basic_ops.py
@@ -16,6 +16,7 @@
from oslo_log import log as logging
from tempest_lib.common.utils import data_utils
+from tempest.common import credentials
from tempest.common import tempest_fixtures as fixtures
from tempest.scenario import manager
from tempest import test
@@ -34,6 +35,13 @@
Deletes aggregate
"""
@classmethod
+ def skip_checks(cls):
+ super(TestAggregatesBasicOps, cls).skip_checks()
+ if not credentials.is_admin_available():
+ msg = ("Missing Identity Admin API credentials in configuration.")
+ raise cls.skipException(msg)
+
+ @classmethod
def setup_clients(cls):
super(TestAggregatesBasicOps, cls).setup_clients()
cls.aggregates_client = cls.manager.aggregates_client
diff --git a/tempest/scenario/test_large_ops.py b/tempest/scenario/test_large_ops.py
index 145efe7..0789c21 100644
--- a/tempest/scenario/test_large_ops.py
+++ b/tempest/scenario/test_large_ops.py
@@ -78,7 +78,7 @@
self.servers_client.wait_for_server_status(server['id'], status)
def nova_boot(self):
- name = data_utils.rand_name('scenario-server-')
+ name = data_utils.rand_name('scenario-server')
flavor_id = CONF.compute.flavor_ref
# Explicitly create secgroup to avoid cleanup at the end of testcases.
# Since no traffic is tested, we don't need to actually add rules to
diff --git a/tempest/scenario/test_minimum_basic.py b/tempest/scenario/test_minimum_basic.py
index c780464..45923ce 100644
--- a/tempest/scenario/test_minimum_basic.py
+++ b/tempest/scenario/test_minimum_basic.py
@@ -73,7 +73,7 @@
self.assertIn(self.volume['id'], [x['id'] for x in volumes])
def cinder_show(self):
- volume = self.volumes_client.get_volume(self.volume['id'])
+ volume = self.volumes_client.show_volume(self.volume['id'])
self.assertEqual(self.volume, volume)
def nova_volume_attach(self):
@@ -83,7 +83,7 @@
self.assertEqual(self.volume['id'], volume['id'])
self.volumes_client.wait_for_volume_status(volume['id'], 'in-use')
# Refresh the volume after the attachment
- self.volume = self.volumes_client.get_volume(volume['id'])
+ self.volume = self.volumes_client.show_volume(volume['id'])
def nova_reboot(self):
self.servers_client.reboot(self.server['id'], 'SOFT')
@@ -99,7 +99,7 @@
self.volumes_client.wait_for_volume_status(self.volume['id'],
'available')
- volume = self.volumes_client.get_volume(self.volume['id'])
+ volume = self.volumes_client.show_volume(self.volume['id'])
self.assertEqual('available', volume['status'])
def create_and_add_security_group(self):
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index bb19853..2c4522d 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -214,7 +214,7 @@
def _reassociate_floating_ips(self):
floating_ip, server = self.floating_ip_tuple
- name = data_utils.rand_name('new_server-smoke-')
+ name = data_utils.rand_name('new_server-smoke')
# create a new server for the floating ip
server = self._create_server(name, self.network)
self._associate_floating_ip(floating_ip, server)
@@ -318,11 +318,15 @@
LOG.info(msg)
return
- subnet = self._list_subnets(
- network_id=CONF.network.public_network_id)
- self.assertEqual(1, len(subnet), "Found %d subnets" % len(subnet))
+ # We ping the external IP from the instance using its floating IP
+ # which is always IPv4, so we must only test connectivity to
+ # external IPv4 IPs if the external network is dualstack.
+ v4_subnets = [s for s in self._list_subnets(
+ network_id=CONF.network.public_network_id) if s['ip_version'] == 4]
+ self.assertEqual(1, len(v4_subnets),
+ "Found %d IPv4 subnets" % len(v4_subnets))
- external_ips = [subnet[0]['gateway_ip']]
+ external_ips = [v4_subnets[0]['gateway_ip']]
self._check_server_connectivity(self.floating_ip_tuple.floating_ip,
external_ips)
diff --git a/tempest/scenario/test_security_groups_basic_ops.py b/tempest/scenario/test_security_groups_basic_ops.py
index cffb2fe..1ecc212 100644
--- a/tempest/scenario/test_security_groups_basic_ops.py
+++ b/tempest/scenario/test_security_groups_basic_ops.py
@@ -125,6 +125,10 @@
if CONF.baremetal.driver_enabled:
msg = ('Not currently supported by baremetal.')
raise cls.skipException(msg)
+ if CONF.network.port_vnic_type in ['direct', 'macvtap']:
+ msg = ('Not currently supported when using vnic_type'
+ ' direct or macvtap')
+ raise cls.skipException(msg)
if not (CONF.network.tenant_networks_reachable or
CONF.network.public_network_id):
msg = ('Either tenant_networks_reachable must be "true", or '
@@ -256,7 +260,7 @@
def _create_tenant_servers(self, tenant, num=1):
for i in range(num):
- name = 'server-{tenant}-gen-{num}-'.format(
+ name = 'server-{tenant}-gen-{num}'.format(
tenant=tenant.creds.tenant_name,
num=i
)
@@ -271,7 +275,7 @@
workaround ip namespace
"""
secgroups = tenant.security_groups.values()
- name = 'server-{tenant}-access_point-'.format(
+ name = 'server-{tenant}-access_point'.format(
tenant=tenant.creds.tenant_name)
name = data_utils.rand_name(name)
server = self._create_server(name, tenant,
@@ -497,7 +501,7 @@
new_tenant.security_groups.update(new_sg=new_sg)
# Create server with default security group
- name = 'server-{tenant}-gen-1-'.format(
+ name = 'server-{tenant}-gen-1'.format(
tenant=new_tenant.creds.tenant_name
)
name = data_utils.rand_name(name)
diff --git a/tempest/scenario/test_stamp_pattern.py b/tempest/scenario/test_stamp_pattern.py
index f7653e7..53b471a 100644
--- a/tempest/scenario/test_stamp_pattern.py
+++ b/tempest/scenario/test_stamp_pattern.py
@@ -78,14 +78,14 @@
return self.get_remote_client(server_or_ip)
def _create_volume_snapshot(self, volume):
- snapshot_name = data_utils.rand_name('scenario-snapshot-')
+ snapshot_name = data_utils.rand_name('scenario-snapshot')
_, snapshot = self.snapshots_client.create_snapshot(
volume['id'], display_name=snapshot_name)
def cleaner():
self.snapshots_client.delete_snapshot(snapshot['id'])
try:
- while self.snapshots_client.get_snapshot(snapshot['id']):
+ while self.snapshots_client.show_snapshot(snapshot['id']):
time.sleep(1)
except lib_exc.NotFound:
pass
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index 8fa2df5..5bc24ea 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -41,6 +41,8 @@
super(TestVolumeBootPattern, cls).skip_checks()
if not CONF.volume_feature_enabled.snapshot:
raise cls.skipException("Cinder volume snapshots are disabled")
+ if CONF.volume.storage_protocol == 'ceph':
+ raise cls.skipException('Skip until bug 1439371 is fixed.')
def _create_volume_from_image(self):
img_uuid = CONF.compute.image_ref
diff --git a/tempest/services/compute/json/hosts_client.py b/tempest/services/compute/json/hosts_client.py
index de925a9..088e695 100644
--- a/tempest/services/compute/json/hosts_client.py
+++ b/tempest/services/compute/json/hosts_client.py
@@ -15,8 +15,7 @@
import json
import urllib
-from tempest.api_schema.response.compute import hosts as schema
-from tempest.api_schema.response.compute.v2_1 import hosts as v2_schema
+from tempest.api_schema.response.compute.v2_1 import hosts as schema
from tempest.common import service_client
@@ -39,7 +38,7 @@
resp, body = self.get("os-hosts/%s" % str(hostname))
body = json.loads(body)
- self.validate_response(schema.show_host_detail, resp, body)
+ self.validate_response(schema.get_host_detail, resp, body)
return service_client.ResponseBodyList(resp, body['host'])
def update_host(self, hostname, **kwargs):
@@ -54,7 +53,7 @@
resp, body = self.put("os-hosts/%s" % str(hostname), request_body)
body = json.loads(body)
- self.validate_response(v2_schema.update_host, resp, body)
+ self.validate_response(schema.update_host, resp, body)
return service_client.ResponseBody(resp, body)
def startup_host(self, hostname):
@@ -62,7 +61,7 @@
resp, body = self.get("os-hosts/%s/startup" % str(hostname))
body = json.loads(body)
- self.validate_response(v2_schema.startup_host, resp, body)
+ self.validate_response(schema.startup_host, resp, body)
return service_client.ResponseBody(resp, body['host'])
def shutdown_host(self, hostname):
@@ -70,7 +69,7 @@
resp, body = self.get("os-hosts/%s/shutdown" % str(hostname))
body = json.loads(body)
- self.validate_response(v2_schema.shutdown_host, resp, body)
+ self.validate_response(schema.shutdown_host, resp, body)
return service_client.ResponseBody(resp, body['host'])
def reboot_host(self, hostname):
@@ -78,5 +77,5 @@
resp, body = self.get("os-hosts/%s/reboot" % str(hostname))
body = json.loads(body)
- self.validate_response(v2_schema.reboot_host, resp, body)
+ self.validate_response(schema.reboot_host, resp, body)
return service_client.ResponseBody(resp, body['host'])
diff --git a/tempest/services/compute/json/hypervisor_client.py b/tempest/services/compute/json/hypervisor_client.py
index bf4bc7f..49ac266 100644
--- a/tempest/services/compute/json/hypervisor_client.py
+++ b/tempest/services/compute/json/hypervisor_client.py
@@ -15,8 +15,7 @@
import json
-from tempest.api_schema.response.compute import hypervisors as common_schema
-from tempest.api_schema.response.compute.v2_1 import hypervisors as v2schema
+from tempest.api_schema.response.compute.v2_1 import hypervisors as schema
from tempest.common import service_client
@@ -26,51 +25,47 @@
"""List hypervisors information."""
resp, body = self.get('os-hypervisors')
body = json.loads(body)
- self.validate_response(common_schema.common_hypervisors_detail,
- resp, body)
+ self.validate_response(schema.list_search_hypervisors, resp, body)
return service_client.ResponseBodyList(resp, body['hypervisors'])
def get_hypervisor_list_details(self):
"""Show detailed hypervisors information."""
resp, body = self.get('os-hypervisors/detail')
body = json.loads(body)
- self.validate_response(common_schema.common_list_hypervisors_detail,
- resp, body)
+ self.validate_response(schema.list_hypervisors_detail, resp, body)
return service_client.ResponseBodyList(resp, body['hypervisors'])
def get_hypervisor_show_details(self, hyper_id):
"""Display the details of the specified hypervisor."""
resp, body = self.get('os-hypervisors/%s' % hyper_id)
body = json.loads(body)
- self.validate_response(common_schema.common_show_hypervisor,
- resp, body)
+ self.validate_response(schema.get_hypervisor, resp, body)
return service_client.ResponseBody(resp, body['hypervisor'])
def get_hypervisor_servers(self, hyper_name):
"""List instances belonging to the specified hypervisor."""
resp, body = self.get('os-hypervisors/%s/servers' % hyper_name)
body = json.loads(body)
- self.validate_response(v2schema.hypervisors_servers, resp, body)
+ self.validate_response(schema.get_hypervisors_servers, resp, body)
return service_client.ResponseBodyList(resp, body['hypervisors'])
def get_hypervisor_stats(self):
"""Get hypervisor statistics over all compute nodes."""
resp, body = self.get('os-hypervisors/statistics')
body = json.loads(body)
- self.validate_response(common_schema.hypervisor_statistics, resp, body)
+ self.validate_response(schema.get_hypervisor_statistics, resp, body)
return service_client.ResponseBody(resp, body['hypervisor_statistics'])
def get_hypervisor_uptime(self, hyper_id):
"""Display the uptime of the specified hypervisor."""
resp, body = self.get('os-hypervisors/%s/uptime' % hyper_id)
body = json.loads(body)
- self.validate_response(common_schema.hypervisor_uptime, resp, body)
+ self.validate_response(schema.get_hypervisor_uptime, resp, body)
return service_client.ResponseBody(resp, body['hypervisor'])
def search_hypervisor(self, hyper_name):
"""Search specified hypervisor."""
resp, body = self.get('os-hypervisors/%s/search' % hyper_name)
body = json.loads(body)
- self.validate_response(common_schema.common_hypervisors_detail,
- resp, body)
+ self.validate_response(schema.list_search_hypervisors, resp, body)
return service_client.ResponseBodyList(resp, body['hypervisors'])
diff --git a/tempest/services/compute/json/keypairs_client.py b/tempest/services/compute/json/keypairs_client.py
index 722aefa..7fe335b 100644
--- a/tempest/services/compute/json/keypairs_client.py
+++ b/tempest/services/compute/json/keypairs_client.py
@@ -15,7 +15,6 @@
import json
-from tempest.api_schema.response.compute import keypairs as common_schema
from tempest.api_schema.response.compute.v2_1 import keypairs as schema
from tempest.common import service_client
@@ -30,7 +29,7 @@
# servers, etc. A bug?
# For now we shall adhere to the spec, but the spec for keypairs
# is yet to be found
- self.validate_response(common_schema.list_keypairs, resp, body)
+ self.validate_response(schema.list_keypairs, resp, body)
return service_client.ResponseBodyList(resp, body['keypairs'])
def get_keypair(self, key_name):
diff --git a/tempest/services/compute/json/quotas_client.py b/tempest/services/compute/json/quotas_client.py
index 89f4acd..6e38c47 100644
--- a/tempest/services/compute/json/quotas_client.py
+++ b/tempest/services/compute/json/quotas_client.py
@@ -31,7 +31,7 @@
url += '?user_id=%s' % str(user_id)
resp, body = self.get(url)
body = json.loads(body)
- self.validate_response(schema.quota_set, resp, body)
+ self.validate_response(schema.get_quota_set, resp, body)
return service_client.ResponseBody(resp, body['quota_set'])
def get_default_quota_set(self, tenant_id):
@@ -40,7 +40,7 @@
url = 'os-quota-sets/%s/defaults' % str(tenant_id)
resp, body = self.get(url)
body = json.loads(body)
- self.validate_response(schema.quota_set, resp, body)
+ self.validate_response(schema.get_quota_set, resp, body)
return service_client.ResponseBody(resp, body['quota_set'])
def update_quota_set(self, tenant_id, user_id=None,
@@ -105,7 +105,7 @@
post_body)
body = json.loads(body)
- self.validate_response(schema.quota_set_update, resp, body)
+ self.validate_response(schema.update_quota_set, resp, body)
return service_client.ResponseBody(resp, body['quota_set'])
def delete_quota_set(self, tenant_id):
@@ -123,7 +123,7 @@
url = 'os-quota-class-sets/%s' % str(quota_class_id)
resp, body = self.get(url)
body = json.loads(body)
- self.validate_response(classes_schema.quota_set, resp, body)
+ self.validate_response(classes_schema.get_quota_class_set, resp, body)
return service_client.ResponseBody(resp, body['quota_class_set'])
def update_quota_class_set(self, quota_class_id, **kwargs):
@@ -136,5 +136,6 @@
post_body)
body = json.loads(body)
- self.validate_response(classes_schema.quota_set_update, resp, body)
+ self.validate_response(classes_schema.update_quota_class_set,
+ resp, body)
return service_client.ResponseBody(resp, body['quota_class_set'])
diff --git a/tempest/services/orchestration/json/orchestration_client.py b/tempest/services/orchestration/json/orchestration_client.py
index 1a4c5d9..debf39b 100644
--- a/tempest/services/orchestration/json/orchestration_client.py
+++ b/tempest/services/orchestration/json/orchestration_client.py
@@ -105,7 +105,7 @@
headers['X-Auth-User'] = self.user
return headers, body
- def get_stack(self, stack_identifier):
+ def show_stack(self, stack_identifier):
"""Returns the details of a single stack."""
url = "stacks/%s" % stack_identifier
resp, body = self.get(url)
@@ -137,7 +137,7 @@
body = json.loads(body)
return service_client.ResponseBodyList(resp, body['resources'])
- def get_resource(self, stack_identifier, resource_name):
+ def show_resource(self, stack_identifier, resource_name):
"""Returns the details of a single resource."""
url = "stacks/%s/resources/%s" % (stack_identifier, resource_name)
resp, body = self.get(url)
@@ -159,7 +159,7 @@
while True:
try:
- body = self.get_resource(
+ body = self.show_resource(
stack_identifier, resource_name)
except lib_exc.NotFound:
# ignore this, as the resource may not have
@@ -195,7 +195,7 @@
while True:
try:
- body = self.get_stack(stack_identifier)
+ body = self.show_stack(stack_identifier)
except lib_exc.NotFound:
if status == 'DELETE_COMPLETE':
return
@@ -295,14 +295,14 @@
body = json.loads(body)
return service_client.ResponseBodyList(resp, body['resource_types'])
- def get_resource_type(self, resource_type_name):
+ def show_resource_type(self, resource_type_name):
"""Return the schema of a resource type."""
url = 'resource_types/%s' % resource_type_name
resp, body = self.get(url)
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, json.loads(body))
- def get_resource_type_template(self, resource_type_name):
+ def show_resource_type_template(self, resource_type_name):
"""Return the template of a resource type."""
url = 'resource_types/%s/template' % resource_type_name
resp, body = self.get(url)
@@ -320,7 +320,7 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_software_config(self, conf_id):
+ def show_software_config(self, conf_id):
"""Returns a software configuration resource."""
url = 'software_configs/%s' % str(conf_id)
resp, body = self.get(url)
@@ -365,7 +365,7 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_software_deploy_list(self):
+ def list_software_deployments(self):
"""Returns a list of all deployments."""
url = 'software_deployments'
resp, body = self.get(url)
@@ -373,7 +373,7 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_software_deploy(self, deploy_id):
+ def show_software_deployment(self, deploy_id):
"""Returns a specific software deployment."""
url = 'software_deployments/%s' % str(deploy_id)
resp, body = self.get(url)
@@ -381,7 +381,7 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_software_deploy_meta(self, server_id):
+ def show_software_deployment_metadata(self, server_id):
"""Return a config metadata for a specific server."""
url = 'software_deployments/metadata/%s' % server_id
resp, body = self.get(url)
diff --git a/tempest/services/volume/json/admin/volume_quotas_client.py b/tempest/services/volume/json/admin/volume_quotas_client.py
index abd36c1..5092afc 100644
--- a/tempest/services/volume/json/admin/volume_quotas_client.py
+++ b/tempest/services/volume/json/admin/volume_quotas_client.py
@@ -26,7 +26,7 @@
TYPE = "json"
- def get_default_quota_set(self, tenant_id):
+ def show_default_quota_set(self, tenant_id):
"""List the default volume quota set for a tenant."""
url = 'os-quota-sets/%s/defaults' % tenant_id
@@ -34,7 +34,7 @@
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, self._parse_resp(body))
- def get_quota_set(self, tenant_id, params=None):
+ def show_quota_set(self, tenant_id, params=None):
"""List the quota set for a tenant."""
url = 'os-quota-sets/%s' % tenant_id
@@ -45,10 +45,10 @@
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, self._parse_resp(body))
- def get_quota_usage(self, tenant_id):
+ def show_quota_usage(self, tenant_id):
"""List the quota set for a tenant."""
- body = self.get_quota_set(tenant_id, params={'usage': True})
+ body = self.show_quota_set(tenant_id, params={'usage': True})
return body
def update_quota_set(self, tenant_id, gigabytes=None, volumes=None,
diff --git a/tempest/services/volume/json/admin/volume_types_client.py b/tempest/services/volume/json/admin/volume_types_client.py
index c905155..9366984 100644
--- a/tempest/services/volume/json/admin/volume_types_client.py
+++ b/tempest/services/volume/json/admin/volume_types_client.py
@@ -33,9 +33,9 @@
# "type": resource_type}
try:
if resource['type'] == "volume-type":
- self.get_volume_type(resource['id'])
+ self.show_volume_type(resource['id'])
elif resource['type'] == "encryption-type":
- body = self.get_encryption_type(resource['id'])
+ body = self.show_encryption_type(resource['id'])
if not body:
return True
else:
@@ -61,7 +61,7 @@
self.expected_success(200, resp.status)
return service_client.ResponseBodyList(resp, body['volume_types'])
- def get_volume_type(self, volume_id):
+ def show_volume_type(self, volume_id):
"""Returns the details of a single volume_type."""
url = "types/%s" % str(volume_id)
resp, body = self.get(url)
@@ -104,7 +104,7 @@
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, body['extra_specs'])
- def get_volume_type_extra_specs(self, vol_type_id, extra_spec_name):
+ def show_volume_type_extra_specs(self, vol_type_id, extra_spec_name):
"""Returns the details of a single volume_type extra spec."""
url = "types/%s/extra_specs/%s" % (str(vol_type_id),
str(extra_spec_name))
@@ -150,7 +150,7 @@
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, body)
- def get_encryption_type(self, vol_type_id):
+ def show_encryption_type(self, vol_type_id):
"""
Get the volume encryption type for the specified volume type.
vol_type_id: Id of volume_type.
diff --git a/tempest/services/volume/json/availability_zone_client.py b/tempest/services/volume/json/availability_zone_client.py
index bb5e39b..dc0388f 100644
--- a/tempest/services/volume/json/availability_zone_client.py
+++ b/tempest/services/volume/json/availability_zone_client.py
@@ -20,7 +20,7 @@
class BaseVolumeAvailabilityZoneClientJSON(service_client.ServiceClient):
- def get_availability_zone_list(self):
+ def list_availability_zones(self):
resp, body = self.get('os-availability-zone')
body = json.loads(body)
self.expected_success(200, resp.status)
diff --git a/tempest/services/volume/json/backups_client.py b/tempest/services/volume/json/backups_client.py
index dad5aff..83ec182 100644
--- a/tempest/services/volume/json/backups_client.py
+++ b/tempest/services/volume/json/backups_client.py
@@ -56,7 +56,7 @@
self.expected_success(202, resp.status)
return service_client.ResponseBody(resp, body)
- def get_backup(self, backup_id):
+ def show_backup(self, backup_id):
"""Returns the details of a single backup."""
url = "backups/%s" % str(backup_id)
resp, body = self.get(url)
@@ -64,9 +64,11 @@
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, body['backup'])
- def list_backups_with_detail(self):
+ def list_backups(self, detail=False):
"""Information for all the tenant's backups."""
- url = "backups/detail"
+ url = "backups"
+ if detail:
+ url += "/detail"
resp, body = self.get(url)
body = json.loads(body)
self.expected_success(200, resp.status)
@@ -74,13 +76,13 @@
def wait_for_backup_status(self, backup_id, status):
"""Waits for a Backup to reach a given status."""
- body = self.get_backup(backup_id)
+ body = self.show_backup(backup_id)
backup_status = body['status']
start = int(time.time())
while backup_status != status:
time.sleep(self.build_interval)
- body = self.get_backup(backup_id)
+ body = self.show_backup(backup_id)
backup_status = body['status']
if backup_status == 'error':
raise exceptions.VolumeBackupException(backup_id=backup_id)
diff --git a/tempest/services/volume/json/qos_client.py b/tempest/services/volume/json/qos_client.py
index 14ff506..e9d3777 100644
--- a/tempest/services/volume/json/qos_client.py
+++ b/tempest/services/volume/json/qos_client.py
@@ -26,7 +26,7 @@
def is_resource_deleted(self, qos_id):
try:
- self.get_qos(qos_id)
+ self.show_qos(qos_id)
except lib_exc.NotFound:
return True
return False
@@ -48,15 +48,15 @@
start_time = int(time.time())
while True:
if operation == 'qos-key-unset':
- body = self.get_qos(qos_id)
+ body = self.show_qos(qos_id)
if not any(key in body['specs'] for key in args):
return
elif operation == 'disassociate':
- body = self.get_association_qos(qos_id)
+ body = self.show_association_qos(qos_id)
if not any(args in body[i]['id'] for i in range(0, len(body))):
return
elif operation == 'disassociate-all':
- body = self.get_association_qos(qos_id)
+ body = self.show_association_qos(qos_id)
if not body:
return
else:
@@ -96,7 +96,7 @@
self.expected_success(200, resp.status)
return service_client.ResponseBodyList(resp, body['qos_specs'])
- def get_qos(self, qos_id):
+ def show_qos(self, qos_id):
"""Get the specified QoS specification."""
url = "qos-specs/%s" % str(qos_id)
resp, body = self.get(url)
@@ -133,7 +133,7 @@
self.expected_success(202, resp.status)
return service_client.ResponseBody(resp, body)
- def get_association_qos(self, qos_id):
+ def show_association_qos(self, qos_id):
"""Get the association of the specified QoS specification."""
url = "qos-specs/%s/associations" % str(qos_id)
resp, body = self.get(url)
diff --git a/tempest/services/volume/json/snapshots_client.py b/tempest/services/volume/json/snapshots_client.py
index 9f88085..2140c62 100644
--- a/tempest/services/volume/json/snapshots_client.py
+++ b/tempest/services/volume/json/snapshots_client.py
@@ -29,29 +29,20 @@
create_resp = 200
- def list_snapshots(self, params=None):
+ def list_snapshots(self, detail=False, params=None):
"""List all the snapshot."""
url = 'snapshots'
+ if detail:
+ url += '/detail'
if params:
- url += '?%s' % urllib.urlencode(params)
+ url += '?%s' % urllib.urlencode(params)
resp, body = self.get(url)
body = json.loads(body)
self.expected_success(200, resp.status)
return service_client.ResponseBodyList(resp, body['snapshots'])
- def list_snapshots_with_detail(self, params=None):
- """List the details of all snapshots."""
- url = 'snapshots/detail'
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.expected_success(200, resp.status)
- return service_client.ResponseBodyList(resp, body['snapshots'])
-
- def get_snapshot(self, snapshot_id):
+ def show_snapshot(self, snapshot_id):
"""Returns the details of a single snapshot."""
url = "snapshots/%s" % str(snapshot_id)
resp, body = self.get(url)
@@ -85,7 +76,7 @@
# NOTE(afazekas): just for the wait function
def _get_snapshot_status(self, snapshot_id):
- body = self.get_snapshot(snapshot_id)
+ body = self.show_snapshot(snapshot_id)
status = body['status']
# NOTE(afazekas): snapshot can reach an "error"
# state in a "normal" lifecycle
@@ -128,7 +119,7 @@
def is_resource_deleted(self, id):
try:
- self.get_snapshot(id)
+ self.show_snapshot(id)
except lib_exc.NotFound:
return True
return False
@@ -166,7 +157,7 @@
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, body['metadata'])
- def get_snapshot_metadata(self, snapshot_id):
+ def show_snapshot_metadata(self, snapshot_id):
"""Get metadata of the snapshot."""
url = "snapshots/%s/metadata" % str(snapshot_id)
resp, body = self.get(url)
diff --git a/tempest/services/volume/json/volumes_client.py b/tempest/services/volume/json/volumes_client.py
index 059664c..a82291a 100644
--- a/tempest/services/volume/json/volumes_client.py
+++ b/tempest/services/volume/json/volumes_client.py
@@ -40,29 +40,20 @@
"""Return the element 'attachment' from input volumes."""
return volume['attachments'][0]
- def list_volumes(self, params=None):
+ def list_volumes(self, detail=False, params=None):
"""List all the volumes created."""
url = 'volumes'
+ if detail:
+ url += '/detail'
if params:
- url += '?%s' % urllib.urlencode(params)
+ url += '?%s' % urllib.urlencode(params)
resp, body = self.get(url)
body = json.loads(body)
self.expected_success(200, resp.status)
return service_client.ResponseBodyList(resp, body['volumes'])
- def list_volumes_with_detail(self, params=None):
- """List the details of all volumes."""
- url = 'volumes/detail'
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.expected_success(200, resp.status)
- return service_client.ResponseBodyList(resp, body['volumes'])
-
- def get_volume(self, volume_id):
+ def show_volume(self, volume_id):
"""Returns the details of a single volume."""
url = "volumes/%s" % str(volume_id)
resp, body = self.get(url)
@@ -161,13 +152,13 @@
def wait_for_volume_status(self, volume_id, status):
"""Waits for a Volume to reach a given status."""
- body = self.get_volume(volume_id)
+ body = self.show_volume(volume_id)
volume_status = body['status']
start = int(time.time())
while volume_status != status:
time.sleep(self.build_interval)
- body = self.get_volume(volume_id)
+ body = self.show_volume(volume_id)
volume_status = body['status']
if volume_status == 'error':
raise exceptions.VolumeBuildErrorException(volume_id=volume_id)
@@ -183,7 +174,7 @@
def is_resource_deleted(self, id):
try:
- self.get_volume(id)
+ self.show_volume(id)
except lib_exc.NotFound:
return True
return False
@@ -240,7 +231,7 @@
self.expected_success(202, resp.status)
return service_client.ResponseBody(resp, body['transfer'])
- def get_volume_transfer(self, transfer_id):
+ def show_volume_transfer(self, transfer_id):
"""Returns the details of a volume transfer."""
url = "os-volume-transfer/%s" % str(transfer_id)
resp, body = self.get(url)
@@ -303,7 +294,7 @@
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, body['metadata'])
- def get_volume_metadata(self, volume_id):
+ def show_volume_metadata(self, volume_id):
"""Get metadata of the volume."""
url = "volumes/%s/metadata" % str(volume_id)
resp, body = self.get(url)
diff --git a/tempest/stress/cleanup.py b/tempest/stress/cleanup.py
index d0b1be1..29c4401 100644
--- a/tempest/stress/cleanup.py
+++ b/tempest/stress/cleanup.py
@@ -80,7 +80,7 @@
# volume deletion may block
_, snaps = admin_manager.snapshots_client.\
- list_snapshots({"all_tenants": True})
+ list_snapshots(params={"all_tenants": True})
LOG.info("Cleanup::remove %s snapshots" % len(snaps))
for v in snaps:
try:
@@ -96,7 +96,8 @@
except Exception:
pass
- vols = admin_manager.volumes_client.list_volumes({"all_tenants": True})
+ vols = admin_manager.volumes_client.list_volumes(
+ params={"all_tenants": True})
LOG.info("Cleanup::remove %s volumes" % len(vols))
for v in vols:
try:
diff --git a/tempest/stress/driver.py b/tempest/stress/driver.py
index e84d627..62e60d6 100644
--- a/tempest/stress/driver.py
+++ b/tempest/stress/driver.py
@@ -23,7 +23,7 @@
from tempest_lib.common.utils import data_utils
from tempest import clients
-from tempest.common import cred_provider
+from tempest.common import isolated_creds
from tempest.common import ssh
from tempest import config
from tempest import exceptions
@@ -149,15 +149,22 @@
username = data_utils.rand_name("stress_user")
tenant_name = data_utils.rand_name("stress_tenant")
password = "pass"
- identity_client = admin_manager.identity_client
- tenant = identity_client.create_tenant(name=tenant_name)
- identity_client.create_user(username,
- password,
- tenant['id'],
- "email")
- creds = cred_provider.get_credentials(username=username,
- password=password,
- tenant_name=tenant_name)
+ if CONF.identity.auth_version == 'v2':
+ identity_client = admin_manager.identity_client
+ else:
+ identity_client = admin_manager.identity_v3_client
+ credentials_client = isolated_creds.get_creds_client(
+ identity_client)
+ project = credentials_client.create_project(
+ name=tenant_name, description=tenant_name)
+ user = credentials_client.create_user(username, password,
+ project['id'], "email")
+ # Add roles specified in config file
+ for conf_role in CONF.auth.tempest_roles:
+ credentials_client.assign_user_role(user, project,
+ conf_role)
+ creds = credentials_client.get_credentials(user, project,
+ password)
manager = clients.Manager(credentials=creds)
test_obj = importutils.import_class(test['action'])
diff --git a/tempest/test.py b/tempest/test.py
index da936b4..d57b1d8 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -445,7 +445,12 @@
# Make sure isolated_creds exists and get a network client
networks_client = cls.get_client_manager().networks_client
isolated_creds = getattr(cls, 'isolated_creds', None)
- if credentials.is_admin_available():
+ # In case of nova network, isolated tenants are not able to list the
+ # network configured in fixed_network_name, even if the can use it
+ # for their servers, so using an admin network client to validate
+ # the network name
+ if (not CONF.service_available.neutron and
+ credentials.is_admin_available()):
admin_creds = isolated_creds.get_admin_creds()
networks_client = clients.Manager(admin_creds).networks_client
return fixed_network.get_tenant_network(isolated_creds,
@@ -467,8 +472,6 @@
super(NegativeAutoTest, cls).setUpClass()
os = cls.get_client_manager()
cls.client = os.negative_client
- os_admin = clients.AdminManager(service=cls._service)
- cls.admin_client = os_admin.negative_client
@staticmethod
def load_tests(*args):
@@ -596,7 +599,13 @@
"mechanism")
if "admin_client" in description and description["admin_client"]:
- client = self.admin_client
+ if not credentials.is_admin_available():
+ msg = ("Missing Identity Admin API credentials in"
+ "configuration.")
+ raise self.skipException(msg)
+ creds = self.isolated_creds.get_admin_creds()
+ os_adm = clients.Manager(credentials=creds)
+ client = os_adm.negative_client
else:
client = self.client
resp, resp_body = client.send_request(method, new_url,
diff --git a/tempest/tests/common/test_accounts.py b/tempest/tests/common/test_accounts.py
index 0f8fa92..6371e49 100644
--- a/tempest/tests/common/test_accounts.py
+++ b/tempest/tests/common/test_accounts.py
@@ -67,7 +67,7 @@
self.useFixture(mockpatch.Patch(
'tempest.common.accounts.read_accounts_yaml',
return_value=self.test_accounts))
- cfg.CONF.set_default('test_accounts_file', '', group='auth')
+ cfg.CONF.set_default('test_accounts_file', 'fake_path', group='auth')
self.useFixture(mockpatch.Patch('os.path.isfile', return_value=True))
def _get_hash_list(self, accounts_list):
diff --git a/tempest/tests/common/test_admin_available.py b/tempest/tests/common/test_admin_available.py
index 5070f22..4e3aa4c 100644
--- a/tempest/tests/common/test_admin_available.py
+++ b/tempest/tests/common/test_admin_available.py
@@ -52,6 +52,8 @@
self.useFixture(mockpatch.Patch(
'tempest.common.accounts.read_accounts_yaml',
return_value=accounts))
+ cfg.CONF.set_default('test_accounts_file',
+ use_accounts_file, group='auth')
self.useFixture(mockpatch.Patch('os.path.isfile',
return_value=True))
else:
diff --git a/tempest/tests/common/utils/linux/test_remote_client.py b/tempest/tests/common/utils/linux/test_remote_client.py
index 40b7b32..d6377e6 100644
--- a/tempest/tests/common/utils/linux/test_remote_client.py
+++ b/tempest/tests/common/utils/linux/test_remote_client.py
@@ -100,15 +100,17 @@
self._assert_exec_called_with('cut -f1 -d. /proc/uptime')
def test_ping_host(self):
- ping_response = """PING localhost (127.0.0.1) 56(84) bytes of data.
-64 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64 time=0.048 ms
+ ping_response = """PING localhost (127.0.0.1) 70(98) bytes of data.
+78 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64 time=0.048 ms
+78 bytes from localhost (127.0.0.1): icmp_req=2 ttl=64 time=0.048 ms
--- localhost ping statistics ---
-1 packets transmitted, 1 received, 0% packet loss, time 0ms
+2 packets transmitted, 2 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.048/0.048/0.048/0.000 ms"""
self.ssh_mock.mock.exec_command.return_value = ping_response
- self.assertEqual(self.conn.ping_host('127.0.0.1'), ping_response)
- self._assert_exec_called_with('ping -c1 -w1 127.0.0.1')
+ self.assertEqual(self.conn.ping_host('127.0.0.1', count=2, size=70),
+ ping_response)
+ self._assert_exec_called_with('ping -c2 -w2 -s70 127.0.0.1')
def test_get_mac_address(self):
macs = """0a:0b:0c:0d:0e:0f
diff --git a/tempest/tests/test_tenant_isolation.py b/tempest/tests/test_tenant_isolation.py
index 82cbde9..fd8718f 100644
--- a/tempest/tests/test_tenant_isolation.py
+++ b/tempest/tests/test_tenant_isolation.py
@@ -278,11 +278,11 @@
router_interface_mock = self.patch(
'tempest.services.network.json.network_client.NetworkClientJSON.'
'add_router_interface_with_subnet_id')
- iso_creds.get_primary_creds()
+ primary_creds = iso_creds.get_primary_creds()
router_interface_mock.called_once_with('1234', '1234')
- network = iso_creds.get_primary_network()
- subnet = iso_creds.get_primary_subnet()
- router = iso_creds.get_primary_router()
+ network = primary_creds.network
+ subnet = primary_creds.subnet
+ router = primary_creds.router
self.assertEqual(network['id'], '1234')
self.assertEqual(network['name'], 'fake_net')
self.assertEqual(subnet['id'], '1234')
@@ -427,11 +427,11 @@
router_interface_mock = self.patch(
'tempest.services.network.json.network_client.NetworkClientJSON.'
'add_router_interface_with_subnet_id')
- iso_creds.get_alt_creds()
+ alt_creds = iso_creds.get_alt_creds()
router_interface_mock.called_once_with('1234', '1234')
- network = iso_creds.get_alt_network()
- subnet = iso_creds.get_alt_subnet()
- router = iso_creds.get_alt_router()
+ network = alt_creds.network
+ subnet = alt_creds.subnet
+ router = alt_creds.router
self.assertEqual(network['id'], '1234')
self.assertEqual(network['name'], 'fake_alt_net')
self.assertEqual(subnet['id'], '1234')
@@ -453,11 +453,11 @@
'tempest.services.network.json.network_client.NetworkClientJSON.'
'add_router_interface_with_subnet_id')
self._mock_list_roles('123456', 'admin')
- iso_creds.get_admin_creds()
+ admin_creds = iso_creds.get_admin_creds()
router_interface_mock.called_once_with('1234', '1234')
- network = iso_creds.get_admin_network()
- subnet = iso_creds.get_admin_subnet()
- router = iso_creds.get_admin_router()
+ network = admin_creds.network
+ subnet = admin_creds.subnet
+ router = admin_creds.router
self.assertEqual(network['id'], '1234')
self.assertEqual(network['name'], 'fake_admin_net')
self.assertEqual(subnet['id'], '1234')
@@ -490,13 +490,13 @@
'delete_router')
router_mock = router.start()
- iso_creds.get_primary_creds()
+ primary_creds = iso_creds.get_primary_creds()
self.assertEqual(net_mock.mock_calls, [])
self.assertEqual(subnet_mock.mock_calls, [])
self.assertEqual(router_mock.mock_calls, [])
- network = iso_creds.get_primary_network()
- subnet = iso_creds.get_primary_subnet()
- router = iso_creds.get_primary_router()
+ network = primary_creds.network
+ subnet = primary_creds.subnet
+ router = primary_creds.router
self.assertIsNone(network)
self.assertIsNone(subnet)
self.assertIsNone(router)
diff --git a/tempest/thirdparty/boto/test_ec2_network.py b/tempest/thirdparty/boto/test_ec2_network.py
deleted file mode 100644
index ce20156..0000000
--- a/tempest/thirdparty/boto/test_ec2_network.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-# 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 tempest import test
-from tempest.thirdparty.boto import test as boto_test
-
-
-class EC2NetworkTest(boto_test.BotoTestCase):
-
- @classmethod
- def setup_clients(cls):
- super(EC2NetworkTest, cls).setup_clients()
- cls.ec2_client = cls.os.ec2api_client
-
- # Note(afazekas): these tests for things duable without an instance
- @test.idempotent_id('48b912af-9403-4b4f-aa69-fa76d690a81f')
- def test_disassociate_not_associated_floating_ip(self):
- # EC2 disassociate not associated floating ip
- ec2_codes = self.ec2_error_code
- address = self.ec2_client.allocate_address()
- public_ip = address.public_ip
- rcuk = self.addResourceCleanUp(self.ec2_client.release_address,
- public_ip)
- addresses_get = self.ec2_client.get_all_addresses(
- addresses=(public_ip,))
- self.assertEqual(len(addresses_get), 1)
- self.assertEqual(addresses_get[0].public_ip, public_ip)
- self.assertBotoError(ec2_codes.client.InvalidAssociationID.NotFound,
- address.disassociate)
- self.ec2_client.release_address(public_ip)
- self.assertAddressReleasedWait(address)
- self.cancelResourceCleanUp(rcuk)
diff --git a/tools/check_uuid.py b/tools/check_uuid.py
index 34effe4..e21c3d8 100755
--- a/tools/check_uuid.py
+++ b/tools/check_uuid.py
@@ -275,7 +275,7 @@
if not test_uuid:
return
if test_uuid in uuids:
- error_str = "%s:%s\n uuid %s collision: %s<->%s\n%s:%s\n" % (
+ error_str = "%s:%s\n uuid %s collision: %s<->%s\n%s:%s" % (
tests[module_name]['source_path'],
tests[module_name]['tests'][test_name].lineno,
test_uuid,
@@ -285,6 +285,8 @@
uuids[test_uuid]['test_node'].lineno,
)
print(error_str)
+ print("cannot automatically resolve the collision, please "
+ "manually remove the duplicate value on the new test.")
return True
else:
uuids[test_uuid] = {