When extending volume reaches status error_extending, we should
return from wait_for_volume_resource_status immediately instead
of waiting for the TimeoutException.
Change-Id: I3db0325c23ebb8d42fe77f4c28552fe9cf5ed807
services and extension decorators are based on CONF and needed by
Tempest only, so moving them to tempest.common.
Since a few plugnis use them today, use debtcollector to avoid
breaking all dependencies.
Change-Id: Ibd52153d00b8e60fb8c89e38d94e358ddc787251
This commit migrates the preprovisioned credentials provider from
tempest/common into tempest/lib. As part of this 2 dependencies are
also migrated to lib: the InvalidTestResource exception class and the
tempest.common.fixed_network module.
Change-Id: Ib9e909aaaf81f7cb57e2382cec44598e918747b8
We are going to make test.py stable for plugins, so it should
only depend on tempest.lib and config.
InvalidServiceTag is in the exceptions module.
It cannot be moved in tempest.lib.exceptions since it has no meaning
in there, so moving it to test.py directly.
Change-Id: I969fb45a44ce08c176d64dfe1c58d75215eacdf5
This function waits for a volume resource to reach a given status.
The function is a common function for volume, snapshot and backup
resources.
Change-Id: I070a9f84b8b199df22765391482f7d69a5414db3
When we get a 404 from Glance because a server snapshot
is not found while we're waiting for it to be ACTIVE, it
means Nova deleted the failed snapshot from Glance because
something failed in nova-compute during the snapshot
operation.
Rather than just dump a 404 in the test console output on this
type of failure, this change gets the server which should have
a fault recorded and uses that to raise a more useful error
message for the test output.
Change-Id: I8ee2e18925e7f4f09d10d857fb25f3d9b8e8bd42
This commit migrates the InvalidConfiguartion exception from tempest's
exceptions into the list of tempest lib exceptions. While tempest lib
itself does not have any configuration, it is very possible that
external test suites would also like a way to raise an exception when
part of the configuration is invalid. This is also needed as part of
the migration of the dynamic credentials provider to tempest lib.
Change-Id: I9ec697c61cfb1f5750d82ae790c607029bfed3ca
Split and migrate v1 and v2 backups__client to tempest.lib.
Partially implements blueprint consistent-service-method-names
Change-Id: I9d6ef9f069c449f392c245fdac10996517a1cc73
There is a number of exceptions available in tempest.lib which are duplicated
in the exceptions module in tempest. They are all identitical, except for one:
TimeoutException. The tempest.lib version inherits from RestClientException,
while the tempest version is a TempestException. The only class that should
use the former is the RestClient (and derivative), while it is used by ssh
client as well. Changing the type of exception raised by ssh.py would be a
backward incompatible change, so I think we cannot change this now.
Change-Id: I98ad80266b00f7d0b9d269a516866d81312aa834
Tempest implements the microversion testing support and
that framework and interfaces have been tested by implementing
the Compute 2.2 microversion as well as by their unit tests.
Those should be stable interfaces so that can be consumed by other
projects microversion testing either in tempest or outside tempest.
To make them as stable interface, this commit moving that framework and
its interfaces to tempest/lib folder.
Adding release notes and library doc for those interface.
Partially implements blueprint api-microversions-testing-support
Change-Id: Icbdcfb4cd5b7fb1029eec035b9e0024be59c8d1f
If API version range is invalid, means min version is greater
than max version, InvalidConfiguration exception was raised.
which seems not much appropriate for utils functions as those
will be migrated to lib.
Adding new excpetion InvalidAPIVersionRange and use that instead
of InvalidConfiguration.
Partially implements blueprint api-microversions-testing-support
Change-Id: Ifb6193bfc252a3343664953aaf2caae85ab50591
For API microversion testing, service clients can be
requested with any supported API microversions.
Compute service clients does response validation using response
schema.
To validate the corresponding microversion response with appropriate
schema, we need to add support of versioning in schema.
Each service client having multiple schema for microversions,
needs to define a list of dict with schema versions information.
Based on that information and requested microversion, schema
will be selected.
Example-
from tempest.api_schema.response.compute.v2_1 import xyz as schemav21
from tempest.api_schema.response.compute.v2_2 import xyz as schemav22
from tempest.api_schema.response.compute.v2_10 import abc as schemav210
.
.
.
schema_versions_info = [
{'min': None, 'max': '2.1', 'schema': schemav21},
{'min': '2.2', 'max': '2.9', 'schema': schemav22},
{'min': '2.10', 'max': None, 'schema': schemav210}]
This can be defined at class level or method level depends on how
schema differ for that service client.
This commits add the logic to select the valid schema for requested API
microversion.
Partially implements blueprint api-microversions-testing-support
Change-Id: I7c87287ca9f6f60a66aab8290031632945c03d59
If StrOpt option is explicitly set as None, oslo config
will return it as string "None" which should be invalid
configuration.
Example-
min_microversion = None will be end up with 'None'.
This commit makes that clear in config and raise exception
for the same.
Partially implements blueprint api-microversions-testing-support
Change-Id: I81e86faca6f8c0ffb7da22154a62236ac25cf0c0
The fixed_network module has very little dependency from config;
removing it so that it may be used by the preprov_creds module.
Change-Id: I24de72a0a997d2824b72338e31fec5329d601074
There is a lot of H404/405 violations in Tempest now, and that leads
difficult to migrate the code to tempest-lib or the other projects'
repos. This patch fixes these violations for remaining.
Change-Id: I3abac40ebb33836980c119d59bc97f035b213c0a
If cinder hits an error when restoring a volume from a backup the volume
is set to 'error_restoring' status. If tempest doesn't handle this and
fail fast, tests keep waiting for the volume to go to 'available' status
or timeout - and the timeout is what happens.
Related-Bug: #1483434
Change-Id: I8f6d0828a84ec5d4a5fa6332e55152bd67eaa605
common ssh.py module and it tests was migrated to tempest_lib.
and included in tempest-lib release 0.5.0. This commit removes
the tempest copies of this module and switches over to using
the tempest-lib copy.
Change-Id: I4a38bd16b5568ce508623170eea186a3c53f1c89
This commit changes tempest.exceptions.Unauthorized to
tempest_lib.exceptions.Unauthorized. This is one of the migrating rest
client to tempest-lib works.
Change-Id: I7675700b53ddedc2deee024c6e1ab3c88e0e3683
This commit changes tempest.exceptions.NotFound to
tempest_lib.exceptions.NotFound. This is one of the migrating
rest client to tempest-lib works.
Change-Id: I2be04f600e6bd8d7d78948d25395d8e04fa0dea3
This commit changes tempest.exceptions.Conflict to
tempest_lib.exceptions.Conflict. This is one of the migrating
rest client to tempest-lib works.
Change-Id: I860a961c442f35ef4a75013e19bfe92f61a587b8
This commit changes tempest.exceptions.OverLimit to
tempest_lib.exceptions.OverLimit. This is one of the migrating
rest client to tempest-lib works.
Change-Id: I38f14f0901521478c53837e79e75bd731061cb7b
In preparation for migration to tempest-lib, add a new parameter
to get_credentials to specify the identity version.
Define a wrapper cred_provider.get_credentials that exposes
the same signature auth.get_credetials use to have, and switch
all consumers to use the cred_provider version.
Do not raise InvalidConfiguration from auth module.
Adapt unit tests accordingly, and remove their dependency to
fake configs, to prepare them as well for migration to tempest-lib.
Change-Id: Idd467166b7547b55be4cee076c9913c72b7b5a8d
This commit changes tempest.exceptions.InvalidContentType to
tempest_lib.exceptions.InvalidContentType. This is one of the migrating
rest client to tempest-lib works.
Change-Id: Ia50f62ab80df3a8f0a3c045ed8b22465566cff30
This commit changes tempest.exceptions.UnprocessableEntity to
tempest_lib.exceptions.UnprocessableEntity. This is one of the migrating
rest client to tempest-lib works.
Change-Id: I7293131d2961388b91b3270167a07496a8a0f378
The rest_client module doesn't raise AuthenticationFailur, so this
patch removes the inheritance.
In addition, this patch changes the order of exceptions for knowing
what exceptions the rest_client module raises.
Change-Id: Ia60ba728bdc650542602382eacbd35149717ecf7
In _error_checker(), both HTTP500 and 501 are converted to the same
exception ServerFault. In addition, some method which extracts error
message raises a specific exception IdentityError without considering
HTTP code.
This patch adds a new exception NotImplemented and uses it for HTTP501
so that we can know which error response is returned from a server.
Change-Id: Ic8fc216377942619f11a2462b79d0597071ac294
RateLimitExceeded, ServerFault and OverLimit raise at rest_client layer
and they should inherit from RestClientException for representing what
happens clearly. This patch changes them.
Change-Id: I0b74bd44a88cc68bdaeab6bd605722d47f5a28a9
Exceptions which inherit from RestClientException should raise based
on an error response which is returned from REST API servers(nova-api,
etc). However, InvalidServiceTag is not now.
We have a plan RestClient is implemented in tempest-lib and related
exceptions also are moved to tempest-lib.
For doing that, this patch separates an unrelated exception from
RestClientException.
Change-Id: I49d50fb14b18c6fb263308a68d7ac6a97b1a9800
After bumping the hacking version to the 0.9.x series ignores were
added for several rules. This commit fixes the violations for a subset
of these rules and re-enables the checks.
Change-Id: Iaff25fc9e2ecfad0c0574b39ddce0c5188d6c31f
When the CommandFailed exception was added it was only being used by
the CLI tests. However, it is generally useful for anything that is
using subprocess to make external calls. This patch moves it to
tempest.exceptions to make using it simpler for non-cli tests to use
the exception.
Change-Id: Ibf5f1cbbb847d32976b54c4484acfc3c0e3b4f48
Nova API sometimes returns important information in a response header,
and Tempest needs to check it for keeping the backward compatibility.
This patch adds the check for "create a server snapshot" API as the
sample.
Partially implements blueprint nova-api-attribute-test
Change-Id: I2441147ee050e7b818906aaa754dcec4480d8c18
This commit removes the exceptions directory and reverts to the
previous organizational behavior of having a single exception file.
The directory was created with the intent of allowing additional
exceptions to be added as separate files. However this is just
distributing exceptions into separate files which would mean separate
imports whenever they were used. So new extensions were only being
added to the __init__ file to avoid the additional import, which is
essentially the previous behavior. So instead of adding the additional
directory it's easier just to leave everything in one file.
This is effectively a revert of 82411edb9c
Change-Id: If15bd171b4708def30a650d514063e9795836746
First patch of three patches:
->1. exceptions
2. config (+ module_utils.py)
3. clients
The main intend is in moving currently existed single 'exceptions' module in
exceptions tree.
It allows separate exceptions by differencies:
- base
- main/common
- project-specific
It also allows to simplify search and using of exceptions, merge changes into
Tempest with minimized amount of merge conflicts.
Partially-implements: bp make-tempest-pluggable
Change-Id: I5c50affba0fce721583a6d56216e56c94ec3b188
Adds new tests to cover cinder backup api as well as the needed
json clients.
xml client will be submitted after bug #1270589 is fixed.
Change-Id: I8d40c58eaf0ccd24abf55a212f1177e61ef0a281
Closes-Bug: 1221335
There are some invalid usages about exceptions. They put some invalid
error messages to the log like this.
--------------------------
BuildErrorException: Server %(server_id)s failed to build and is in
ERROR status)
--------------------------
This commit fixes them.
NOTE: 'RateLimitExceeded' is only used in tempest/common/rest_client.py.
This was refactored in I6c38c343618f92e0e79843aaa662a3d24026702b . But
the class was not. And the last usage of 'SQLException' was removed in
I0fac7b030c51985f9d6d93129bf9bab75c18cd11 . But the class was not.
Change-Id: I1477e093a56210c0c9a65fa32900c2c0b876d9a4
We don't need to have the vim headers in each source files. We can set
it in our vimrc file instead. Also if set incorrectly, gate (pep8 check)
will catch the mistakes.
More discussions:
http://lists.openstack.org/pipermail/openstack-dev/2013-October/017353.html
Change-Id: I43703e2289212389c7841f44691ae7849ed1f505
Closes-Bug: #1229324