Commit Graph

31 Commits

Author SHA1 Message Date
Kefu Chai
75570ce6a4 qa/keystone: pin python-openstackclient and osc-lib
keystone's dependencies are installed using its tox.ini,
which in turn uses a constraints file of
https://releases.openstack.org/constraints/upper/ussuri,
and it pins cliff to 3.1.0, which is not able to fulfill the requirement
of osc-lib 2.2.0. as it needs needs cliff>=3.2.0. per
https://releases.openstack.org/ussuri/, the latest osc-lib for
ussuri is 2.0.0. and osc-lib>=2.0.0 is required by
python-openstackclient 2.5.1, so let's use it instead of using the latest
one.

if we install cliff==3.1.0 along with python-openstackclient==5.2.1,
we will have following error, as `CommandManager.add_command_group()`
method was added to cliff in 3.2.0. see
8477c4dbd0,
so cliff failed to work with the latest openstackclient, like:

2020-06-29T17:26:23.402 INFO:teuthology.orchestra.run.smithi039.stderr:'CommandManager' object has no attribute 'add_command_group'
2020-06-29T17:26:23.402 INFO:teuthology.orchestra.run.smithi039.stderr:Traceback (most recent call last):
2020-06-29T17:26:23.403 INFO:teuthology.orchestra.run.smithi039.stderr:  File "/home/ubuntu/cephtest/keystone/.tox/venv/lib/python3.6/site-packages/cliff/app.py", line 264, in run
2020-06-29T17:26:23.403 INFO:teuthology.orchestra.run.smithi039.stderr:    self.initialize_app(remainder)
2020-06-29T17:26:23.403 INFO:teuthology.orchestra.run.smithi039.stderr:  File "/home/ubuntu/cephtest/keystone/.tox/venv/lib/python3.6/site-packages/openstackclient/shell.py", line 133, in
initialize_app
2020-06-29T17:26:23.403 INFO:teuthology.orchestra.run.smithi039.stderr:    super(OpenStackShell, self).initialize_app(argv)
2020-06-29T17:26:23.403 INFO:teuthology.orchestra.run.smithi039.stderr:  File "/home/ubuntu/cephtest/keystone/.tox/venv/lib/python3.6/site-packages/osc_lib/shell.py", line 442, in initialize_app
2020-06-29T17:26:23.404 INFO:teuthology.orchestra.run.smithi039.stderr:    self._load_plugins()
2020-06-29T17:26:23.404 INFO:teuthology.orchestra.run.smithi039.stderr:  File "/home/ubuntu/cephtest/keystone/.tox/venv/lib/python3.6/site-packages/openstackclient/shell.py", line 104, in
_load_plugins
2020-06-29T17:26:23.404 INFO:teuthology.orchestra.run.smithi039.stderr:    self.command_manager.add_command_group(cmd_group)
2020-06-29T17:26:23.404 INFO:teuthology.orchestra.run.smithi039.stderr:AttributeError: 'CommandManager' object has no attribute 'add_command_group'
2020-06-29T17:26:23.404 INFO:teuthology.orchestra.run.smithi039.stderr:Traceback (most recent call last):
2020-06-29T17:26:23.405 INFO:teuthology.orchestra.run.smithi039.stderr:  File "/home/ubuntu/cephtest/keystone/.tox/venv/lib/python3.6/site-packages/osc_lib/shell.py", line 134, in run
2020-06-29T17:26:23.405 INFO:teuthology.orchestra.run.smithi039.stderr:    ret_val = super(OpenStackShell, self).run(argv)
2020-06-29T17:26:23.405 INFO:teuthology.orchestra.run.smithi039.stderr:  File "/home/ubuntu/cephtest/keystone/.tox/venv/lib/python3.6/site-packages/cliff/app.py", line 264, in run
2020-06-29T17:26:23.405 INFO:teuthology.orchestra.run.smithi039.stderr:    self.initialize_app(remainder)
2020-06-29T17:26:23.405 INFO:teuthology.orchestra.run.smithi039.stderr:  File "/home/ubuntu/cephtest/keystone/.tox/venv/lib/python3.6/site-packages/openstackclient/shell.py", line 133, in
initialize_app
2020-06-29T17:26:23.405 INFO:teuthology.orchestra.run.smithi039.stderr:    super(OpenStackShell, self).initialize_app(argv)
2020-06-29T17:26:23.406 INFO:teuthology.orchestra.run.smithi039.stderr:  File "/home/ubuntu/cephtest/keystone/.tox/venv/lib/python3.6/site-packages/osc_lib/shell.py", line 442, in initialize_app
2020-06-29T17:26:23.406 INFO:teuthology.orchestra.run.smithi039.stderr:    self._load_plugins()
2020-06-29T17:26:23.406 INFO:teuthology.orchestra.run.smithi039.stderr:  File "/home/ubuntu/cephtest/keystone/.tox/venv/lib/python3.6/site-packages/openstackclient/shell.py", line 104, in
_load_plugins
2020-06-29T17:26:23.406 INFO:teuthology.orchestra.run.smithi039.stderr:    self.command_manager.add_command_group(cmd_group)
2020-06-29T17:26:23.406 INFO:teuthology.orchestra.run.smithi039.stderr:AttributeError: 'CommandManager' object has no attribute 'add_command_group'

in this change the openstackclients version is pin'ed to the
latest stable of 5.2.1. will have a separated PR to bump up
the cliff version on teuthology side.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-07-22 19:20:00 +08:00
Kefu Chai
60269764b4 qa/keystone: unpin python-openstackclient
this reverts 2dac5c5012cffb5f41d7e7457569c6bfdc53ec26,
as we don't use `--os-url` anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-06-02 09:48:32 +08:00
Kefu Chai
8f5c832915 qa/tasks/tempest: use user/pass to authenticate
instead of using admin token use "admin" user to authenticate,
as admin token is not suggested anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-06-02 09:48:32 +08:00
Kefu Chai
a53c69943c qa/tasks/keystone: use "keystone-manage bootstrap"
* qa/tasks/keystone.py:
  instead of prefilling keystone manually, use "keystone-manage bootstrap"
  instead. it helps to setup the admin user, a "Default" domain with
  "default" id, and wire them up with the expected role and a "admin" project,
  etc. as id of the admin domain is known to be "default", we can just use it
  in our tests without querying openstack for the id of "Default"
  domain. this is very handy.
* qa/suites/rgw/tempest/tasks/rgw_tempest.yaml:
  use "Default" for domain name. as "Default" is the name of the domain
  created by bootstrap, while "default" is its id.
* qa/suites/rgw/crypt/2-kms/barbican.yaml:
  remove settings to bootstrap keystone

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-06-02 09:48:32 +08:00
Kefu Chai
9bd3e0ff40 qa/suites/rgw/tempest: bump up keystone to 17.0.0
* also generate a sample conf file following the document at
  https://github.com/openstack/keystone/tree/17.0.0.0rc2/etc
* use "projects" instead of "tenants" to match the terminology used by
  openstack identify API 3.0.
* test API 3.0 instead of API 2.0, by changing
  `rgw_keystone_api_version` from "2" to "3"
* explicitly specify a domain "default" for project to be created,
  otherwise a POST request will fail with:
```
{"error":{"code":400,"message":"You have tried to create a resource using the admin token. As this token is not within a domain you must explicitly include a domain for this resource to belong
to.","title":"Bad Request"}}
````
* create "default" domain, and use it, othewise a GET request fails
  like:
```
2020-05-28T11:17:28.751 INFO:teuthology.orchestra.run.smithi092.stderr:http://smithi092.front.sepia.ceph.com:35357 "GET /v3/domains/default HTTP/1.1" 404 87
2020-05-28T11:17:28.752 INFO:teuthology.orchestra.run.smithi092.stderr:RESP: [404] Content-Length: 87 Content-Type: application/json Date: Thu, 28 May 2020 11:17:28 GMT Server: WSGIServer/0.2
CPython/3.6.9 Vary: X-Auth-Token x-openstack-request-id: req-bc33796f-2bc3-411c-a7fb-1208918e0dbd
2020-05-28T11:17:28.752 INFO:teuthology.orchestra.run.smithi092.stderr:RESP BODY: {"error":{"code":404,"message":"Could not find domain: default.","title":"Not Found"}}
```
* add user to "default" domain when creating it.
* use "type" as the positional argument, per
  https://docs.openstack.org/keystone/pike/admin/cli-keystone-manage-services.html
  otherwise we will have failures like:
```
2020-05-28T13:38:24.867 INFO:teuthology.orchestra.run.smithi198.stderr:openstack service create: error: unrecognized arguments: --type keystone
```
* update `create_endpoint()` to use the V3 API,
  see
  https://docs.openstack.org/python-openstackclient/pike/cli/command-objects/endpoint.html

Fixes: https://tracker.ceph.com/issues/45692
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-06-02 09:48:32 +08:00
Kefu Chai
a620587ecf qa/tasks/keystone.py: support multiple positional args
it's required when creating endpoint, see
https://docs.openstack.org/python-openstackclient/pike/cli/command-objects/endpoint.html,
where we need to pass <service>, <interface>, and <url>

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-06-02 09:48:32 +08:00
Kefu Chai
35a3d5f7f8 qa/tasks/keystone.py: use list(a_dict) for concatenating lists
`dict.items()` does not return a list in python3, so we need to convert
it to a list first.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kyr Shatskyy
dcf85e4328 qa/tasks/keystone: get rid of cStringIO for py3
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
2020-03-06 10:19:55 +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
Kyr Shatskyy
50b1823fac qa: get rid of iteritems for python3 compatibility
Fixes: https://tracker.ceph.com/issues/42267
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
2019-10-15 11:27:39 +02:00
Kyr Shatskyy
5f95b532aa qa: get rid of iterkeys for py3 compatibility
Fixes: https://tracker.ceph.com/issues/42287

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
2019-10-11 18:54:29 +02:00
Casey Bodley
3bb3d817ff qa/keystone: add --debug to openstack commands
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2019-09-13 15:04:43 -04:00
Casey Bodley
392d746141 qa/keystone: save keystone config to archive dir
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2019-09-13 15:04:43 -04:00
Casey Bodley
29ac64304d qa/keystone: hardcode --os-identity-api-version 2.0
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2019-09-13 15:04:43 -04:00
Casey Bodley
2dac5c5012 qa/keystone: add requirements.txt with python-openstackclient
works around a VersionConflict error by including the requirements on
jsonschema when installing python-openstackclient

also pin the version of python-openstackclient, because newer clients
don't seem to recognize --os-url

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2019-09-13 15:04:43 -04:00
Casey Bodley
7d479d0bf8 qa/keystone: log to a file in the archive dir
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2019-09-13 15:04:43 -04:00
Casey Bodley
2144fd8cc7 qa/keystone: pip install bindep
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2019-09-13 15:04:43 -04:00
Casey Bodley
86930f3e0f qa/keystone: use bindep to discover keystone's dependencies
downloads the keystone repository first, because we need
keystone/bindep.txt to discover the binary dependencies

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2019-09-13 15:04:43 -04:00
Casey Bodley
0cc6a832c3 qa/keystone: add missing ConfigError import
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2019-09-13 15:04:43 -04:00
Adam Kupczyk
a5ec971402 tasks/barbican: Added task to deploy and configure barbican
Fixed keystone, rgw and s3tests tasks to work with it.

Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
2019-09-13 15:04:43 -04:00
Sage Weil
9c729a78be qa/tasks/keystone.py: no need for notcmalloc in example
Signed-off-by: Sage Weil <sage@redhat.com>
2019-02-08 09:12:01 -06:00
Casey Bodley
338b97a8b9 qa/rgw: patch keystone requirements.txt
an ugly workaround for a python dependency conflict that's broken the
rgw/tempest suite. allows us to preserve the pinned versions of
keystone/tempest without having to maintain a fork of the keystone
repository

Fixes: http://tracker.ceph.com/issues/23659

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2018-08-02 16:43:42 -04:00
Radoslaw Zarzynski
3dbacd1387 qa/tasks/keystone: make possible to deploy Keystone on CentOS as well.
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2017-08-13 23:14:40 +00:00
Radoslaw Zarzynski
afe1ad3010 qa, rgw: Keystone's instances can be now accessed via non-local network interfaces.
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2017-08-13 23:14:40 +00:00
Radoslaw Zarzynski
f81669f673 qa/tasks/keystone: handle packaged dependencies of Keystone.
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2017-08-13 23:14:40 +00:00
Radoslaw Zarzynski
1d8a4e5921 qa/tasks/tox: separate tox deployment from Keystone.
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2017-08-13 23:14:40 +00:00
Radoslaw Zarzynski
2a845344e7 qa/tasks/keystone: comply wih the CLI interface older openstack-client.
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2017-08-13 23:14:40 +00:00
Radoslaw Zarzynski
c1d93e80c8 qa/tasks/keystone: deploy tox.
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2017-08-13 23:14:40 +00:00
Radoslaw Zarzynski
979d936ad1 qa/tasks/keystone: the task can be now executed also on remotes.
Initially it was compatible with local_runner only.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2017-08-13 23:14:40 +00:00
Radoslaw Zarzynski
2ee29a7c6a qa/tasks/keystone: deploy a Keystone instance for testing RadosGW.
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2017-08-13 23:14:40 +00:00