Import the remaning service client classes in the __init__ of the
corresponding services module, and define __all__, so that service client
classes may be accessed by importing the service module only.
Change-Id: Id7428ac7bc9aeffed21a5e99c3f520f1568f2018
Partially-implements: bp client-manager-refactor
Since Ic542eefcd09c3d55ac69c22e35eb1f47d1a99363 , the removed wapper
method has been unused. So this patch removes it for the cleanup.
Change-Id: I95f43f81bf586eba83b30987df57f0ba2ca9ee3f
Now service_client is unnecessary because that is the same as
rest_client. This patch makes object_storage and orchestration
clients use the rest_client, and we will remove service_client
for the cleanup in the future.
This patch removes these clients from a certain test because
this test is just for service_client, not rest_client as the
test name. We have added this test for verifying all arguments
are passed into rest_client via service_client. However, this
patch some clients use rest_client directly, so this test becomes
meaningless for these clients. That is a reason why the migrated
clients(into tempest.lib before) are not contained in this test.
Partially implements blueprint consistent-service-method-names
Change-Id: I763107de6a9f7b411a5892d2c53dcf99b7afa3ef
Now that tempest_lib code is copied back into tempest, stop using
tempest_lib in tempest, and start using the copied code.
Remove the dependency to tempest_lib from requirements, and drop
the script to use tempest_lib in tempest. Add os-testr to the
test-requirements.
Partially implements bp tempest-lib-reintegration
Change-Id: I21ab5fe6349f72c98ac9f960a29bf62e813f8b1b
Provide the entire response object for all methods of the
OrchestrationClient
partially implements: blueprint method-return-value-and-move-service-clients-to-lib
Change-Id: I6db8f17335a2dfb9baaa61cfd22353d5e4fc538a
This commit migrates all the usage of the json library to use jsonutils
from oslo_serialization. On python 3 httplib2 returns a bytes type for
the response body however all the methods in the json library are
expecting str types. We could switch all the uses of json.loads to
encode the input prior to calling json.loads however oslo_serialization
has baked in all dual python version edge conditions around this into
a call compatible lib which is much cleaner.
Change-Id: Icee30fb74db128c77b2c0c27e68b5801bd138cd5
As part of enabling python3 support in tempest we need to be able to
handle urllib, HTMLParser, and urllib2 usage in both python2 and
python3. Six provides a compat layer for doing this, so this commit
moves all uses of urllib2, HTMLParser, and urllib to get it through
six.
Change-Id: I81e348ac79001ac94bdb92a9b60c7dca4c93686a
[GET /resources] methods should be "list_<resource name>s"
or "show_<resource name>", so this patch applies the rule
to orchestration client.
Partially implements blueprint consistent-service-method-names
Change-Id: I5a0d046d3811d48d3e4bddae8b0f022762c621c8
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
To move OrchestrationClient to tempest-lib, this patch moves
CONF values from OrchestrationClient to the client setting.
In addition, this patch adds default_params into general client
setting class and makes use it for removing default_params values
from service client code in the future.
Change-Id: Ia988862516b7bc1d6e8bd79c671da4ecc2abe8f3
To moving RestClient to tempest-lib, this patch moves all CONF values
from RestClient to service clients. This patch adds TempestRestClient
which passes common CONF values for Tempest own values.
Change-Id: I3434061fd19de741e36b13bd3c458cf49fdfe783
_get_region() was used for getting a region from CONF for each project,
but most projects' sections contain a region value and it is easy to
specify its value instead of _get_region().
In addition, RestClient will become a tempest-lib class and it is needed
to separate CONF values from a RestClient class.
This patch moves _get_region() to NegativeRestClient and makes each client
specify its own CONF value.
Change-Id: Ib26badf64e7cddf4158e4720e193b3129e8fdb12
_get_endpoint_type() was used for getting endpoint_type from CONF for
each project, but most projects' sections contain a endpoint_type value
and it is easy to specify its value instead of _get_endpoint_type().
In addition, RestClient will become a tempest-lib class and it is needed
to separate CONF values from a RestClient class.
This patch removes _get_endpoint_type() and makes each client specify
its own CONF value.
Change-Id: I5609c56507bb5ad0ce249b020a8bea1fe11bee3e
RestClient used compute build_interval/timeout values as the default,
even if the other projects' clients. This implementation is not useful
when RestClient is changed to a library class.
Then this patch separates compute build_interval/timeout values from
the class and set the same static values as the default.
Change-Id: Ibc4307b406b71db258975da90a39c1f51ad27e12
If this method failed because the resource will not reach desired
status, you just know expected status, not actual status at time of
timeout. It can help with debugging.
Change-Id: I583f0739bf771dd587acd13c1453ae6a440a9e87
'create_stack' function in orchestration_client return raw json strings.
However, in most of cases, raw json strings are not expected because it's
too hard to use. So we should do 'json.loads(body)' for the response body.
And the other apis such as {update,delete,suspend,resume} do not return a
response body in the API spec docs[1]. So we do not need to add
'json.load(body)' to the functions for now.
[1] http://developer.openstack.org/api-ref-orchestration-v1.html
Change-Id: Ic7d37d70aa0373d9bbf3ad302d1a521f5adaafe9
This patch fix the coding issue where "mutable" objects like list, dict
are being used as default value of param.
Current functions with mutable object as default value can create issues
if they will be called in more random order.
For example - first call with non default value and then with default
value. In this case original default will be overridden by the first
function call (as mutable object keep their state among function calls).
This commit also add the hacking check for the same and its
corresponding test.
Closes-Bug: #1330322
Change-Id: I251b316ef6d37f4b95c5e8d73a20a39005c22870
Updated all orchestration tests to remove the response checks
and move those to respective clients.
Partially Implements blueprint: client-checks-success
Change-Id: If74df1644c6f61b03388e47768f1cffa91fad99c
Adds an orchestration API test to ensure
the resource types APIs work correctly.
Change-Id: I9a28332debaad28b3725711f180242ac30744e76
Closes-Bug: #1336169
When waiting for a stack to transition to DELETE_COMPLETE status
it's possible to either get that status, or a NotFound exception
so catch the exception and return in that case, to avoid needing
try/except around the wait, or risking races in tests which wait
for DELETE_COMPLETE without a try/except (test_volumes.py)
Change-Id: I4ded172db3c8969075365a0dc6b60d8e3e7db71d
Partial-Bug: #1344989
Added functions to the JSON client to support the new software
configuration API.
Software configurations and deployments are tiered and dependant on each
other so splitting the API calls to smaller tests is impossible.
Each test verifies different things, this is how I tried to prevent the
tests from being too bloated.
Co-Authored-By: Steven Hardy <shardy@redhat.com>
Change-Id: Ied896fcaf3cf4a80385b28235eb5f4af9cd182c8
Adds support for passing files argument to the create/update
calls in the json client, and adds a simple test of defining
a provider resource, which is a user-defined resource type,
mapped via the "resource_registry" section of the environment
file, with the filename looked up by a key in the files map.
Change-Id: I87fd1f2b1cf2c68c22d53891d99c8cd6b6b7c777
Partial-Bug: #1317095
wait_for_resource_status was raising a StackBuildErrorException with incorrect
parameters, leading to an unhelpful error message.
This will log the nova console to help diagnose Related-Bug: #1295396
Closes-Bug: #1295404
Change-Id: I979f9edcc0b57924fd3dd681b60165a3db311e6e
Attr self.headers in rest client is deprecated now, and
should be removed from usage by service clients.
This patch removes first bunch of attrs.
Second and last part is intended to be in another patch,
with removing from all other service clients
and from rest client itself.
Change-Id: I28981738a9e7f39343cf530c2642315f0a5b22f2
Partially-implements: bp refactor-rest-client
Moves authentication from rest_client to an external auth_provider,
assigned to the client by the client manager.
The auth provider can decorate a request based on credentials (coming
from the client manager) and filters (region, service, endpoint_type)
given by the client. The auth provider can also return the raw
auth_data, which in the Keystone implementation is a tuple (token,
auth_data). The auth provider allows mixing multiple credentials
when decorating a request, possibly using empty or invalid credentials,
to facilitate negative tests.
The auth provider caches auth data, so that all API requests for a
specific set of credentials only require a single call to obtain a
token, unless the token expires or is forcefully deleted from the
auth provder.
Two implementations of the auth provider are included: Keystonev2 and
Keystonev3. The Manager object behaves as factory of auth_providers,
building the correct one based on the configured auth_version, and on
the interface type (JSON or XML).
Fixes endpoint selection for v3 auth. Drops unused basic_auth.
Extends TokenClients to provide both token and auth data,
and accept different combinations of credentials for v3.
Removes redundant server_client_v3_auth.
Adapts tempest unit tests to work with modified rest client.
Introduces a configuration parameter for authentication version to be
used. That is used when instantiating the client manager, and it
applies to all clients used by api tests.
Next steps (next patches):
- move to credentials as dict (as opposed to tuple)
- expose a get_client method from the client manager
and create clients only when requested
- remove redundant CustomizedHeader object storage clients
- supports keystone v3 in tenant isolation
- use Auth Provider in scenario tests
- use Auth Provider in CLI tests
- implement parsing of catalog XML format (?)
Partially implements: bp multi-keystone-api-version-tests
Change-Id: Icfa921e9051c01f339f8d2471b12d6ec950cc456
This commit takes the rest client and all subclass(all the service
clients) and converts all uses of config to the global CONF object.
Partially implements bp config-cleanup
Change-Id: I09525af4f1b308b91d45b7bbea05e0f734ea485c
This change allows stack output to be parsed/checked.
Partial-Bug: #1269566
Partial blueprint: tempest-heat-integration
Change-Id: Iff23620dbce2c834591836dfed8b68439a9804cf
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