Commit Graph

748 Commits (0ea2c01d757375d54aa9a9de34c2c9995bb48d13)

Author SHA1 Message Date
Zuul 82f7b1ae6c Merge "Add APIMicroversionFixture to library interface" 4 years ago
Zuul 53d8b0b1cf Merge "Add compute API response schema validation for 2.71" 4 years ago
Zuul 21ce12ed9f Merge "Add support for compute API v2.70 - os-volume_attachments" 4 years ago
Matt Riedemann 0b14b1e0ff Add compute API response schema validation for 2.71
The 2.71 compute API includes the "server_groups" parameter
in the response to the following APIs:

- GET /servers/{server_id} (show)
- PUT /servers/{server_id} (update)
- POST /servers/{server_id}/action (rebuild)

This will be used in an upcoming change to test attaching
and detaching the root volume of a shelved offloaded instance.

Change-Id: I612a15c475404ded0af15b6241b9ac8ec9fb8e26
4 years ago
Matt Riedemann b9b6e37a75 Add support for compute API v2.70 - os-volume_attachments
This adds the compute API response schema validation for the
2.70 microversion and the following APIs:

- GET /servers/{server_id}/os-volume_attachments (list)
- GET /servers/{server_id}/os-volume_attachments/{volume_id} (show)
- POST /servers/{server_id}/os-volume_attachments (attach)

This will be used in an upcoming change for testing root volume
attach/detach of a shelved offloaded server.

Since the response schema for these have not changed since 2.1 we
have to backfill all of the other servers API response schema
files going back to 2.1.

Change-Id: I2f36a51fa47b28df1afada5396dec3ce7dc43d78
4 years ago
Lee Yarwood e5597401ff Introduce an attached volume migration test
This change introduces a true cinder host to host attached volume
migration test in addition to the existing attached volume retype test.
To enable this two new calls are introduced to the v3 volume client to
allow all volume backends to be listed per project and to also call for
a direct volume migration between backends.

Related-bug: #1803961
Depends-On: I1bdf3431bda2da98380e0dcaa9f952e6768ca3af
Change-Id: I501eb0cd5eb101b4dc553c2cdbc414693dd5b681
4 years ago
Lee Yarwood 8df5fdcbe0 Add assertions to attached volume retype test
Previously only the volume type and timestamp data was checked when
retyping an attached volume. This change adds additional assertions to
ensure the volume state remains `in-use`, volume migration state is
`success` and the same `volume_id` remains attached to the instance
after the retype completes. This final check ensures that nova has
correctly called the os-migrate_volume_completion cinder API.

Related-bug: #1803961
Change-Id: I32f0611bdfd2ccede73e7ab774286f5315ff92c3
4 years ago
Zuul 845780d4c0 Merge "Add the api type check when check the param of api_microversion" 4 years ago
chenke 4beff29c36 Add the api type check when check the param of api_microversion
When I specified COMPUTE_MICROVERSION = 2.53,
the error message made me confused. It doesn't
tell me whether the type I set is int or a string,
so I recommend adding a type check.

Change-Id: I620c90f1652fa22bff2ffff9b84b1addc31285ff
4 years ago
Ghanshyam Mann ad8737c7f2 Add APIMicroversionFixture to library interface
APIMicroversionFixture is used to set the microversion on
service clients which will take care of reseting the microversion.

This interface has been added to set the microversion on all supported
service clients which use microverison. User can set multiple
service microversion all together.

Using the new interface in compute tests to make sure it is all
working in serial and parallel testing.

Change-Id: I6ed41b02041d38c2c92c58b0d3dd6613d03da3f7
4 years ago
Zuul e6057592fb Merge "Add unstable_test decorator" 4 years ago
Slawek Kaplonski 21f53012f7 Add unstable_test decorator
This decorator can be used to temporarily mark some tests as unstable.
This may help sometimes to debug such test which is failing often
but not always in the gate because it will still be run but will
not cause all job failure when it fails.

This may be also used to easily track in logstash how often
such test is failing by looking for describption of unstability
reason set in decorator.

Change-Id: I79ce70f479506ec2b3216747d533ff2e450685aa
Related-Bug: #1813198
4 years ago
Zuul a63313ea0a Merge "Add profiler support into Tempest" 4 years ago
Zuul 67e0778618 Merge "Add autopep8 to tox.ini" 4 years ago
Zuul d69c11044f Merge "Remove LOG in misc.py" 4 years ago
Alfredo Moralejo 3e7752c93f Make type decorator compatible with unicode strings
When importing unicode_literals from __future__ in tempest plugins as in
watcher, type is set as unicode instead of string when running in
python2, so the type is not properly detected. This is making that only
3 tests are detected as smoke in watcher tests plugins with python2 (other
may be affected) instead of 52 which are discovered as smoke with python3.

This patch uses six to make this compatible with both string and unicode
in python2.

Change-Id: Ibba9d8217f543fae0c232757ddb18c4fdf957aff
Co-Authored-By: yatin <ykarel@redhat.com>
4 years ago
zhufl 19cb7836dc Remove LOG in misc.py
LOG is not used in misc.py, so this is to remove it.

Change-Id: I5c1e3b675d770bbeaeece676880c56d840646284
4 years ago
afazekas 40fcb9ba28 Add autopep8 to tox.ini
autopep8 is an automated code formatting tool for python,
it does not know everything, also not super fast,
but it is faster than I can manually reformat the code.

tools/format.sh will call the formatting,
the tox will check did you called it.

Also adding a tox -eautopep8 way to use it.

autopep8 formats the lines in one way,
where tempest used a another way it was changed.

Change-Id: I6d51b14a5a5b87761071d0927fca23ba1651aa41
4 years ago
Zuul 787ca5edca Merge "Allow decorators.attr to be conditional" 4 years ago
Pallav Gupta 1f6cc860ff Fix typo
Change-Id: Ie5ac0576459ffa9ae06251e56c7bcdd3f715efd5
4 years ago
Ilya Shakhat 1291bb4736 Add profiler support into Tempest
The primary goal is to be able to run all Tempest tests
and verify OpenStack when profiling is enabled. Also this patch
allows to:
 * manually verify that certain services are properly instrumented
   and produce trace events when a scenario is executed;
 * write automatic tests for trace coverage;
 * profile certain tests from performance perspective.

A new parameter is introduced into tempest.conf:
 * profiler.key - the key used to enable OSProfiler (should
     match the one configured in OpenStack services)

To test the patch on DevStack:
 1. Enable osprofiler with Redis collector in local.conf:

   enable_plugin osprofiler https://git.openstack.org/openstack/osprofiler master
   OSPROFILER_COLLECTOR=redis

 2. Run all Tempest tests or select some, e.g.:

   tempest run --regex tempest.api.network.test_networks.NetworksTest.test_list_networks*

Change-Id: I64f30c36adbf7fb26609142f22d3e305ac9e82b5
4 years ago
Matt Riedemann 2999963ff8 Allow decorators.attr to be conditional
There are cases where we want to conditionally apply an
attribute to a test function, for example, if SSH validation
is enabled then a test may run much slower than if it is not.

This adds a 'condition' kwarg to the attr() decorator which
behaves similarly to the 'condition' kwarg on the skip_because()
decorator.

Change-Id: I83233854a217b6961e7614d7d9df1b4fc8d5a640
4 years ago
Colleen Murphy 8b9980b497 Normalize endpoint path in oauth client
oauthlib uses the request URI as input for generating an oauth
signature and matching it against the incoming oauth_signature request
attribute. tempest also uses the URI to generate this signature, which
means the URIs must match exactly.

If the keystone catalog contains an endpoint with a trailing slash, such
as https://keystone.example.org/v3/, then the URI that tempest uses for
the signature generation will be
https://keystone.example.org/v3//OS-OAUTH1/request_token. The incoming
request URI that oauthlib sees will not have the duplicate slash and so
the resulting signature will differ, and the auth request will be
rejected due to mismatching HMAC-SHA1 signatures.

This patch corrects the issue for deployments that use a trailing slash
in their keystone catalogs (which is valid) by normalizing the path
before generating the signature.

Change-Id: Ie827b1af7b23c6d6eaf2c2894cc2629d0e252108
4 years ago
Zuul d47a79c2b5 Merge "fix typos" 4 years ago
Zuul b972204d8d Merge "Remove warnings.simplefilter to suppress ResourceWarning" 4 years ago
Matt Riedemann 91d92424bc Fix E117 for pycodestyle (pep8) 2.5.0
The new 2.5.0 release of pycodestyle enforces E117
and is not managed by upper-constraints so we have
to fix the violations. Thankfully there are only a
few and they are fixed here.

Change-Id: Ic71eaf9b3552dfa6603632e556b102696c8d76e4
4 years ago
Masayuki Igawa d8d0d6e95a
Remove warnings.simplefilter to suppress ResourceWarning
This commit removes warnings.simplefilter from
tempest.lib.services.clients code to suppress annoying ResourceWarning
like following.

 ResourceWarning: unclosed file <_io.FileIO....

Change-Id: I9e96cfc062bbdaf73f8a4efb9af9dc581c96994f
4 years ago
Lajos Katona ceb882169a Add placement client for basic GET operations
The goal of this placement client for tempest is to make possible the
end-to-end testing of the placement based bandwidth feature (see the
nova and neutron specs: https://review.openstack.org/502306
https://review.openstack.org/508149)
The minimum placement microversion is 1.29, and the following operations
are supported: list_allocation_candidates, list_allocations.

Change-Id: I0cf1caadeb40761ec79338510919f12baf2d8f56
Partial-Bug: #1578989
See-Also: https://review.openstack.org/502306 (nova spec)
See-Also: https://review.openstack.org/508149 (neutron spec)
4 years ago
Zuul ca9c706592 Merge "Remove unnecessary line of code" 4 years ago
Zuul 976e87a986 Merge "Add missing ws seperator between words part 2" 5 years ago
Sergey Vilgelm 36fdd20cb1 Add missing ws seperator between words part 2
This is to add missing ws seperator between words

Change-Id: I83b74ccde5dfc7e74f55a4df6fa1ad67442042a4
5 years ago
Terry Wilson ad4c9ddf3f Remove unnecessary line of code
Change-Id: Iaf68a7550f7557bd5e941b619cc2012ca27b38d6
5 years ago
Sergey Vilgelm eac094a8cf
docs: Fix incorrect docstrings in reStructuredText format
Several docstrings have incorrect format, what prevents to generate
a documentation using sphinx-apidoc extension.

Change-Id: I66431c7030089173d7635c1e2a72765db21f9780
5 years ago
zhufl de67637682 Add missing ws seperator between words
This is to add missing ws seperator between words, usually
in log messages.

Change-Id: I228573a755717bb9725267fad61706ce2ef3da87
5 years ago
sunqingliang6 99690f6657 fix typos
Change-Id: Ied69a5ba0745300afd20b40ef77fc143056dc270
5 years ago
zhufl e80266a71b Add api ref link for import_backup
import_backup in backups_client.py has kwargs parameter,
but no api ref link for a full list of available parameters,
this is to add the link.

Change-Id: Ie30eb1ee76ee6521c5bdc9c8c3349a17ad6604b3
5 years ago
Vu Cong Tuan d13622f274 Replace deprecated "decodestring"
decodestring() is a deprecated alias, use decodebytes()
https://docs.python.org/3.1/library/base64.html#base64.decodestring

This patch helps to remove this deprecation alias by
replacing "base64.decodestring" with "oslo_serialization.base64.decode_as_bytes".
The same has been done for nova:
https://review.openstack.org/#/c/610401/

Change-Id: Ibba785b8f9b27a74344c27dc952a8782f10fa697
5 years ago
Zuul f197405648 Merge "Remove deprecated find_test_caller function" 5 years ago
Felipe Monteiro a485b094fe Remove deprecated find_test_caller function
This patchset removes the long-ago deprecated version of
find_test_caller in ``tempest.lib.common.utils.misc.find_test_caller``
which was deprecated during Kilo release cycle in favor of
``tempest.lib.common.utils.test_utils.find_test_caller`` [0].

There are a few projects that depend on the old find_test_caller
for which patchsets have been submitted to change to the
non-deprecated version: [1][2].

Only remaining place is in openstack/tempest-lib which no longer
appears to be supported (no activity in a few years) [3].

[0] http://git.openstack.org/cgit/openstack/tempest/tree/releasenotes/notes/12/12.1.0-new-test-utils-module-adf34468c4d52719.yaml
[1] https://review.openstack.org/#/c/578166/
[2] https://review.openstack.org/#/c/578168/
[3] e.g. http://git.openstack.org/cgit/openstack/tempest-lib/tree/tempest_lib/common/utils/misc.py

Change-Id: I64253af8eb401238aba254d1887d748a68cf32d3
5 years ago
Zuul ba1cc6c181 Merge "Allow to create a rest_client not following redirects" 5 years ago
Jens Harbott 3ffa54e446 Allow to create a rest_client not following redirects
Some tests need to verify that the first response from an API is indeed
a redirect, this can not be done if the client automatically follows
redirects. Introduce a parameter that allows consumers to disable the
default behaviour, so that they can see the 301 response instead.

Change-Id: I366fa8d1971cd7502a1cd985f5ee6ad5e1ecb216
Closes-Bug: 1616892
5 years ago
Zuul ef3fbb2193 Merge "Add delete_agent to AgentsClient" 5 years ago
Zuul 9353dbb1ba Merge "Add missing test for "Show API v2 details" action" 5 years ago
Mykola Yakovliev 709c8d36f1 Add delete_agent to AgentsClient
This patchset add delete_agent method that implements respective API [1]

[1] https://developer.openstack.org/api-ref/network/v2/index.html#delete-agent

Change-Id: I093574579bcecb08c2e2d4deeeda0438f3900ad6
Closes-Bug: 1792007
5 years ago
zhufl 53d94a82b7 Add response schema validation for volume qos-specs
This is to add response schema validation for volume
qos-specs.
Besides, there are some inconsistencies in volume qos-specs api ref,
Ib5c9b3a15ee2ca40c19e7a530d1ff5351d3dcaf8 will fix them.

Change-Id: I433c78821185600a230803cddec54a5d264c2ca5
partially-implements: blueprint volume-response-schema-validation
5 years ago
Sergey Vilgelm fb4d863703
Add missing test for "Show API v2 details" action
Add test to cover the request to "Show API v2 details"[0] action.
Add the show_version function to the NetworkVersionsClient class.
Modify the list_versions function of the NetworkVersionsClient class
to use the .get() function instead of the .raw_request() function
because using the .get() makes the function simplier and abstracts out
the logging and retrying a request for us.
Add the unit tests for the show_version function.

[0] https://developer.openstack.org/api-ref/network/v2/index.html#show-api-v2-details

Change-Id: I7ebea0c53437e929fc613495bcb8a8f8838c2044
5 years ago
jeremy.zhang b0f65f6ae7 Remove unnecessary class variable in v3 snapshots_client
The class variable 'create_resp' in v3 snapshots_client is not unnecessary,
and it can be substituted by constant string 202.

Change-Id: I983465f34b4130d4db39e2be82d33d54aec0d537
5 years ago
Zuul 4959096c66 Merge "Fix comments in rest_client" 5 years ago
Zuul f7fe7ff723 Merge "Add server schema for microversion 2.8" 5 years ago
Zuul 114214cab6 Merge "Change schema hypervisor.cpu_info from string to object in 2.28" 5 years ago