Use common method to delete objects and containers after Swift
testing. The used method ensures proper deletion before continuing;
simply listing and deleting sometimes raises exeptions due to delayed
executions.
Also fixes a docstring to reflect current behaviour.
Change-Id: Ieaaba496028de741f3e506dac800b151aa833333
Let's try to unskip test_create_object_with_transfer_encoding
and see if it's still failing. The commit marks the test as
unstable so that it doesn't fail a check/gate job in case the
test fails again.
Related-Bug: #1905432
Change-Id: I84ad0a3a699cc0c04b2ce173edceb1df46f8c7a1
The local IP is replaced with a wrong and irregular value
if tested with IPv6. This patch fixes this, replacing the
netloc with the right IPv6 localhost value.
Closes-Bug: 1944728
Change-Id: Icb3668abebb4821f1cf4824f4898abb2163e4d99
In some cases (such as when using Ceph RADOSGW with a load-balancer)
the container (bucket) creation will be received by different backend
to the object creation triggering a subtle edge case.
The rgw handling the object creation request has (cached) knowledge
the bucket doesn't exist (it didn't a few seconds ago) and will (in
rgw) create it, at which point triggering a "409 BucketAlreadyExists"
code.
Detecting this and retrying (with a small delay) should reduce
instances of this failing.
Change-Id: Id88fb93dd1a48d046917e9168d623e53497ec83e
Invoking delete containers at test level tearDown caused:
1) unnecessary requests are being sent again in the tearDown for
the subsequent methods,
2) possible race condition can happen between methods during the
tearDown.
Closes-Bug: #1938593
Change-Id: I24087607a9f0129b7b3d21473196fab1b5f08cd4
md5 is not an approved algorithm in FIPS mode, and trying to
instantiate a hashlib.md5() will fail when the system is running in
FIPS mode.
md5 is allowed when in a non-security context. There is a plan to
add a keyword parameter (usedforsecurity) to hashlib.md5() to annotate
whether or not the instance is being used in a security context.
In the case where it is not, the instantiation of md5 will be allowed.
See https://bugs.python.org/issue9216 for more details.
Some downstream python versions already support this parameter. To
support these versions, a new encapsulation of md5() has been added to
oslo_utils. See https://review.opendev.org/#/c/750031/
This patch is to replace the instances of hashlib.md5() with this new
encapsulation, adding an annotation indicating whether the usage is
a security context or not.
In this case, all hashlib.md5() invocations are to run tempest tests
so this is not a security context. With this patch, we can run tempest
tests from a FIPS enabled machine.
Change-Id: Ib301466bb0a1996997c63599918fa96059a927bd
Currently today we dont have any way in swift to verify that resources were deleted
before moving to the next command
In current code there was hardcoded sleep for 2 seconds instead of checking if
resource really deleted.
Added to the current cleanup :
Implement is_resource_deleted for object_client and container_client
After remove action we wait/ verify till resource really deleted
Remove hardcoded sleep for 2 seconds
Remove ignore for not found in reomval , if we hit on it means something
wrong in our code.
Change-Id: I32f37f8e874a3510bb1af6db45a1b9a8d2fed543
When Tempest is used in customer site, often we are required to
provide a testcase list including testcase names and descriptions.
Now no this kind of doc is available, so we can add descriptions
with the format of doc string for every testcase, so later we
can generata such a testcase description list.
There are hundreds of testcases missing descriptions, so we can
add them gradually, and limit the modified files in one patch
for the convenience of reviewing.
Change-Id: Id8f747c0eb018847bd9dc5bc3801ee973704da4b
partially-implements: blueprint testcase-description
When Tempest is used in customer site, often we are required to
provide a testcase list including testcase names and descriptions.
Now no this kind of doc is available, so we can add descriptions
with the format of doc string for every testcase, so later we
can generata such a testcase description list.
There are hundreds of testcases missing descriptions, so we can
add them gradually, and limit the modified files in one patch
for the convenience of reviewing.
Change-Id: I60d39b91ae064300347a789aa1b72a3115afae76
partially-implements: blueprint testcase-description
When Tempest is used in customer site, often we are required to
provide a testcase list including testcase names and descriptions.
Now no this kind of doc is available, so we can add descriptions
with the format of doc string for every testcase, so later we
can generata such a testcase description list.
There are hundreds of testcases missing descriptions, so we can
add them gradually, and limit the modified files in one patch
for the convenience of reviewing.
Change-Id: Ib0df766d305ab2583d284d4c0aed32e7685eb595
partially-implements: blueprint testcase-description
As explained in [1] it is not legitimate to require a Transfer-Encoding
header in Swift responses. That prevents running some tests
successfully in the case where Swift is behind a proxy/load-balancer
that does not use any Transfer-Encoding in its responses.
This change hence removes the checks for the presence of a
"Transfer-Encoding" header, and replaces them by the use
of the existing check methods, after modifying the
custom_matcher checks on which these methods rely on to accept
either a Content-Length or a Transfer-Encoding header.
Some adaptation was also required to avoid trying to process 'etag'
for DELETE requests.
A side-effect of this change is a code simplification and
cleanup since the specific header checks in the corresponding
tests are replaced by the generic check methods.
[1] https://bugs.launchpad.net/tempest/+bug/1819851/comments/3
Closes-Bug: 1819851
Change-Id: Iaccea41640a53b564f72cee73981e2e61d3e80ae
The bug which was the reason for skipping the test is considered
resolved. To make sure the test works, let's mark it unstable
for a while.
Change-Id: I7f02d82f5758bc2e32b06234652f755512a74787
Related-Bug: #1317133
The review drops usage of skip_path() filter in the related tests
and uses raw_request() instead.
Normally a swift url is organised as host:port/info and
host:port/v1/AUTH_<tenant-id>, see
https://docs.openstack.org/api-ref/object-store/
But RadosGW API is organised as host:port/swift/info and
host:port/swift/v1/AUTH_<tenant-id>, see
https://docs.ceph.com/docs/master/radosgw/config-ref/#swift-settings
Close-bug: 1799981
Change-Id: I6a932639a05defe0f04c600afcc35a19662937af
Several docstrings have incorrect format, what prevents to generate
a documentation using sphinx-apidoc extension.
Change-Id: I66431c7030089173d7635c1e2a72765db21f9780
Switch to using ID's instead of names for the test tenant and user.
Under Keystone v3 names (vs ids) are only supported for members of
the 'default' domain, so if accounts are created in a different domain
the container ACL tests will fail.
Switch to using ID's which are guaranteed to be unique across domains,
resolving test failures in this type of deployment configuration.
Change-Id: I79e5754379e3cf72d2a9858e6e69e8c190b0b2ed
Config option 'resources_prefix' was deprecated. It is
used by only manila plugin which fix has been commited.
This commit removes this config option and hardcode the
resource prefix as 'tempest'
Change-Id: Idce7af97fe6647e3095b2b626fbacb3446694fbc
Depends-On: I9c140b3a9efabeced7fc26cb1f169ebe6789d88b
delete_containers() expects containers should be list, but the method
is used for cleanup and it is easy to miss if a string value is passed
instead of list. This patch changes the method can cover a string case.
Change-Id: Ice9dafa5555e78dc68dc69e82acfd05b894492c1
Running tempest.api.object_storage.test_container_sync_middleware.
ContainerSyncMiddlewareTest.test_container_synchronization along with
all other swift testcases will fail with Unauthorized error, but it can
pass when being executed alone.
This is because clients in parent class ContainerSyncTest is a class
variable, which will cause trouble when using dynamic credentials. So
this is to change clients to an instance variable.
Change-Id: I10f04fadae95932258a5df58ef68d80f81075b79
Closes-Bug: #1740075
test_object_version.py keep created containers till
class level cleanup which is not needed.
This patch makes it to use addCleanup to remove containers
during test itself.
Change-Id: I0cda6692764031dbbee94965dd1d8d843dd94b12
Many of the method of object_client accept many headers and
query param.
This commit makes them to accept all headers and query param.
Partially implements blueprint consistent-service-method-names
Change-Id: I80668c00a38db00958bbe54421e69798d54482d7
There are few methods in object_clients which are
wrapper on PUT API with different combination of
headers.
As object_client is going to be declared as lib interface
it is better to remove these wrapper.
NOTE: Those methods are not being used outside of Tempest.
Partially implements blueprint consistent-service-method-names
Change-Id: Ia70ef3913c1650fad7b8f6b9019378b074c88155
Swift accept lot many headers in create container API but service
client method only accept the metadata headers.
This commit makes the PUT method to accept headers as kwargs.
Also this commit renames the PUT method to update_container because
that is PUT operation. In addition, this adds create_container as
the alias for the usability.
Details- https://developer.openstack.org/api-ref/object-store/#create-container
Partially implements blueprint consistent-service-method-names
Change-Id: I2a722bf181853ca903d05d4518b4c98764fadc12
Swift provides a single API to Create, Update or Delete
container metadata.
With different headers or values those operation can be
achieved. For example:
- delete metadata by passing metadata without value
- update metadata by passing updated value with same key
Details- https://developer.openstack.org/api-ref/object-store/?expanded=create-update-or-delete-container-metadata-detail
But current service client for account has 2 different
method for these operation. update_, delete_
To make it consistent with other service client and to have
single service client method per API, this patch merge those
methods.
Partially implements blueprint consistent-service-method-names
Change-Id: I75e40fc5c19d5b56d2be5f68e6cdb41bda4f9595
Make the list methods naming and doc string consistent
for container clients.
Partially implements blueprint consistent-service-method-names
Change-Id: Ibc770eef75a74880231d18670478e6ec99c90d1f
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
- Use six.StringIO instead of StringIO [1].
- Use six.int2byte instead of chr [1].
[1] https://pythonhosted.org/six/
Change-Id: I28d9ce6a435af1f9213c50569d2addf89c722ae3
Closes-bug: #1709546
A swift test relies on identity v2 client for no reason.
Removing that dependency so that we have no issue running v3 only.
Change-Id: Iff969ea556e9105d998a081ae80b00b2cb959f8c
All service clients methods return their response wrapped in
ResponseBody, ResponseBodyData or ResponseBodyList.
But object storage service clients were left out of this
because response from object storage APIs are not same way other
service return. Some APIs return is as string etc.
This commit makes capabilities_client to return ResponseBody
object with consistency to other service clients.
Also add unit tests for that.
This is step to move these clients to lib.
Partially implements blueprint consistent-service-method-names
Change-Id: Ida85033c06a50011b2cd9a86941089fb1ea7bedd
All service clients methods return their response wrapped in
ResponseBody, ResponseBodyData or ResponseBodyList.
But object storage service clients were left out of this
because response from object storage APIs are not same way other
service return. Some APIs return is as string etc.
This commit makes bulk_middleware_client to return ResponseBodyData
object with consistency to other service clients.
This is step to move these clients to lib.
Partially implements blueprint consistent-service-method-names
Change-Id: Iade0a1afd0e28ea42f12df175f55eadb1bea7071