Merge "Return complete response from limits,migration client"
diff --git a/HACKING.rst b/HACKING.rst
index 6ddb8ac..8e0ac44 100644
--- a/HACKING.rst
+++ b/HACKING.rst
@@ -319,7 +319,7 @@
Every function that provides a test must have an ``idempotent_id`` decorator
that is a unique ``uuid-4`` instance. This ID is used to complement the fully
-qualified test name and track test funcionality through refactoring. The
+qualified test name and track test functionality through refactoring. The
format of the metadata looks like::
@test.idempotent_id('585e934c-448e-43c4-acbf-d06a9b899997')
diff --git a/README.rst b/README.rst
index 7a7dfa6..d94fbdd 100644
--- a/README.rst
+++ b/README.rst
@@ -37,57 +37,61 @@
Quickstart
----------
-To run Tempest, you first need to create a configuration file that
-will tell Tempest where to find the various OpenStack services and
-other testing behavior switches.
+To run Tempest, you first need to create a configuration file that will tell
+Tempest where to find the various OpenStack services and other testing behavior
+switches. Where the configuration file lives and how you interact with it
+depends on how you'll be running Tempest. There are 2 methods of using Tempest.
+The first, which is a newer and recommended workflow treats Tempest as a system
+installed program. The second older method is to run Tempest assuming your
+working dir is the actually Tempest source repo, and there are a number of
+assumptions related to that. For this section we'll only cover the newer method
+as it is simpler, and quicker to work with.
-The easiest way to create a configuration file is to generate a sample
-in the ``etc/`` directory ::
+#. You first need to install Tempest this is done with pip, after you check out
+ the Tempest repo you simply run something like::
- $> cd $TEMPEST_ROOT_DIR
- $> oslo-config-generator --config-file \
- tools/config/config-generator.tempest.conf \
- --output-file etc/tempest.conf
+ $ pip install tempest
-After that, open up the ``etc/tempest.conf`` file and edit the
-configuration variables to match valid data in your environment.
-This includes your Keystone endpoint, a valid user and credentials,
-and reference data to be used in testing.
+ This can be done within a venv, but the assumption for this guide is that
+ the Tempest cli entry point will be in your shell's PATH.
-.. note::
+#. Installing Tempest will create a /etc/tempest dir which will contain the
+ sample config file packaged with Tempest. The contents of /etc/tempest will
+ be copied to all local working dirs, so if there is any common configuration
+ you'd like to be shared between anyone setting up local Tempest working dirs
+ it's recommended that you copy or rename tempest.conf.sample to tempest.conf
+ and make those changes to that file in /etc/tempest
- If you have a running devstack environment, Tempest will be
- automatically configured and placed in ``/opt/stack/tempest``. It
- will have a configuration file already set up to work with your
- devstack installation.
+#. Setup a local working Tempest dir. This is done using the tempest init
+ command::
-Tempest is not tied to any single test runner, but `testr`_ is the most commonly
-used tool. Also, the nosetests test runner is **not** recommended to run Tempest.
+ tempest init cloud-01
-After setting up your configuration file, you can execute the set of Tempest
-tests by using ``testr`` ::
+ works the same as::
- $> testr run --parallel
+ mkdir cloud-01 && cd cloud-01 && tempest init
-.. _testr: http://testrepository.readthedocs.org/en/latest/MANUAL.html
+ This will create a new directory for running a single Tempest configuration.
+ If you'd like to run Tempest against multiple OpenStack deployments the idea
+ is that you'll create a new working directory for each to maintain separate
+ configuration files and local artifact storage for each.
-To run one single test serially ::
+#. Then cd into the newly created working dir and also modify the local
+ config files located in the etc/ subdir created by the ``tempest init``
+ command. Tempest is expecting a tempest.conf file in etc/ so if only a
+ sample exists you must rename or copy it to tempest.conf before making
+ any changes to it otherwise Tempest will not know how to load it.
- $> testr run tempest.api.compute.servers.test_servers_negative.ServersNegativeTestJSON.test_reboot_non_existent_server
+#. Once the configuration is done you're now ready to run Tempest. This can
+ be done with testr directly or any `testr`_ based test runner, like
+ `ostestr`_. For example, from the working dir running::
-Alternatively, you can use the run_tempest.sh script which will create a venv
-and run the tests or use tox to do the same. Tox also contains several existing
-job configurations. For example::
+ $ ostestr --regex '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty))'
- $> tox -efull
+ will run the same set of tests as the default gate jobs.
-which will run the same set of tests as the OpenStack gate. (it's exactly how
-the gate invokes Tempest) Or::
-
- $> tox -esmoke
-
-to run the tests tagged as smoke.
-
+.. _testr: https://testrepository.readthedocs.org/en/latest/MANUAL.html
+.. _ostestr: http://docs.openstack.org/developer/os-testr/
Configuration
-------------
@@ -146,3 +150,62 @@
there might be uncaught issues running on Python 3.4. So until there is a gating
job which does a full Tempest run using Python 3.4 there isn't any guarantee
that running Tempest under Python 3.4 is bug free.
+
+Legacy run method
+-----------------
+
+The legacy method of running Tempest is to just treat the Tempest source code
+as a python unittest repository and run directly from the source repo. When
+running in this way you still start with a Tempest config file and the steps
+are basically the same except that it expects you know where the Tempest code
+lives on your system and requires a bit more manual interaction to get Tempest
+running. For example, when running Tempest this way things like a lock file
+directory do not get generated automatically and the burden is on the user to
+create and configure that.
+
+To start you need to create a configuration file. The easiest way to create a
+configuration file is to generate a sample in the ``etc/`` directory ::
+
+ $> cd $TEMPEST_ROOT_DIR
+ $> oslo-config-generator --config-file \
+ tools/config/config-generator.tempest.conf \
+ --output-file etc/tempest.conf
+
+After that, open up the ``etc/tempest.conf`` file and edit the
+configuration variables to match valid data in your environment.
+This includes your Keystone endpoint, a valid user and credentials,
+and reference data to be used in testing.
+
+.. note::
+
+ If you have a running devstack environment, Tempest will be
+ automatically configured and placed in ``/opt/stack/tempest``. It
+ will have a configuration file already set up to work with your
+ devstack installation.
+
+Tempest is not tied to any single test runner, but `testr`_ is the most commonly
+used tool. Also, the nosetests test runner is **not** recommended to run Tempest.
+
+After setting up your configuration file, you can execute the set of Tempest
+tests by using ``testr`` ::
+
+ $> testr run --parallel
+
+.. _testr: http://testrepository.readthedocs.org/en/latest/MANUAL.html
+
+To run one single test serially ::
+
+ $> testr run tempest.api.compute.servers.test_servers_negative.ServersNegativeTestJSON.test_reboot_non_existent_server
+
+Alternatively, you can use the run_tempest.sh script which will create a venv
+and run the tests or use tox to do the same. Tox also contains several existing
+job configurations. For example::
+
+ $> tox -efull
+
+which will run the same set of tests as the OpenStack gate. (it's exactly how
+the gate invokes Tempest) Or::
+
+ $> tox -esmoke
+
+to run the tests tagged as smoke.
diff --git a/doc/source/plugin.rst b/doc/source/plugin.rst
index 4e97dbe..f92f63e 100644
--- a/doc/source/plugin.rst
+++ b/doc/source/plugin.rst
@@ -91,6 +91,21 @@
of the tempest developer and reviewer documentation to ensure that the tests
being added in the plugin act and behave like the rest of tempest.
+Dealing with configuration options
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Historically Tempest didn't provide external guarantees on its configuration
+options. However, with the introduction of the plugin interface this is no
+longer the case. An external plugin can rely on using any configuration option
+coming from Tempest, there will be at least a full deprecation cycle for any
+option before it's removed. However, just the options provided by Tempest
+may not be sufficient for the plugin. If you need to add any plugin specific
+configuration options you should use the ``register_opts`` and
+``get_opt_lists`` methods to pass them to Tempest when the plugin is loaded.
+When adding configuration options the ``register_opts`` method gets passed the
+CONF object from tempest. This enables the plugin to add options to both
+existing sections and also create new configuration sections for new options.
+
Using Plugins
=============
diff --git a/tempest/api/compute/admin/test_aggregates.py b/tempest/api/compute/admin/test_aggregates.py
index e42131d..3553ce7 100644
--- a/tempest/api/compute/admin/test_aggregates.py
+++ b/tempest/api/compute/admin/test_aggregates.py
@@ -57,7 +57,8 @@
def test_aggregate_create_delete(self):
# Create and delete an aggregate.
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = self.client.create_aggregate(name=aggregate_name)
+ aggregate = (self.client.create_aggregate(name=aggregate_name)
+ ['aggregate'])
self.addCleanup(self._try_delete_aggregate, aggregate['id'])
self.assertEqual(aggregate_name, aggregate['name'])
self.assertIsNone(aggregate['availability_zone'])
@@ -71,7 +72,7 @@
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
az_name = data_utils.rand_name(self.az_name_prefix)
aggregate = self.client.create_aggregate(
- name=aggregate_name, availability_zone=az_name)
+ name=aggregate_name, availability_zone=az_name)['aggregate']
self.addCleanup(self._try_delete_aggregate, aggregate['id'])
self.assertEqual(aggregate_name, aggregate['name'])
self.assertEqual(az_name, aggregate['availability_zone'])
@@ -83,10 +84,11 @@
def test_aggregate_create_verify_entry_in_list(self):
# Create an aggregate and ensure it is listed.
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = self.client.create_aggregate(name=aggregate_name)
+ aggregate = (self.client.create_aggregate(name=aggregate_name)
+ ['aggregate'])
self.addCleanup(self.client.delete_aggregate, aggregate['id'])
- aggregates = self.client.list_aggregates()
+ aggregates = self.client.list_aggregates()['aggregates']
self.assertIn((aggregate['id'], aggregate['availability_zone']),
map(lambda x: (x['id'], x['availability_zone']),
aggregates))
@@ -95,10 +97,11 @@
def test_aggregate_create_update_metadata_get_details(self):
# Create an aggregate and ensure its details are returned.
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = self.client.create_aggregate(name=aggregate_name)
+ aggregate = (self.client.create_aggregate(name=aggregate_name)
+ ['aggregate'])
self.addCleanup(self.client.delete_aggregate, aggregate['id'])
- body = self.client.show_aggregate(aggregate['id'])
+ body = self.client.show_aggregate(aggregate['id'])['aggregate']
self.assertEqual(aggregate['name'], body['name'])
self.assertEqual(aggregate['availability_zone'],
body['availability_zone'])
@@ -107,10 +110,10 @@
# set the metadata of the aggregate
meta = {"key": "value"}
body = self.client.set_metadata(aggregate['id'], metadata=meta)
- self.assertEqual(meta, body["metadata"])
+ self.assertEqual(meta, body['aggregate']["metadata"])
# verify the metadata has been set
- body = self.client.show_aggregate(aggregate['id'])
+ body = self.client.show_aggregate(aggregate['id'])['aggregate']
self.assertEqual(meta, body["metadata"])
@test.idempotent_id('4d2b2004-40fa-40a1-aab2-66f4dab81beb')
@@ -119,7 +122,7 @@
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
az_name = data_utils.rand_name(self.az_name_prefix)
aggregate = self.client.create_aggregate(
- name=aggregate_name, availability_zone=az_name)
+ name=aggregate_name, availability_zone=az_name)['aggregate']
self.addCleanup(self.client.delete_aggregate, aggregate['id'])
self.assertEqual(aggregate_name, aggregate['name'])
@@ -133,11 +136,11 @@
resp_aggregate = self.client.update_aggregate(
aggregate_id,
name=new_aggregate_name,
- availability_zone=new_az_name)
+ availability_zone=new_az_name)['aggregate']
self.assertEqual(new_aggregate_name, resp_aggregate['name'])
self.assertEqual(new_az_name, resp_aggregate['availability_zone'])
- aggregates = self.client.list_aggregates()
+ aggregates = self.client.list_aggregates()['aggregates']
self.assertIn((aggregate_id, new_aggregate_name, new_az_name),
map(lambda x:
(x['id'], x['name'], x['availability_zone']),
@@ -148,16 +151,19 @@
# Add an host to the given aggregate and remove.
self.useFixture(fixtures.LockFixture('availability_zone'))
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = self.client.create_aggregate(name=aggregate_name)
+ aggregate = (self.client.create_aggregate(name=aggregate_name)
+ ['aggregate'])
self.addCleanup(self.client.delete_aggregate, aggregate['id'])
- body = self.client.add_host(aggregate['id'], host=self.host)
+ body = (self.client.add_host(aggregate['id'], host=self.host)
+ ['aggregate'])
self.assertEqual(aggregate_name, body['name'])
self.assertEqual(aggregate['availability_zone'],
body['availability_zone'])
self.assertIn(self.host, body['hosts'])
- body = self.client.remove_host(aggregate['id'], host=self.host)
+ body = (self.client.remove_host(aggregate['id'], host=self.host)
+ ['aggregate'])
self.assertEqual(aggregate_name, body['name'])
self.assertEqual(aggregate['availability_zone'],
body['availability_zone'])
@@ -168,13 +174,14 @@
# Add an host to the given aggregate and list.
self.useFixture(fixtures.LockFixture('availability_zone'))
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = self.client.create_aggregate(name=aggregate_name)
+ aggregate = (self.client.create_aggregate(name=aggregate_name)
+ ['aggregate'])
self.addCleanup(self.client.delete_aggregate, aggregate['id'])
self.client.add_host(aggregate['id'], host=self.host)
self.addCleanup(self.client.remove_host, aggregate['id'],
host=self.host)
- aggregates = self.client.list_aggregates()
+ aggregates = self.client.list_aggregates()['aggregates']
aggs = filter(lambda x: x['id'] == aggregate['id'], aggregates)
self.assertEqual(1, len(aggs))
agg = aggs[0]
@@ -187,13 +194,14 @@
# Add an host to the given aggregate and get details.
self.useFixture(fixtures.LockFixture('availability_zone'))
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = self.client.create_aggregate(name=aggregate_name)
+ aggregate = (self.client.create_aggregate(name=aggregate_name)
+ ['aggregate'])
self.addCleanup(self.client.delete_aggregate, aggregate['id'])
self.client.add_host(aggregate['id'], host=self.host)
self.addCleanup(self.client.remove_host, aggregate['id'],
host=self.host)
- body = self.client.show_aggregate(aggregate['id'])
+ body = self.client.show_aggregate(aggregate['id'])['aggregate']
self.assertEqual(aggregate_name, body['name'])
self.assertIsNone(body['availability_zone'])
self.assertIn(self.host, body['hosts'])
@@ -205,7 +213,7 @@
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
az_name = data_utils.rand_name(self.az_name_prefix)
aggregate = self.client.create_aggregate(
- name=aggregate_name, availability_zone=az_name)
+ name=aggregate_name, availability_zone=az_name)['aggregate']
self.addCleanup(self.client.delete_aggregate, aggregate['id'])
self.client.add_host(aggregate['id'], host=self.host)
self.addCleanup(self.client.remove_host, aggregate['id'],
diff --git a/tempest/api/compute/admin/test_aggregates_negative.py b/tempest/api/compute/admin/test_aggregates_negative.py
index 02e0af0..bc1a854 100644
--- a/tempest/api/compute/admin/test_aggregates_negative.py
+++ b/tempest/api/compute/admin/test_aggregates_negative.py
@@ -76,7 +76,8 @@
# creating an aggregate with existent aggregate name is forbidden
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
aggregate = self.client.create_aggregate(name=aggregate_name)
- self.addCleanup(self.client.delete_aggregate, aggregate['id'])
+ self.addCleanup(self.client.delete_aggregate,
+ aggregate['aggregate']['id'])
self.assertRaises(lib_exc.Conflict,
self.client.create_aggregate,
@@ -87,7 +88,8 @@
def test_aggregate_delete_as_user(self):
# Regular user is not allowed to delete an aggregate.
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = self.client.create_aggregate(name=aggregate_name)
+ aggregate = (self.client.create_aggregate(name=aggregate_name)
+ ['aggregate'])
self.addCleanup(self.client.delete_aggregate, aggregate['id'])
self.assertRaises(lib_exc.Forbidden,
@@ -106,7 +108,8 @@
def test_aggregate_get_details_as_user(self):
# Regular user is not allowed to get aggregate details.
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = self.client.create_aggregate(name=aggregate_name)
+ aggregate = (self.client.create_aggregate(name=aggregate_name)
+ ['aggregate'])
self.addCleanup(self.client.delete_aggregate, aggregate['id'])
self.assertRaises(lib_exc.Forbidden,
@@ -139,7 +142,8 @@
break
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = self.client.create_aggregate(name=aggregate_name)
+ aggregate = (self.client.create_aggregate(name=aggregate_name)
+ ['aggregate'])
self.addCleanup(self.client.delete_aggregate, aggregate['id'])
self.assertRaises(lib_exc.NotFound, self.client.add_host,
@@ -150,7 +154,8 @@
def test_aggregate_add_host_as_user(self):
# Regular user is not allowed to add a host to an aggregate.
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = self.client.create_aggregate(name=aggregate_name)
+ aggregate = (self.client.create_aggregate(name=aggregate_name)
+ ['aggregate'])
self.addCleanup(self.client.delete_aggregate, aggregate['id'])
self.assertRaises(lib_exc.Forbidden,
@@ -162,7 +167,8 @@
def test_aggregate_add_existent_host(self):
self.useFixture(fixtures.LockFixture('availability_zone'))
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = self.client.create_aggregate(name=aggregate_name)
+ aggregate = (self.client.create_aggregate(name=aggregate_name)
+ ['aggregate'])
self.addCleanup(self.client.delete_aggregate, aggregate['id'])
self.client.add_host(aggregate['id'], host=self.host)
@@ -178,7 +184,8 @@
# Regular user is not allowed to remove a host from an aggregate.
self.useFixture(fixtures.LockFixture('availability_zone'))
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = self.client.create_aggregate(name=aggregate_name)
+ aggregate = (self.client.create_aggregate(name=aggregate_name)
+ ['aggregate'])
self.addCleanup(self.client.delete_aggregate, aggregate['id'])
self.client.add_host(aggregate['id'], host=self.host)
self.addCleanup(self.client.remove_host, aggregate['id'],
@@ -193,7 +200,8 @@
def test_aggregate_remove_nonexistent_host(self):
non_exist_host = data_utils.rand_name('nonexist_host')
aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = self.client.create_aggregate(name=aggregate_name)
+ aggregate = (self.client.create_aggregate(name=aggregate_name)
+ ['aggregate'])
self.addCleanup(self.client.delete_aggregate, aggregate['id'])
self.assertRaises(lib_exc.NotFound, self.client.remove_host,
diff --git a/tempest/api/compute/admin/test_flavors.py b/tempest/api/compute/admin/test_flavors.py
index a3c25a2..42a2984 100644
--- a/tempest/api/compute/admin/test_flavors.py
+++ b/tempest/api/compute/admin/test_flavors.py
@@ -69,7 +69,7 @@
id=flavor_id,
ephemeral=self.ephemeral,
swap=self.swap,
- rxtx_factor=self.rxtx)
+ rxtx_factor=self.rxtx)['flavor']
self.addCleanup(self.flavor_clean_up, flavor['id'])
self.assertEqual(flavor['name'], flavor_name)
self.assertEqual(flavor['vcpus'], self.vcpus)
@@ -82,7 +82,7 @@
self.assertEqual(flavor['os-flavor-access:is_public'], True)
# Verify flavor is retrieved
- flavor = self.client.show_flavor(flavor['id'])
+ flavor = self.client.show_flavor(flavor['id'])['flavor']
self.assertEqual(flavor['name'], flavor_name)
return flavor['id']
@@ -121,11 +121,11 @@
id=new_flavor_id,
ephemeral=self.ephemeral,
swap=self.swap,
- rxtx_factor=self.rxtx)
+ rxtx_factor=self.rxtx)['flavor']
self.addCleanup(self.flavor_clean_up, flavor['id'])
flag = False
# Verify flavor is retrieved
- flavors = self.client.list_flavors(detail=True)
+ flavors = self.client.list_flavors(detail=True)['flavors']
for flavor in flavors:
if flavor['name'] == flavor_name:
flag = True
@@ -150,7 +150,7 @@
flavor = self.client.create_flavor(name=flavor_name,
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
- id=new_flavor_id)
+ id=new_flavor_id)['flavor']
self.addCleanup(self.flavor_clean_up, flavor['id'])
self.assertEqual(flavor['name'], flavor_name)
self.assertEqual(flavor['ram'], self.ram)
@@ -160,12 +160,12 @@
verify_flavor_response_extension(flavor)
# Verify flavor is retrieved
- flavor = self.client.show_flavor(new_flavor_id)
+ flavor = self.client.show_flavor(new_flavor_id)['flavor']
self.assertEqual(flavor['name'], flavor_name)
verify_flavor_response_extension(flavor)
# Check if flavor is present in list
- flavors = self.user_client.list_flavors(detail=True)
+ flavors = self.user_client.list_flavors(detail=True)['flavors']
for flavor in flavors:
if flavor['name'] == flavor_name:
verify_flavor_response_extension(flavor)
@@ -186,11 +186,11 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public="False")
+ is_public="False")['flavor']
self.addCleanup(self.flavor_clean_up, flavor['id'])
# Verify flavor is retrieved
flag = False
- flavors = self.client.list_flavors(detail=True)
+ flavors = self.client.list_flavors(detail=True)['flavors']
for flavor in flavors:
if flavor['name'] == flavor_name:
flag = True
@@ -198,7 +198,7 @@
# Verify flavor is not retrieved with other user
flag = False
- flavors = self.user_client.list_flavors(detail=True)
+ flavors = self.user_client.list_flavors(detail=True)['flavors']
for flavor in flavors:
if flavor['name'] == flavor_name:
flag = True
@@ -215,7 +215,7 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public="False")
+ is_public="False")['flavor']
self.addCleanup(self.flavor_clean_up, flavor['id'])
# Verify flavor is not used by other user
@@ -235,12 +235,12 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public="True")
+ is_public="True")['flavor']
self.addCleanup(self.flavor_clean_up, flavor['id'])
flag = False
self.new_client = self.flavors_client
# Verify flavor is retrieved with new user
- flavors = self.new_client.list_flavors(detail=True)
+ flavors = self.new_client.list_flavors(detail=True)['flavors']
for flavor in flavors:
if flavor['name'] == flavor_name:
flag = True
@@ -258,7 +258,7 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=flavor_id_not_public,
- is_public="False")
+ is_public="False")['flavor']
self.addCleanup(self.flavor_clean_up, flavor['id'])
# Create a public flavor
@@ -266,7 +266,7 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=flavor_id_public,
- is_public="True")
+ is_public="True")['flavor']
self.addCleanup(self.flavor_clean_up, flavor['id'])
def _flavor_lookup(flavors, flavor_name):
@@ -278,7 +278,8 @@
def _test_string_variations(variations, flavor_name):
for string in variations:
params = {'is_public': string}
- flavors = self.client.list_flavors(detail=True, **params)
+ flavors = (self.client.list_flavors(detail=True, **params)
+ ['flavors'])
flavor = _flavor_lookup(flavors, flavor_name)
self.assertIsNotNone(flavor)
@@ -297,7 +298,7 @@
flavor = self.client.create_flavor(name=flavor_name,
ram=ram, vcpus=self.vcpus,
disk=self.disk,
- id=new_flavor_id)
+ id=new_flavor_id)['flavor']
self.addCleanup(self.flavor_clean_up, flavor['id'])
self.assertEqual(flavor['name'], flavor_name)
self.assertEqual(flavor['vcpus'], self.vcpus)
diff --git a/tempest/api/compute/admin/test_flavors_access.py b/tempest/api/compute/admin/test_flavors_access.py
index ccfe20b..0a11d52 100644
--- a/tempest/api/compute/admin/test_flavors_access.py
+++ b/tempest/api/compute/admin/test_flavors_access.py
@@ -43,8 +43,6 @@
# Non admin tenant ID
cls.tenant_id = cls.flavors_client.tenant_id
- # Compute admin tenant ID
- cls.adm_tenant_id = cls.client.tenant_id
cls.flavor_name_prefix = 'test_flavor_access_'
cls.ram = 512
cls.vcpus = 1
@@ -60,9 +58,10 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public='False')
+ is_public='False')['flavor']
self.addCleanup(self.client.delete_flavor, new_flavor['id'])
- flavor_access = self.client.list_flavor_access(new_flavor_id)
+ flavor_access = (self.client.list_flavor_access(new_flavor_id)
+ ['flavor_access'])
self.assertEqual(len(flavor_access), 0, str(flavor_access))
@test.idempotent_id('59e622f6-bdf6-45e3-8ba8-fedad905a6b4')
@@ -74,26 +73,28 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public='False')
+ is_public='False')['flavor']
self.addCleanup(self.client.delete_flavor, new_flavor['id'])
# Add flavor access to a tenant.
resp_body = {
"tenant_id": str(self.tenant_id),
"flavor_id": str(new_flavor['id']),
}
- add_body = \
- self.client.add_flavor_access(new_flavor['id'], self.tenant_id)
+ add_body = (self.client.add_flavor_access(new_flavor['id'],
+ self.tenant_id)
+ ['flavor_access'])
self.assertIn(resp_body, add_body)
# The flavor is present in list.
- flavors = self.flavors_client.list_flavors(detail=True)
+ flavors = self.flavors_client.list_flavors(detail=True)['flavors']
self.assertIn(new_flavor['id'], map(lambda x: x['id'], flavors))
# Remove flavor access from a tenant.
- remove_body = \
- self.client.remove_flavor_access(new_flavor['id'], self.tenant_id)
+ remove_body = (self.client.remove_flavor_access(new_flavor['id'],
+ self.tenant_id)
+ ['flavor_access'])
self.assertNotIn(resp_body, remove_body)
# The flavor is not present in list.
- flavors = self.flavors_client.list_flavors(detail=True)
+ flavors = self.flavors_client.list_flavors(detail=True)['flavors']
self.assertNotIn(new_flavor['id'], map(lambda x: x['id'], flavors))
diff --git a/tempest/api/compute/admin/test_flavors_access_negative.py b/tempest/api/compute/admin/test_flavors_access_negative.py
index 03898c2..89ae1b5 100644
--- a/tempest/api/compute/admin/test_flavors_access_negative.py
+++ b/tempest/api/compute/admin/test_flavors_access_negative.py
@@ -61,7 +61,7 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public='True')
+ is_public='True')['flavor']
self.addCleanup(self.client.delete_flavor, new_flavor['id'])
self.assertRaises(lib_exc.NotFound,
self.client.list_flavor_access,
@@ -77,7 +77,7 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public='False')
+ is_public='False')['flavor']
self.addCleanup(self.client.delete_flavor, new_flavor['id'])
self.assertRaises(lib_exc.Forbidden,
self.flavors_client.add_flavor_access,
@@ -94,7 +94,7 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public='False')
+ is_public='False')['flavor']
self.addCleanup(self.client.delete_flavor, new_flavor['id'])
# Add flavor access to a tenant.
self.client.add_flavor_access(new_flavor['id'], self.tenant_id)
@@ -115,7 +115,7 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public='False')
+ is_public='False')['flavor']
self.addCleanup(self.client.delete_flavor, new_flavor['id'])
# Add flavor access to a tenant.
@@ -140,7 +140,7 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public='False')
+ is_public='False')['flavor']
self.addCleanup(self.client.delete_flavor, new_flavor['id'])
# An exception should be raised when flavor access is not found
diff --git a/tempest/api/compute/admin/test_flavors_extra_specs.py b/tempest/api/compute/admin/test_flavors_extra_specs.py
index 6039cb2..25dce6a 100644
--- a/tempest/api/compute/admin/test_flavors_extra_specs.py
+++ b/tempest/api/compute/admin/test_flavors_extra_specs.py
@@ -55,7 +55,8 @@
disk=disk,
id=cls.new_flavor_id,
ephemeral=ephemeral,
- swap=swap, rxtx_factor=rxtx)
+ swap=swap,
+ rxtx_factor=rxtx)['flavor']
@classmethod
def resource_cleanup(cls):
@@ -70,11 +71,12 @@
# Assigning extra specs values that are to be set
specs = {"key1": "value1", "key2": "value2"}
# SET extra specs to the flavor created in setUp
- set_body = \
- self.client.set_flavor_extra_spec(self.flavor['id'], **specs)
+ set_body = self.client.set_flavor_extra_spec(self.flavor['id'],
+ **specs)['extra_specs']
self.assertEqual(set_body, specs)
# GET extra specs and verify
- get_body = self.client.list_flavor_extra_specs(self.flavor['id'])
+ get_body = (self.client.list_flavor_extra_specs(self.flavor['id'])
+ ['extra_specs'])
self.assertEqual(get_body, specs)
# UPDATE the value of the extra specs key1
@@ -86,7 +88,8 @@
# GET extra specs and verify the value of the key2
# is the same as before
- get_body = self.client.list_flavor_extra_specs(self.flavor['id'])
+ get_body = (self.client.list_flavor_extra_specs(self.flavor['id'])
+ ['extra_specs'])
self.assertEqual(get_body, {"key1": "value", "key2": "value2"})
# UNSET extra specs that were set in this test
@@ -97,7 +100,8 @@
def test_flavor_non_admin_get_all_keys(self):
specs = {"key1": "value1", "key2": "value2"}
self.client.set_flavor_extra_spec(self.flavor['id'], **specs)
- body = self.flavors_client.list_flavor_extra_specs(self.flavor['id'])
+ body = (self.flavors_client.list_flavor_extra_specs(self.flavor['id'])
+ ['extra_specs'])
for key in specs:
self.assertEqual(body[key], specs[key])
@@ -105,7 +109,8 @@
@test.idempotent_id('12805a7f-39a3-4042-b989-701d5cad9c90')
def test_flavor_non_admin_get_specific_key(self):
body = self.client.set_flavor_extra_spec(self.flavor['id'],
- key1="value1", key2="value2")
+ key1="value1",
+ key2="value2")['extra_specs']
self.assertEqual(body['key1'], 'value1')
self.assertIn('key2', body)
body = self.flavors_client.show_flavor_extra_spec(
diff --git a/tempest/api/compute/admin/test_flavors_extra_specs_negative.py b/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
index f1e11f4..aa95454 100644
--- a/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
+++ b/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
@@ -58,7 +58,8 @@
disk=disk,
id=cls.new_flavor_id,
ephemeral=ephemeral,
- swap=swap, rxtx_factor=rxtx)
+ swap=swap,
+ rxtx_factor=rxtx)['flavor']
@classmethod
def resource_cleanup(cls):
@@ -80,7 +81,7 @@
def test_flavor_non_admin_update_specific_key(self):
# non admin user is not allowed to update flavor extra spec
body = self.client.set_flavor_extra_spec(
- self.flavor['id'], key1="value1", key2="value2")
+ self.flavor['id'], key1="value1", key2="value2")['extra_specs']
self.assertEqual(body['key1'], 'value1')
self.assertRaises(lib_exc.Forbidden,
self.flavors_client.
diff --git a/tempest/api/compute/admin/test_hosts_negative.py b/tempest/api/compute/admin/test_hosts_negative.py
index 2ea7f1a..4c8d8a2 100644
--- a/tempest/api/compute/admin/test_hosts_negative.py
+++ b/tempest/api/compute/admin/test_hosts_negative.py
@@ -71,19 +71,6 @@
maintenance_mode='enable')
@test.attr(type=['negative'])
- @test.idempotent_id('76e396fe-5418-4dd3-a186-5b301edc0721')
- def test_update_host_with_extra_param(self):
- # only 'status' and 'maintenance_mode' are the valid params.
- hostname = self._get_host_name()
-
- self.assertRaises(lib_exc.BadRequest,
- self.client.update_host,
- hostname,
- status='enable',
- maintenance_mode='enable',
- param='XXX')
-
- @test.attr(type=['negative'])
@test.idempotent_id('fbe2bf3e-3246-4a95-a59f-94e4e298ec77')
def test_update_host_with_invalid_status(self):
# 'status' can only be 'enable' or 'disable'
diff --git a/tempest/api/compute/admin/test_hypervisor.py b/tempest/api/compute/admin/test_hypervisor.py
index 47f66af..186867e 100644
--- a/tempest/api/compute/admin/test_hypervisor.py
+++ b/tempest/api/compute/admin/test_hypervisor.py
@@ -30,7 +30,7 @@
def _list_hypervisors(self):
# List of hypervisors
- hypers = self.client.list_hypervisors()
+ hypers = self.client.list_hypervisors()['hypervisors']
return hypers
def assertHypervisors(self, hypers):
@@ -45,7 +45,7 @@
@test.idempotent_id('1e7fdac2-b672-4ad1-97a4-bad0e3030118')
def test_get_hypervisor_list_details(self):
# Display the details of the all hypervisor
- hypers = self.client.list_hypervisors(detail=True)
+ hypers = self.client.list_hypervisors(detail=True)['hypervisors']
self.assertHypervisors(hypers)
@test.idempotent_id('94ff9eae-a183-428e-9cdb-79fde71211cc')
@@ -54,7 +54,7 @@
hypers = self._list_hypervisors()
self.assertHypervisors(hypers)
- details = self.client.show_hypervisor(hypers[0]['id'])
+ details = self.client.show_hypervisor(hypers[0]['id'])['hypervisor']
self.assertTrue(len(details) > 0)
self.assertEqual(details['hypervisor_hostname'],
hypers[0]['hypervisor_hostname'])
@@ -66,13 +66,15 @@
self.assertHypervisors(hypers)
hostname = hypers[0]['hypervisor_hostname']
- hypervisors = self.client.list_servers_on_hypervisor(hostname)
+ hypervisors = (self.client.list_servers_on_hypervisor(hostname)
+ ['hypervisors'])
self.assertTrue(len(hypervisors) > 0)
@test.idempotent_id('797e4f28-b6e0-454d-a548-80cc77c00816')
def test_get_hypervisor_stats(self):
# Verify the stats of the all hypervisor
- stats = self.client.show_hypervisor_statistics()
+ stats = (self.client.show_hypervisor_statistics()
+ ['hypervisor_statistics'])
self.assertTrue(len(stats) > 0)
@test.idempotent_id('91a50d7d-1c2b-4f24-b55a-a1fe20efca70')
@@ -88,7 +90,8 @@
ironic_only = True
hypers_without_ironic = []
for hyper in hypers:
- details = self.client.show_hypervisor(hypers[0]['id'])
+ details = (self.client.show_hypervisor(hypers[0]['id'])
+ ['hypervisor'])
if details['hypervisor_type'] != 'ironic':
hypers_without_ironic.append(hyper)
ironic_only = False
@@ -102,7 +105,8 @@
# because hypervisors might be disabled, this loops looking
# for any good hit.
try:
- uptime = self.client.show_hypervisor_uptime(hyper['id'])
+ uptime = (self.client.show_hypervisor_uptime(hyper['id'])
+ ['hypervisor'])
if len(uptime) > 0:
has_valid_uptime = True
break
@@ -117,5 +121,5 @@
hypers = self._list_hypervisors()
self.assertHypervisors(hypers)
hypers = self.client.search_hypervisor(
- hypers[0]['hypervisor_hostname'])
+ hypers[0]['hypervisor_hostname'])['hypervisors']
self.assertHypervisors(hypers)
diff --git a/tempest/api/compute/admin/test_hypervisor_negative.py b/tempest/api/compute/admin/test_hypervisor_negative.py
index 701b4bb..ca4a691 100644
--- a/tempest/api/compute/admin/test_hypervisor_negative.py
+++ b/tempest/api/compute/admin/test_hypervisor_negative.py
@@ -36,7 +36,7 @@
def _list_hypervisors(self):
# List of hypervisors
- hypers = self.client.list_hypervisors()
+ hypers = self.client.list_hypervisors()['hypervisors']
return hypers
@test.attr(type=['negative'])
diff --git a/tempest/api/compute/admin/test_instance_usage_audit_log.py b/tempest/api/compute/admin/test_instance_usage_audit_log.py
index 189c316..6976783 100644
--- a/tempest/api/compute/admin/test_instance_usage_audit_log.py
+++ b/tempest/api/compute/admin/test_instance_usage_audit_log.py
@@ -31,7 +31,8 @@
@test.idempotent_id('25319919-33d9-424f-9f99-2c203ee48b9d')
def test_list_instance_usage_audit_logs(self):
# list instance usage audit logs
- body = self.adm_client.list_instance_usage_audit_logs()
+ body = (self.adm_client.list_instance_usage_audit_logs()
+ ["instance_usage_audit_logs"])
expected_items = ['total_errors', 'total_instances', 'log',
'num_hosts_running', 'num_hosts_done',
'num_hosts', 'hosts_not_run', 'overall_status',
@@ -44,8 +45,9 @@
def test_get_instance_usage_audit_log(self):
# Get instance usage audit log before specified time
now = datetime.datetime.now()
- body = self.adm_client.show_instance_usage_audit_log(
+ body = (self.adm_client.show_instance_usage_audit_log(
urllib.quote(now.strftime("%Y-%m-%d %H:%M:%S")))
+ ["instance_usage_audit_log"])
expected_items = ['total_errors', 'total_instances', 'log',
'num_hosts_running', 'num_hosts_done', 'num_hosts',
diff --git a/tempest/api/compute/admin/test_migrations.py b/tempest/api/compute/admin/test_migrations.py
index c993bb8..0809bb4 100644
--- a/tempest/api/compute/admin/test_migrations.py
+++ b/tempest/api/compute/admin/test_migrations.py
@@ -42,7 +42,7 @@
server = self.create_test_server(wait_until="ACTIVE")
server_id = server['id']
- self.servers_client.resize(server_id, self.flavor_ref_alt)
+ self.servers_client.resize_server(server_id, self.flavor_ref_alt)
waiters.wait_for_server_status(self.servers_client,
server_id, 'VERIFY_RESIZE')
self.servers_client.confirm_resize(server_id)
diff --git a/tempest/api/compute/admin/test_networks.py b/tempest/api/compute/admin/test_networks.py
index 981a5c9..deb81a9 100644
--- a/tempest/api/compute/admin/test_networks.py
+++ b/tempest/api/compute/admin/test_networks.py
@@ -36,7 +36,7 @@
@test.idempotent_id('d206d211-8912-486f-86e2-a9d090d1f416')
def test_get_network(self):
- networks = self.client.list_networks()
+ networks = self.client.list_networks()['networks']
if CONF.compute.fixed_network_name:
configured_network = [x for x in networks if x['label'] ==
CONF.compute.fixed_network_name]
@@ -47,12 +47,13 @@
else:
configured_network = networks
configured_network = configured_network[0]
- network = self.client.show_network(configured_network['id'])
+ network = (self.client.show_network(configured_network['id'])
+ ['network'])
self.assertEqual(configured_network['label'], network['label'])
@test.idempotent_id('df3d1046-6fa5-4b2c-ad0c-cfa46a351cb9')
def test_list_all_networks(self):
- networks = self.client.list_networks()
+ networks = self.client.list_networks()['networks']
# Check the configured network is in the list
if CONF.compute.fixed_network_name:
configured_network = CONF.compute.fixed_network_name
diff --git a/tempest/api/compute/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index 3416eae..ef96f9b 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -59,7 +59,7 @@
# Admin can get the default resource quota set for a tenant
expected_quota_set = self.default_quota_set | set(['id'])
quota_set = self.adm_client.show_default_quota_set(
- self.demo_tenant_id)
+ self.demo_tenant_id)['quota_set']
self.assertEqual(quota_set['id'], self.demo_tenant_id)
for quota in expected_quota_set:
self.assertIn(quota, quota_set.keys())
@@ -68,7 +68,7 @@
def test_update_all_quota_resources_for_tenant(self):
# Admin can update all the resource quota limits for a tenant
default_quota_set = self.adm_client.show_default_quota_set(
- self.demo_tenant_id)
+ self.demo_tenant_id)['quota_set']
new_quota_set = {'injected_file_content_bytes': 20480,
'metadata_items': 256, 'injected_files': 10,
'ram': 10240, 'floating_ips': 20, 'fixed_ips': 10,
@@ -79,7 +79,7 @@
quota_set = self.adm_client.update_quota_set(
self.demo_tenant_id,
force=True,
- **new_quota_set)
+ **new_quota_set)['quota_set']
default_quota_set.pop('id')
# NOTE(PhilDay) The following is safe as we're not updating these
@@ -107,7 +107,7 @@
self.addCleanup(identity_client.delete_tenant, tenant_id)
self.adm_client.update_quota_set(tenant_id, ram='5120')
- quota_set = self.adm_client.show_quota_set(tenant_id)
+ quota_set = self.adm_client.show_quota_set(tenant_id)['quota_set']
self.assertEqual(5120, quota_set['ram'])
# Verify that GET shows the updated quota set of user
@@ -126,8 +126,8 @@
self.adm_client.update_quota_set(tenant_id,
user_id=user_id,
ram='2048')
- quota_set = self.adm_client.show_quota_set(tenant_id,
- user_id=user_id)
+ quota_set = self.adm_client.show_quota_set(
+ tenant_id, user_id=user_id)['quota_set']
self.assertEqual(2048, quota_set['ram'])
@test.idempotent_id('389d04f0-3a41-405f-9317-e5f86e3c44f0')
@@ -140,14 +140,15 @@
description=tenant_desc)
tenant_id = tenant['id']
self.addCleanup(identity_client.delete_tenant, tenant_id)
- quota_set_default = self.adm_client.show_quota_set(tenant_id)
+ quota_set_default = (self.adm_client.show_quota_set(tenant_id)
+ ['quota_set'])
ram_default = quota_set_default['ram']
self.adm_client.update_quota_set(tenant_id, ram='5120')
self.adm_client.delete_quota_set(tenant_id)
- quota_set_new = self.adm_client.show_quota_set(tenant_id)
+ quota_set_new = self.adm_client.show_quota_set(tenant_id)['quota_set']
self.assertEqual(ram_default, quota_set_new['ram'])
@@ -169,7 +170,7 @@
def _restore_default_quotas(self, original_defaults):
LOG.debug("restoring quota class defaults")
self.adm_client.update_quota_class_set(
- 'default', **original_defaults)
+ 'default', **original_defaults)['quota_class_set']
# NOTE(sdague): this test is problematic as it changes
# global state, and possibly needs to be part of a set of
@@ -178,7 +179,8 @@
@test.idempotent_id('7932ab0f-5136-4075-b201-c0e2338df51a')
def test_update_default_quotas(self):
LOG.debug("get the current 'default' quota class values")
- body = self.adm_client.show_quota_class_set('default')
+ body = (self.adm_client.show_quota_class_set('default')
+ ['quota_class_set'])
self.assertIn('id', body)
self.assertEqual('default', body.pop('id'))
# restore the defaults when the test is done
@@ -190,8 +192,8 @@
# to a very small number which causes issues.
body[quota] = default + 100
LOG.debug("update limits for the default quota class set")
- update_body = self.adm_client.update_quota_class_set('default',
- **body)
+ update_body = self.adm_client.update_quota_class_set(
+ 'default', **body)['quota_class_set']
LOG.debug("assert that the response has all of the changed values")
self.assertThat(update_body.items(),
matchers.ContainsAll(body.items()))
diff --git a/tempest/api/compute/admin/test_quotas_negative.py b/tempest/api/compute/admin/test_quotas_negative.py
index 0a9d41e..758cd43 100644
--- a/tempest/api/compute/admin/test_quotas_negative.py
+++ b/tempest/api/compute/admin/test_quotas_negative.py
@@ -55,13 +55,14 @@
@test.idempotent_id('91058876-9947-4807-9f22-f6eb17140d9b')
def test_create_server_when_cpu_quota_is_full(self):
# Disallow server creation when tenant's vcpu quota is full
- quota_set = self.adm_client.show_quota_set(self.demo_tenant_id)
+ quota_set = (self.adm_client.show_quota_set(self.demo_tenant_id)
+ ['quota_set'])
default_vcpu_quota = quota_set['cores']
vcpu_quota = 0 # Set the quota to zero to conserve resources
- quota_set = self.adm_client.update_quota_set(self.demo_tenant_id,
- force=True,
- cores=vcpu_quota)
+ self.adm_client.update_quota_set(self.demo_tenant_id,
+ force=True,
+ cores=vcpu_quota)
self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
cores=default_vcpu_quota)
@@ -72,7 +73,8 @@
@test.idempotent_id('6fdd7012-584d-4327-a61c-49122e0d5864')
def test_create_server_when_memory_quota_is_full(self):
# Disallow server creation when tenant's memory quota is full
- quota_set = self.adm_client.show_quota_set(self.demo_tenant_id)
+ quota_set = (self.adm_client.show_quota_set(self.demo_tenant_id)
+ ['quota_set'])
default_mem_quota = quota_set['ram']
mem_quota = 0 # Set the quota to zero to conserve resources
@@ -89,7 +91,8 @@
@test.idempotent_id('7c6be468-0274-449a-81c3-ac1c32ee0161')
def test_create_server_when_instances_quota_is_full(self):
# Once instances quota limit is reached, disallow server creation
- quota_set = self.adm_client.show_quota_set(self.demo_tenant_id)
+ quota_set = (self.adm_client.show_quota_set(self.demo_tenant_id)
+ ['quota_set'])
default_instances_quota = quota_set['instances']
instances_quota = 0 # Set quota to zero to disallow server creation
@@ -108,17 +111,17 @@
def test_security_groups_exceed_limit(self):
# Negative test: Creation Security Groups over limit should FAIL
- quota_set = self.adm_client.show_quota_set(self.demo_tenant_id)
+ quota_set = (self.adm_client.show_quota_set(self.demo_tenant_id)
+ ['quota_set'])
default_sg_quota = quota_set['security_groups']
# Set the quota to number of used security groups
sg_quota = self.limits_client.show_limits()['limits']['absolute'][
'totalSecurityGroupsUsed']
- quota_set =\
- self.adm_client.update_quota_set(self.demo_tenant_id,
- force=True,
- security_groups=sg_quota)
+ self.adm_client.update_quota_set(self.demo_tenant_id,
+ force=True,
+ security_groups=sg_quota)
self.addCleanup(self.adm_client.update_quota_set,
self.demo_tenant_id,
@@ -140,15 +143,14 @@
# Negative test: Creation of Security Group Rules should FAIL
# when we reach limit maxSecurityGroupRules
- quota_set = self.adm_client.show_quota_set(self.demo_tenant_id)
+ quota_set = (self.adm_client.show_quota_set(self.demo_tenant_id)
+ ['quota_set'])
default_sg_rules_quota = quota_set['security_group_rules']
sg_rules_quota = 0 # Set the quota to zero to conserve resources
- quota_set =\
- self.adm_client.update_quota_set(
- self.demo_tenant_id,
- force=True,
- security_group_rules=sg_rules_quota)
+ self.adm_client.update_quota_set(self.demo_tenant_id,
+ force=True,
+ security_group_rules=sg_rules_quota)
self.addCleanup(self.adm_client.update_quota_set,
self.demo_tenant_id,
@@ -156,9 +158,8 @@
s_name = data_utils.rand_name('securitygroup')
s_description = data_utils.rand_name('description')
- securitygroup =\
- self.sg_client.create_security_group(name=s_name,
- description=s_description)
+ securitygroup = self.sg_client.create_security_group(
+ name=s_name, description=s_description)['security_group']
self.addCleanup(self.sg_client.delete_security_group,
securitygroup['id'])
diff --git a/tempest/api/compute/admin/test_security_group_default_rules.py b/tempest/api/compute/admin/test_security_group_default_rules.py
index 5ae6553..74f3caa 100644
--- a/tempest/api/compute/admin/test_security_group_default_rules.py
+++ b/tempest/api/compute/admin/test_security_group_default_rules.py
@@ -48,7 +48,7 @@
ip_protocol=ip_protocol,
from_port=from_port,
to_port=to_port,
- cidr=cidr)
+ cidr=cidr)['security_group_default_rule']
self.assertEqual(ip_protocol, rule['ip_protocol'])
self.assertEqual(from_port, rule['from_port'])
self.assertEqual(to_port, rule['to_port'])
@@ -75,7 +75,7 @@
rule = self.adm_client.create_security_default_group_rule(
ip_protocol=ip_protocol,
from_port=from_port,
- to_port=to_port)
+ to_port=to_port)['security_group_default_rule']
self.addCleanup(self.adm_client.delete_security_group_default_rule,
rule['id'])
self.assertNotEqual(0, rule['id'])
@@ -91,7 +91,7 @@
ip_protocol=ip_protocol,
from_port=from_port,
to_port=to_port,
- cidr=cidr)
+ cidr=cidr)['security_group_default_rule']
self.addCleanup(self.adm_client.delete_security_group_default_rule,
rule['id'])
self.assertNotEqual(0, rule['id'])
@@ -109,7 +109,8 @@
cidr)
self.addCleanup(self.adm_client.delete_security_group_default_rule,
rule['id'])
- rules = self.adm_client.list_security_group_default_rules()
+ rules = (self.adm_client.list_security_group_default_rules()
+ ['security_group_default_rules'])
self.assertNotEqual(0, len(rules))
self.assertIn(rule, rules)
@@ -126,5 +127,5 @@
self.addCleanup(self.adm_client.delete_security_group_default_rule,
rule['id'])
fetched_rule = self.adm_client.show_security_group_default_rule(
- rule['id'])
+ rule['id'])['security_group_default_rule']
self.assertEqual(rule, fetched_rule)
diff --git a/tempest/api/compute/admin/test_security_groups.py b/tempest/api/compute/admin/test_security_groups.py
index b2a1b98..b0a3086 100644
--- a/tempest/api/compute/admin/test_security_groups.py
+++ b/tempest/api/compute/admin/test_security_groups.py
@@ -50,9 +50,8 @@
for i in range(2):
name = data_utils.rand_name('securitygroup')
description = data_utils.rand_name('description')
- securitygroup = (self.client
- .create_security_group(name=name,
- description=description))
+ securitygroup = self.client.create_security_group(
+ name=name, description=description)['security_group']
self.addCleanup(self._delete_security_group,
securitygroup['id'], admin=False)
security_group_list.append(securitygroup)
@@ -63,13 +62,14 @@
name = data_utils.rand_name('securitygroup')
description = data_utils.rand_name('description')
adm_securitygroup = self.adm_client.create_security_group(
- name=name, description=description)
+ name=name, description=description)['security_group']
self.addCleanup(self._delete_security_group,
adm_securitygroup['id'])
security_group_list.append(adm_securitygroup)
# Fetch all security groups based on 'all_tenants' search filter
- fetched_list = self.adm_client.list_security_groups(all_tenants='true')
+ fetched_list = self.adm_client.list_security_groups(
+ all_tenants='true')['security_groups']
sec_group_id_list = map(lambda sg: sg['id'], fetched_list)
# Now check if all created Security Groups are present in fetched list
for sec_group in security_group_list:
@@ -77,7 +77,8 @@
# Fetch all security groups for non-admin user with 'all_tenants'
# search filter
- fetched_list = self.client.list_security_groups(all_tenants='true')
+ fetched_list = (self.client.list_security_groups(all_tenants='true')
+ ['security_groups'])
# Now check if all created Security Groups are present in fetched list
for sec_group in fetched_list:
self.assertEqual(sec_group['tenant_id'], client_tenant_id,
diff --git a/tempest/api/compute/admin/test_servers.py b/tempest/api/compute/admin/test_servers.py
index 1982eda..0528fa5 100644
--- a/tempest/api/compute/admin/test_servers.py
+++ b/tempest/api/compute/admin/test_servers.py
@@ -163,11 +163,11 @@
# resetting vm state require admin privilege
self.client.reset_state(self.s1_id, state='error')
- rebuilt_server = self.non_admin_client.rebuild(
+ rebuilt_server = self.non_admin_client.rebuild_server(
self.s1_id, self.image_ref_alt)
self.addCleanup(waiters.wait_for_server_status, self.non_admin_client,
self.s1_id, 'ACTIVE')
- self.addCleanup(self.non_admin_client.rebuild, self.s1_id,
+ self.addCleanup(self.non_admin_client.rebuild_server, self.s1_id,
self.image_ref)
# Verify the properties in the initial response are correct
diff --git a/tempest/api/compute/admin/test_servers_negative.py b/tempest/api/compute/admin/test_servers_negative.py
index 0241e70..c2dc94c 100644
--- a/tempest/api/compute/admin/test_servers_negative.py
+++ b/tempest/api/compute/admin/test_servers_negative.py
@@ -69,16 +69,18 @@
self.useFixture(fixtures.LockFixture('compute_quotas'))
flavor_name = data_utils.rand_name("flavor")
flavor_id = self._get_unused_flavor_id()
- quota_set = self.quotas_client.show_default_quota_set(self.tenant_id)
+ quota_set = (self.quotas_client.show_default_quota_set(self.tenant_id)
+ ['quota_set'])
ram = int(quota_set['ram']) + 1
vcpus = 8
disk = 10
flavor_ref = self.flavors_client.create_flavor(name=flavor_name,
ram=ram, vcpus=vcpus,
- disk=disk, id=flavor_id)
+ disk=disk,
+ id=flavor_id)['flavor']
self.addCleanup(self.flavors_client.delete_flavor, flavor_id)
self.assertRaises((lib_exc.Forbidden, lib_exc.OverLimit),
- self.client.resize,
+ self.client.resize_server,
self.servers[0]['id'],
flavor_ref['id'])
@@ -92,15 +94,17 @@
flavor_name = data_utils.rand_name("flavor")
flavor_id = self._get_unused_flavor_id()
ram = 512
- quota_set = self.quotas_client.show_default_quota_set(self.tenant_id)
+ quota_set = (self.quotas_client.show_default_quota_set(self.tenant_id)
+ ['quota_set'])
vcpus = int(quota_set['cores']) + 1
disk = 10
flavor_ref = self.flavors_client.create_flavor(name=flavor_name,
ram=ram, vcpus=vcpus,
- disk=disk, id=flavor_id)
+ disk=disk,
+ id=flavor_id)['flavor']
self.addCleanup(self.flavors_client.delete_flavor, flavor_id)
self.assertRaises((lib_exc.Forbidden, lib_exc.OverLimit),
- self.client.resize,
+ self.client.resize_server,
self.servers[0]['id'],
flavor_ref['id'])
diff --git a/tempest/api/compute/admin/test_services.py b/tempest/api/compute/admin/test_services.py
index db22925..4d7dea5 100644
--- a/tempest/api/compute/admin/test_services.py
+++ b/tempest/api/compute/admin/test_services.py
@@ -31,25 +31,25 @@
@test.idempotent_id('5be41ef4-53d1-41cc-8839-5c2a48a1b283')
def test_list_services(self):
- services = self.client.list_services()
+ services = self.client.list_services()['services']
self.assertNotEqual(0, len(services))
@test.idempotent_id('f345b1ec-bc6e-4c38-a527-3ca2bc00bef5')
def test_get_service_by_service_binary_name(self):
binary_name = 'nova-compute'
- services = self.client.list_services(binary=binary_name)
+ services = self.client.list_services(binary=binary_name)['services']
self.assertNotEqual(0, len(services))
for service in services:
self.assertEqual(binary_name, service['binary'])
@test.idempotent_id('affb42d5-5b4b-43c8-8b0b-6dca054abcca')
def test_get_service_by_host_name(self):
- services = self.client.list_services()
+ services = self.client.list_services()['services']
host_name = services[0]['host']
services_on_host = [service for service in services if
service['host'] == host_name]
- services = self.client.list_services(host=host_name)
+ services = self.client.list_services(host=host_name)['services']
# we could have a periodic job checkin between the 2 service
# lookups, so only compare binary lists.
@@ -62,12 +62,12 @@
@test.idempotent_id('39397f6f-37b8-4234-8671-281e44c74025')
def test_get_service_by_service_and_host_name(self):
- services = self.client.list_services()
+ services = self.client.list_services()['services']
host_name = services[0]['host']
binary_name = services[0]['binary']
services = self.client.list_services(host=host_name,
- binary=binary_name)
+ binary=binary_name)['services']
self.assertEqual(1, len(services))
self.assertEqual(host_name, services[0]['host'])
self.assertEqual(binary_name, services[0]['binary'])
diff --git a/tempest/api/compute/admin/test_services_negative.py b/tempest/api/compute/admin/test_services_negative.py
index b9335c9..0c81ccb 100644
--- a/tempest/api/compute/admin/test_services_negative.py
+++ b/tempest/api/compute/admin/test_services_negative.py
@@ -40,22 +40,25 @@
@test.idempotent_id('d0884a69-f693-4e79-a9af-232d15643bf7')
def test_get_service_by_invalid_params(self):
# return all services if send the request with invalid parameter
- services = self.client.list_services()
- services_xxx = self.client.list_services(xxx='nova-compute')
+ services = self.client.list_services()['services']
+ services_xxx = (self.client.list_services(xxx='nova-compute')
+ ['services'])
self.assertEqual(len(services), len(services_xxx))
@test.attr(type=['negative'])
@test.idempotent_id('1e966d4a-226e-47c7-b601-0b18a27add54')
def test_get_service_by_invalid_service_and_valid_host(self):
- services = self.client.list_services()
+ services = self.client.list_services()['services']
host_name = services[0]['host']
- services = self.client.list_services(host=host_name, binary='xxx')
+ services = self.client.list_services(host=host_name,
+ binary='xxx')['services']
self.assertEqual(0, len(services))
@test.attr(type=['negative'])
@test.idempotent_id('64e7e7fb-69e8-4cb6-a71d-8d5eb0c98655')
def test_get_service_with_valid_service_and_invalid_host(self):
- services = self.client.list_services()
+ services = self.client.list_services()['services']
binary_name = services[0]['binary']
- services = self.client.list_services(host='xxx', binary=binary_name)
+ services = self.client.list_services(host='xxx',
+ binary=binary_name)['services']
self.assertEqual(0, len(services))
diff --git a/tempest/api/compute/admin/test_simple_tenant_usage.py b/tempest/api/compute/admin/test_simple_tenant_usage.py
index 204281c..7333acb 100644
--- a/tempest/api/compute/admin/test_simple_tenant_usage.py
+++ b/tempest/api/compute/admin/test_simple_tenant_usage.py
@@ -50,14 +50,14 @@
def test_list_usage_all_tenants(self):
# Get usage for all tenants
tenant_usage = self.adm_client.list_tenant_usages(
- start=self.start, end=self.end, detailed="1")
+ start=self.start, end=self.end, detailed="1")['tenant_usages'][0]
self.assertEqual(len(tenant_usage), 8)
@test.idempotent_id('94135049-a4c5-4934-ad39-08fa7da4f22e')
def test_get_usage_tenant(self):
# Get usage for a specific tenant
tenant_usage = self.adm_client.show_tenant_usage(
- self.tenant_id, start=self.start, end=self.end)
+ self.tenant_id, start=self.start, end=self.end)['tenant_usage']
self.assertEqual(len(tenant_usage), 8)
@@ -65,6 +65,6 @@
def test_get_usage_tenant_with_non_admin_user(self):
# Get usage for a specific tenant with non admin user
tenant_usage = self.client.show_tenant_usage(
- self.tenant_id, start=self.start, end=self.end)
+ self.tenant_id, start=self.start, end=self.end)['tenant_usage']
self.assertEqual(len(tenant_usage), 8)
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 1ec2b56..a25a2af 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -43,6 +43,8 @@
@classmethod
def skip_checks(cls):
super(BaseComputeTest, cls).skip_checks()
+ if not CONF.service_available.nova:
+ raise cls.skipException("Nova is not available")
if cls._api_version != 2:
msg = ("Unexpected API version is specified (%s)" %
cls._api_version)
@@ -223,9 +225,8 @@
name = data_utils.rand_name(cls.__name__ + "-securitygroup")
if description is None:
description = data_utils.rand_name('description')
- body = \
- cls.security_groups_client.create_security_group(
- name=name, description=description)
+ body = cls.security_groups_client.create_security_group(
+ name=name, description=description)['security_group']
cls.security_groups.append(body)
return body
@@ -236,7 +237,8 @@
name = data_utils.rand_name(cls.__name__ + "-Server-Group")
if policy is None:
policy = ['affinity']
- body = cls.server_groups_client.create_server_group(name, policy)
+ body = (cls.server_groups_client.create_server_group(name, policy)
+ ['server_group'])
cls.server_groups.append(body['id'])
return body
@@ -288,7 +290,7 @@
if 'wait_until' in kwargs:
waiters.wait_for_image_status(cls.images_client,
image_id, kwargs['wait_until'])
- image = cls.images_client.show_image(image_id)
+ image = cls.images_client.show_image(image_id)['image']
if kwargs['wait_until'] == 'ACTIVE':
if kwargs.get('wait_for_server', True):
diff --git a/tempest/api/compute/flavors/test_flavors.py b/tempest/api/compute/flavors/test_flavors.py
index 728fefb..e114c80 100644
--- a/tempest/api/compute/flavors/test_flavors.py
+++ b/tempest/api/compute/flavors/test_flavors.py
@@ -32,8 +32,8 @@
@test.idempotent_id('e36c0eaa-dff5-4082-ad1f-3f9a80aa3f59')
def test_list_flavors(self):
# List of all flavors should contain the expected flavor
- flavors = self.client.list_flavors()
- flavor = self.client.show_flavor(self.flavor_ref)
+ flavors = self.client.list_flavors()['flavors']
+ flavor = self.client.show_flavor(self.flavor_ref)['flavor']
flavor_min_detail = {'id': flavor['id'], 'links': flavor['links'],
'name': flavor['name']}
self.assertIn(flavor_min_detail, flavors)
@@ -41,89 +41,89 @@
@test.idempotent_id('6e85fde4-b3cd-4137-ab72-ed5f418e8c24')
def test_list_flavors_with_detail(self):
# Detailed list of all flavors should contain the expected flavor
- flavors = self.client.list_flavors(detail=True)
- flavor = self.client.show_flavor(self.flavor_ref)
+ flavors = self.client.list_flavors(detail=True)['flavors']
+ flavor = self.client.show_flavor(self.flavor_ref)['flavor']
self.assertIn(flavor, flavors)
@test.attr(type='smoke')
@test.idempotent_id('1f12046b-753d-40d2-abb6-d8eb8b30cb2f')
def test_get_flavor(self):
# The expected flavor details should be returned
- flavor = self.client.show_flavor(self.flavor_ref)
+ flavor = self.client.show_flavor(self.flavor_ref)['flavor']
self.assertEqual(self.flavor_ref, flavor['id'])
@test.idempotent_id('8d7691b3-6ed4-411a-abc9-2839a765adab')
def test_list_flavors_limit_results(self):
# Only the expected number of flavors should be returned
params = {'limit': 1}
- flavors = self.client.list_flavors(**params)
+ flavors = self.client.list_flavors(**params)['flavors']
self.assertEqual(1, len(flavors))
@test.idempotent_id('b26f6327-2886-467a-82be-cef7a27709cb')
def test_list_flavors_detailed_limit_results(self):
# Only the expected number of flavors (detailed) should be returned
params = {'limit': 1}
- flavors = self.client.list_flavors(detail=True, **params)
+ flavors = self.client.list_flavors(detail=True, **params)['flavors']
self.assertEqual(1, len(flavors))
@test.idempotent_id('e800f879-9828-4bd0-8eae-4f17189951fb')
def test_list_flavors_using_marker(self):
# The list of flavors should start from the provided marker
- flavor = self.client.show_flavor(self.flavor_ref)
+ flavor = self.client.show_flavor(self.flavor_ref)['flavor']
flavor_id = flavor['id']
params = {'marker': flavor_id}
- flavors = self.client.list_flavors(**params)
+ flavors = self.client.list_flavors(**params)['flavors']
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]),
'The list of flavors did not start after the marker.')
@test.idempotent_id('6db2f0c0-ddee-4162-9c84-0703d3dd1107')
def test_list_flavors_detailed_using_marker(self):
# The list of flavors should start from the provided marker
- flavor = self.client.show_flavor(self.flavor_ref)
+ flavor = self.client.show_flavor(self.flavor_ref)['flavor']
flavor_id = flavor['id']
params = {'marker': flavor_id}
- flavors = self.client.list_flavors(detail=True, **params)
+ flavors = self.client.list_flavors(detail=True, **params)['flavors']
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]),
'The list of flavors did not start after the marker.')
@test.idempotent_id('3df2743e-3034-4e57-a4cb-b6527f6eac79')
def test_list_flavors_detailed_filter_by_min_disk(self):
# The detailed list of flavors should be filtered by disk space
- flavor = self.client.show_flavor(self.flavor_ref)
+ flavor = self.client.show_flavor(self.flavor_ref)['flavor']
flavor_id = flavor['id']
params = {self._min_disk: flavor['disk'] + 1}
- flavors = self.client.list_flavors(detail=True, **params)
+ flavors = self.client.list_flavors(detail=True, **params)['flavors']
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
@test.idempotent_id('09fe7509-b4ee-4b34-bf8b-39532dc47292')
def test_list_flavors_detailed_filter_by_min_ram(self):
# The detailed list of flavors should be filtered by RAM
- flavor = self.client.show_flavor(self.flavor_ref)
+ flavor = self.client.show_flavor(self.flavor_ref)['flavor']
flavor_id = flavor['id']
params = {self._min_ram: flavor['ram'] + 1}
- flavors = self.client.list_flavors(detail=True, **params)
+ flavors = self.client.list_flavors(detail=True, **params)['flavors']
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
@test.idempotent_id('10645a4d-96f5-443f-831b-730711e11dd4')
def test_list_flavors_filter_by_min_disk(self):
# The list of flavors should be filtered by disk space
- flavor = self.client.show_flavor(self.flavor_ref)
+ flavor = self.client.show_flavor(self.flavor_ref)['flavor']
flavor_id = flavor['id']
params = {self._min_disk: flavor['disk'] + 1}
- flavors = self.client.list_flavors(**params)
+ flavors = self.client.list_flavors(**params)['flavors']
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
@test.idempotent_id('935cf550-e7c8-4da6-8002-00f92d5edfaa')
def test_list_flavors_filter_by_min_ram(self):
# The list of flavors should be filtered by RAM
- flavor = self.client.show_flavor(self.flavor_ref)
+ flavor = self.client.show_flavor(self.flavor_ref)['flavor']
flavor_id = flavor['id']
params = {self._min_ram: flavor['ram'] + 1}
- flavors = self.client.list_flavors(**params)
+ flavors = self.client.list_flavors(**params)['flavors']
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
diff --git a/tempest/api/compute/floating_ips/test_floating_ips_actions.py b/tempest/api/compute/floating_ips/test_floating_ips_actions.py
index 8bb4fac..5b90641 100644
--- a/tempest/api/compute/floating_ips/test_floating_ips_actions.py
+++ b/tempest/api/compute/floating_ips/test_floating_ips_actions.py
@@ -39,7 +39,7 @@
server = cls.create_test_server(wait_until='ACTIVE')
cls.server_id = server['id']
# Floating IP creation
- body = cls.client.create_floating_ip()
+ body = cls.client.create_floating_ip()['floating_ip']
cls.floating_ip_id = body['id']
cls.floating_ip = body['ip']
@@ -63,14 +63,14 @@
def test_allocate_floating_ip(self):
# Positive test:Allocation of a new floating IP to a project
# should be successful
- body = self.client.create_floating_ip()
+ body = self.client.create_floating_ip()['floating_ip']
floating_ip_id_allocated = body['id']
self.addCleanup(self.client.delete_floating_ip,
floating_ip_id_allocated)
- floating_ip_details = \
- self.client.show_floating_ip(floating_ip_id_allocated)
+ floating_ip_details = self.client.show_floating_ip(
+ floating_ip_id_allocated)['floating_ip']
# Checking if the details of allocated IP is in list of floating IP
- body = self.client.list_floating_ips()
+ body = self.client.list_floating_ips()['floating_ips']
self.assertIn(floating_ip_details, body)
@test.idempotent_id('de45e989-b5ca-4a9b-916b-04a52e7bbb8b')
@@ -79,7 +79,7 @@
# Positive test:Deletion of valid floating IP from project
# should be successful
# Creating the floating IP that is to be deleted in this method
- floating_ip_body = self.client.create_floating_ip()
+ floating_ip_body = self.client.create_floating_ip()['floating_ip']
self.addCleanup(self._try_delete_floating_ip, floating_ip_body['id'])
# Deleting the floating IP from the project
self.client.delete_floating_ip(floating_ip_body['id'])
@@ -98,7 +98,8 @@
self.server_id)
# Check instance_id in the floating_ip body
- body = self.client.show_floating_ip(self.floating_ip_id)
+ body = (self.client.show_floating_ip(self.floating_ip_id)
+ ['floating_ip'])
self.assertEqual(self.server_id, body['instance_id'])
# Disassociation of floating IP that was associated in this method
diff --git a/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py b/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py
index c07af72..64aac80 100644
--- a/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py
+++ b/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py
@@ -42,7 +42,7 @@
cls.server_id = server['id']
# Generating a nonexistent floatingIP id
cls.floating_ip_ids = []
- body = cls.client.list_floating_ips()
+ body = cls.client.list_floating_ips()['floating_ips']
for i in range(len(body)):
cls.floating_ip_ids.append(body[i]['id'])
while True:
diff --git a/tempest/api/compute/floating_ips/test_list_floating_ips.py b/tempest/api/compute/floating_ips/test_list_floating_ips.py
index 7a5bcff..d003967 100644
--- a/tempest/api/compute/floating_ips/test_list_floating_ips.py
+++ b/tempest/api/compute/floating_ips/test_list_floating_ips.py
@@ -31,7 +31,7 @@
cls.floating_ip = []
cls.floating_ip_id = []
for i in range(3):
- body = cls.client.create_floating_ip()
+ body = cls.client.create_floating_ip()['floating_ip']
cls.floating_ip.append(body)
cls.floating_ip_id.append(body['id'])
@@ -45,7 +45,7 @@
@test.services('network')
def test_list_floating_ips(self):
# Positive test:Should return the list of floating IPs
- body = self.client.list_floating_ips()
+ body = self.client.list_floating_ips()['floating_ips']
floating_ips = body
self.assertNotEqual(0, len(floating_ips),
"Expected floating IPs. Got zero.")
@@ -57,14 +57,14 @@
def test_get_floating_ip_details(self):
# Positive test:Should be able to GET the details of floatingIP
# Creating a floating IP for which details are to be checked
- body = self.client.create_floating_ip()
+ body = self.client.create_floating_ip()['floating_ip']
floating_ip_id = body['id']
self.addCleanup(self.client.delete_floating_ip,
floating_ip_id)
floating_ip_instance_id = body['instance_id']
floating_ip_ip = body['ip']
floating_ip_fixed_ip = body['fixed_ip']
- body = self.client.show_floating_ip(floating_ip_id)
+ body = self.client.show_floating_ip(floating_ip_id)['floating_ip']
# Comparing the details of floating IP
self.assertEqual(floating_ip_instance_id,
body['instance_id'])
diff --git a/tempest/api/compute/images/test_image_metadata.py b/tempest/api/compute/images/test_image_metadata.py
index d16c020..975b850 100644
--- a/tempest/api/compute/images/test_image_metadata.py
+++ b/tempest/api/compute/images/test_image_metadata.py
@@ -64,7 +64,8 @@
def test_list_image_metadata(self):
# All metadata key/value pairs for an image should be returned
resp_metadata = self.client.list_image_metadata(self.image_id)
- expected = {'os_version': 'value1', 'os_distro': 'value2'}
+ expected = {'metadata': {
+ 'os_version': 'value1', 'os_distro': 'value2'}}
self.assertEqual(expected, resp_metadata)
@test.idempotent_id('ece7befc-d3ce-42a4-b4be-c3067a418c29')
@@ -74,7 +75,8 @@
self.client.set_image_metadata(self.image_id,
req_metadata)
- resp_metadata = self.client.list_image_metadata(self.image_id)
+ resp_metadata = (self.client.list_image_metadata(self.image_id)
+ ['metadata'])
self.assertEqual(req_metadata, resp_metadata)
@test.idempotent_id('7b491c11-a9d5-40fe-a696-7f7e03d3fea2')
@@ -85,16 +87,17 @@
req_metadata)
resp_metadata = self.client.list_image_metadata(self.image_id)
- expected = {'os_version': 'alt1',
- 'os_distro': 'value2',
- 'architecture': 'value3'}
+ expected = {'metadata': {
+ 'os_version': 'alt1',
+ 'os_distro': 'value2',
+ 'architecture': 'value3'}}
self.assertEqual(expected, resp_metadata)
@test.idempotent_id('4f5db52f-6685-4c75-b848-f4bb363f9aa6')
def test_get_image_metadata_item(self):
# The value for a specific metadata key should be returned
meta = self.client.show_image_metadata_item(self.image_id,
- 'os_distro')
+ 'os_distro')['meta']
self.assertEqual('value2', meta['os_distro'])
@test.idempotent_id('f2de776a-4778-4d90-a5da-aae63aee64ae')
@@ -105,7 +108,7 @@
self.client.set_image_metadata_item(self.image_id,
'os_version', meta)
resp_metadata = self.client.list_image_metadata(self.image_id)
- expected = {'os_version': 'alt', 'os_distro': 'value2'}
+ expected = {'metadata': {'os_version': 'alt', 'os_distro': 'value2'}}
self.assertEqual(expected, resp_metadata)
@test.idempotent_id('a013796c-ba37-4bb5-8602-d944511def14')
@@ -114,5 +117,5 @@
self.client.delete_image_metadata_item(self.image_id,
'os_version')
resp_metadata = self.client.list_image_metadata(self.image_id)
- expected = {'os_distro': 'value2'}
+ expected = {'metadata': {'os_distro': 'value2'}}
self.assertEqual(expected, resp_metadata)
diff --git a/tempest/api/compute/images/test_images_oneserver.py b/tempest/api/compute/images/test_images_oneserver.py
index 06b7cac..37c2bb6 100644
--- a/tempest/api/compute/images/test_images_oneserver.py
+++ b/tempest/api/compute/images/test_images_oneserver.py
@@ -71,7 +71,7 @@
cls.server_id = server['id']
def _get_default_flavor_disk_size(self, flavor_id):
- flavor = self.flavors_client.show_flavor(flavor_id)
+ flavor = self.flavors_client.show_flavor(flavor_id)['flavor']
return flavor['disk']
@test.idempotent_id('3731d080-d4c5-4872-b41a-64d0d0021314')
@@ -86,11 +86,11 @@
waiters.wait_for_image_status(self.client, image_id, 'ACTIVE')
# Verify the image was created correctly
- image = self.client.show_image(image_id)
+ image = self.client.show_image(image_id)['image']
self.assertEqual(name, image['name'])
self.assertEqual('test', image['metadata']['image_type'])
- original_image = self.client.show_image(self.image_ref)
+ original_image = self.client.show_image(self.image_ref)['image']
# Verify minRAM is the same as the original image
self.assertEqual(image['minRam'], original_image['minRam'])
diff --git a/tempest/api/compute/images/test_list_image_filters.py b/tempest/api/compute/images/test_list_image_filters.py
index 247a57b..9f3ba71 100644
--- a/tempest/api/compute/images/test_list_image_filters.py
+++ b/tempest/api/compute/images/test_list_image_filters.py
@@ -63,7 +63,7 @@
image_file = six.StringIO(('*' * 1024))
cls.glance_client.update_image(image_id, data=image_file)
waiters.wait_for_image_status(cls.client, image_id, 'ACTIVE')
- body = cls.client.show_image(image_id)
+ body = cls.client.show_image(image_id)['image']
return body
# Create non-snapshot images via glance
@@ -106,7 +106,7 @@
# The list of images should contain only images with the
# provided status
params = {'status': 'ACTIVE'}
- images = self.client.list_images(**params)
+ images = self.client.list_images(**params)['images']
self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
@@ -117,7 +117,7 @@
# List of all images should contain the expected images filtered
# by name
params = {'name': self.image1['name']}
- images = self.client.list_images(**params)
+ images = self.client.list_images(**params)['images']
self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
self.assertFalse(any([i for i in images if i['id'] == self.image2_id]))
@@ -129,7 +129,7 @@
def test_list_images_filter_by_server_id(self):
# The images should contain images filtered by server id
params = {'server': self.server1['id']}
- images = self.client.list_images(**params)
+ images = self.client.list_images(**params)['images']
self.assertTrue(any([i for i in images
if i['id'] == self.snapshot1_id]),
@@ -150,7 +150,7 @@
# Try all server link types
for link in server_links:
params = {'server': link['href']}
- images = self.client.list_images(**params)
+ images = self.client.list_images(**params)['images']
self.assertFalse(any([i for i in images
if i['id'] == self.snapshot1_id]))
@@ -165,7 +165,7 @@
def test_list_images_filter_by_type(self):
# The list of servers should be filtered by image type
params = {'type': 'snapshot'}
- images = self.client.list_images(**params)
+ images = self.client.list_images(**params)['images']
self.assertTrue(any([i for i in images
if i['id'] == self.snapshot1_id]))
@@ -180,7 +180,7 @@
def test_list_images_limit_results(self):
# Verify only the expected number of results are returned
params = {'limit': '1'}
- images = self.client.list_images(**params)
+ images = self.client.list_images(**params)['images']
self.assertEqual(1, len([x for x in images if 'id' in x]))
@test.idempotent_id('18bac3ae-da27-436c-92a9-b22474d13aab')
@@ -190,7 +190,7 @@
# Becoming ACTIVE will modify the updated time
# Filter by the image's created time
params = {'changes-since': self.image3['created']}
- images = self.client.list_images(**params)
+ images = self.client.list_images(**params)['images']
found = any([i for i in images if i['id'] == self.image3_id])
self.assertTrue(found)
@@ -199,7 +199,7 @@
# Detailed list of all images should only contain images
# with the provided status
params = {'status': 'ACTIVE'}
- images = self.client.list_images(detail=True, **params)
+ images = self.client.list_images(detail=True, **params)['images']
self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
@@ -210,7 +210,7 @@
# Detailed list of all images should contain the expected
# images filtered by name
params = {'name': self.image1['name']}
- images = self.client.list_images(detail=True, **params)
+ images = self.client.list_images(detail=True, **params)['images']
self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
self.assertFalse(any([i for i in images if i['id'] == self.image2_id]))
@@ -221,7 +221,7 @@
# Verify only the expected number of results (with full details)
# are returned
params = {'limit': '1'}
- images = self.client.list_images(detail=True, **params)
+ images = self.client.list_images(detail=True, **params)['images']
self.assertEqual(1, len(images))
@test.idempotent_id('8c78f822-203b-4bf6-8bba-56ebd551cf84')
@@ -234,7 +234,7 @@
# Try all server link types
for link in server_links:
params = {'server': link['href']}
- images = self.client.list_images(detail=True, **params)
+ images = self.client.list_images(detail=True, **params)['images']
self.assertFalse(any([i for i in images
if i['id'] == self.snapshot1_id]))
@@ -249,7 +249,7 @@
def test_list_images_with_detail_filter_by_type(self):
# The detailed list of servers should be filtered by image type
params = {'type': 'snapshot'}
- images = self.client.list_images(detail=True, **params)
+ images = self.client.list_images(detail=True, **params)['images']
self.client.show_image(self.image_ref)
self.assertTrue(any([i for i in images
@@ -268,5 +268,5 @@
# Becoming ACTIVE will modify the updated time
# Filter by the image's created time
params = {'changes-since': self.image1['created']}
- images = self.client.list_images(detail=True, **params)
+ images = self.client.list_images(detail=True, **params)['images']
self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
diff --git a/tempest/api/compute/images/test_list_images.py b/tempest/api/compute/images/test_list_images.py
index b67378c..6ca15d6 100644
--- a/tempest/api/compute/images/test_list_images.py
+++ b/tempest/api/compute/images/test_list_images.py
@@ -37,19 +37,19 @@
@test.idempotent_id('490d0898-e12a-463f-aef0-c50156b9f789')
def test_get_image(self):
# Returns the correct details for a single image
- image = self.client.show_image(self.image_ref)
+ image = self.client.show_image(self.image_ref)['image']
self.assertEqual(self.image_ref, image['id'])
@test.idempotent_id('fd51b7f4-d4a3-4331-9885-866658112a6f')
def test_list_images(self):
# The list of all images should contain the image
- images = self.client.list_images()
+ images = self.client.list_images()['images']
found = any([i for i in images if i['id'] == self.image_ref])
self.assertTrue(found)
@test.idempotent_id('9f94cb6b-7f10-48c5-b911-a0b84d7d4cd6')
def test_list_images_with_detail(self):
# Detailed list of all images should contain the expected images
- images = self.client.list_images(detail=True)
+ images = self.client.list_images(detail=True)['images']
found = any([i for i in images if i['id'] == self.image_ref])
self.assertTrue(found)
diff --git a/tempest/api/compute/security_groups/test_security_group_rules.py b/tempest/api/compute/security_groups/test_security_group_rules.py
index b5eff70..3c22d28 100644
--- a/tempest/api/compute/security_groups/test_security_group_rules.py
+++ b/tempest/api/compute/security_groups/test_security_group_rules.py
@@ -73,7 +73,7 @@
parent_group_id=securitygroup_id,
ip_protocol=self.ip_protocol,
from_port=self.from_port,
- to_port=self.to_port)
+ to_port=self.to_port)['security_group_rule']
self.expected['parent_group_id'] = securitygroup_id
self.expected['ip_range'] = {'cidr': '0.0.0.0/0'}
self._check_expected_response(rule)
@@ -96,7 +96,7 @@
ip_protocol=self.ip_protocol,
from_port=self.from_port,
to_port=self.to_port,
- cidr=cidr)
+ cidr=cidr)['security_group_rule']
self.expected['parent_group_id'] = parent_group_id
self.expected['ip_range'] = {'cidr': cidr}
self._check_expected_response(rule)
@@ -123,7 +123,7 @@
ip_protocol=self.ip_protocol,
from_port=self.from_port,
to_port=self.to_port,
- group_id=group_id)
+ group_id=group_id)['security_group_rule']
self.expected['parent_group_id'] = parent_group_id
self.expected['group'] = {'tenant_id': self.client.tenant_id,
'name': group_name}
@@ -144,7 +144,7 @@
parent_group_id=securitygroup_id,
ip_protocol=self.ip_protocol,
from_port=self.from_port,
- to_port=self.to_port)
+ to_port=self.to_port)['security_group_rule']
rule1_id = rule['id']
# Add a second rule to the created Security Group
@@ -155,14 +155,14 @@
parent_group_id=securitygroup_id,
ip_protocol=ip_protocol2,
from_port=from_port2,
- to_port=to_port2)
+ to_port=to_port2)['security_group_rule']
rule2_id = rule['id']
# Delete the Security Group rule2 at the end of this method
self.addCleanup(self.client.delete_security_group_rule, rule2_id)
# Get rules of the created Security Group
- rules = \
- self.client.list_security_group_rules(securitygroup_id)
+ rules = (self.client.list_security_group_rules(securitygroup_id)
+ ['rules'])
self.assertTrue(any([i for i in rules if i['id'] == rule1_id]))
self.assertTrue(any([i for i in rules if i['id'] == rule2_id]))
@@ -182,12 +182,11 @@
ip_protocol=self.ip_protocol,
from_port=self.from_port,
to_port=self.to_port,
- group_id=sg2_id)
+ group_id=sg2_id)['security_group_rule']
# Delete group2
self.security_groups_client.delete_security_group(sg2_id)
# Get rules of the Group1
- rules = \
- self.client.list_security_group_rules(sg1_id)
+ rules = self.client.list_security_group_rules(sg1_id)['rules']
# The group1 has no rules because group2 has deleted
self.assertEqual(0, len(rules))
diff --git a/tempest/api/compute/security_groups/test_security_group_rules_negative.py b/tempest/api/compute/security_groups/test_security_group_rules_negative.py
index d12306a..816038a 100644
--- a/tempest/api/compute/security_groups/test_security_group_rules_negative.py
+++ b/tempest/api/compute/security_groups/test_security_group_rules_negative.py
@@ -87,7 +87,7 @@
rule = self.rules_client.create_security_group_rule(
parent_group_id=parent_group_id, ip_protocol=ip_protocol,
- from_port=from_port, to_port=to_port)
+ from_port=from_port, to_port=to_port)['security_group_rule']
self.addCleanup(self.rules_client.delete_security_group_rule,
rule['id'])
# Add the same rule to the group should fail
diff --git a/tempest/api/compute/security_groups/test_security_groups.py b/tempest/api/compute/security_groups/test_security_groups.py
index 7fff8bf..dbbeb70 100644
--- a/tempest/api/compute/security_groups/test_security_groups.py
+++ b/tempest/api/compute/security_groups/test_security_groups.py
@@ -40,7 +40,7 @@
security_group_list.append(body)
# Fetch all Security Groups and verify the list
# has all created Security Groups
- fetched_list = self.client.list_security_groups()
+ fetched_list = self.client.list_security_groups()['security_groups']
# Now check if all the created Security Groups are in fetched list
missing_sgs = \
[sg for sg in security_group_list if sg not in fetched_list]
@@ -53,7 +53,7 @@
self.client.delete_security_group(sg['id'])
self.client.wait_for_resource_deletion(sg['id'])
# Now check if all the created Security Groups are deleted
- fetched_list = self.client.list_security_groups()
+ fetched_list = self.client.list_security_groups()['security_groups']
deleted_sgs = \
[sg for sg in security_group_list if sg in fetched_list]
self.assertFalse(deleted_sgs,
@@ -75,8 +75,8 @@
"The created Security Group name is "
"not equal to the requested name")
# Now fetch the created Security Group by its 'id'
- fetched_group = \
- self.client.show_security_group(securitygroup['id'])
+ fetched_group = (self.client.show_security_group(securitygroup['id'])
+ ['security_group'])
self.assertEqual(securitygroup, fetched_group,
"The fetched Security Group is different "
"from the created Group")
@@ -109,7 +109,7 @@
sg['id'])
# Reboot and add the other security group
- self.servers_client.reboot(server_id, 'HARD')
+ self.servers_client.reboot_server(server_id, 'HARD')
waiters.wait_for_server_status(self.servers_client, server_id,
'ACTIVE')
self.servers_client.add_security_group(server_id, sg2['name'])
@@ -143,7 +143,7 @@
name=s_new_name,
description=s_new_des)
# get the security group
- fetched_group = \
- self.client.show_security_group(securitygroup_id)
+ fetched_group = (self.client.show_security_group(securitygroup_id)
+ ['security_group'])
self.assertEqual(s_new_name, fetched_group['name'])
self.assertEqual(s_new_des, fetched_group['description'])
diff --git a/tempest/api/compute/security_groups/test_security_groups_negative.py b/tempest/api/compute/security_groups/test_security_groups_negative.py
index 642aca1..120d327 100644
--- a/tempest/api/compute/security_groups/test_security_groups_negative.py
+++ b/tempest/api/compute/security_groups/test_security_groups_negative.py
@@ -39,7 +39,7 @@
def _generate_a_non_existent_security_group_id(self):
security_group_id = []
- body = self.client.list_security_groups()
+ body = self.client.list_security_groups()['security_groups']
for i in range(len(body)):
security_group_id.append(body[i]['id'])
# Generate a non-existent security group id
@@ -122,7 +122,7 @@
def test_delete_the_default_security_group(self):
# Negative test:Deletion of the "default" Security Group should Fail
default_security_group_id = None
- body = self.client.list_security_groups()
+ body = self.client.list_security_groups()['security_groups']
for i in range(len(body)):
if body[i]['name'] == 'default':
default_security_group_id = body[i]['id']
diff --git a/tempest/api/compute/servers/test_create_server.py b/tempest/api/compute/servers/test_create_server.py
index c6fb2fb..35f2b2c 100644
--- a/tempest/api/compute/servers/test_create_server.py
+++ b/tempest/api/compute/servers/test_create_server.py
@@ -117,7 +117,7 @@
def test_verify_created_server_vcpus(self):
# Verify that the number of vcpus reported by the instance matches
# the amount stated by the flavor
- flavor = self.flavors_client.show_flavor(self.flavor_ref)
+ flavor = self.flavors_client.show_flavor(self.flavor_ref)['flavor']
linux_client = remote_client.RemoteClient(
self.get_server_ip(self.server),
self.ssh_user,
@@ -143,7 +143,7 @@
name = data_utils.rand_name('server_group')
policies = ['affinity']
body = self.server_groups_client.create_server_group(
- name=name, policies=policies)
+ name=name, policies=policies)['server_group']
group_id = body['id']
self.addCleanup(self.server_groups_client.delete_server_group,
group_id)
@@ -153,7 +153,8 @@
wait_until='ACTIVE')
# Check a server is in the group
- server_group = self.server_groups_client.get_server_group(group_id)
+ server_group = (self.server_groups_client.get_server_group(group_id)
+ ['server_group'])
self.assertIn(server['id'], server_group['members'])
@test.idempotent_id('0578d144-ed74-43f8-8e57-ab10dbf9b3c2')
@@ -275,7 +276,7 @@
create_flavor(name=flavor_with_eph_disk_name,
ram=ram, vcpus=vcpus, disk=disk,
id=flavor_with_eph_disk_id,
- ephemeral=1))
+ ephemeral=1))['flavor']
self.addCleanup(flavor_clean_up, flavor['id'])
return flavor['id']
@@ -292,7 +293,7 @@
flavor = (self.flavor_client.
create_flavor(name=flavor_no_eph_disk_name,
ram=ram, vcpus=vcpus, disk=disk,
- id=flavor_no_eph_disk_id))
+ id=flavor_no_eph_disk_id))['flavor']
self.addCleanup(flavor_clean_up, flavor['id'])
return flavor['id']
diff --git a/tempest/api/compute/servers/test_delete_server.py b/tempest/api/compute/servers/test_delete_server.py
index 551f8b4..cf0cf97 100644
--- a/tempest/api/compute/servers/test_delete_server.py
+++ b/tempest/api/compute/servers/test_delete_server.py
@@ -103,7 +103,7 @@
def test_delete_server_while_in_verify_resize_state(self):
# Delete a server while it's VM state is VERIFY_RESIZE
server = self.create_test_server(wait_until='ACTIVE')
- self.client.resize(server['id'], self.flavor_ref_alt)
+ self.client.resize_server(server['id'], self.flavor_ref_alt)
waiters.wait_for_server_status(self.client, server['id'],
'VERIFY_RESIZE')
self.client.delete_server(server['id'])
@@ -117,7 +117,7 @@
device = '/dev/%s' % CONF.compute.volume_device_name
server = self.create_test_server(wait_until='ACTIVE')
- volume = volumes_client.create_volume()
+ volume = volumes_client.create_volume(size=CONF.volume.volume_size)
self.addCleanup(volumes_client.delete_volume, volume['id'])
waiters.wait_for_volume_status(volumes_client,
volume['id'], 'available')
diff --git a/tempest/api/compute/servers/test_disk_config.py b/tempest/api/compute/servers/test_disk_config.py
index 3e8a0d2..5b9338a 100644
--- a/tempest/api/compute/servers/test_disk_config.py
+++ b/tempest/api/compute/servers/test_disk_config.py
@@ -57,9 +57,9 @@
# A server should be rebuilt using the manual disk config option
self._update_server_with_disk_config(disk_config='AUTO')
- server = self.client.rebuild(self.server_id,
- self.image_ref_alt,
- disk_config='MANUAL')
+ server = self.client.rebuild_server(self.server_id,
+ self.image_ref_alt,
+ disk_config='MANUAL')
# Wait for the server to become active
waiters.wait_for_server_status(self.client, server['id'], 'ACTIVE')
@@ -73,9 +73,9 @@
# A server should be rebuilt using the auto disk config option
self._update_server_with_disk_config(disk_config='MANUAL')
- server = self.client.rebuild(self.server_id,
- self.image_ref_alt,
- disk_config='AUTO')
+ server = self.client.rebuild_server(self.server_id,
+ self.image_ref_alt,
+ disk_config='AUTO')
# Wait for the server to become active
waiters.wait_for_server_status(self.client, server['id'], 'ACTIVE')
@@ -101,7 +101,8 @@
# Resize with auto option
flavor_id = self._get_alternative_flavor()
- self.client.resize(self.server_id, flavor_id, disk_config='AUTO')
+ self.client.resize_server(self.server_id, flavor_id,
+ disk_config='AUTO')
waiters.wait_for_server_status(self.client, self.server_id,
'VERIFY_RESIZE')
self.client.confirm_resize(self.server_id)
@@ -119,7 +120,8 @@
# Resize with manual option
flavor_id = self._get_alternative_flavor()
- self.client.resize(self.server_id, flavor_id, disk_config='MANUAL')
+ self.client.resize_server(self.server_id, flavor_id,
+ disk_config='MANUAL')
waiters.wait_for_server_status(self.client, self.server_id,
'VERIFY_RESIZE')
self.client.confirm_resize(self.server_id)
diff --git a/tempest/api/compute/servers/test_instance_actions.py b/tempest/api/compute/servers/test_instance_actions.py
index dc126a5..4ac1a49 100644
--- a/tempest/api/compute/servers/test_instance_actions.py
+++ b/tempest/api/compute/servers/test_instance_actions.py
@@ -35,7 +35,7 @@
@test.idempotent_id('77ca5cc5-9990-45e0-ab98-1de8fead201a')
def test_list_instance_actions(self):
# List actions of the provided server
- self.client.reboot(self.server_id, 'HARD')
+ self.client.reboot_server(self.server_id, 'HARD')
waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
body = self.client.list_instance_actions(self.server_id)
diff --git a/tempest/api/compute/servers/test_list_server_filters.py b/tempest/api/compute/servers/test_list_server_filters.py
index 6160844..5c63557 100644
--- a/tempest/api/compute/servers/test_list_server_filters.py
+++ b/tempest/api/compute/servers/test_list_server_filters.py
@@ -44,7 +44,7 @@
# Check to see if the alternate image ref actually exists...
images_client = cls.images_client
- images = images_client.list_images()
+ images = images_client.list_images()['images']
if cls.image_ref != cls.image_ref_alt and \
any([image for image in images
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index a20f7f5..6b3b661 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -105,7 +105,7 @@
self.validation_resources['keypair']['private_key'])
boot_time = linux_client.get_boot_time()
- self.client.reboot(self.server_id, reboot_type)
+ self.client.reboot_server(self.server_id, reboot_type)
waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
if CONF.validation.run_validation:
@@ -132,7 +132,7 @@
self._test_reboot_server('SOFT')
def _rebuild_server_and_check(self, image_ref):
- rebuilt_server = self.client.rebuild(self.server_id, image_ref)
+ rebuilt_server = self.client.rebuild_server(self.server_id, image_ref)
waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
msg = ('Server was not rebuilt to the original image. '
'The original image: {0}. The current image: {1}'
@@ -148,12 +148,12 @@
personality = [{'path': 'rebuild.txt',
'contents': base64.b64encode(file_contents)}]
password = 'rebuildPassw0rd'
- rebuilt_server = self.client.rebuild(self.server_id,
- self.image_ref_alt,
- name=new_name,
- metadata=meta,
- personality=personality,
- adminPass=password)
+ rebuilt_server = self.client.rebuild_server(self.server_id,
+ self.image_ref_alt,
+ name=new_name,
+ metadata=meta,
+ personality=personality,
+ adminPass=password)
# If the server was rebuilt on a different image, restore it to the
# original image once the test ends
@@ -193,7 +193,7 @@
if old_image == self.image_ref else self.image_ref)
self.client.stop(self.server_id)
waiters.wait_for_server_status(self.client, self.server_id, 'SHUTOFF')
- rebuilt_server = self.client.rebuild(self.server_id, new_image)
+ rebuilt_server = self.client.rebuild_server(self.server_id, new_image)
# If the server was rebuilt on a different image, restore it to the
# original image once the test ends
if self.image_ref_alt != self.image_ref:
@@ -223,7 +223,7 @@
waiters.wait_for_server_status(self.client, self.server_id,
'SHUTOFF')
- self.client.resize(self.server_id, self.flavor_ref_alt)
+ self.client.resize_server(self.server_id, self.flavor_ref_alt)
waiters.wait_for_server_status(self.client, self.server_id,
'VERIFY_RESIZE')
@@ -262,7 +262,7 @@
# The server's RAM and disk space should return to its original
# values after a resize is reverted
- self.client.resize(self.server_id, self.flavor_ref_alt)
+ self.client.resize_server(self.server_id, self.flavor_ref_alt)
waiters.wait_for_server_status(self.client, self.server_id,
'VERIFY_RESIZE')
@@ -375,7 +375,7 @@
# log file is truncated and we cannot get any console log through
# "console-log" API.
# The detail is https://bugs.launchpad.net/nova/+bug/1251920
- self.client.reboot(self.server_id, 'HARD')
+ self.client.reboot_server(self.server_id, 'HARD')
waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
self.wait_for(self._get_output)
@@ -456,7 +456,7 @@
server = self.client.show_server(self.server_id)
image_name = server['name'] + '-shelved'
params = {'name': image_name}
- images = self.images_client.list_images(**params)
+ images = self.images_client.list_images(**params)['images']
self.assertEqual(1, len(images))
self.assertEqual(image_name, images[0]['name'])
diff --git a/tempest/api/compute/servers/test_server_group.py b/tempest/api/compute/servers/test_server_group.py
index 0e7c1eb..0da7912 100644
--- a/tempest/api/compute/servers/test_server_group.py
+++ b/tempest/api/compute/servers/test_server_group.py
@@ -61,7 +61,7 @@
# delete the test server-group
self.client.delete_server_group(server_group['id'])
# validation of server-group deletion
- server_group_list = self.client.list_server_groups()
+ server_group_list = self.client.list_server_groups()['server_groups']
self.assertNotIn(server_group, server_group_list)
def _create_delete_server_group(self, policy):
@@ -107,11 +107,11 @@
def test_get_server_group(self):
# Get the server-group
body = self.client.get_server_group(
- self.created_server_group['id'])
+ self.created_server_group['id'])['server_group']
self.assertEqual(self.created_server_group, body)
@test.idempotent_id('d4874179-27b4-4d7d-80e4-6c560cdfe321')
def test_list_server_groups(self):
# List the server-group
- body = self.client.list_server_groups()
+ body = self.client.list_server_groups()['server_groups']
self.assertIn(self.created_server_group, body)
diff --git a/tempest/api/compute/servers/test_server_metadata_negative.py b/tempest/api/compute/servers/test_server_metadata_negative.py
index c42ec3d..5804dbe 100644
--- a/tempest/api/compute/servers/test_server_metadata_negative.py
+++ b/tempest/api/compute/servers/test_server_metadata_negative.py
@@ -137,7 +137,7 @@
# A 403 Forbidden or 413 Overlimit (old behaviour) exception
# will be raised while exceeding metadata items limit for
# tenant.
- quota_set = self.quotas.show_quota_set(self.tenant_id)
+ quota_set = self.quotas.show_quota_set(self.tenant_id)['quota_set']
quota_metadata = quota_set['metadata_items']
if quota_metadata == -1:
raise self.skipException("No limit for metadata_items")
diff --git a/tempest/api/compute/servers/test_server_rescue.py b/tempest/api/compute/servers/test_server_rescue.py
index 7e09096..96ce45e 100644
--- a/tempest/api/compute/servers/test_server_rescue.py
+++ b/tempest/api/compute/servers/test_server_rescue.py
@@ -41,7 +41,7 @@
super(ServerRescueTestJSON, cls).resource_setup()
# Floating IP creation
- body = cls.floating_ips_client.create_floating_ip()
+ body = cls.floating_ips_client.create_floating_ip()['floating_ip']
cls.floating_ip_id = str(body['id']).strip()
cls.floating_ip = str(body['ip']).strip()
@@ -49,7 +49,7 @@
cls.sg_name = data_utils.rand_name('sg')
cls.sg_desc = data_utils.rand_name('sg-desc')
cls.sg = cls.security_groups_client.create_security_group(
- name=cls.sg_name, description=cls.sg_desc)
+ name=cls.sg_name, description=cls.sg_desc)['security_group']
cls.sg_id = cls.sg['id']
# Server for positive tests
diff --git a/tempest/api/compute/servers/test_server_rescue_negative.py b/tempest/api/compute/servers/test_server_rescue_negative.py
index 7a25526..9d06188 100644
--- a/tempest/api/compute/servers/test_server_rescue_negative.py
+++ b/tempest/api/compute/servers/test_server_rescue_negative.py
@@ -61,7 +61,7 @@
def _create_volume(self):
volume = self.volumes_extensions_client.create_volume(
- CONF.volume.volume_size, display_name=data_utils.rand_name(
+ size=CONF.volume.volume_size, display_name=data_utils.rand_name(
self.__class__.__name__ + '_volume'))
self.addCleanup(self.delete_volume, volume['id'])
waiters.wait_for_volume_status(self.volumes_extensions_client,
@@ -100,7 +100,7 @@
@test.attr(type=['negative'])
@test.idempotent_id('db22b618-f157-4566-a317-1b6d467a8094')
def test_rescued_vm_reboot(self):
- self.assertRaises(lib_exc.Conflict, self.servers_client.reboot,
+ self.assertRaises(lib_exc.Conflict, self.servers_client.reboot_server,
self.rescue_id, 'HARD')
@test.attr(type=['negative'])
@@ -116,7 +116,7 @@
@test.idempotent_id('70cdb8a1-89f8-437d-9448-8844fd82bf46')
def test_rescued_vm_rebuild(self):
self.assertRaises(lib_exc.Conflict,
- self.servers_client.rebuild,
+ self.servers_client.rebuild_server,
self.rescue_id,
self.image_ref_alt)
diff --git a/tempest/api/compute/servers/test_servers_negative.py b/tempest/api/compute/servers/test_servers_negative.py
index f5d99fc..8f81de0 100644
--- a/tempest/api/compute/servers/test_servers_negative.py
+++ b/tempest/api/compute/servers/test_servers_negative.py
@@ -122,7 +122,7 @@
# Resize a non-existent server
nonexistent_server = data_utils.rand_uuid()
self.assertRaises(lib_exc.NotFound,
- self.client.resize,
+ self.client.resize_server,
nonexistent_server, self.flavor_ref)
@test.idempotent_id('ced1a1d7-2ab6-45c9-b90f-b27d87b30efd')
@@ -132,7 +132,7 @@
def test_resize_server_with_non_existent_flavor(self):
# Resize a server with non-existent flavor
nonexistent_flavor = data_utils.rand_uuid()
- self.assertRaises(lib_exc.BadRequest, self.client.resize,
+ self.assertRaises(lib_exc.BadRequest, self.client.resize_server,
self.server_id, flavor_ref=nonexistent_flavor)
@test.idempotent_id('45436a7d-a388-4a35-a9d8-3adc5d0d940b')
@@ -141,7 +141,7 @@
@test.attr(type=['negative'])
def test_resize_server_with_null_flavor(self):
# Resize a server with null flavor
- self.assertRaises(lib_exc.BadRequest, self.client.resize,
+ self.assertRaises(lib_exc.BadRequest, self.client.resize_server,
self.server_id, flavor_ref="")
@test.attr(type=['negative'])
@@ -149,7 +149,7 @@
def test_reboot_non_existent_server(self):
# Reboot a non existent server
nonexistent_server = data_utils.rand_uuid()
- self.assertRaises(lib_exc.NotFound, self.client.reboot,
+ self.assertRaises(lib_exc.NotFound, self.client.reboot_server,
nonexistent_server, 'SOFT')
@test.idempotent_id('d1417e7f-a509-41b5-a102-d5eed8613369')
@@ -174,9 +174,9 @@
waiters.wait_for_server_termination(self.client, server['id'])
self.assertRaises(lib_exc.NotFound,
- self.client.rebuild,
+ self.client.rebuild_server,
server['id'], self.image_ref_alt)
- self.assertRaises(lib_exc.NotFound, self.client.reboot,
+ self.assertRaises(lib_exc.NotFound, self.client.reboot_server,
server['id'], 'SOFT')
@test.attr(type=['negative'])
@@ -185,7 +185,7 @@
# Rebuild a non existent server
nonexistent_server = data_utils.rand_uuid()
self.assertRaises(lib_exc.NotFound,
- self.client.rebuild,
+ self.client.rebuild_server,
nonexistent_server,
self.image_ref_alt)
@@ -480,7 +480,7 @@
server = self.client.show_server(self.server_id)
image_name = server['name'] + '-shelved'
params = {'name': image_name}
- images = self.images_client.list_images(**params)
+ images = self.images_client.list_images(**params)['images']
self.assertEqual(1, len(images))
self.assertEqual(image_name, images[0]['name'])
diff --git a/tempest/api/compute/test_authorization.py b/tempest/api/compute/test_authorization.py
index b542d7f..b5a24c7 100644
--- a/tempest/api/compute/test_authorization.py
+++ b/tempest/api/compute/test_authorization.py
@@ -76,7 +76,7 @@
body = cls.glance_client.update_image(image_id,
data=image_file)['image']
cls.glance_client.wait_for_image_status(image_id, 'active')
- cls.image = cls.images_client.show_image(image_id)
+ cls.image = cls.images_client.show_image(image_id)['image']
cls.keypairname = data_utils.rand_name('keypair')
cls.keypairs_client.create_keypair(name=cls.keypairname)
@@ -84,7 +84,7 @@
name = data_utils.rand_name('security')
description = data_utils.rand_name('description')
cls.security_group = cls.security_client.create_security_group(
- name=name, description=description)
+ name=name, description=description)['security_group']
parent_group_id = cls.security_group['id']
ip_protocol = 'tcp'
@@ -92,7 +92,7 @@
to_port = 22
cls.rule = cls.rule_client.create_security_group_rule(
parent_group_id=parent_group_id, ip_protocol=ip_protocol,
- from_port=from_port, to_port=to_port)
+ from_port=from_port, to_port=to_port)['security_group_rule']
@classmethod
def resource_cleanup(cls):
@@ -155,19 +155,19 @@
@test.idempotent_id('14cb5ff5-f646-45ca-8f51-09081d6c0c24')
def test_reboot_server_for_alt_account_fails(self):
# A reboot request for another user's server should fail
- self.assertRaises(lib_exc.NotFound, self.alt_client.reboot,
+ self.assertRaises(lib_exc.NotFound, self.alt_client.reboot_server,
self.server['id'], 'HARD')
@test.idempotent_id('8a0bce51-cd00-480b-88ba-dbc7d8408a37')
def test_rebuild_server_for_alt_account_fails(self):
# A rebuild request for another user's server should fail
- self.assertRaises(lib_exc.NotFound, self.alt_client.rebuild,
+ self.assertRaises(lib_exc.NotFound, self.alt_client.rebuild_server,
self.server['id'], self.image_ref_alt)
@test.idempotent_id('e4da647e-f982-4e61-9dad-1d1abebfb933')
def test_resize_server_for_alt_account_fails(self):
# A resize request for another user's server should fail
- self.assertRaises(lib_exc.NotFound, self.alt_client.resize,
+ self.assertRaises(lib_exc.NotFound, self.alt_client.resize_server,
self.server['id'], self.flavor_ref_alt)
@test.idempotent_id('a9fe8112-0ffa-4902-b061-f892bd5fe0d3')
diff --git a/tempest/api/compute/test_networks.py b/tempest/api/compute/test_networks.py
index deb9ee2..bf2a78d 100644
--- a/tempest/api/compute/test_networks.py
+++ b/tempest/api/compute/test_networks.py
@@ -33,5 +33,5 @@
@test.idempotent_id('3fe07175-312e-49a5-a623-5f52eeada4c2')
def test_list_networks(self):
- networks = self.client.list_networks()
+ networks = self.client.list_networks()['networks']
self.assertNotEmpty(networks, "No networks found.")
diff --git a/tempest/api/compute/test_quotas.py b/tempest/api/compute/test_quotas.py
index 9f37143..43f4c97 100644
--- a/tempest/api/compute/test_quotas.py
+++ b/tempest/api/compute/test_quotas.py
@@ -54,14 +54,14 @@
def test_get_quotas(self):
# User can get the quota set for it's tenant
expected_quota_set = self.default_quota_set | set(['id'])
- quota_set = self.client.show_quota_set(self.tenant_id)
+ quota_set = self.client.show_quota_set(self.tenant_id)['quota_set']
self.assertEqual(quota_set['id'], self.tenant_id)
for quota in expected_quota_set:
self.assertIn(quota, quota_set.keys())
# get the quota set using user id
quota_set = self.client.show_quota_set(self.tenant_id,
- self.user_id)
+ self.user_id)['quota_set']
self.assertEqual(quota_set['id'], self.tenant_id)
for quota in expected_quota_set:
self.assertIn(quota, quota_set.keys())
@@ -70,7 +70,8 @@
def test_get_default_quotas(self):
# User can get the default quota set for it's tenant
expected_quota_set = self.default_quota_set | set(['id'])
- quota_set = self.client.show_default_quota_set(self.tenant_id)
+ quota_set = (self.client.show_default_quota_set(self.tenant_id)
+ ['quota_set'])
self.assertEqual(quota_set['id'], self.tenant_id)
for quota in expected_quota_set:
self.assertIn(quota, quota_set.keys())
@@ -79,6 +80,7 @@
def test_compare_tenant_quotas_with_default_quotas(self):
# Tenants are created with the default quota values
defualt_quota_set = \
- self.client.show_default_quota_set(self.tenant_id)
- tenant_quota_set = self.client.show_quota_set(self.tenant_id)
+ self.client.show_default_quota_set(self.tenant_id)['quota_set']
+ tenant_quota_set = (self.client.show_quota_set(self.tenant_id)
+ ['quota_set'])
self.assertEqual(defualt_quota_set, tenant_quota_set)
diff --git a/tempest/api/compute/test_tenant_networks.py b/tempest/api/compute/test_tenant_networks.py
index ad5adaa..11f572e 100644
--- a/tempest/api/compute/test_tenant_networks.py
+++ b/tempest/api/compute/test_tenant_networks.py
@@ -25,9 +25,10 @@
@test.idempotent_id('edfea98e-bbe3-4c7a-9739-87b986baff26')
def test_list_show_tenant_networks(self):
- tenant_networks = self.client.list_tenant_networks()
+ tenant_networks = self.client.list_tenant_networks()['networks']
self.assertNotEmpty(tenant_networks, "No tenant networks found.")
for net in tenant_networks:
- tenant_network = self.client.show_tenant_network(net['id'])
+ tenant_network = (self.client.show_tenant_network(net['id'])
+ ['network'])
self.assertEqual(net['id'], tenant_network['id'])
diff --git a/tempest/api/compute/v2/__init__.py b/tempest/api/compute/v2/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/api/compute/v2/__init__.py
+++ /dev/null
diff --git a/tempest/api/compute/volumes/test_volumes_get.py b/tempest/api/compute/volumes/test_volumes_get.py
index 44339a3..f05a5a3 100644
--- a/tempest/api/compute/volumes/test_volumes_get.py
+++ b/tempest/api/compute/volumes/test_volumes_get.py
@@ -46,7 +46,8 @@
v_name = data_utils.rand_name('Volume')
metadata = {'Type': 'work'}
# Create volume
- volume = self.client.create_volume(display_name=v_name,
+ volume = self.client.create_volume(size=CONF.volume.volume_size,
+ display_name=v_name,
metadata=metadata)
self.addCleanup(self.delete_volume, volume['id'])
self.assertIn('id', volume)
diff --git a/tempest/api/compute/volumes/test_volumes_list.py b/tempest/api/compute/volumes/test_volumes_list.py
index 22b3d13..421d96f 100644
--- a/tempest/api/compute/volumes/test_volumes_list.py
+++ b/tempest/api/compute/volumes/test_volumes_list.py
@@ -54,7 +54,8 @@
v_name = data_utils.rand_name('volume')
metadata = {'Type': 'work'}
try:
- volume = cls.client.create_volume(display_name=v_name,
+ volume = cls.client.create_volume(size=CONF.volume.volume_size,
+ display_name=v_name,
metadata=metadata)
waiters.wait_for_volume_status(cls.client,
volume['id'], 'available')
diff --git a/tempest/api/database/flavors/test_flavors.py b/tempest/api/database/flavors/test_flavors.py
index e698baa..c97ddd7 100644
--- a/tempest/api/database/flavors/test_flavors.py
+++ b/tempest/api/database/flavors/test_flavors.py
@@ -58,7 +58,8 @@
@test.services('compute')
def test_compare_db_flavors_with_os(self):
db_flavors = self.client.list_db_flavors()
- os_flavors = self.os_flavors_client.list_flavors(detail=True)
+ os_flavors = (self.os_flavors_client.list_flavors(detail=True)
+ ['flavors'])
self.assertEqual(len(os_flavors), len(db_flavors),
"OS flavors %s do not match DB flavors %s" %
(os_flavors, db_flavors))
diff --git a/tempest/api/identity/admin/v3/test_policies.py b/tempest/api/identity/admin/v3/test_policies.py
index 8b67945..d079fec 100644
--- a/tempest/api/identity/admin/v3/test_policies.py
+++ b/tempest/api/identity/admin/v3/test_policies.py
@@ -32,12 +32,12 @@
blob = data_utils.rand_name('BlobName')
policy_type = data_utils.rand_name('PolicyType')
policy = self.policy_client.create_policy(blob,
- policy_type)
+ policy_type)['policy']
# Delete the Policy at the end of this method
self.addCleanup(self._delete_policy, policy['id'])
policy_ids.append(policy['id'])
# List and Verify Policies
- body = self.policy_client.list_policies()
+ body = self.policy_client.list_policies()['policies']
for p in body:
fetched_ids.append(p['id'])
missing_pols = [p for p in policy_ids if p not in fetched_ids]
@@ -49,7 +49,7 @@
# Test to update policy
blob = data_utils.rand_name('BlobName')
policy_type = data_utils.rand_name('PolicyType')
- policy = self.policy_client.create_policy(blob, policy_type)
+ policy = self.policy_client.create_policy(blob, policy_type)['policy']
self.addCleanup(self._delete_policy, policy['id'])
self.assertIn('id', policy)
self.assertIn('type', policy)
@@ -60,10 +60,10 @@
# Update policy
update_type = data_utils.rand_name('UpdatedPolicyType')
data = self.policy_client.update_policy(
- policy['id'], type=update_type)
+ policy['id'], type=update_type)['policy']
self.assertIn('type', data)
# Assertion for updated value with fetched value
- fetched_policy = self.policy_client.get_policy(policy['id'])
+ fetched_policy = self.policy_client.get_policy(policy['id'])['policy']
self.assertIn('id', fetched_policy)
self.assertIn('blob', fetched_policy)
self.assertIn('type', fetched_policy)
diff --git a/tempest/api/identity/admin/v3/test_trusts.py b/tempest/api/identity/admin/v3/test_trusts.py
index b8700a6..fac8826 100644
--- a/tempest/api/identity/admin/v3/test_trusts.py
+++ b/tempest/api/identity/admin/v3/test_trusts.py
@@ -34,7 +34,6 @@
if not CONF.identity_feature_enabled.trust:
raise self.skipException("Trusts aren't enabled")
- self.trustee_username = CONF.identity.alt_username
self.trust_id = None
def tearDown(self):
diff --git a/tempest/api/identity/v3/test_api_discovery.py b/tempest/api/identity/v3/test_api_discovery.py
index 2ec8ad8..e0207a9 100644
--- a/tempest/api/identity/v3/test_api_discovery.py
+++ b/tempest/api/identity/v3/test_api_discovery.py
@@ -23,7 +23,7 @@
@test.attr(type='smoke')
@test.idempotent_id('b9232f5e-d9e5-4d97-b96c-28d3db4de1bd')
def test_api_version_resources(self):
- descr = self.non_admin_client.get_api_description()
+ descr = self.non_admin_client.get_api_description()['version']
expected_resources = ('id', 'links', 'media-types', 'status',
'updated')
@@ -34,7 +34,7 @@
@test.attr(type='smoke')
@test.idempotent_id('657c1970-4722-4189-8831-7325f3bc4265')
def test_api_media_types(self):
- descr = self.non_admin_client.get_api_description()
+ descr = self.non_admin_client.get_api_description()['version']
# Get MIME type bases and descriptions
media_types = [(media_type['base'], media_type['type']) for
media_type in descr['media-types']]
@@ -49,7 +49,7 @@
@test.attr(type='smoke')
@test.idempotent_id('8879a470-abfb-47bb-bb8d-5a7fd279ad1e')
def test_api_version_statuses(self):
- descr = self.non_admin_client.get_api_description()
+ descr = self.non_admin_client.get_api_description()['version']
status = descr['status'].lower()
supported_statuses = ['current', 'stable', 'experimental',
'supported', 'deprecated']
diff --git a/tempest/api/image/admin/v2/test_images.py b/tempest/api/image/admin/v2/test_images.py
index 1608b76..09877ba 100644
--- a/tempest/api/image/admin/v2/test_images.py
+++ b/tempest/api/image/admin/v2/test_images.py
@@ -20,7 +20,7 @@
from tempest.api.image import base
from tempest import config
from tempest import test
-
+from tempest_lib import exceptions as lib_exc
CONF = config.CONF
@@ -43,13 +43,20 @@
image_id = body['id']
self.addCleanup(self.client.delete_image, image_id)
# upload an image file
- image_file = moves.cStringIO(data_utils.random_bytes())
+ content = data_utils.random_bytes()
+ image_file = moves.cStringIO(content)
self.client.store_image_file(image_id, image_file)
# deactivate image
self.admin_client.deactivate_image(image_id)
body = self.client.show_image(image_id)
self.assertEqual("deactivated", body['status'])
+ # non-admin user unable to download deactivated image
+ self.assertRaises(lib_exc.Forbidden, self.client.load_image_file,
+ image_id)
# reactivate image
self.admin_client.reactivate_image(image_id)
body = self.client.show_image(image_id)
self.assertEqual("active", body['status'])
+ # non-admin user able to download image after reactivation by admin
+ body = self.client.load_image_file(image_id)
+ self.assertEqual(content, body.data)
diff --git a/tempest/api/image/v1/test_images.py b/tempest/api/image/v1/test_images.py
index 7739d16..d4dbfcd 100644
--- a/tempest/api/image/v1/test_images.py
+++ b/tempest/api/image/v1/test_images.py
@@ -119,9 +119,6 @@
img7 = cls._create_standard_image('33', 'bare', 'raw', 142)
img8 = cls._create_standard_image('33', 'bare', 'raw', 142)
cls.created_set = set(cls.created_images)
- # 4x-4x remote image
- cls.remote_set = set((img1, img2, img3, img4))
- cls.standard_set = set((img5, img6, img7, img8))
# 5x bare, 3x ami
cls.bare_set = set((img1, img3, img4, img7, img8))
cls.ami_set = set((img2, img5, img6))
diff --git a/tempest/api/network/admin/test_dhcp_agent_scheduler.py b/tempest/api/network/admin/test_dhcp_agent_scheduler.py
index 4a86aca..86b4973 100644
--- a/tempest/api/network/admin/test_dhcp_agent_scheduler.py
+++ b/tempest/api/network/admin/test_dhcp_agent_scheduler.py
@@ -32,7 +32,6 @@
# dhcp agent: this is done by creating a regular port
cls.network = cls.create_network()
cls.subnet = cls.create_subnet(cls.network)
- cls.cidr = cls.subnet['cidr']
cls.port = cls.create_port(cls.network)
@test.idempotent_id('5032b1fe-eb42-4a64-8f3b-6e189d8b5c7d')
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index fda8fc3..fa6fa33 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -77,7 +77,6 @@
@classmethod
def resource_setup(cls):
super(BaseNetworkTest, cls).resource_setup()
- cls.network_cfg = CONF.network
cls.networks = []
cls.subnets = []
cls.ports = []
diff --git a/tempest/api/network/test_extensions.py b/tempest/api/network/test_extensions.py
index be7174b..f56688f 100644
--- a/tempest/api/network/test_extensions.py
+++ b/tempest/api/network/test_extensions.py
@@ -39,7 +39,8 @@
'ext-gw-mode', 'binding', 'quotas',
'agent', 'dhcp_agent_scheduler', 'provider',
'router', 'extraroute', 'external-net',
- 'allowed-address-pairs', 'extra_dhcp_opt']
+ 'allowed-address-pairs', 'extra_dhcp_opt',
+ 'metering', 'dvr', 'service-type']
expected_alias = [ext for ext in expected_alias if
test.is_extension_enabled(ext, 'network')]
actual_alias = list()
diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py
index 842a56d..5685be8 100644
--- a/tempest/api/network/test_networks.py
+++ b/tempest/api/network/test_networks.py
@@ -66,7 +66,6 @@
cls.name = cls.network['name']
cls.subnet = cls._create_subnet_with_last_subnet_block(cls.network,
cls._ip_version)
- cls.cidr = cls.subnet['cidr']
cls._subnet_data = {6: {'gateway':
str(cls._get_gateway_from_tempest_conf(6)),
'allocation_pools':
diff --git a/tempest/api/network/test_routers.py b/tempest/api/network/test_routers.py
index 1308414..aa3d274 100644
--- a/tempest/api/network/test_routers.py
+++ b/tempest/api/network/test_routers.py
@@ -275,7 +275,7 @@
next_cidr = netaddr.IPNetwork(self.tenant_cidr)
# Prepare to build several routes
test_routes = []
- routes_num = 5
+ routes_num = 4
# Create a router
router = self._create_router(
data_utils.rand_name('router-'), True)
diff --git a/tempest/api/object_storage/test_container_services.py b/tempest/api/object_storage/test_container_services.py
index 0f107f5..1cc9437 100644
--- a/tempest/api/object_storage/test_container_services.py
+++ b/tempest/api/object_storage/test_container_services.py
@@ -321,7 +321,7 @@
self.assertNotIn('x-container-meta-', str(resp))
@test.idempotent_id('cf19bc0b-7e16-4a5a-aaed-cb0c2fe8deef')
- def test_update_container_metadata_with_create_and_delete_matadata(self):
+ def test_update_container_metadata_with_create_and_delete_metadata(self):
# Send one request of adding and deleting metadata
container_name = data_utils.rand_name(name='TestContainer')
metadata_1 = {'test-container-meta1': 'Meta1'}
@@ -379,8 +379,8 @@
self.assertNotIn('x-container-meta-test-container-meta1', resp)
@test.idempotent_id('31f40a5f-6a52-4314-8794-cd89baed3040')
- def test_update_container_metadata_with_create_matadata_key(self):
- # update container metadata with a blenk value of metadata
+ def test_update_container_metadata_with_create_metadata_key(self):
+ # update container metadata with a blank value of metadata
container_name = self._create_container()
metadata = {'test-container-meta1': ''}
@@ -395,7 +395,7 @@
@test.idempotent_id('a2e36378-6f1f-43f4-840a-ffd9cfd61914')
def test_update_container_metadata_with_delete_metadata_key(self):
- # update container metadata with a blank value of matadata
+ # update container metadata with a blank value of metadata
container_name = data_utils.rand_name(name='TestContainer')
metadata = {'test-container-meta1': 'Meta1'}
self.container_client.create_container(container_name,
diff --git a/tempest/api/object_storage/test_object_services.py b/tempest/api/object_storage/test_object_services.py
index 2198753..d64efee 100644
--- a/tempest/api/object_storage/test_object_services.py
+++ b/tempest/api/object_storage/test_object_services.py
@@ -811,7 +811,7 @@
@test.idempotent_id('aa467252-44f3-472a-b5ae-5b57c3c9c147')
def test_copy_object_across_containers(self):
- # create a container to use as asource container
+ # create a container to use as a source container
src_container_name = data_utils.rand_name(name='TestSourceContainer')
self.container_client.create_container(src_container_name)
self.containers.append(src_container_name)
diff --git a/tempest/api/volume/admin/test_volumes_backup.py b/tempest/api/volume/admin/test_volumes_backup.py
index 8015c35..86fa668 100644
--- a/tempest/api/volume/admin/test_volumes_backup.py
+++ b/tempest/api/volume/admin/test_volumes_backup.py
@@ -48,7 +48,7 @@
backup_name = data_utils.rand_name('Backup')
create_backup = self.backups_adm_client.create_backup
backup = create_backup(self.volume['id'],
- name=backup_name)
+ name=backup_name)['backup']
self.addCleanup(self.backups_adm_client.delete_backup,
backup['id'])
self.assertEqual(backup_name, backup['name'])
@@ -58,16 +58,17 @@
'available')
# Get a given backup
- backup = self.backups_adm_client.show_backup(backup['id'])
+ backup = self.backups_adm_client.show_backup(backup['id'])['backup']
self.assertEqual(backup_name, backup['name'])
# Get all backups with detail
- backups = self.backups_adm_client.list_backups(detail=True)
+ backups = self.backups_adm_client.list_backups(detail=True)['backups']
self.assertIn((backup['name'], backup['id']),
[(m['name'], m['id']) for m in backups])
# Restore backup
- restore = self.backups_adm_client.restore_backup(backup['id'])
+ restore = self.backups_adm_client.restore_backup(
+ backup['id'])['restore']
# Delete backup
self.addCleanup(self.admin_volume_client.delete_volume,
@@ -82,15 +83,17 @@
def test_volume_backup_export_import(self):
# Create backup
backup_name = data_utils.rand_name('Backup')
- backup = self.backups_adm_client.create_backup(self.volume['id'],
- name=backup_name)
+ backup = (self.backups_adm_client.create_backup(self.volume['id'],
+ name=backup_name)
+ ['backup'])
self.addCleanup(self._delete_backup, backup['id'])
self.assertEqual(backup_name, backup['name'])
self.backups_adm_client.wait_for_backup_status(backup['id'],
'available')
# Export Backup
- export_backup = self.backups_adm_client.export_backup(backup['id'])
+ export_backup = (self.backups_adm_client.export_backup(backup['id'])
+ ['backup-record'])
self.assertIn('backup_service', export_backup)
self.assertIn('backup_url', export_backup)
self.assertTrue(export_backup['backup_service'].startswith(
@@ -100,18 +103,19 @@
# Import Backup
import_backup = self.backups_adm_client.import_backup(
backup_service=export_backup['backup_service'],
- backup_url=export_backup['backup_url'])
+ backup_url=export_backup['backup_url'])['backup']
self.addCleanup(self._delete_backup, import_backup['id'])
self.assertIn("id", import_backup)
self.backups_adm_client.wait_for_backup_status(import_backup['id'],
'available')
# Verify Import Backup
- backups = self.backups_adm_client.list_backups(detail=True)
+ backups = self.backups_adm_client.list_backups(detail=True)['backups']
self.assertIn(import_backup['id'], [b['id'] for b in backups])
# Restore backup
- restore = self.backups_adm_client.restore_backup(import_backup['id'])
+ restore = (self.backups_adm_client.restore_backup(import_backup['id'])
+ ['restore'])
self.addCleanup(self.admin_volume_client.delete_volume,
restore['volume_id'])
self.assertEqual(import_backup['id'], restore['backup_id'])
diff --git a/tempest/api/volume/test_volumes_actions.py b/tempest/api/volume/test_volumes_actions.py
index 58c5ba9..79615b3 100644
--- a/tempest/api/volume/test_volumes_actions.py
+++ b/tempest/api/volume/test_volumes_actions.py
@@ -45,10 +45,6 @@
cls.volume = cls.create_volume()
cls.client.wait_for_volume_status(cls.volume['id'], 'available')
- def _delete_image_with_wait(self, image_id):
- self.image_client.delete_image(image_id)
- self.image_client.wait_for_resource_deletion(image_id)
-
@classmethod
def resource_cleanup(cls):
# Delete the test instance
diff --git a/tempest/api/volume/test_volumes_get.py b/tempest/api/volume/test_volumes_get.py
index a90f9ca..9db2321 100644
--- a/tempest/api/volume/test_volumes_get.py
+++ b/tempest/api/volume/test_volumes_get.py
@@ -131,7 +131,7 @@
@test.idempotent_id('54a01030-c7fc-447c-86ee-c1182beae638')
@test.services('image')
def test_volume_create_get_update_delete_from_image(self):
- image = self.images_client.show_image(CONF.compute.image_ref)
+ image = self.images_client.show_image(CONF.compute.image_ref)['image']
min_disk = image.get('minDisk')
disk_size = max(min_disk, CONF.volume.volume_size)
self._volume_create_get_update_delete(
diff --git a/tempest/clients.py b/tempest/clients.py
index 7cb4347..b9f7991 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -321,8 +321,7 @@
'build_timeout': CONF.volume.build_timeout
})
self.volumes_extensions_client = VolumesExtensionsClient(
- self.auth_provider, default_volume_size=CONF.volume.volume_size,
- **params_volume)
+ self.auth_provider, **params_volume)
def _set_database_clients(self):
self.database_flavors_client = DatabaseFlavorsClient(
diff --git a/tempest/cmd/cleanup_service.py b/tempest/cmd/cleanup_service.py
index 5ad33c8..365f37f 100644
--- a/tempest/cmd/cleanup_service.py
+++ b/tempest/cmd/cleanup_service.py
@@ -195,7 +195,7 @@
def list(self):
client = self.client
- sgs = client.list_server_groups()
+ sgs = client.list_server_groups()['server_groups']
LOG.debug("List count, %s Server Groups" % len(sgs))
return sgs
@@ -271,7 +271,7 @@
def list(self):
client = self.client
- secgrps = client.list_security_groups()
+ secgrps = client.list_security_groups()['security_groups']
secgrp_del = [grp for grp in secgrps if grp['name'] != 'default']
LOG.debug("List count, %s Security Groups" % len(secgrp_del))
return secgrp_del
@@ -297,7 +297,7 @@
def list(self):
client = self.client
- floating_ips = client.list_floating_ips()
+ floating_ips = client.list_floating_ips()['floating_ips']
LOG.debug("List count, %s Floating IPs" % len(floating_ips))
return floating_ips
@@ -731,7 +731,7 @@
def list(self):
client = self.client
- flavors = client.list_flavors({"is_public": None})
+ flavors = client.list_flavors({"is_public": None})['flavors']
if not self.is_save_state:
# recreate list removing saved flavors
flavors = [flavor for flavor in flavors if flavor['id']
@@ -770,7 +770,7 @@
def list(self):
client = self.client
- images = client.list_images({"all_tenants": True})
+ images = client.list_images({"all_tenants": True})['images']
if not self.is_save_state:
images = [image for image in images if image['id']
not in self.saved_state_json['images'].keys()]
diff --git a/tempest/cmd/javelin.py b/tempest/cmd/javelin.py
index 71aacbd..7f896d1 100755
--- a/tempest/cmd/javelin.py
+++ b/tempest/cmd/javelin.py
@@ -840,7 +840,7 @@
def _get_flavor_by_name(client, name):
- body = client.flavors.list_flavors()
+ body = client.flavors.list_flavors()['flavors']
for flavor in body:
if name == flavor['name']:
return flavor
@@ -878,7 +878,7 @@
if CONF.compute.use_floatingip_for_ssh:
floating_ip_pool = server.get('floating_ip_pool')
floating_ip = client.floating_ips.create_floating_ip(
- pool_name=floating_ip_pool)
+ pool_name=floating_ip_pool)['floating_ip']
client.floating_ips.associate_floating_ip_to_server(
floating_ip['ip'], server_id)
@@ -909,14 +909,15 @@
# only create a security group if the name isn't here
# i.e. a security group may be used by another server
# only create a router if the name isn't here
- body = client.secgroups.list_security_groups()
+ body = client.secgroups.list_security_groups()['security_groups']
if any(item['name'] == secgroup['name'] for item in body):
LOG.warning("Security group '%s' already exists" %
secgroup['name'])
continue
body = client.secgroups.create_security_group(
- name=secgroup['name'], description=secgroup['description'])
+ name=secgroup['name'],
+ description=secgroup['description'])['security_group']
secgroup_id = body['id']
# for each security group, create the rules
for rule in secgroup['rules']:
diff --git a/tempest/common/fixed_network.py b/tempest/common/fixed_network.py
index 9ec0ec6..b81830a 100644
--- a/tempest/common/fixed_network.py
+++ b/tempest/common/fixed_network.py
@@ -40,7 +40,7 @@
if not name:
raise exceptions.InvalidConfiguration()
- networks = compute_networks_client.list_networks()
+ networks = compute_networks_client.list_networks()['networks']
networks = [n for n in networks if n['label'] == name]
# Check that a network exists, else raise an InvalidConfigurationException
diff --git a/tempest/common/validation_resources.py b/tempest/common/validation_resources.py
index d018aed..debc200 100644
--- a/tempest/common/validation_resources.py
+++ b/tempest/common/validation_resources.py
@@ -28,7 +28,7 @@
sg_name = data_utils.rand_name('securitygroup-')
sg_description = data_utils.rand_name('description-')
security_group = security_groups_client.create_security_group(
- name=sg_name, description=sg_description)
+ name=sg_name, description=sg_description)['security_group']
if add_rule:
security_group_rules_client.create_security_group_rule(
parent_group_id=security_group['id'], ip_protocol='tcp',
@@ -59,8 +59,7 @@
create_ssh_security_group(os, add_rule)
if validation_resources['floating_ip']:
floating_client = os.floating_ips_client
- validation_data['floating_ip'] = \
- floating_client.create_floating_ip()
+ validation_data.update(floating_client.create_floating_ip())
return validation_data
diff --git a/tempest/common/waiters.py b/tempest/common/waiters.py
index 7aa4fc2..803ad6c 100644
--- a/tempest/common/waiters.py
+++ b/tempest/common/waiters.py
@@ -51,7 +51,7 @@
return
# NOTE(afazekas): The instance is in "ready for action state"
# when no task in progress
- # NOTE(afazekas): Converted to string bacuse of the XML
+ # NOTE(afazekas): Converted to string because of the XML
# responses
if str(task_state) == "None":
# without state api extension 3 sec usually enough
@@ -123,11 +123,19 @@
The client should also have build_interval and build_timeout attributes.
"""
image = client.show_image(image_id)
+ # Compute image client return response wrapped in 'image' element
+ # which is not case with glance image client.
+ if 'image' in image:
+ image = image['image']
start = int(time.time())
while image['status'] != status:
time.sleep(client.build_interval)
image = client.show_image(image_id)
+ # Compute image client return response wrapped in 'image' element
+ # which is not case with glance image client.
+ if 'image' in image:
+ image = image['image']
status_curr = image['status']
if status_curr == 'ERROR':
raise exceptions.AddImageException(image_id=image_id)
diff --git a/tempest/config.py b/tempest/config.py
index 0262d1b..b5f1de1 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -77,7 +77,7 @@
cfg.BoolOpt('create_isolated_networks',
default=True,
help="If allow_tenant_isolation is set to True and Neutron is "
- "enabled Tempest will try to create a useable network, "
+ "enabled Tempest will try to create a usable network, "
"subnet, and router when needed for each tenant it "
"creates. However in some neutron configurations, like "
"with VLAN provider networks, this doesn't work. So if "
@@ -881,7 +881,8 @@
help="Where the dashboard can be found"),
cfg.StrOpt('login_url',
default='http://localhost/auth/login/',
- help="Login page for the dashboard"),
+ help="Login page for the dashboard",
+ deprecated_for_removal=True),
]
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 7eb718e..a406aa3 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -18,6 +18,7 @@
import netaddr
from oslo_log import log
+from oslo_serialization import jsonutils as json
import six
from tempest_lib.common.utils import misc as misc_utils
from tempest_lib import exceptions as lib_exc
@@ -226,7 +227,7 @@
_client = self.security_groups_client
_client_rules = self.security_group_rules_client
if secgroup_id is None:
- sgs = _client.list_security_groups()
+ sgs = _client.list_security_groups()['security_groups']
for sg in sgs:
if sg['name'] == 'default':
secgroup_id = sg['id']
@@ -254,7 +255,7 @@
rules = list()
for ruleset in rulesets:
sg_rule = _client_rules.create_security_group_rule(
- parent_group_id=secgroup_id, **ruleset)
+ parent_group_id=secgroup_id, **ruleset)['security_group_rule']
self.addCleanup(self.delete_wrapper,
_client_rules.delete_security_group_rule,
sg_rule['id'])
@@ -266,7 +267,7 @@
sg_name = data_utils.rand_name(self.__class__.__name__)
sg_desc = sg_name + " description"
secgroup = self.security_groups_client.create_security_group(
- name=sg_name, description=sg_desc)
+ name=sg_name, description=sg_desc)['security_group']
self.assertEqual(secgroup['name'], sg_name)
self.assertEqual(secgroup['description'], sg_desc)
self.addCleanup(self.delete_wrapper,
@@ -416,6 +417,21 @@
cleanup_callable=self.delete_wrapper,
cleanup_args=[_image_client.delete_image, image_id])
snapshot_image = _image_client.get_image_meta(image_id)
+
+ bdm = snapshot_image.get('properties', {}).get('block_device_mapping')
+ if bdm:
+ bdm = json.loads(bdm)
+ if bdm and 'snapshot_id' in bdm[0]:
+ snapshot_id = bdm[0]['snapshot_id']
+ self.addCleanup(
+ self.snapshots_client.wait_for_resource_deletion,
+ snapshot_id)
+ self.addCleanup(
+ self.delete_wrapper, self.snapshots_client.delete_snapshot,
+ snapshot_id)
+ self.snapshots_client.wait_for_snapshot_status(snapshot_id,
+ 'available')
+
image_name = snapshot_image['name']
self.assertEqual(name, image_name)
LOG.debug("Created snapshot image %s for server %s",
@@ -449,9 +465,10 @@
LOG.debug("Rebuilding server (id: %s, image: %s, preserve eph: %s)",
server_id, image, preserve_ephemeral)
- self.servers_client.rebuild(server_id=server_id, image_ref=image,
- preserve_ephemeral=preserve_ephemeral,
- **rebuild_kwargs)
+ self.servers_client.rebuild_server(
+ server_id=server_id, image_ref=image,
+ preserve_ephemeral=preserve_ephemeral,
+ **rebuild_kwargs)
if wait:
waiters.wait_for_server_status(self.servers_client,
server_id, 'ACTIVE')
@@ -521,7 +538,8 @@
Nova clients
"""
- floating_ip = self.floating_ips_client.create_floating_ip(pool_name)
+ floating_ip = (self.floating_ips_client.create_floating_ip(pool_name)
+ ['floating_ip'])
self.addCleanup(self.delete_wrapper,
self.floating_ips_client.delete_floating_ip,
floating_ip['id'])
@@ -592,6 +610,12 @@
*args, **kwargs)
return ports_list['ports']
+ def _list_agents(self, *args, **kwargs):
+ """List agents using admin creds """
+ agents_list = self.admin_manager.network_client.list_agents(
+ *args, **kwargs)
+ return agents_list['agents']
+
def _create_subnet(self, network, client=None, namestart='subnet-smoke',
**kwargs):
"""
@@ -1092,6 +1116,7 @@
ports.append({'port': port.id})
if ports:
create_kwargs['networks'] = ports
+ self.ports = ports
return super(NetworkScenarioTest, self).create_server(
name=name, image=image, flavor=flavor,
diff --git a/tempest/scenario/test_aggregates_basic_ops.py b/tempest/scenario/test_aggregates_basic_ops.py
index fcde561..22d2603 100644
--- a/tempest/scenario/test_aggregates_basic_ops.py
+++ b/tempest/scenario/test_aggregates_basic_ops.py
@@ -46,7 +46,8 @@
cls.hosts_client = cls.manager.hosts_client
def _create_aggregate(self, **kwargs):
- aggregate = self.aggregates_client.create_aggregate(**kwargs)
+ aggregate = (self.aggregates_client.create_aggregate(**kwargs)
+ ['aggregate'])
self.addCleanup(self._delete_aggregate, aggregate)
aggregate_name = kwargs['name']
availability_zone = kwargs['availability_zone']
@@ -64,17 +65,19 @@
return computes[0]['host_name']
def _add_host(self, aggregate_id, host):
- aggregate = self.aggregates_client.add_host(aggregate_id, host=host)
+ aggregate = (self.aggregates_client.add_host(aggregate_id, host=host)
+ ['aggregate'])
self.addCleanup(self._remove_host, aggregate['id'], host)
self.assertIn(host, aggregate['hosts'])
def _remove_host(self, aggregate_id, host):
aggregate = self.aggregates_client.remove_host(aggregate_id, host=host)
- self.assertNotIn(host, aggregate['hosts'])
+ self.assertNotIn(host, aggregate['aggregate']['hosts'])
def _check_aggregate_details(self, aggregate, aggregate_name, azone,
hosts, metadata):
- aggregate = self.aggregates_client.show_aggregate(aggregate['id'])
+ aggregate = (self.aggregates_client.show_aggregate(aggregate['id'])
+ ['aggregate'])
self.assertEqual(aggregate_name, aggregate['name'])
self.assertEqual(azone, aggregate['availability_zone'])
self.assertEqual(hosts, aggregate['hosts'])
@@ -88,13 +91,14 @@
metadata=meta)
for key, value in meta.items():
- self.assertEqual(meta[key], aggregate['metadata'][key])
+ self.assertEqual(meta[key],
+ aggregate['aggregate']['metadata'][key])
def _update_aggregate(self, aggregate, aggregate_name,
availability_zone):
aggregate = self.aggregates_client.update_aggregate(
aggregate['id'], name=aggregate_name,
- availability_zone=availability_zone)
+ availability_zone=availability_zone)['aggregate']
self.assertEqual(aggregate['name'], aggregate_name)
self.assertEqual(aggregate['availability_zone'], availability_zone)
return aggregate
diff --git a/tempest/scenario/test_baremetal_basic_ops.py b/tempest/scenario/test_baremetal_basic_ops.py
index 346f56b..c0b5a44 100644
--- a/tempest/scenario/test_baremetal_basic_ops.py
+++ b/tempest/scenario/test_baremetal_basic_ops.py
@@ -101,14 +101,15 @@
def get_flavor_ephemeral_size(self):
"""Returns size of the ephemeral partition in GiB."""
f_id = self.instance['flavor']['id']
- flavor = self.flavors_client.show_flavor(f_id)
+ flavor = self.flavors_client.show_flavor(f_id)['flavor']
ephemeral = flavor.get('OS-FLV-EXT-DATA:ephemeral')
if not ephemeral or ephemeral == 'N/A':
return None
return int(ephemeral)
def add_floating_ip(self):
- floating_ip = self.floating_ips_client.create_floating_ip()
+ floating_ip = (self.floating_ips_client.create_floating_ip()
+ ['floating_ip'])
self.floating_ips_client.associate_floating_ip_to_server(
floating_ip['ip'], self.instance['id'])
return floating_ip['ip']
diff --git a/tempest/scenario/test_dashboard_basic_ops.py b/tempest/scenario/test_dashboard_basic_ops.py
index 8e91a6d..d5bad64 100644
--- a/tempest/scenario/test_dashboard_basic_ops.py
+++ b/tempest/scenario/test_dashboard_basic_ops.py
@@ -88,7 +88,7 @@
parser = HorizonHTMLParser()
parser.feed(response)
- # construct login url for dashboard, discovery accomodates non-/ web
+ # construct login url for dashboard, discovery accommodates non-/ web
# root for dashboard
login_url = CONF.dashboard.dashboard_url + parser.login[1:]
diff --git a/tempest/scenario/test_large_ops.py b/tempest/scenario/test_large_ops.py
index 4e6358e..2ad5d2d 100644
--- a/tempest/scenario/test_large_ops.py
+++ b/tempest/scenario/test_large_ops.py
@@ -87,7 +87,8 @@
# Since no traffic is tested, we don't need to actually add rules to
# secgroup
secgroup = self.security_groups_client.create_security_group(
- name='secgroup-%s' % name, description='secgroup-desc-%s' % name)
+ name='secgroup-%s' % name,
+ description='secgroup-desc-%s' % name)['security_group']
self.addCleanupClass(self.security_groups_client.delete_security_group,
secgroup['id'])
create_kwargs = {
diff --git a/tempest/scenario/test_minimum_basic.py b/tempest/scenario/test_minimum_basic.py
index f868382..c38ce2d 100644
--- a/tempest/scenario/test_minimum_basic.py
+++ b/tempest/scenario/test_minimum_basic.py
@@ -79,7 +79,7 @@
self.assertEqual(self.volume, volume)
def nova_reboot(self):
- self.servers_client.reboot(self.server['id'], 'SOFT')
+ self.servers_client.reboot_server(self.server['id'], 'SOFT')
self._wait_for_server_status('ACTIVE')
def check_partitions(self):
diff --git a/tempest/scenario/test_network_advanced_server_ops.py b/tempest/scenario/test_network_advanced_server_ops.py
index 3d233d8..71c48fe 100644
--- a/tempest/scenario/test_network_advanced_server_ops.py
+++ b/tempest/scenario/test_network_advanced_server_ops.py
@@ -111,7 +111,8 @@
@test.services('compute', 'network')
def test_server_connectivity_reboot(self):
self._setup_network_and_servers()
- self.servers_client.reboot(self.server['id'], reboot_type='SOFT')
+ self.servers_client.reboot_server(self.server['id'],
+ reboot_type='SOFT')
self._wait_server_status_and_check_network_connectivity()
@test.idempotent_id('88a529c2-1daa-4c85-9aec-d541ba3eb699')
@@ -119,8 +120,8 @@
def test_server_connectivity_rebuild(self):
self._setup_network_and_servers()
image_ref_alt = CONF.compute.image_ref_alt
- self.servers_client.rebuild(self.server['id'],
- image_ref=image_ref_alt)
+ self.servers_client.rebuild_server(self.server['id'],
+ image_ref=image_ref_alt)
self._wait_server_status_and_check_network_connectivity()
@test.idempotent_id('2b2642db-6568-4b35-b812-eceed3fa20ce')
@@ -159,7 +160,8 @@
msg = "Skipping test - flavor_ref and flavor_ref_alt are identical"
raise self.skipException(msg)
self._setup_network_and_servers()
- self.servers_client.resize(self.server['id'], flavor_ref=resize_flavor)
+ self.servers_client.resize_server(self.server['id'],
+ flavor_ref=resize_flavor)
waiters.wait_for_server_status(self.servers_client, self.server['id'],
'VERIFY_RESIZE')
self.servers_client.confirm_resize(self.server['id'])
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index 0662938..2a22c42 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -17,6 +17,7 @@
import re
from oslo_log import log as logging
+from tempest_lib import decorators
import testtools
from tempest.common.utils import data_utils
@@ -108,10 +109,12 @@
self.network, self.subnet, self.router = self.create_networks(**kwargs)
self.check_networks()
+ self.ports = []
self.port_id = None
if boot_with_port:
# create a port on the network and boot with that
self.port_id = self._create_port(self.network['id']).id
+ self.ports.append({'port': self.port_id})
name = data_utils.rand_name('server-smoke')
server = self._create_server(name, self.network, self.port_id)
@@ -632,7 +635,11 @@
# Setup the network, create a port and boot the server from that port.
self._setup_network_and_servers(boot_with_port=True)
_, server = self.floating_ip_tuple
- self.assertIsNotNone(self.port_id,
+ self.assertEqual(1, len(self.ports),
+ 'There should only be one port created for '
+ 'server %s.' % server['id'])
+ port_id = self.ports[0]['port']
+ self.assertIsNotNone(port_id,
'Server should have been created from a '
'pre-existing port.')
# Assert the port is bound to the server.
@@ -641,13 +648,79 @@
self.assertEqual(1, len(port_list),
'There should only be one port created for '
'server %s.' % server['id'])
- self.assertEqual(self.port_id, port_list[0]['id'])
+ self.assertEqual(port_id, port_list[0]['id'])
# Delete the server.
self.servers_client.delete_server(server['id'])
waiters.wait_for_server_termination(self.servers_client, server['id'])
# Assert the port still exists on the network but is unbound from
# the deleted server.
- port = self.network_client.show_port(self.port_id)['port']
+ port = self.network_client.show_port(port_id)['port']
self.assertEqual(self.network['id'], port['network_id'])
self.assertEqual('', port['device_id'])
self.assertEqual('', port['device_owner'])
+
+ @test.idempotent_id('2e788c46-fb3f-4ac9-8f82-0561555bea73')
+ @decorators.skip_because(bug="1489929")
+ @test.services('compute', 'network')
+ def test_router_rescheduling(self):
+ """Tests that router can be removed from agent and add to a new agent.
+
+ 1. Verify connectivity
+ 2. Remove router from all l3-agents
+ 3. Verify connectivity is down
+ 4. Assign router to new l3-agent (or old one if no new agent is
+ available)
+ 5. Verify connectivity
+ """
+
+ # TODO(yfried): refactor this test to be used for other agents (dhcp)
+ # as well
+
+ list_hosts = (self.admin_manager.network_client.
+ list_l3_agents_hosting_router)
+ schedule_router = (self.admin_manager.network_client.
+ add_router_to_l3_agent)
+ unschedule_router = (self.admin_manager.network_client.
+ remove_router_from_l3_agent)
+
+ agent_list = set(a["id"] for a in
+ self._list_agents(agent_type="L3 agent"))
+ self._setup_network_and_servers()
+ self.check_public_network_connectivity(should_connect=True)
+
+ # remove resource from agents
+ hosting_agents = set(a["id"] for a in
+ list_hosts(self.router.id)['agents'])
+ no_migration = agent_list == hosting_agents
+ LOG.info("Router will be assigned to {mig} hosting agent".
+ format(mig="the same" if no_migration else "a new"))
+
+ for hosting_agent in hosting_agents:
+ unschedule_router(hosting_agent, self.router.id)
+ self.assertNotIn(hosting_agent,
+ [a["id"] for a in
+ list_hosts(self.router.id)['agents']],
+ 'unscheduling router failed')
+
+ # verify resource is un-functional
+ self.check_public_network_connectivity(
+ should_connect=False,
+ msg='after router unscheduling',
+ should_check_floating_ip_status=False
+ )
+
+ # schedule resource to new agent
+ target_agent = list(hosting_agents if no_migration else
+ agent_list - hosting_agents)[0]
+ schedule_router(target_agent,
+ self.router['id'])
+ self.assertEqual(
+ target_agent,
+ list_hosts(self.router.id)['agents'][0]['id'],
+ "Router failed to reschedule. Hosting agent doesn't match "
+ "target agent")
+
+ # verify resource is functional
+ self.check_public_network_connectivity(
+ should_connect=True,
+ msg='After router rescheduling')
diff --git a/tempest/scenario/test_security_groups_basic_ops.py b/tempest/scenario/test_security_groups_basic_ops.py
index 18fd09d..1db1ac2 100644
--- a/tempest/scenario/test_security_groups_basic_ops.py
+++ b/tempest/scenario/test_security_groups_basic_ops.py
@@ -161,9 +161,6 @@
cls.floating_ip_access = not CONF.network.public_router_id
- def cleanup_wrapper(self, resource):
- self.cleanup_resource(resource, self.__class__.__name__)
-
def setUp(self):
super(TestSecurityGroupsBasicOps, self).setUp()
self._deploy_tenant(self.primary_tenant)
diff --git a/tempest/scenario/test_server_advanced_ops.py b/tempest/scenario/test_server_advanced_ops.py
index e405cf5..8693fb3 100644
--- a/tempest/scenario/test_server_advanced_ops.py
+++ b/tempest/scenario/test_server_advanced_ops.py
@@ -58,7 +58,7 @@
resize_flavor = CONF.compute.flavor_ref_alt
LOG.debug("Resizing instance %s from flavor %s to flavor %s",
instance['id'], instance['flavor']['id'], resize_flavor)
- self.servers_client.resize(instance_id, resize_flavor)
+ self.servers_client.resize_server(instance_id, resize_flavor)
waiters.wait_for_server_status(self.servers_client, instance_id,
'VERIFY_RESIZE')
diff --git a/tempest/scenario/test_server_basic_ops.py b/tempest/scenario/test_server_basic_ops.py
index 3019cc4..0f27cd1 100644
--- a/tempest/scenario/test_server_basic_ops.py
+++ b/tempest/scenario/test_server_basic_ops.py
@@ -83,7 +83,8 @@
def verify_ssh(self):
if self.run_ssh:
# Obtain a floating IP
- self.floating_ip = self.floating_ips_client.create_floating_ip()
+ self.floating_ip = (self.floating_ips_client.create_floating_ip()
+ ['floating_ip'])
self.addCleanup(self.delete_wrapper,
self.floating_ips_client.delete_floating_ip,
self.floating_ip['id'])
diff --git a/tempest/scenario/test_shelve_instance.py b/tempest/scenario/test_shelve_instance.py
index 02ee7b9..022306e 100644
--- a/tempest/scenario/test_shelve_instance.py
+++ b/tempest/scenario/test_shelve_instance.py
@@ -82,7 +82,8 @@
create_kwargs=create_kwargs)
if CONF.compute.use_floatingip_for_ssh:
- floating_ip = self.floating_ips_client.create_floating_ip()
+ floating_ip = (self.floating_ips_client.create_floating_ip()
+ ['floating_ip'])
self.addCleanup(self.delete_wrapper,
self.floating_ips_client.delete_floating_ip,
floating_ip['id'])
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index f69b7d2..4912033 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -48,7 +48,7 @@
vol_name = data_utils.rand_name('volume-origin')
return self.create_volume(name=vol_name, imageRef=img_uuid)
- def _boot_instance_from_volume(self, vol_id, keypair, security_group):
+ def _get_bdm(self, vol_id, delete_on_termination=False):
# NOTE(gfidente): the syntax for block_device_mapping is
# dev_name=id:type:size:delete_on_terminate
# where type needs to be "snap" if the server is booted
@@ -56,12 +56,20 @@
bd_map = [{
'device_name': 'vda',
'volume_id': vol_id,
- 'delete_on_termination': '0'}]
- create_kwargs = {
- 'block_device_mapping': bd_map,
- 'key_name': keypair['name'],
- 'security_groups': [{'name': security_group['name']}]
- }
+ 'delete_on_termination': str(int(delete_on_termination))}]
+ return {'block_device_mapping': bd_map}
+
+ def _boot_instance_from_volume(self, vol_id, keypair=None,
+ security_group=None,
+ delete_on_termination=False):
+ create_kwargs = dict()
+ if keypair:
+ create_kwargs['key_name'] = keypair['name']
+ if security_group:
+ create_kwargs['security_groups'] = [
+ {'name': security_group['name']}]
+ create_kwargs.update(self._get_bdm(
+ vol_id, delete_on_termination=delete_on_termination))
return self.create_server(image='', create_kwargs=create_kwargs)
def _create_snapshot_from_volume(self, vol_id):
@@ -89,16 +97,10 @@
waiters.wait_for_server_status(self.servers_client,
i['id'], 'SHUTOFF')
- def _detach_volumes(self, volumes):
- # NOTE(gfidente): two loops so we do not wait for the status twice
- for v in volumes:
- self.volumes_client.detach_volume(v['id'])
- for v in volumes:
- self.volumes_client.wait_for_volume_status(v['id'], 'available')
-
def _ssh_to_server(self, server, keypair):
if CONF.compute.use_floatingip_for_ssh:
- floating_ip = self.floating_ips_client.create_floating_ip()
+ floating_ip = (self.floating_ips_client.create_floating_ip()
+ ['floating_ip'])
self.addCleanup(self.delete_wrapper,
self.floating_ips_client.delete_floating_ip,
floating_ip['id'])
@@ -174,18 +176,34 @@
# deletion operations to succeed
self._stop_instances([instance_2nd, instance_from_snapshot])
+ @test.idempotent_id('36c34c67-7b54-4b59-b188-02a2f458a63b')
+ @test.services('compute', 'volume', 'image')
+ def test_create_ebs_image_and_check_boot(self):
+ # create an instance from volume
+ volume_origin = self._create_volume_from_image()
+ instance = self._boot_instance_from_volume(volume_origin['id'],
+ delete_on_termination=True)
+ # create EBS image
+ name = data_utils.rand_name('image')
+ image = self.create_server_snapshot(instance, name=name)
+
+ # delete instance
+ self._delete_server(instance)
+
+ # boot instance from EBS image
+ instance = self.create_server(image=image['id'])
+ # just ensure that instance booted
+
+ # delete instance
+ self._delete_server(instance)
+
class TestVolumeBootPatternV2(TestVolumeBootPattern):
- def _boot_instance_from_volume(self, vol_id, keypair, security_group):
+ def _get_bdm(self, vol_id, delete_on_termination=False):
bd_map_v2 = [{
'uuid': vol_id,
'source_type': 'volume',
'destination_type': 'volume',
'boot_index': 0,
- 'delete_on_termination': False}]
- create_kwargs = {
- 'block_device_mapping_v2': bd_map_v2,
- 'key_name': keypair['name'],
- 'security_groups': [{'name': security_group['name']}]
- }
- return self.create_server(image='', create_kwargs=create_kwargs)
+ 'delete_on_termination': delete_on_termination}]
+ return {'block_device_mapping_v2': bd_map_v2}
diff --git a/tempest/scenario/utils.py b/tempest/scenario/utils.py
index b1246d2..0a7d492 100644
--- a/tempest/scenario/utils.py
+++ b/tempest/scenario/utils.py
@@ -44,7 +44,7 @@
self.flavors_client = os.flavors_client
def ssh_user(self, image_id):
- _image = self.images_client.show_image(image_id)
+ _image = self.images_client.show_image(image_id)['image']
for regex, user in self.ssh_users:
# First match wins
if re.match(regex, _image['name']) is not None:
@@ -57,15 +57,15 @@
string=str(image['name']))
def is_sshable_image(self, image_id):
- _image = self.images_client.show_image(image_id)
+ _image = self.images_client.show_image(image_id)['image']
return self._is_sshable_image(_image)
def _is_flavor_enough(self, flavor, image):
return image['minDisk'] <= flavor['disk']
def is_flavor_enough(self, flavor_id, image_id):
- _image = self.images_client.show_image(image_id)
- _flavor = self.flavors_client.show_flavor(flavor_id)
+ _image = self.images_client.show_image(image_id)['image']
+ _flavor = self.flavors_client.show_flavor(flavor_id)['flavor']
return self._is_flavor_enough(_flavor, _image)
@@ -131,7 +131,7 @@
return []
if not hasattr(self, '_scenario_images'):
try:
- images = self.images_client.list_images()
+ images = self.images_client.list_images()['images']
self._scenario_images = [
(self._normalize_name(i['name']), dict(image_ref=i['id']))
for i in images if re.search(self.image_pattern,
@@ -148,7 +148,7 @@
"""
if not hasattr(self, '_scenario_flavors'):
try:
- flavors = self.flavors_client.list_flavors()
+ flavors = self.flavors_client.list_flavors()['flavors']
self._scenario_flavors = [
(self._normalize_name(f['name']), dict(flavor_ref=f['id']))
for f in flavors if re.search(self.flavor_pattern,
diff --git a/tempest/services/compute/json/aggregates_client.py b/tempest/services/compute/json/aggregates_client.py
index 4114b8b..c9895db 100644
--- a/tempest/services/compute/json/aggregates_client.py
+++ b/tempest/services/compute/json/aggregates_client.py
@@ -27,14 +27,14 @@
resp, body = self.get("os-aggregates")
body = json.loads(body)
self.validate_response(schema.list_aggregates, resp, body)
- return service_client.ResponseBodyList(resp, body['aggregates'])
+ return service_client.ResponseBody(resp, body)
def show_aggregate(self, aggregate_id):
"""Get details of the given aggregate."""
resp, body = self.get("os-aggregates/%s" % aggregate_id)
body = json.loads(body)
self.validate_response(schema.get_aggregate, resp, body)
- return service_client.ResponseBody(resp, body['aggregate'])
+ return service_client.ResponseBody(resp, body)
def create_aggregate(self, **kwargs):
"""Creates a new aggregate."""
@@ -43,7 +43,7 @@
body = json.loads(body)
self.validate_response(schema.create_aggregate, resp, body)
- return service_client.ResponseBody(resp, body['aggregate'])
+ return service_client.ResponseBody(resp, body)
def update_aggregate(self, aggregate_id, **kwargs):
"""Update a aggregate."""
@@ -52,7 +52,7 @@
body = json.loads(body)
self.validate_response(schema.update_aggregate, resp, body)
- return service_client.ResponseBody(resp, body['aggregate'])
+ return service_client.ResponseBody(resp, body)
def delete_aggregate(self, aggregate_id):
"""Deletes the given aggregate."""
@@ -79,7 +79,7 @@
post_body)
body = json.loads(body)
self.validate_response(schema.aggregate_add_remove_host, resp, body)
- return service_client.ResponseBody(resp, body['aggregate'])
+ return service_client.ResponseBody(resp, body)
def remove_host(self, aggregate_id, **kwargs):
"""Removes a host from the given aggregate."""
@@ -88,7 +88,7 @@
post_body)
body = json.loads(body)
self.validate_response(schema.aggregate_add_remove_host, resp, body)
- return service_client.ResponseBody(resp, body['aggregate'])
+ return service_client.ResponseBody(resp, body)
def set_metadata(self, aggregate_id, **kwargs):
"""Replaces the aggregate's existing metadata with new metadata."""
@@ -97,4 +97,4 @@
post_body)
body = json.loads(body)
self.validate_response(schema.aggregate_set_metadata, resp, body)
- return service_client.ResponseBody(resp, body['aggregate'])
+ return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/compute/json/flavors_client.py b/tempest/services/compute/json/flavors_client.py
index 1422944..2c32d30 100644
--- a/tempest/services/compute/json/flavors_client.py
+++ b/tempest/services/compute/json/flavors_client.py
@@ -39,13 +39,13 @@
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(_schema, resp, body)
- return service_client.ResponseBodyList(resp, body['flavors'])
+ return service_client.ResponseBody(resp, body)
def show_flavor(self, flavor_id):
resp, body = self.get("flavors/%s" % flavor_id)
body = json.loads(body)
self.validate_response(schema.create_get_flavor_details, resp, body)
- return service_client.ResponseBody(resp, body['flavor'])
+ return service_client.ResponseBody(resp, body)
def create_flavor(self, **kwargs):
"""Creates a new flavor or instance type.
@@ -64,7 +64,7 @@
body = json.loads(body)
self.validate_response(schema.create_get_flavor_details, resp, body)
- return service_client.ResponseBody(resp, body['flavor'])
+ return service_client.ResponseBody(resp, body)
def delete_flavor(self, flavor_id):
"""Deletes the given flavor."""
@@ -76,7 +76,7 @@
# Did not use show_flavor(id) for verification as it gives
# 200 ok even for deleted id. LP #981263
# we can remove the loop here and use get by ID when bug gets sortedout
- flavors = self.list_flavors(detail=True)
+ flavors = self.list_flavors(detail=True)['flavors']
for flavor in flavors:
if flavor['id'] == id:
return False
@@ -95,7 +95,7 @@
body = json.loads(body)
self.validate_response(schema_extra_specs.set_get_flavor_extra_specs,
resp, body)
- return service_client.ResponseBody(resp, body['extra_specs'])
+ return service_client.ResponseBody(resp, body)
def list_flavor_extra_specs(self, flavor_id):
"""Gets extra Specs details of the mentioned flavor."""
@@ -103,7 +103,7 @@
body = json.loads(body)
self.validate_response(schema_extra_specs.set_get_flavor_extra_specs,
resp, body)
- return service_client.ResponseBody(resp, body['extra_specs'])
+ return service_client.ResponseBody(resp, body)
def show_flavor_extra_spec(self, flavor_id, key):
"""Gets extra Specs key-value of the mentioned flavor and key."""
@@ -138,7 +138,7 @@
body = json.loads(body)
self.validate_response(schema_access.add_remove_list_flavor_access,
resp, body)
- return service_client.ResponseBodyList(resp, body['flavor_access'])
+ return service_client.ResponseBody(resp, body)
def add_flavor_access(self, flavor_id, tenant_id):
"""Add flavor access for the specified tenant."""
@@ -152,7 +152,7 @@
body = json.loads(body)
self.validate_response(schema_access.add_remove_list_flavor_access,
resp, body)
- return service_client.ResponseBodyList(resp, body['flavor_access'])
+ return service_client.ResponseBody(resp, body)
def remove_flavor_access(self, flavor_id, tenant_id):
"""Remove flavor access from the specified tenant."""
@@ -166,4 +166,4 @@
body = json.loads(body)
self.validate_response(schema_access.add_remove_list_flavor_access,
resp, body)
- return service_client.ResponseBody(resp, body['flavor_access'])
+ return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/compute/json/floating_ips_client.py b/tempest/services/compute/json/floating_ips_client.py
index 2193949..69d06a3 100644
--- a/tempest/services/compute/json/floating_ips_client.py
+++ b/tempest/services/compute/json/floating_ips_client.py
@@ -32,7 +32,7 @@
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(schema.list_floating_ips, resp, body)
- return service_client.ResponseBodyList(resp, body['floating_ips'])
+ return service_client.ResponseBody(resp, body)
def show_floating_ip(self, floating_ip_id):
"""Get the details of a floating IP."""
@@ -40,7 +40,7 @@
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(schema.create_get_floating_ip, resp, body)
- return service_client.ResponseBody(resp, body['floating_ip'])
+ return service_client.ResponseBody(resp, body)
def create_floating_ip(self, pool_name=None):
"""Allocate a floating IP to the project."""
@@ -50,7 +50,7 @@
resp, body = self.post(url, post_body)
body = json.loads(body)
self.validate_response(schema.create_get_floating_ip, resp, body)
- return service_client.ResponseBody(resp, body['floating_ip'])
+ return service_client.ResponseBody(resp, body)
def delete_floating_ip(self, floating_ip_id):
"""Deletes the provided floating IP from the project."""
diff --git a/tempest/services/compute/json/hypervisor_client.py b/tempest/services/compute/json/hypervisor_client.py
index e894a5c..ba06f23 100644
--- a/tempest/services/compute/json/hypervisor_client.py
+++ b/tempest/services/compute/json/hypervisor_client.py
@@ -32,39 +32,39 @@
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(_schema, resp, body)
- return service_client.ResponseBodyList(resp, body['hypervisors'])
+ return service_client.ResponseBody(resp, body)
def show_hypervisor(self, hypervisor_id):
"""Display the details of the specified hypervisor."""
resp, body = self.get('os-hypervisors/%s' % hypervisor_id)
body = json.loads(body)
self.validate_response(schema.get_hypervisor, resp, body)
- return service_client.ResponseBody(resp, body['hypervisor'])
+ return service_client.ResponseBody(resp, body)
def list_servers_on_hypervisor(self, hypervisor_name):
"""List instances belonging to the specified hypervisor."""
resp, body = self.get('os-hypervisors/%s/servers' % hypervisor_name)
body = json.loads(body)
self.validate_response(schema.get_hypervisors_servers, resp, body)
- return service_client.ResponseBodyList(resp, body['hypervisors'])
+ return service_client.ResponseBody(resp, body)
def show_hypervisor_statistics(self):
"""Get hypervisor statistics over all compute nodes."""
resp, body = self.get('os-hypervisors/statistics')
body = json.loads(body)
self.validate_response(schema.get_hypervisor_statistics, resp, body)
- return service_client.ResponseBody(resp, body['hypervisor_statistics'])
+ return service_client.ResponseBody(resp, body)
def show_hypervisor_uptime(self, hypervisor_id):
"""Display the uptime of the specified hypervisor."""
resp, body = self.get('os-hypervisors/%s/uptime' % hypervisor_id)
body = json.loads(body)
self.validate_response(schema.get_hypervisor_uptime, resp, body)
- return service_client.ResponseBody(resp, body['hypervisor'])
+ return service_client.ResponseBody(resp, body)
def search_hypervisor(self, hypervisor_name):
"""Search specified hypervisor."""
resp, body = self.get('os-hypervisors/%s/search' % hypervisor_name)
body = json.loads(body)
self.validate_response(schema.list_search_hypervisors, resp, body)
- return service_client.ResponseBodyList(resp, body['hypervisors'])
+ return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/compute/json/images_client.py b/tempest/services/compute/json/images_client.py
index 4e7e93f..99fdfe6 100644
--- a/tempest/services/compute/json/images_client.py
+++ b/tempest/services/compute/json/images_client.py
@@ -47,7 +47,7 @@
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(_schema, resp, body)
- return service_client.ResponseBodyList(resp, body['images'])
+ return service_client.ResponseBody(resp, body)
def show_image(self, image_id):
"""Returns the details of a single image."""
@@ -55,7 +55,7 @@
self.expected_success(200, resp.status)
body = json.loads(body)
self.validate_response(schema.get_image, resp, body)
- return service_client.ResponseBody(resp, body['image'])
+ return service_client.ResponseBody(resp, body)
def delete_image(self, image_id):
"""Deletes the provided image."""
@@ -68,7 +68,7 @@
resp, body = self.get("images/%s/metadata" % image_id)
body = json.loads(body)
self.validate_response(schema.image_metadata, resp, body)
- return service_client.ResponseBody(resp, body['metadata'])
+ return service_client.ResponseBody(resp, body)
def set_image_metadata(self, image_id, meta):
"""Sets the metadata for an image."""
@@ -76,7 +76,7 @@
resp, body = self.put('images/%s/metadata' % image_id, post_body)
body = json.loads(body)
self.validate_response(schema.image_metadata, resp, body)
- return service_client.ResponseBody(resp, body['metadata'])
+ return service_client.ResponseBody(resp, body)
def update_image_metadata(self, image_id, meta):
"""Updates the metadata for an image."""
@@ -84,14 +84,14 @@
resp, body = self.post('images/%s/metadata' % image_id, post_body)
body = json.loads(body)
self.validate_response(schema.image_metadata, resp, body)
- return service_client.ResponseBody(resp, body['metadata'])
+ return service_client.ResponseBody(resp, body)
def show_image_metadata_item(self, image_id, key):
"""Returns the value for a specific image metadata key."""
resp, body = self.get("images/%s/metadata/%s" % (image_id, key))
body = json.loads(body)
self.validate_response(schema.image_meta_item, resp, body)
- return service_client.ResponseBody(resp, body['meta'])
+ return service_client.ResponseBody(resp, body)
def set_image_metadata_item(self, image_id, key, meta):
"""Sets the value for a specific image metadata key."""
@@ -100,7 +100,7 @@
post_body)
body = json.loads(body)
self.validate_response(schema.image_meta_item, resp, body)
- return service_client.ResponseBody(resp, body['meta'])
+ return service_client.ResponseBody(resp, body)
def delete_image_metadata_item(self, image_id, key):
"""Deletes a single image metadata key/value pair."""
diff --git a/tempest/services/compute/json/instance_usage_audit_log_client.py b/tempest/services/compute/json/instance_usage_audit_log_client.py
index f06a675..4d9625e 100644
--- a/tempest/services/compute/json/instance_usage_audit_log_client.py
+++ b/tempest/services/compute/json/instance_usage_audit_log_client.py
@@ -28,13 +28,11 @@
body = json.loads(body)
self.validate_response(schema.list_instance_usage_audit_log,
resp, body)
- return service_client.ResponseBody(resp,
- body["instance_usage_audit_logs"])
+ return service_client.ResponseBody(resp, body)
def show_instance_usage_audit_log(self, time_before):
url = 'os-instance_usage_audit_log/%s' % time_before
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(schema.get_instance_usage_audit_log, resp, body)
- return service_client.ResponseBody(resp,
- body["instance_usage_audit_log"])
+ return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/compute/json/networks_client.py b/tempest/services/compute/json/networks_client.py
index 6373f01..dd20ee5 100644
--- a/tempest/services/compute/json/networks_client.py
+++ b/tempest/services/compute/json/networks_client.py
@@ -24,10 +24,10 @@
resp, body = self.get("os-networks")
body = json.loads(body)
self.expected_success(200, resp.status)
- return service_client.ResponseBodyList(resp, body['networks'])
+ return service_client.ResponseBody(resp, body)
def show_network(self, network_id):
resp, body = self.get("os-networks/%s" % network_id)
body = json.loads(body)
self.expected_success(200, resp.status)
- return service_client.ResponseBody(resp, body['network'])
+ return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/compute/json/quota_classes_client.py b/tempest/services/compute/json/quota_classes_client.py
index 30d3501..d55c3f1 100644
--- a/tempest/services/compute/json/quota_classes_client.py
+++ b/tempest/services/compute/json/quota_classes_client.py
@@ -29,7 +29,7 @@
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(classes_schema.get_quota_class_set, resp, body)
- return service_client.ResponseBody(resp, body['quota_class_set'])
+ return service_client.ResponseBody(resp, body)
def update_quota_class_set(self, quota_class_id, **kwargs):
"""
@@ -43,4 +43,4 @@
body = json.loads(body)
self.validate_response(classes_schema.update_quota_class_set,
resp, body)
- return service_client.ResponseBody(resp, body['quota_class_set'])
+ return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/compute/json/quotas_client.py b/tempest/services/compute/json/quotas_client.py
index 88d0567..4a1b909 100644
--- a/tempest/services/compute/json/quotas_client.py
+++ b/tempest/services/compute/json/quotas_client.py
@@ -30,7 +30,7 @@
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(schema.get_quota_set, resp, body)
- return service_client.ResponseBody(resp, body['quota_set'])
+ return service_client.ResponseBody(resp, body)
def show_default_quota_set(self, tenant_id):
"""List the default quota set for a tenant."""
@@ -39,7 +39,7 @@
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(schema.get_quota_set, resp, body)
- return service_client.ResponseBody(resp, body['quota_set'])
+ return service_client.ResponseBody(resp, body)
def update_quota_set(self, tenant_id, user_id=None, **kwargs):
"""
@@ -56,7 +56,7 @@
body = json.loads(body)
self.validate_response(schema.update_quota_set, resp, body)
- return service_client.ResponseBody(resp, body['quota_set'])
+ return service_client.ResponseBody(resp, body)
def delete_quota_set(self, tenant_id):
"""Delete the tenant's quota set."""
diff --git a/tempest/services/compute/json/security_group_default_rules_client.py b/tempest/services/compute/json/security_group_default_rules_client.py
index 658b89a..6e4d1e4 100644
--- a/tempest/services/compute/json/security_group_default_rules_client.py
+++ b/tempest/services/compute/json/security_group_default_rules_client.py
@@ -36,8 +36,7 @@
body = json.loads(body)
self.validate_response(schema.create_get_security_group_default_rule,
resp, body)
- rule = body['security_group_default_rule']
- return service_client.ResponseBody(resp, rule)
+ return service_client.ResponseBody(resp, body)
def delete_security_group_default_rule(self,
security_group_default_rule_id):
@@ -54,8 +53,7 @@
body = json.loads(body)
self.validate_response(schema.list_security_group_default_rules,
resp, body)
- rules = body['security_group_default_rules']
- return service_client.ResponseBodyList(resp, rules)
+ return service_client.ResponseBody(resp, body)
def show_security_group_default_rule(self, security_group_default_rule_id):
"""Return the details of provided Security Group default rule."""
@@ -64,5 +62,4 @@
body = json.loads(body)
self.validate_response(schema.create_get_security_group_default_rule,
resp, body)
- rule = body['security_group_default_rule']
- return service_client.ResponseBody(resp, rule)
+ return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/compute/json/security_group_rules_client.py b/tempest/services/compute/json/security_group_rules_client.py
index 9a7c881..c9096d0 100644
--- a/tempest/services/compute/json/security_group_rules_client.py
+++ b/tempest/services/compute/json/security_group_rules_client.py
@@ -39,7 +39,7 @@
resp, body = self.post(url, post_body)
body = json.loads(body)
self.validate_response(schema.create_security_group_rule, resp, body)
- return service_client.ResponseBody(resp, body['security_group_rule'])
+ return service_client.ResponseBody(resp, body)
def delete_security_group_rule(self, group_rule_id):
"""Deletes the provided Security Group rule."""
@@ -55,5 +55,5 @@
self.validate_response(schema.list_security_groups, resp, body)
for sg in body['security_groups']:
if sg['id'] == security_group_id:
- return service_client.ResponseBodyList(resp, sg['rules'])
+ return service_client.ResponseBody(resp, sg)
raise lib_exc.NotFound('No such Security Group')
diff --git a/tempest/services/compute/json/security_groups_client.py b/tempest/services/compute/json/security_groups_client.py
index c0b667b..083d03a 100644
--- a/tempest/services/compute/json/security_groups_client.py
+++ b/tempest/services/compute/json/security_groups_client.py
@@ -33,7 +33,7 @@
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(schema.list_security_groups, resp, body)
- return service_client.ResponseBodyList(resp, body['security_groups'])
+ return service_client.ResponseBody(resp, body)
def show_security_group(self, security_group_id):
"""Get the details of a Security Group."""
@@ -41,7 +41,7 @@
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(schema.get_security_group, resp, body)
- return service_client.ResponseBody(resp, body['security_group'])
+ return service_client.ResponseBody(resp, body)
def create_security_group(self, **kwargs):
"""
@@ -53,7 +53,7 @@
resp, body = self.post('os-security-groups', post_body)
body = json.loads(body)
self.validate_response(schema.get_security_group, resp, body)
- return service_client.ResponseBody(resp, body['security_group'])
+ return service_client.ResponseBody(resp, body)
def update_security_group(self, security_group_id, **kwargs):
"""
@@ -67,7 +67,7 @@
post_body)
body = json.loads(body)
self.validate_response(schema.update_security_group, resp, body)
- return service_client.ResponseBody(resp, body['security_group'])
+ return service_client.ResponseBody(resp, body)
def delete_security_group(self, security_group_id):
"""Deletes the provided Security Group."""
diff --git a/tempest/services/compute/json/server_groups_client.py b/tempest/services/compute/json/server_groups_client.py
index 9fec930..30e9e5b 100644
--- a/tempest/services/compute/json/server_groups_client.py
+++ b/tempest/services/compute/json/server_groups_client.py
@@ -38,7 +38,7 @@
body = json.loads(body)
self.validate_response(schema.create_get_server_group, resp, body)
- return service_client.ResponseBody(resp, body['server_group'])
+ return service_client.ResponseBody(resp, body)
def delete_server_group(self, server_group_id):
"""Delete the given server-group."""
@@ -51,11 +51,11 @@
resp, body = self.get("os-server-groups")
body = json.loads(body)
self.validate_response(schema.list_server_groups, resp, body)
- return service_client.ResponseBodyList(resp, body['server_groups'])
+ return service_client.ResponseBody(resp, body)
def get_server_group(self, server_group_id):
"""Get the details of given server_group."""
resp, body = self.get("os-server-groups/%s" % server_group_id)
body = json.loads(body)
self.validate_response(schema.create_get_server_group, resp, body)
- return service_client.ResponseBody(resp, body['server_group'])
+ return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/compute/json/servers_client.py b/tempest/services/compute/json/servers_client.py
index 7022418..671450a 100644
--- a/tempest/services/compute/json/servers_client.py
+++ b/tempest/services/compute/json/servers_client.py
@@ -221,16 +221,19 @@
resp, body)
return service_client.ResponseBody(resp, body)
- def reboot(self, server_id, reboot_type):
+ def reboot_server(self, server_id, reboot_type):
"""Reboots a server."""
return self.action(server_id, 'reboot', None, type=reboot_type)
- def rebuild(self, server_id, image_ref, **kwargs):
- """Rebuilds a server with a new image."""
+ def rebuild_server(self, server_id, image_ref, **kwargs):
+ """Rebuilds a server with a new image.
+ Most parameters except the following are passed to the API without
+ any changes.
+ :param disk_config: The name is changed to OS-DCF:diskConfig
+ """
kwargs['imageRef'] = image_ref
if 'disk_config' in kwargs:
- kwargs['OS-DCF:diskConfig'] = kwargs['disk_config']
- del kwargs['disk_config']
+ kwargs['OS-DCF:diskConfig'] = kwargs.pop('disk_config')
if self.enable_instance_password:
rebuild_schema = schema.rebuild_server_with_admin_pass
else:
@@ -238,12 +241,15 @@
return self.action(server_id, 'rebuild', 'server',
rebuild_schema, **kwargs)
- def resize(self, server_id, flavor_ref, **kwargs):
- """Changes the flavor of a server."""
+ def resize_server(self, server_id, flavor_ref, **kwargs):
+ """Changes the flavor of a server.
+ Most parameters except the following are passed to the API without
+ any changes.
+ :param disk_config: The name is changed to OS-DCF:diskConfig
+ """
kwargs['flavorRef'] = flavor_ref
if 'disk_config' in kwargs:
- kwargs['OS-DCF:diskConfig'] = kwargs['disk_config']
- del kwargs['disk_config']
+ kwargs['OS-DCF:diskConfig'] = kwargs.pop('disk_config')
return self.action(server_id, 'resize', None, **kwargs)
def confirm_resize(self, server_id, **kwargs):
diff --git a/tempest/services/compute/json/services_client.py b/tempest/services/compute/json/services_client.py
index 699d3e7..232b301 100644
--- a/tempest/services/compute/json/services_client.py
+++ b/tempest/services/compute/json/services_client.py
@@ -31,7 +31,7 @@
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(schema.list_services, resp, body)
- return service_client.ResponseBodyList(resp, body['services'])
+ return service_client.ResponseBody(resp, body)
def enable_service(self, host_name, binary):
"""
@@ -43,7 +43,7 @@
resp, body = self.put('os-services/enable', post_body)
body = json.loads(body)
self.validate_response(schema.enable_service, resp, body)
- return service_client.ResponseBody(resp, body['service'])
+ return service_client.ResponseBody(resp, body)
def disable_service(self, host_name, binary):
"""
@@ -54,4 +54,4 @@
post_body = json.dumps({'binary': binary, 'host': host_name})
resp, body = self.put('os-services/disable', post_body)
body = json.loads(body)
- return service_client.ResponseBody(resp, body['service'])
+ return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/compute/json/tenant_networks_client.py b/tempest/services/compute/json/tenant_networks_client.py
index d31c5f5..33166c0 100644
--- a/tempest/services/compute/json/tenant_networks_client.py
+++ b/tempest/services/compute/json/tenant_networks_client.py
@@ -24,10 +24,10 @@
resp, body = self.get("os-tenant-networks")
body = json.loads(body)
self.validate_response(schema.list_tenant_networks, resp, body)
- return service_client.ResponseBodyList(resp, body['networks'])
+ return service_client.ResponseBody(resp, body)
def show_tenant_network(self, network_id):
resp, body = self.get("os-tenant-networks/%s" % network_id)
body = json.loads(body)
self.validate_response(schema.get_tenant_network, resp, body)
- return service_client.ResponseBody(resp, body['network'])
+ return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/compute/json/tenant_usages_client.py b/tempest/services/compute/json/tenant_usages_client.py
index 72fcde2..73b4706 100644
--- a/tempest/services/compute/json/tenant_usages_client.py
+++ b/tempest/services/compute/json/tenant_usages_client.py
@@ -30,7 +30,7 @@
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(schema.list_tenant_usage, resp, body)
- return service_client.ResponseBodyList(resp, body['tenant_usages'][0])
+ return service_client.ResponseBody(resp, body)
def show_tenant_usage(self, tenant_id, **params):
url = 'os-simple-tenant-usage/%s' % tenant_id
@@ -40,4 +40,4 @@
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(schema.get_tenant_usage, resp, body)
- return service_client.ResponseBodyList(resp, body['tenant_usage'])
+ return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/compute/json/volumes_extensions_client.py b/tempest/services/compute/json/volumes_extensions_client.py
index ac55049..c86aaff 100644
--- a/tempest/services/compute/json/volumes_extensions_client.py
+++ b/tempest/services/compute/json/volumes_extensions_client.py
@@ -23,12 +23,6 @@
class VolumesExtensionsClient(service_client.ServiceClient):
- def __init__(self, auth_provider, service, region,
- default_volume_size=1, **kwargs):
- super(VolumesExtensionsClient, self).__init__(
- auth_provider, service, region, **kwargs)
- self.default_volume_size = default_volume_size
-
def list_volumes(self, detail=False, **params):
"""List all the volumes created."""
url = 'os-volumes'
@@ -51,7 +45,7 @@
self.validate_response(schema.create_get_volume, resp, body)
return service_client.ResponseBody(resp, body['volume'])
- def create_volume(self, size=None, **kwargs):
+ def create_volume(self, **kwargs):
"""
Creates a new Volume.
size(Required): Size of volume in GB.
@@ -59,14 +53,7 @@
display_name: Optional Volume Name.
metadata: A dictionary of values to be used as metadata.
"""
- if size is None:
- size = self.default_volume_size
- post_body = {
- 'size': size
- }
- post_body.update(kwargs)
-
- post_body = json.dumps({'volume': post_body})
+ post_body = json.dumps({'volume': kwargs})
resp, body = self.post('os-volumes', post_body)
body = json.loads(body)
self.validate_response(schema.create_get_volume, resp, body)
diff --git a/tempest/services/identity/v3/json/identity_client.py b/tempest/services/identity/v3/json/identity_client.py
index 9a60a24..3f27624 100644
--- a/tempest/services/identity/v3/json/identity_client.py
+++ b/tempest/services/identity/v3/json/identity_client.py
@@ -27,7 +27,8 @@
url = ''
resp, body = self.get(url)
self.expected_success(200, resp.status)
- return service_client.ResponseBody(resp, self._parse_resp(body))
+ body = json.loads(body)
+ return service_client.ResponseBody(resp, body)
def create_user(self, user_name, password=None, project_id=None,
email=None, domain_id='default', **kwargs):
diff --git a/tempest/services/identity/v3/json/policy_client.py b/tempest/services/identity/v3/json/policy_client.py
index f820598..3231bb0 100644
--- a/tempest/services/identity/v3/json/policy_client.py
+++ b/tempest/services/identity/v3/json/policy_client.py
@@ -31,14 +31,14 @@
resp, body = self.post('policies', post_body)
self.expected_success(201, resp.status)
body = json.loads(body)
- return service_client.ResponseBody(resp, body['policy'])
+ return service_client.ResponseBody(resp, body)
def list_policies(self):
"""Lists the policies."""
resp, body = self.get('policies')
self.expected_success(200, resp.status)
body = json.loads(body)
- return service_client.ResponseBodyList(resp, body['policies'])
+ return service_client.ResponseBody(resp, body)
def get_policy(self, policy_id):
"""Lists out the given policy."""
@@ -46,7 +46,7 @@
resp, body = self.get(url)
self.expected_success(200, resp.status)
body = json.loads(body)
- return service_client.ResponseBody(resp, body['policy'])
+ return service_client.ResponseBody(resp, body)
def update_policy(self, policy_id, **kwargs):
"""Updates a policy."""
@@ -59,7 +59,7 @@
resp, body = self.patch(url, post_body)
self.expected_success(200, resp.status)
body = json.loads(body)
- return service_client.ResponseBody(resp, body['policy'])
+ return service_client.ResponseBody(resp, body)
def delete_policy(self, policy_id):
"""Deletes the policy."""
diff --git a/tempest/services/volume/json/backups_client.py b/tempest/services/volume/json/backups_client.py
index 8d34230..6827c93 100644
--- a/tempest/services/volume/json/backups_client.py
+++ b/tempest/services/volume/json/backups_client.py
@@ -42,7 +42,7 @@
resp, body = self.post('backups', post_body)
body = json.loads(body)
self.expected_success(202, resp.status)
- return service_client.ResponseBody(resp, body['backup'])
+ return service_client.ResponseBody(resp, body)
def restore_backup(self, backup_id, volume_id=None):
"""Restore volume from backup."""
@@ -51,7 +51,7 @@
resp, body = self.post('backups/%s/restore' % (backup_id), post_body)
body = json.loads(body)
self.expected_success(202, resp.status)
- return service_client.ResponseBody(resp, body['restore'])
+ return service_client.ResponseBody(resp, body)
def delete_backup(self, backup_id):
"""Delete a backup of volume."""
@@ -65,7 +65,7 @@
resp, body = self.get(url)
body = json.loads(body)
self.expected_success(200, resp.status)
- return service_client.ResponseBody(resp, body['backup'])
+ return service_client.ResponseBody(resp, body)
def list_backups(self, detail=False):
"""Information for all the tenant's backups."""
@@ -75,7 +75,7 @@
resp, body = self.get(url)
body = json.loads(body)
self.expected_success(200, resp.status)
- return service_client.ResponseBodyList(resp, body['backups'])
+ return service_client.ResponseBody(resp, body)
def export_backup(self, backup_id):
"""Export backup metadata record."""
@@ -83,7 +83,7 @@
resp, body = self.get(url)
body = json.loads(body)
self.expected_success(200, resp.status)
- return service_client.ResponseBody(resp, body['backup-record'])
+ return service_client.ResponseBody(resp, body)
def import_backup(self, backup_service, backup_url):
"""Import backup metadata record."""
@@ -93,17 +93,17 @@
resp, body = self.post("backups/import_record", post_body)
body = json.loads(body)
self.expected_success(201, resp.status)
- return service_client.ResponseBody(resp, body['backup'])
+ return service_client.ResponseBody(resp, body)
def wait_for_backup_status(self, backup_id, status):
"""Waits for a Backup to reach a given status."""
- body = self.show_backup(backup_id)
+ body = self.show_backup(backup_id)['backup']
backup_status = body['status']
start = int(time.time())
while backup_status != status:
time.sleep(self.build_interval)
- body = self.show_backup(backup_id)
+ body = self.show_backup(backup_id)['backup']
backup_status = body['status']
if backup_status == 'error':
raise exceptions.VolumeBackupException(backup_id=backup_id)
diff --git a/tempest/stress/actions/ssh_floating.py b/tempest/stress/actions/ssh_floating.py
index 2a7a85c..2505a77 100644
--- a/tempest/stress/actions/ssh_floating.py
+++ b/tempest/stress/actions/ssh_floating.py
@@ -95,7 +95,7 @@
s_name = data_utils.rand_name('sec_grp')
s_description = data_utils.rand_name('desc')
self.sec_grp = sec_grp_cli.create_security_group(
- name=s_name, description=s_description)
+ name=s_name, description=s_description)['security_group']
create_rule = sec_grp_cli.create_security_group_rule
create_rule(parent_group_id=self.sec_grp['id'], ip_protocol='tcp',
from_port=22, to_port=22)
@@ -108,7 +108,8 @@
def _create_floating_ip(self):
floating_cli = self.manager.floating_ips_client
- self.floating = floating_cli.create_floating_ip(self.floating_pool)
+ self.floating = (floating_cli.create_floating_ip(self.floating_pool)
+ ['floating_ip'])
def _destroy_floating_ip(self):
cli = self.manager.floating_ips_client
@@ -148,7 +149,8 @@
cli = self.manager.floating_ips_client
def func():
- floating = cli.show_floating_ip(self.floating['id'])
+ floating = (cli.show_floating_ip(self.floating['id'])
+ ['floating_ip'])
return floating['instance_id'] is None
if not tempest.test.call_until_true(func, self.check_timeout,
diff --git a/tempest/stress/actions/volume_attach_verify.py b/tempest/stress/actions/volume_attach_verify.py
index 038569a..dc7d217 100644
--- a/tempest/stress/actions/volume_attach_verify.py
+++ b/tempest/stress/actions/volume_attach_verify.py
@@ -58,7 +58,7 @@
s_name = data_utils.rand_name('sec_grp')
s_description = data_utils.rand_name('desc')
self.sec_grp = sec_grp_cli.create_security_group(
- name=s_name, description=s_description)
+ name=s_name, description=s_description)['security_group']
create_rule = sec_grp_cli.create_security_group_rule
create_rule(parent_group_id=self.sec_grp['id'], ip_protocol='tcp',
from_port=22, to_port=22)
@@ -71,7 +71,8 @@
def _create_floating_ip(self):
floating_cli = self.manager.floating_ips_client
- self.floating = floating_cli.create_floating_ip(self.floating_pool)
+ self.floating = (floating_cli.create_floating_ip(self.floating_pool)
+ ['floating_ip'])
def _destroy_floating_ip(self):
cli = self.manager.floating_ips_client
@@ -100,7 +101,8 @@
cli = self.manager.floating_ips_client
def func():
- floating = cli.show_floating_ip(self.floating['id'])
+ floating = (cli.show_floating_ip(self.floating['id'])
+ ['floating_ip'])
return floating['instance_id'] is None
if not tempest.test.call_until_true(func, CONF.compute.build_timeout,
diff --git a/tempest/stress/cleanup.py b/tempest/stress/cleanup.py
index 9e21326..9456590 100644
--- a/tempest/stress/cleanup.py
+++ b/tempest/stress/cleanup.py
@@ -49,7 +49,8 @@
pass
secgrp_client = admin_manager.security_groups_client
- secgrp = secgrp_client.list_security_groups(all_tenants=True)
+ secgrp = (secgrp_client.list_security_groups(all_tenants=True)
+ ['security_groups'])
secgrp_del = [grp for grp in secgrp if grp['name'] != 'default']
LOG.info("Cleanup::remove %s Security Group" % len(secgrp_del))
for g in secgrp_del:
@@ -58,7 +59,8 @@
except Exception:
pass
- floating_ips = admin_manager.floating_ips_client.list_floating_ips()
+ floating_ips = (admin_manager.floating_ips_client.list_floating_ips()
+ ['floating_ips'])
LOG.info("Cleanup::remove %s floating ips" % len(floating_ips))
for f in floating_ips:
try:
diff --git a/tempest/tests/cmd/test_javelin.py b/tempest/tests/cmd/test_javelin.py
index d1dee54..a95d400 100644
--- a/tempest/tests/cmd/test_javelin.py
+++ b/tempest/tests/cmd/test_javelin.py
@@ -270,9 +270,10 @@
def test_create_secgroup(self):
self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
return_value=self.fake_client))
- self.fake_client.secgroups.list_security_groups.return_value = []
+ self.fake_client.secgroups.list_security_groups.return_value = (
+ {'security_groups': []})
self.fake_client.secgroups.create_security_group.return_value = \
- {'id': self.fake_object['secgroup_id']}
+ {'security_group': {'id': self.fake_object['secgroup_id']}}
javelin.create_secgroups([self.fake_object])
diff --git a/tempest/tests/common/test_accounts.py b/tempest/tests/common/test_accounts.py
index 8fc3745..1acef8a 100644
--- a/tempest/tests/common/test_accounts.py
+++ b/tempest/tests/common/test_accounts.py
@@ -297,8 +297,9 @@
test_accounts_class = accounts.Accounts('v2', 'test_name')
with mock.patch('tempest.services.compute.json.networks_client.'
'NetworksClient.list_networks',
- return_value=[{'name': 'network-2', 'id': 'fake-id',
- 'label': 'network-2'}]):
+ return_value={'networks': [{'name': 'network-2',
+ 'id': 'fake-id',
+ 'label': 'network-2'}]}):
creds = test_accounts_class.get_creds_by_roles(['role-7'])
self.assertTrue(isinstance(creds, cred_provider.TestResources))
network = creds.network
diff --git a/tempest/tests/services/compute/test_aggregates_client.py b/tempest/tests/services/compute/test_aggregates_client.py
index eacc251..14930a7 100644
--- a/tempest/tests/services/compute/test_aggregates_client.py
+++ b/tempest/tests/services/compute/test_aggregates_client.py
@@ -34,7 +34,7 @@
body = '{"aggregates": []}'
if bytes_body:
body = body.encode('utf-8')
- expected = []
+ expected = {"aggregates": []}
response = (httplib2.Response({'status': 200}), body)
self.useFixture(mockpatch.Patch(
'tempest.common.service_client.ServiceClient.get',
@@ -48,17 +48,17 @@
self._test_list_aggregates(bytes_body=True)
def _test_show_aggregate(self, bytes_body=False):
- expected = {"name": "hoge",
- "availability_zone": None,
- "deleted": False,
- "created_at":
- "2015-07-16T03:07:32.000000",
- "updated_at": None,
- "hosts": [],
- "deleted_at": None,
- "id": 1,
- "metadata": {}}
- serialized_body = json.dumps({"aggregate": expected})
+ expected = {"aggregate": {"name": "hoge",
+ "availability_zone": None,
+ "deleted": False,
+ "created_at":
+ "2015-07-16T03:07:32.000000",
+ "updated_at": None,
+ "hosts": [],
+ "deleted_at": None,
+ "id": 1,
+ "metadata": {}}}
+ serialized_body = json.dumps(expected)
if bytes_body:
serialized_body = serialized_body.encode('utf-8')
@@ -76,14 +76,14 @@
self._test_show_aggregate(bytes_body=True)
def _test_create_aggregate(self, bytes_body=False):
- expected = {"name": u'\xf4',
- "availability_zone": None,
- "deleted": False,
- "created_at": "2015-07-21T04:11:18.000000",
- "updated_at": None,
- "deleted_at": None,
- "id": 1}
- serialized_body = json.dumps({"aggregate": expected})
+ expected = {"aggregate": {"name": u'\xf4',
+ "availability_zone": None,
+ "deleted": False,
+ "created_at": "2015-07-21T04:11:18.000000",
+ "updated_at": None,
+ "deleted_at": None,
+ "id": 1}}
+ serialized_body = json.dumps(expected)
if bytes_body:
serialized_body = serialized_body.encode('utf-8')
@@ -110,16 +110,16 @@
self.assertEqual(expected, resp)
def _test_update_aggregate(self, bytes_body=False):
- expected = {"name": u'\xe9',
- "availability_zone": None,
- "deleted": False,
- "created_at": "2015-07-16T03:07:32.000000",
- "updated_at": "2015-07-23T05:16:29.000000",
- "hosts": [],
- "deleted_at": None,
- "id": 1,
- "metadata": {}}
- serialized_body = json.dumps({"aggregate": expected})
+ expected = {"aggregate": {"name": u'\xe9',
+ "availability_zone": None,
+ "deleted": False,
+ "created_at": "2015-07-16T03:07:32.000000",
+ "updated_at": "2015-07-23T05:16:29.000000",
+ "hosts": [],
+ "deleted_at": None,
+ "id": 1,
+ "metadata": {}}}
+ serialized_body = json.dumps(expected)
if bytes_body:
serialized_body = serialized_body.encode('utf-8')
diff --git a/tempest/tests/services/compute/test_availability_zone_client.py b/tempest/tests/services/compute/test_availability_zone_client.py
new file mode 100644
index 0000000..64efd08
--- /dev/null
+++ b/tempest/tests/services/compute/test_availability_zone_client.py
@@ -0,0 +1,61 @@
+# Copyright 2015 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 httplib2
+
+from oslo_serialization import jsonutils as json
+from oslotest import mockpatch
+
+from tempest.services.compute.json import availability_zone_client
+from tempest.tests import base
+from tempest.tests import fake_auth_provider
+
+
+class TestAvailabilityZoneClient(base.TestCase):
+
+ FAKE_AVAILABIRITY_ZONE_INFO = [
+ {
+ "zoneState": {
+ "available": True
+ },
+ "hosts": None,
+ "zoneName": u'\xf4'
+ }
+ ]
+
+ def setUp(self):
+ super(TestAvailabilityZoneClient, self).setUp()
+ fake_auth = fake_auth_provider.FakeAuthProvider()
+ self.client = availability_zone_client.AvailabilityZoneClient(
+ fake_auth, 'compute', 'regionOne')
+
+ def _test_list_availability_zones(self, bytes_body=False):
+ serialized_body = json.dumps({
+ "availabilityZoneInfo": self.FAKE_AVAILABIRITY_ZONE_INFO})
+ if bytes_body:
+ serialized_body = serialized_body.encode('utf-8')
+
+ mocked_resp = (httplib2.Response({'status': 200}), serialized_body)
+ self.useFixture(mockpatch.Patch(
+ 'tempest.common.service_client.ServiceClient.get',
+ return_value=mocked_resp))
+ resp = self.client.list_availability_zones()
+ self.assertEqual({
+ "availabilityZoneInfo": self.FAKE_AVAILABIRITY_ZONE_INFO}, resp)
+
+ def test_list_availability_zones_with_str_body(self):
+ self._test_list_availability_zones()
+
+ def test_list_availability_zones_with_bytes_body(self):
+ self._test_list_availability_zones(bytes_body=True)
diff --git a/tempest/tests/services/compute/test_networks_client.py b/tempest/tests/services/compute/test_networks_client.py
index 5e57dea..cbeaefc 100644
--- a/tempest/tests/services/compute/test_networks_client.py
+++ b/tempest/tests/services/compute/test_networks_client.py
@@ -70,7 +70,8 @@
fake_auth, 'compute', 'regionOne')
def _test_list_networks(self, bytes_body=False):
- serialized_body = json.dumps({"networks": self.FAKE_NETWORKS})
+ expected = {"networks": self.FAKE_NETWORKS}
+ serialized_body = json.dumps(expected)
if bytes_body:
serialized_body = serialized_body.encode('utf-8')
@@ -79,7 +80,7 @@
'tempest.common.service_client.ServiceClient.get',
return_value=mocked_resp))
resp = self.client.list_networks()
- self.assertEqual(self.FAKE_NETWORKS, resp)
+ self.assertEqual(expected, resp)
def test_list_networks_with_str_body(self):
self._test_list_networks()
@@ -88,7 +89,8 @@
self._test_list_networks(bytes_body=True)
def _test_show_network(self, bytes_body=False):
- serialized_body = json.dumps({"network": self.FAKE_NETWORK})
+ expected = {"network": self.FAKE_NETWORKS}
+ serialized_body = json.dumps(expected)
if bytes_body:
serialized_body = serialized_body.encode('utf-8')
@@ -97,7 +99,7 @@
'tempest.common.service_client.ServiceClient.get',
return_value=mocked_resp))
resp = self.client.show_network(self.network_id)
- self.assertEqual(self.FAKE_NETWORK, resp)
+ self.assertEqual(expected, resp)
def test_show_network_with_str_body(self):
self._test_show_network()
diff --git a/tempest/tests/services/compute/test_quota_classes_client.py b/tempest/tests/services/compute/test_quota_classes_client.py
index ff9b310..bc52511 100644
--- a/tempest/tests/services/compute/test_quota_classes_client.py
+++ b/tempest/tests/services/compute/test_quota_classes_client.py
@@ -50,8 +50,8 @@
fake_auth, 'compute', 'regionOne')
def _test_show_quota_class_set(self, bytes_body=False):
- serialized_body = json.dumps({
- "quota_class_set": self.FAKE_QUOTA_CLASS_SET})
+ expected = {'quota_class_set': self.FAKE_QUOTA_CLASS_SET}
+ serialized_body = json.dumps(expected)
if bytes_body:
serialized_body = serialized_body.encode('utf-8')
@@ -60,7 +60,7 @@
'tempest.common.service_client.ServiceClient.get',
return_value=mocked_resp))
resp = self.client.show_quota_class_set("test")
- self.assertEqual(self.FAKE_QUOTA_CLASS_SET, resp)
+ self.assertEqual(expected, resp)
def test_show_quota_class_set_with_str_body(self):
self._test_show_quota_class_set()
@@ -71,11 +71,12 @@
def test_update_quota_class_set(self):
fake_quota_class_set = copy.deepcopy(self.FAKE_QUOTA_CLASS_SET)
fake_quota_class_set.pop("id")
- serialized_body = json.dumps({"quota_class_set": fake_quota_class_set})
+ expected = {'quota_class_set': fake_quota_class_set}
+ serialized_body = json.dumps(expected)
mocked_resp = (httplib2.Response({'status': 200}), serialized_body)
self.useFixture(mockpatch.Patch(
'tempest.common.service_client.ServiceClient.put',
return_value=mocked_resp))
resp = self.client.update_quota_class_set("test")
- self.assertEqual(fake_quota_class_set, resp)
+ self.assertEqual(expected, resp)
diff --git a/tempest/tests/services/compute/test_quotas_client.py b/tempest/tests/services/compute/test_quotas_client.py
index a9bd0a1..0f72b3d 100644
--- a/tempest/tests/services/compute/test_quotas_client.py
+++ b/tempest/tests/services/compute/test_quotas_client.py
@@ -25,21 +25,24 @@
class TestQuotasClient(base.TestCase):
- FAKE_QUOTA_SET = {"injected_file_content_bytes": 10240,
- "metadata_items": 128,
- "server_group_members": 10,
- "server_groups": 10,
- "ram": 51200,
- "floating_ips": 10,
- "key_pairs": 100,
- "id": "8421f7be61064f50b680465c07f334af",
- "instances": 10,
- "security_group_rules": 20,
- "injected_files": 5,
- "cores": 20,
- "fixed_ips": -1,
- "injected_file_path_bytes": 255,
- "security_groups": 10}
+ FAKE_QUOTA_SET = {
+ "quota_set": {
+ "injected_file_content_bytes": 10240,
+ "metadata_items": 128,
+ "server_group_members": 10,
+ "server_groups": 10,
+ "ram": 51200,
+ "floating_ips": 10,
+ "key_pairs": 100,
+ "id": "8421f7be61064f50b680465c07f334af",
+ "instances": 10,
+ "security_group_rules": 20,
+ "injected_files": 5,
+ "cores": 20,
+ "fixed_ips": -1,
+ "injected_file_path_bytes": 255,
+ "security_groups": 10}
+ }
project_id = "8421f7be61064f50b680465c07f334af"
@@ -50,7 +53,7 @@
fake_auth, 'compute', 'regionOne')
def _test_show_quota_set(self, bytes_body=False):
- serialized_body = json.dumps({"quota_set": self.FAKE_QUOTA_SET})
+ serialized_body = json.dumps(self.FAKE_QUOTA_SET)
if bytes_body:
serialized_body = serialized_body.encode('utf-8')
@@ -68,7 +71,7 @@
self._test_show_quota_set(bytes_body=True)
def _test_show_default_quota_set(self, bytes_body=False):
- serialized_body = json.dumps({"quota_set": self.FAKE_QUOTA_SET})
+ serialized_body = json.dumps(self.FAKE_QUOTA_SET)
if bytes_body:
serialized_body = serialized_body.encode('utf-8')
@@ -87,8 +90,8 @@
def test_update_quota_set(self):
fake_quota_set = copy.deepcopy(self.FAKE_QUOTA_SET)
- fake_quota_set.pop("id")
- serialized_body = json.dumps({"quota_set": fake_quota_set})
+ fake_quota_set['quota_set'].pop("id")
+ serialized_body = json.dumps(fake_quota_set)
mocked_resp = (httplib2.Response({'status': 200}), serialized_body)
self.useFixture(mockpatch.Patch(
'tempest.common.service_client.ServiceClient.put',
diff --git a/tempest/tests/services/compute/test_services_client.py b/tempest/tests/services/compute/test_services_client.py
index 61ca830..7d87711 100644
--- a/tempest/tests/services/compute/test_services_client.py
+++ b/tempest/tests/services/compute/test_services_client.py
@@ -49,7 +49,8 @@
fake_auth, 'compute', 'regionOne')
def _test_list_services(self, bytes_body=False):
- serialized_body = json.dumps({"services": self.FAKE_SERVICES})
+ expected = {"services": self.FAKE_SERVICES}
+ serialized_body = json.dumps(expected)
if bytes_body:
serialized_body = serialized_body.encode('utf-8')
@@ -58,7 +59,7 @@
'tempest.common.service_client.ServiceClient.get',
return_value=mocked_resp))
resp = self.client.list_services()
- self.assertEqual(self.FAKE_SERVICES, resp)
+ self.assertEqual(expected, resp)
def test_list_services_with_str_body(self):
self._test_list_services()
@@ -67,7 +68,8 @@
self._test_list_services(bytes_body=True)
def _test_enable_service(self, bytes_body=False):
- serialized_body = json.dumps({"service": self.FAKE_SERVICE})
+ expected = {"service": self.FAKE_SERVICE}
+ serialized_body = json.dumps(expected)
if bytes_body:
serialized_body = serialized_body.encode('utf-8')
@@ -76,7 +78,7 @@
'tempest.common.service_client.ServiceClient.put',
return_value=mocked_resp))
resp = self.client.enable_service("nova-conductor", "controller")
- self.assertEqual(self.FAKE_SERVICE, resp)
+ self.assertEqual(expected, resp)
def test_enable_service_with_str_body(self):
self._test_enable_service()
@@ -87,8 +89,8 @@
def _test_disable_service(self, bytes_body=False):
fake_service = copy.deepcopy(self.FAKE_SERVICE)
fake_service["status"] = "disable"
-
- serialized_body = json.dumps({"service": self.FAKE_SERVICE})
+ expected = {"service": self.FAKE_SERVICE}
+ serialized_body = json.dumps(expected)
if bytes_body:
serialized_body = serialized_body.encode('utf-8')
@@ -97,7 +99,7 @@
'tempest.common.service_client.ServiceClient.put',
return_value=mocked_resp))
resp = self.client.disable_service("nova-conductor", "controller")
- self.assertEqual(self.FAKE_SERVICE, resp)
+ self.assertEqual(expected, resp)
def test_disable_service_with_str_body(self):
self._test_enable_service()
diff --git a/tempest/tests/services/compute/test_tenant_usages_client.py b/tempest/tests/services/compute/test_tenant_usages_client.py
new file mode 100644
index 0000000..f6bcf5f
--- /dev/null
+++ b/tempest/tests/services/compute/test_tenant_usages_client.py
@@ -0,0 +1,95 @@
+# Copyright 2015 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 httplib2
+
+from oslo_serialization import jsonutils as json
+from oslotest import mockpatch
+
+from tempest.services.compute.json import tenant_usages_client
+from tempest.tests import base
+from tempest.tests import fake_auth_provider
+
+
+class TestTenantUsagesClient(base.TestCase):
+
+ FAKE_SERVER_USAGES = [{
+ "ended_at": None,
+ "flavor": "m1.tiny",
+ "hours": 1.0,
+ "instance_id": "1f1deceb-17b5-4c04-84c7-e0d4499c8fe0",
+ "local_gb": 1,
+ "memory_mb": 512,
+ "name": "new-server-test",
+ "started_at": "2012-10-08T20:10:44.541277",
+ "state": "active",
+ "tenant_id": "openstack",
+ "uptime": 3600,
+ "vcpus": 1
+ }]
+
+ FAKE_TENANT_USAGES = [{
+ "server_usages": FAKE_SERVER_USAGES,
+ "start": "2012-10-08T21:10:44.587336",
+ "stop": "2012-10-08T22:10:44.587336",
+ "tenant_id": "openstack",
+ "total_hours": 1,
+ "total_local_gb_usage": 1,
+ "total_memory_mb_usage": 512,
+ "total_vcpus_usage": 1
+ }]
+
+ def setUp(self):
+ super(TestTenantUsagesClient, self).setUp()
+ fake_auth = fake_auth_provider.FakeAuthProvider()
+ self.client = tenant_usages_client.TenantUsagesClient(
+ fake_auth, 'compute', 'regionOne')
+
+ def _test_list_tenant_usages(self, bytes_body=False):
+ serialized_body = json.dumps({"tenant_usages":
+ self.FAKE_TENANT_USAGES})
+ if bytes_body:
+ serialized_body = serialized_body.encode('utf-8')
+
+ mocked_resp = (httplib2.Response({'status': 200}), serialized_body)
+ self.useFixture(mockpatch.Patch(
+ 'tempest.common.service_client.ServiceClient.get',
+ return_value=mocked_resp))
+ resp = self.client.list_tenant_usages()
+ self.assertEqual({"tenant_usages": self.FAKE_TENANT_USAGES}, resp)
+
+ def test_list_tenant_usages_with_str_body(self):
+ self._test_list_tenant_usages()
+
+ def test_list_tenant_usages_with_bytes_body(self):
+ self._test_list_tenant_usages(bytes_body=True)
+
+ def _test_show_tenant_usage(self, bytes_body=False):
+ serialized_body = json.dumps({"tenant_usage":
+ self.FAKE_TENANT_USAGES[0]})
+ if bytes_body:
+ serialized_body = serialized_body.encode('utf-8')
+
+ mocked_resp = (httplib2.Response({'status': 200}), serialized_body)
+ self.useFixture(mockpatch.Patch(
+ 'tempest.common.service_client.ServiceClient.get',
+ return_value=mocked_resp))
+ resp = self.client.show_tenant_usage('openstack')
+ self.assertEqual({"tenant_usage": self.FAKE_TENANT_USAGES[0]}, resp)
+
+ def test_show_tenant_usage_with_str_body(self):
+ self._test_show_tenant_usage()
+
+ def test_show_tenant_usage_with_bytes_body(self):
+ self._test_show_tenant_usage(bytes_body=True)
diff --git a/tempest/thirdparty/boto/test.py b/tempest/thirdparty/boto/test.py
index 9f119b4..8c371a7 100644
--- a/tempest/thirdparty/boto/test.py
+++ b/tempest/thirdparty/boto/test.py
@@ -303,7 +303,7 @@
@classmethod
def get_lfunction_gone(cls, obj):
"""If the object is instance of a well know type returns back with
- with the correspoding function otherwise it assumes the obj itself
+ with the corresponding function otherwise it assumes the obj itself
is the function.
"""
ec = cls.ec2_error_code
@@ -377,7 +377,7 @@
state = self.waitSnapshotStatus(lfunction, wait_for)
self.assertIn(state, wait_for)
- def assertAddressDissasociatedWait(self, address):
+ def assertAddressDisassociatedWait(self, address):
def _disassociate():
cli = self.ec2_client
@@ -467,7 +467,7 @@
client.InvalidInstanceID.NotFound.match(exc) is None:
return "_GONE"
# NOTE(afazekas): incorrect code,
- # but the resource must be destoreyd
+ # but the resource must be destroyed
if exc.error_code == "InstanceNotFound":
return "_GONE"
diff --git a/tempest/thirdparty/boto/test_ec2_instance_run.py b/tempest/thirdparty/boto/test_ec2_instance_run.py
index 920f602..49a1854 100644
--- a/tempest/thirdparty/boto/test_ec2_instance_run.py
+++ b/tempest/thirdparty/boto/test_ec2_instance_run.py
@@ -348,7 +348,7 @@
instance.stop()
address.disassociate()
- self.assertAddressDissasociatedWait(address)
+ self.assertAddressDisassociatedWait(address)
self.cancelResourceCleanUp(rcuk_da)
address.release()
self.assertAddressReleasedWait(address)
diff --git a/tempest/thirdparty/boto/test_ec2_security_groups.py b/tempest/thirdparty/boto/test_ec2_security_groups.py
index 88ff154..594dc8b 100644
--- a/tempest/thirdparty/boto/test_ec2_security_groups.py
+++ b/tempest/thirdparty/boto/test_ec2_security_groups.py
@@ -68,5 +68,5 @@
group_get = self.client.get_all_security_groups(
groupnames=(group_name,))[0]
- # all rules shuld be removed now
+ # all rules should be removed now
self.assertEqual(0, len(group_get.rules))