Commit Graph

30 Commits

Author SHA1 Message Date
Matt Benjamin
0046803534 qa/rgw: use local runner with cmdline radosgw_admin.py
Restore ability to run radosgw_admin.py unit standalone--improved
to use vstart_runner hooks.

Local rgwadmin(...) wrapper suggested as a cleanup in review by Casey.

Fixes: https://tracker.ceph.com/issues/52837

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
2021-11-17 11:22:32 -05:00
Matt Benjamin
788da98cde qa/rgw: fix ops log tests to handle non-bucket ops (which are now valid)
After 3863eb89512f1698b8e56f1f1ffc78a6ca8d5826--rgw: permit logging of
list-bucket (and any other no-bucket op-- the radosgw ops-log
contains entries for ops with no associated buckets--e.g., list_buckets.
When examining such a log object in the radosgw_admin task, don't assert
that it has any bucket name.

Fixes: https://tracker.ceph.com/issues/52647

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
2021-10-06 16:08:06 -04:00
Kefu Chai
4d9cca04e5 qa/tasks/radosgw_admin: drop py2 support
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-07-05 10:58:28 +08:00
Kefu Chai
96ed9c87c0 qa/tasks/radosgw_admin.py: coerce key.name and key.acl to str
if `key.name` is not set, boto fills it with md5, in that case, it comes
from `base64.b64encode()`. so we need to make sure it's str before
passing it to shell.

the same applies to `key.get_xml_acl()`, as its return value comes
directly from something like
```
        response = self.connection.make_request('GET', self.name, key_name,
                                                query_args=query_args,
                                                headers=headers)
        body = response.read()
        # ...
        return body
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
9ccf88d95f qa/tasks: pass encoding to Key.get_content_as_string()
we assume that boto.Key.get_content_as_string() returns str instead of
bytes, and compare the return value with a string, so, to ensure that
lhs and rhs are both strings, we need to decode the returned content.

since we always store strings composed with ASCII, it's safe to use
'ascii' to decode them.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
590e9b35aa qa/tasks/radosgw_admin.py: do not use dict.has_keys()
in python3, `dict.has_key()` was removed. let's use __contains__
instead.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
4a9c43313a qa/tasks/radosgw_admin: use HTTPMessage as a dict in PY3
in Python3, HTTPMessage is a dict-like class by itself, and it does not
offer `dict` attribute anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
d7258ea7fd qa/tasks: use next(iter(..)) for accessing first element in a view
in python2, dict.values() and dict.keys() return lists. but in python3,
they return views, which cannot be indexed directly using an integer index.

there are three use cases when we access these views in python3:

1. get the first element
2. get all the elements and then *might* want to access them by index
3. get the first element assuming there is only a single element in
   the view
4. iterate thru the view

in the 1st case, we cannot assume the number of elements, so to be
python3 compatible, we should use `next(iter(a_dict))` instead.

in the 2nd case, in this change, the view is materialized using
`list(a_dict)`.

in the 3rd case, we can just continue using the short hand of
```py
(first_element,) = a_dict.keys()
```
to unpack the view. this works in both python2 and python3.

in the 4th case, the existing code works in both python2 and python3, as
both list and view can be iterated using `iter`, and `len` works as
well.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 20:33:47 +08:00
Kefu Chai
80b71ef461 qa: import py3 compatible modules using six
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-03-24 18:27:55 +08:00
Kefu Chai
947a74349d qa: import with full path
to be py3 compatible

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-03-24 18:27:55 +08:00
Kyr Shatskyy
0a224991cf qa/tasks/radosgw_admin: get rid of cStringIO for py3
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
2020-03-06 10:19:55 +01:00
Kyr Shatskyy
08b83007dc qa/tasks/radosgw_admin: fix tab inconsistancy
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
2020-03-06 10:19:55 +01:00
Abhishek L
7c1a690560
Merge pull request #30684 from theanalyst/rgw/qa/rgw-admin-user-stats
qa: radosgw_admin: validate a simple user stats output

Reviewed-By: Casey Bodley <cbodley@redhat.com>
2020-02-04 17:21:25 +01:00
Thomas Bechtold
bdcc94a1d1 qa: Run flake8 on python2 and python3
To be able to catch problems with python2 *and* python3, run flake8
with both versions. From the flake8 homepage:

It is very important to install Flake8 on the correct version of
Python for your needs. If you want Flake8 to properly parse new
language features in Python 3.5 (for example), you need it to be
installed on 3.5 for Flake8 to understand those features. In many
ways, Flake8 is tied to the version of Python on which it runs.

Also fix the problems with python3 on the way.
Note: This requires now the six module for teuthology. But this is
already an install_require in teuthology itself.

Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
2019-12-13 09:24:20 +01:00
Thomas Bechtold
0127cd1e88 qa: Enable flake8 tox and fix failures
There were a couple of problems found by flake8 in the qa/
directory (most of them fixed now). Enabling flake8 during the usual
check runs hopefully avoids adding new issues in the future.

Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
2019-12-12 10:21:01 +01:00
Yehuda Sadeh
1bf21326aa qa: radosgw-admin: remove dependency on bunch package
Fixes: https://tracker.ceph.com/issues/43184

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2019-12-08 19:41:17 -08:00
Kyr Shatskyy
7e87f80a87 tests: use python3 compatible print
Fixes: https://tracker.ceph.com/issues/42210
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
2019-10-11 19:02:04 +02:00
Abhishek Lekshmanan
5d0f33c603 qa: radosgw_admin: validate a simple user stats output
In order to validate that we create user stats correctly

Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
2019-10-02 10:30:26 +02:00
Shilpa Jagannath
fd86bf726f Test to link/unlink bucket in tenanted user space.
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
2019-08-22 16:16:53 +05:30
Shilpa Jagannath
07142d5f9e Added test to verify user rename failure.
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
2019-08-05 12:16:23 +05:30
Shilpa Jagannath
80d5e962b7 Added user rename test
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
2019-07-30 14:00:45 +05:30
Casey Bodley
d4c33f0177 qa/rgw: add class for rgw endpoints
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2018-03-09 16:31:32 -05:00
lvshanchun
2c1653ca37 radosgw-admin zonegroup get and zone get return defaults when there is no realm
Fixs: http://tracker.ceph.com/issues/21615
Signed-off-by: lvshanchun <lvshanchun@gmail.com>
2017-11-16 23:43:55 +08:00
Marcus Watts
a45ab45f74 Test bytes_sent bugs.
Rearrange logic to make it easier to measure accumulation.
Instrument the boto request/response loop to count bytes in and out.
Accumulate byte counts in usage like structure.
Compare actual usage reported by ceph against local usage measured.
Report and assert if there are any short-comings.
Remove zone placement rule that was newly added at end: tests should be rerunable.

Nit: the logic to wait for "delete_obj" is not quite right.

Fixes: http://tracker.ceph.com/issues/19870
Signed-off-by: Marcus Watts <mwatts@redhat.com>
2017-08-08 21:56:01 -04:00
Casey Bodley
9d82486d0e qa/rgw: remove radosgw-agent tests from radosgw_admin task
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2017-05-19 15:53:37 -04:00
Casey Bodley
88b6a142bc qa/rgw: fix assertions in radosgw_admin task
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2017-04-27 19:38:10 -04:00
Ali Maredia
b31b84529e rgw multisite: use get_config_master_client for radosgw_admin task
Signed-off-by: Ali Maredia <amaredia@redhat.com>
2017-04-13 12:15:50 -04:00
Ali Maredia
c5956790e6 rgw: multisite enabled over multiple clusters
Added '--cluster' to all necessary commands
ex: radosgw-admin, rados, ceph, made sure
necessary checks were in place so that clients
can be read with our without a cluster_name
preceeding them

Made master_client defined in the config for
radosgw-admin task

Signed-off-by: Ali Maredia <amaredia@redhat.com>
2017-04-13 12:15:50 -04:00
Yehuda Sadeh
515db13970 qa/tasks/radosgw_admin: adjust test to new bucket structure
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-03-09 09:18:56 -08:00
Sage Weil
c01f2ee0e2 move ceph-qa-suite dirs into qa/ 2016-12-14 11:29:55 -06:00