This patch replace yaml.load() by yaml.safe_load() which will
fix the TypeError our jobs currently face:
TypeError: load() missing 1 required positional argument: 'Loader'
Change-Id: I3d238eabf374be895782ebc9e4907db93157a5d4
Use of signer/verifier functions has been deprecated since
cryptography 2.0, and a deprecation warning is shown on
every use of the 'refstack-client sign' command.
Remove that warning by using the sign function instead
of the signer function, as described in:
https: //github.com/pyca/cryptography/blob/1.9/docs/hazmat/primitives/asymmetric/rsa.rst#signing
Change-Id: Id9d5ed33b601771cd75df421a15ed2894fcd4d92
The 'refstack-client sign' command currently fails to produce
data that is directly copy-pastable into the RefStack website:
- the 'Public key' might contain the key comment, if the public key
is read from a .pub file that includes one
- The 'Self-signature' is enclosed in b'...'
This fixes the proposed output by stripping the key comment of the
comment (if any) and converting the signature bytes into a string.
Change-Id: If782d81d18c44fa3e5e4c8e529a68b217f6fb84b
Following tempest's example where arguments such as --blacklist-file,
--black-regex and --whitelist-file are deprecated by [1], let's do
the change here as well.
A few occurrences cannot be renamed atm as refstack-client uses an older
tempest version which doesn't contain the change [1] yet. After we update
the tempest version used in this project, the rest occurrences will be
renamed as well.
[1] https://review.opendev.org/c/openstack/tempest/+/768583
Change-Id: I514fb688f6895338a877cbc706ddd8d6fc5f906d
The method have used tempest_dir value given by the argument as well
as self.tempest_dir value which was confusing and lead to a unit test
failure in the case when tempest_dir was a valid path to an existing
tempest environment.
Usually self.tempest_dir and tempest_dir were the same, the values
were different only in a unittest which was editing the tempest dir
path for test purposes.
The docstring suggests that the method should use the value from the
argument, therefore the patch removes the self.tempest_dir occurrence.
Change-Id: I80dc38e6f0dcff1956f2881894d51a1c35577b33
The patch edits the code so that it complies with W605 rule
wherever it makes sense. W504 rule is added to a ignore list.
High version cap of pyflakes and flake8 packages is increased
as well.
Change-Id: I51558ee9c808e03b4164d0832fc525c5556dddd1
When running refstack-client without verbose mode enabled exception
occurs, since the argparse argument is not properly initialized. Do this
by setting default to 0.
Change-Id: I1c5abc8d0ee0b14d3b7294b0e77274c270c5055c
until refstack-client uses tempest tag which contains
default value for concurrency it needs to be set here.
Change-Id: Ic33639f39a21d5827c9ffe14fc76a47a36c7b47f
The patch fixes the default value of image argument,
which was missing and caused problems in python-tempestconf.
Then the overrides weren't parsed corectly and were not exposed
to python-tempestconf. The patch fixes that too.
Story: 2003787
Task: 26493
Change-Id: Iaeecb838599039067a5b198ec3a08c233dfdac94
New version of keystone replace tenant for project, and it returns none
when we have an accounts.yaml file using project_name, this patch looks
for both tenant_name and project_name, whichever get set, it will get
the value.
Also, checks for test repository, and if doesn't exist, call the init
command
Change-Id: I97fa91ee64933fa713f7e1354403bd6b3884f52a
According the README, the tempest.conf and accounts.yaml
files should be generated under refstack-client/etc/ dir.
Change-Id: Ic1024b56273466bc85836b335eab89f615e5f9f9
Tempest has changed to use stestr instead of testr and testrepository
starting from 18.0.0,and the testr.conf was removed:
https://review.openstack.org/#/c/504345/
refstack-client will not able to run for tempest 18.0.0 as some commands
need the testr.conf in the path:
root@defcore:/home/defcore/refstack-client/refstack_client#
/home/defcore/refstack-client/.tempest/tools/with_venv.sh testr
list-tests
No .testr.conf config file
Tempest Commit SHA: 8316f962c52b01edc5be466b18e54904e2a1248a pointing
to tempest 19.0.0
Install tempest from master
Updated Guidelines to match 2018.02
Change-Id: Ic796cc7ad48037e64a4437d4834051c7fa7cbda1
Closes-Bug: #1765609
Usage: $ refstack-client config --use-test-accounts <path to test
accounts file>
If not accounts.yaml is passed then:
$ refstack-client config
It will generate accounts.yaml and tempest.conf in etc folder
* It adds support for the above command
* Added zuul based devstack job to run the same
* let setup_env handles the installation of tempestconf
* updated git url for tempest
* It also generates accounts.yaml if no account file is
passed
* we can --overrides flag to overrides the tempest.conf
value.
* volume-feature-enabled.api_v2=True is added as default
in overrides as it is deprecated in Rocky cycle but needed
for interop tests.
Depends-On: https://review.openstack.org/589260
Story: 2001696
Task: 19758
Change-Id: I9cabfc52672e7a8a54792ca9d867c62babf12cb7
install_venv script was removed from tempest back in Jan, 2016
Further details see Ib7dd6b34533880e48b367732ae3520026a92500e
This patch removes script references since virtualenv management is
handled during refstack installation.
Change-Id: I9c6a9a84792c5f4afd38d53f8a5cb86ecfa344a3
Refstack-client fails when tempest value "api_v3" under section
identity_feature_group is not set. But according to Tempest docs:
https://docs.openstack.org/tempest/latest/configuration.html#keystone-connection-info
api_v3 is not required to stablish a connection with keystone.
Furthermore it defaults to True which will enable v3 features
unless explicitly set to False.
This fix simplifies the way we set auth_url
Change-Id: I1a4ea9cdcc625f94f978e1a929de1f543000051d
PyCrypto seems to no longer be maintained and has issues with
Python 3+. This patch switches refstack-client to use the cryptography
library instead. Cryptography is actively maintained and works with
later versions of Python.
Change-Id: Ie6d1405b1d48bcf12b6064f32a77810cbfc46a86
Since SafeConfigParser.read doesn't thrown an exception
when a file can not be opened, we must explicitly check first.
Change-Id: Ifa5c58e5c30323956a401beae9396ffb0b97dbd9
Closes-Bug: #1692587
When running refstack-client with the "--test-list" option, the
entire API tests were run when the input test list file has no
content. The correct behavior should be that no test would be
run if the test-list is empty.
Closes-Bug: #1677153
Change-Id: I0049f185e8c771419c0464a81d4f631ee5946ef2
QA community default test runner is ostestr, and using run_tempest.sh
script is no longer recommended. BP replaces run_tempest.sh script
with direct ostestr call passing the appropriate parameters.
Implements blueprint: implement-ostestr-refstackclient
Change-Id: If4ffed70c8320abb4b4c7bfd1b84ca7892272665
This patch simply changes 'username' to 'tenant_name' under
the _generate_keystone_data function when the value of for
'name' under 'project' is being called.
Closes-Bug: #1552025
Change-Id: I3fac7a3014368334f69f7ff1732cc3587f9db99d
Credentials should be specified in the accounts file
as described in the Tempest configuration guide
(http://docs.openstack.org/developer/tempest/configuration.html).
Specifying credentials in the identity section of the tempest
config file is deprecated.
If the user provides credentials in the identity section of tempest
config file and does not provide accounts file, show a warning
that this is deprecated and will be not supported in the future.
If the user does not provide credentials at all, show an error and
exit.
Show information to the user how to configure the credentials.
Update the refstack-client unit tests that still use the identity
section to use accounts file instead.
Change-Id: I6eab3b587292a35404c93da35914ad1f53ef49c7
Closes-Bug: #1552377
Use case: I'm running refstack-client in a tox job, which always appears
to succeed, even when the test fails.
Currently, unless it throws a backtrace on it's own, the refstack-client
script always returns successfully, even when the tempest job it's
running fails.
This change simply passes non-zero return codes back through as the
refstack-client's return code.
Only the test() method was affected here, because it's the only
externally callable function that uses subprocess. Other functions can
now return non-zero return codes as well.
Change-Id: I0ce786babcbee47da1c038a3478bcd4de0dff16e
RefStack should use Tempest approach for retrieving Keystone service
Id. For RefStack purpose, raw API call to keystone should be enough
to get necessary information.
Closes-Bug: #1528357
Change-Id: I555308aabb59b638e22249ead882ca5b09043b7b
This patch allows subunit files to be uploaded to a RefStack
server using the refstack-client. This adds the new command
'upload-subunit'.
Change-Id: Ie8079c66a732da34d08c46664e441723cf904c3a
If the client can't get the identity service ID from the cloud,
the client will use a hash of the endpoint's hostname as the CPID.
Change-Id: I0d61ccb05caf40131a2590bd89b6fce7c62cedd2
Implements-Spec: https://review.openstack.org/#/c/255607/
With the test-list option, refstack-client will first normalize the
user input test list to the test list from the currently installed
Tempest. There seems to be some non RefStack updates in the recent
releases that "testr list-tests" would now require a valid
tempest.conf for test listing. The path of the tempest.conf file
is determined by the .tempest/tempest/config.py module. If a
tempest.conf file is not found, then the failsafe file is used,
namely "/etc/tempest/tempest.conf" which does not exist in
refstack-client.
This patch initialzes the tempest conf related environment variables
with the user passes in information before starting the test run.
Closes-Bug: #1516458
Change-Id: Ic2cdbdcdf575e23cb0fc59c5478ceda5807c06fb
Use a try/except block instead of checking if keys exists
for cleaner code. Now if the identity key is not found in the
catalog, the user will get an error instead of the function
returning None as the cpid.
Closes-Bug: #1502949
Closes-Bug: #1515880
Co-Authored-By: Paul Van Eck <pvaneck@us.ibm.com>
Change-Id: I63942fbf28eff5da58de754ef870506fb246d2d6
refstack-client currently uses the user information
provided in the identity section of the Tempest configuration
when determining the cpid. The account information from the
identity section has now been made optional and a secondary
option of using a yaml file with test account information
was added.
refstack-client currently is not aware of this accounts file
and will fail to run if the user is using only the accounts file
and has not filled in the user information in the identity
section. This change checks to see if the user has specified
an accounts file to use and reads the user data from there
when applicable.
Change-Id: Id5a5a1800febc23a1006b29e58fec05a3aa40af1
Closes-Bug: 1501903
Corrects a bug that caused retrieval of the keystone ID to be used as
the Cloud Provider ID to fail when using keystone v2.
Change-Id: Id378e8ff31472fd2eb194fd59ecd8042297229d8
Closes-Bug: #1497067
This patch changes the way refstack-client gets keystone service id.
Now non-admin creds should be enought for that.
This patch adds support for Keystone API V3.
Keystone API version selected from tempest.conf
Section: 'identity-feature-enabled', key: 'api_v3'
Closes-Bug: #1495671
Change-Id: I1f9edffba88cf99c39b2c8b99f792088d35dbd2e
Sometimes a keystone endpoint might have ssl issues, and you might
get an error like "certificate verify failed". This patch extends the
'-k/--insecure' arg to allow skipping ssl checks when connecting to
keystone.
Change-Id: Icd09aa9906cabc1f4f5ab635fb30fbcebbd37ced