Commit Graph

85 Commits (cd147631f8254c2f727ccfc937566a7a200349f9)

Author SHA1 Message Date
zhufl 0ea2c01d75 Break wait_for_volume_resource_status when error_extending
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
4 years ago
zhufl 7446709de8 Remove unused RFCViolation
This is to remove unused RFCViolation exception.

Change-Id: Id1c4f421ca47ff075d2df236fe302565fcaa57ea
6 years ago
Andrea Frittoli cd36841ca2 Move test decorators to common
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
6 years ago
Matthew Treinish b19c55df4b
Migrate the preprov creds module to tempest lib
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
6 years ago
Andrea Frittoli 07acf26015 Move InvalidServiceTag
We are going to make 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 directly.

Change-Id: I969fb45a44ce08c176d64dfe1c58d75215eacdf5
6 years ago
lkuchlan 52d7b0d626 Add a generic "wait_for_volume_resource_status" function
This function waits for a volume resource to reach a given status.
The function is a common function for volume, snapshot and backup

Change-Id: I070a9f84b8b199df22765391482f7d69a5414db3
6 years ago
Matt Riedemann 1395435e6a Get server fault if snapshot fails
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

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
6 years ago
guo yunxian ebb15f265e Delete TimeoutException in tempest/
Delete TimeoutException in tempest/ because it repeats
in tempest/

Change-Id: I4242d8156dcba7d8e893975de62c82547625afbc
7 years ago
Matthew Treinish 4217a703c9
Move InvalidConfiguration exception to tempest.lib
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
7 years ago
David Paterson 9eabc33da4 Migrate backups clients to tempest.lib
Split and migrate v1 and v2 backups__client to tempest.lib.

Partially implements blueprint consistent-service-method-names

Change-Id: I9d6ef9f069c449f392c245fdac10996517a1cc73
7 years ago
Jenkins 5ba5d648f6 Merge "Add server_id in exception ServerUnreachable" 7 years ago
guo yunxian 99debda8e9 Fix typo about message of exception
Add missing 's' in exception

Change-Id: Iac87294ab5847bf70e817df81e6f8ce89471305a
7 years ago
zhufl 955f82b47f Add server_id in exception ServerUnreachable
This is to add server_id in exception ServerUnreachable for the
convenience of debugging.

Change-Id: Ib31fe70fae33d5e2eb7cda6e02b03649918a546b
7 years ago
Andrea Frittoli (andreaf) af4f7cfe90 Cleanup exceptions in tempest
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 would be a
backward incompatible change, so I think we cannot change this now.

Change-Id: I98ad80266b00f7d0b9d269a516866d81312aa834
7 years ago
Andrea Frittoli (andreaf) 1370bafda0 Remove few refercences left to tempest-lib
A few places in docs / comments still refer to tempest-lib.
Cleaning those up.

Change-Id: I6a15a6e7e58a49a39b3955c60e16d0c196ec154c
7 years ago
Jordan Pittier 374d38028a Remove definitions of unused exception classes.
It looks like those classes are not used anymore.

Change-Id: Iccf7300859339335fd13f4429b241258341d3766
7 years ago
Ghanshyam 1f47cf976b Migrated microversion testing framework to tempest/lib
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
7 years ago
Ghanshyam d2e7a0afba Add new exception InvalidAPIVersionRange for microversion
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
7 years ago
Ghanshyam 77f3f90348 Add support of schema versioning for microversion
For API microversion testing, service clients can be
requested with any supported API microversions.
Compute service clients does response validation using response

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.


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

Partially implements blueprint api-microversions-testing-support

Change-Id: I7c87287ca9f6f60a66aab8290031632945c03d59
7 years ago
Ghanshyam 395c5b5b42 Makes microversions config option clear about 'None'
If StrOpt option is explicitly set as None, oslo config
will return it as string "None" which should be invalid
   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
8 years ago
Ken'ichi Ohmichi 4d237e72fe Add the base microversions test part
This is base part of microversions tests.
This patch adds the mechanism for selecting the microversion tests based
on new configration options like the following:

TestClass A: min_microversion = None,  max_microversion = 'latest'
TestClass B: min_microversion = None,  max_microversion = '2.2'
TestClass C: min_microversion = '2.3', max_microversion = 'latest'
TestClass D: min_microversion = '2.5', max_microversion = '2.10'

  | Configration       | Test classes                                        |
  | (min,    max)      | (Passed microversion)                               |
  | None,     None     | A(Not passed), B(Not passed), C & D - Skipped       |
  | None,     '2.3'    | A(Not passed), B(Not passed), C('2.3'), D - Skipped |
  | '2.2',    'latest' | A('2.2'), B('2.2'), C('2.3'), D('2.5')              |
  | '2.2',    '2.3'    | A('2.2'), B('2.2'), C('2.3'), D - Skipped           |
  | '2.10',   '2.10'   | A('2.10'), B - Skipped, C('2.10'), D('2.10')        |
  | None,     'latest' | A(Not passed), B(Not passed), C('2.3'), D('2.5')    |
  | 'latest', 'latest' | A('latest'), B - Skipped, C('latest'), D - Skipped  |

After this patch, we need to add tests for each microversion and
these test classes need to contain the range of microversions.

Partially implements blueprint api-microversions-testing-support

Change-Id: I57b78b4c0543b6fb0533b556886a19a03297555e
8 years ago
Andrea Frittoli (andreaf) 940f8c6049 Drop fixed_network dependency from CONF
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
8 years ago
Ken'ichi Ohmichi 2e2ee19179 Fix H404/405 violations for remaining
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
8 years ago
ghanshyam 367c693524 Fix missing value types for log message
This commit fix the missing value type in log message of exception.

Change-Id: Ib052964e49ded2eb427d5b448241e25cbd066906
Closes-Bug: #1494574
8 years ago
Matt Riedemann f77e7dcb33 Handle 'error_restoring' status in wait_for_volume_status
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
8 years ago
Andrey Pavlov 6472376752 Remove common/ due to migration to tempest_lib
common 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
8 years ago
Jenkins 0fe93aea15 Merge "Remove auth_version config from get_credentials" 8 years ago
Masayuki Igawa 29d554f410 Change tempest Unauthorized exc to tempest-lib exc
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
8 years ago
Masayuki Igawa bfa0760e0a Change tempest NotFound exc to tempest-lib exc
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
8 years ago
Masayuki Igawa d938876e88 Change tempest Conflict exc to tempest-lib exc
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
8 years ago
Masayuki Igawa 90c914eb3a Change tempest OverLimit exc to tempest-lib exc
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
8 years ago
Andrea Frittoli 878d5ab9d1 Remove auth_version config from get_credentials
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
8 years ago
Masayuki Igawa d5f3b6cf73 Change tempest InvalidContentType exc to tempest-lib exc
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
8 years ago
Masayuki Igawa dd7590832a Change tempest UnprocessableEntity exc to tempest-lib exc
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
8 years ago
Masayuki Igawa 9a77c920a2 Remove unused exceptions
This commit just removes unused exceptions.

Change-Id: I00f9b8c7a83575bd938a5e08b3ee3849147a0633
8 years ago
Masayuki Igawa ce34d2fcf1 Remove UnexpectedResponseCode exception
This commit just removes UnexpectedResponseCode exception. Because we
already don't use it.

Change-Id: Ibb3af95f7038c46f0e67727b161328ec4fadce8e
8 years ago
Ken'ichi Ohmichi 4ca14f609c Remove RestClientException inheritance
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
8 years ago
Ken'ichi Ohmichi 43a694a988 Raise a new exception NotImplemented for HTTP501
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
9 years ago
Ken'ichi Ohmichi c240bccc91 Change rest client exceptions' inheritances
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
9 years ago
Ken'ichi Ohmichi 53c963a916 Make InvalidServiceTag inherit from TempestException
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

Change-Id: I49d50fb14b18c6fb263308a68d7ac6a97b1a9800
9 years ago
Matthew Treinish 1d14c54fd8 Enable E128 ignore E129
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
9 years ago
Matthew Treinish aeb5274fd4 Move CommandFailed exception to tempest.exceptions
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
9 years ago
Jenkins 3ce1f8e6ed Merge "Add a lacking message format letter 's'" 9 years ago
Masayuki Igawa 89ba568c9a Add a lacking message format letter 's'
This lacking leads an unhelpful error message.

Change-Id: I435defc871c69423ed2800e1b304cc7b27792256
Closes-Bug: #1313616
9 years ago
Ken'ichi Ohmichi 57b384b4d4 Add a response header validation
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

Partially implements blueprint nova-api-attribute-test

Change-Id: I2441147ee050e7b818906aaa754dcec4480d8c18
9 years ago
Matthew Treinish 8bdf6e3c05 Move exceptions back into one place
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
9 years ago
vponomaryov 82411edb9c Implement pluggability for tempest (exceptions)
First patch of three patches:
->1. exceptions
  2. config (+
  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
9 years ago
Giulio Fidente 74b08ad1e1 Adds cinder backup functional tests
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
9 years ago
Masayuki Igawa a0e786af52 Cleanup exceptions
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/
 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
9 years ago
Masayuki Igawa e8d31a0b80 Remove vim headers
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:

Change-Id: I43703e2289212389c7841f44691ae7849ed1f505
Closes-Bug: #1229324
9 years ago