73 Commits

Author SHA1 Message Date
Martin Kopec
71000ff2d5 Reflect osf/ to openinfra/ namespace rename
Lately osf/ namespace got renamed to openinfra/ [1], this commit
reflects this change within refstack-client's repo.

[1] https://review.opendev.org/c/openstack/project-config/+/808479

Change-Id: I629d84cc8eed63ef8f33d3e063a3c7dc763c1d37
2021-10-21 21:08:37 +00:00
Martin Kopec
0fb2a056c9 Fix load() missing argument Loader
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
2021-10-21 21:06:55 +00:00
Martin Kopec
d9924541d8 Remove concurrency workaround
After we bumped tempest version used in refstack to the commit
from Oct 2019 [1], we can remove concurrency workaround which
was needed only until the tempest version used in refstack
doesn't contain this commit [2] which is from Mar 2019.

[1] https://review.opendev.org/c/osf/refstack-client/+/782592
[2] https://review.opendev.org/c/openstack/tempest/+/641349

Change-Id: I17d5df4635b0451e4442ef693f4293ee3851ff6d
2021-04-18 20:44:15 +00:00
Thierry Carrez
028d13d74b Remove warning about deprecated signer function
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
2021-01-13 15:05:02 +01:00
Thierry Carrez
832b712812 Fix output of sign command
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
2021-01-13 15:04:30 +01:00
Martin Kopec
1fce1e362e Inclusive jargon
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
2021-01-04 15:08:48 +00:00
Martin Kopec
f018caa06e Unite tempest_dir in _get_next_stream_subunit_output_file
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
2020-12-18 20:31:26 +00:00
Zuul
b93f14f4e6 Merge "Initialize verbose flag properly" 2020-12-11 12:26:43 +00:00
Zuul
b576c974fd Merge "Replace GitHub repositories with OpenDev repositories" 2020-11-19 16:48:12 +00:00
Martin Kopec
f069afca67 Fix pep8, flake8 and unit test failures
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
2020-11-18 15:42:33 +00:00
Christian Berendt
4a6ceb8acf Replace GitHub repositories with OpenDev repositories
Change-Id: I7cce77dae30b1331c093a560946dc5ff31eb986a
2020-06-30 13:56:37 +02:00
Artem Goncharov
d037611e99 Initialize verbose flag properly
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
2020-02-20 12:55:14 +01:00
Martin Kopec
5be0ac7a6f Set concurrency to 0
until refstack-client uses tempest tag which contains
default value for concurrency it needs to be set here.

Change-Id: Ic33639f39a21d5827c9ffe14fc76a47a36c7b47f
2019-03-07 09:03:14 +00:00
Martin Kopec
ab8ec0a485 Fix overrides and image_path
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
2018-10-14 22:01:08 +00:00
Arx Cruz
2d3efc28a5 Update refstack client to use project instead of tenant
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
2018-10-12 11:59:23 +02:00
Martin Kopec
044cf48649 Generate files under ./etc
According the README, the tempest.conf and accounts.yaml
files should be generated under refstack-client/etc/ dir.

Change-Id: Ic1024b56273466bc85836b335eab89f615e5f9f9
2018-10-02 08:12:33 +00:00
Chandan Kumar
74b6ac1c3f Refstack-client should use stestr for tempest testing
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
2018-09-03 18:01:49 +05:30
Chandan Kumar
e1744ea1e4 Generate tempest.conf automatically using refstack-client
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
2018-08-13 19:59:53 +05:30
Luz Cazares
a13a5a4375 Remove usage of tempest install_venv scripts
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
2018-05-14 11:13:23 -07:00
Chris Hoge
91a9142ac9 Enable parallel test execution
Change-Id: Iccebb50fe87633934d356d0ba7dd85deff8c79a7
2017-10-18 17:46:39 -05:00
Zuul
52e4a89ae0 Merge "Replace ostestr with tempest run" 2017-10-16 23:29:17 +00:00
vagrant
ae949741ad Replace ostestr with tempest run
ostestr has been removed, and is being replace with the
`tempest run` command for now.

Change-Id: Ie6b13ed3967f31248aea0cbeb9cde75a02b690f8
2017-10-10 17:40:55 +00:00
Luz Cazares
aa15405555 Change auth_url setup according to Tempest docs
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
2017-10-04 00:13:41 +00:00
Luz Cazares
c876311111 Add python35 support
To be aligned with community goals
Add python35 support to refstack-client

Change-Id: I42ccc6128fc6a83ddee0e4014cbe2c8793b84012
2017-08-09 18:28:53 -07:00
Luz Cazares
ef1cc141a3 Switch from pycrypto to cryptography
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
2017-06-27 20:40:15 +00:00
Paul Van Eck
770acc7765 Check conf file permission
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
2017-05-23 18:19:17 -07:00
Catherine Diep
f7a9226899 Fix to not run any test when the input test list is empty
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
2017-04-07 12:40:19 -07:00
xuchao
11980519c2 Modify the invalid url
Change-Id: I97f4f67bf26a23d8971b4531c1b911753e44ef73
2016-11-29 14:42:52 +08:00
Paul Van Eck
333cdde312 Propagate insecure arg to all requests
If the --insecure/-k flag is passed in, all requests should honor it.

Change-Id: I7bbd9f481595f8a90db3e96f890ec9315b01000c
Closes-Bug: #1633145
2016-10-18 15:54:58 -07:00
Luz Cazares
e610492537 Replace run_tempest.sh script with ostestr command
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
2016-07-06 13:18:37 -07:00
Stephen Lowrie
abb45d2e41 Add entry_point during setup
Change-Id: Ic929dbd053ff99a91ef71870c1b01fa0ee2bb17e
2016-03-21 11:24:00 -05:00
Jenkins
a35b727169 Merge "Fix incorrect auth config key" 2016-03-04 17:48:07 +00:00
Charles Mholen Siloy
800795b088 Fix incorrect auth config key
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
2016-03-04 07:49:07 +00:00
Simeon Monov
b066bd68a8 Identity section should not be used to specify credentials
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
2016-03-03 23:13:20 +01:00
Dolph Mathews
1b7f413b60 Pass tempest return code back to caller
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
2016-02-04 15:22:28 +00:00
david liu
0fc224a533 Remove RefStack dependency on Keystone client.
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
2016-01-23 14:43:01 +08:00
Paul Van Eck
90a79907c5 Add support for subunit file uploading
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
2016-01-15 11:35:09 -08:00
Paul Van Eck
2c355b84a4 Add cpid failover
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/
2016-01-04 11:58:42 -08:00
cdiep
1d392df77f Fix refstack-client testing with test-list option failure.
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
2015-11-18 14:59:52 -08:00
david liu
e04a06b106 Address regression and strengthen cpid checks
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
2015-11-13 23:11:34 +00:00
Jenkins
1c7db8829e Merge "Add guard checks in _get_cpid_from_keystone." 2015-11-12 09:02:20 +00:00
david liu
c39c3c7981 Add guard checks in _get_cpid_from_keystone.
Closes-Bug: #1502949

Change-Id: I8e4bea2b5ab0e60d92fc07a5f0cfa60a7f84732d
2015-11-11 19:34:11 +08:00
Jenkins
0d9423ebc3 Merge "refstack-client default verbosity should be info." 2015-10-19 09:31:28 +00:00
david liu
960d675125 refstack-client default verbosity should be info.
Closes-Bug: #1493588

Change-Id: I1f0c99f2b08b706356d9206da196729488f3b09a
2015-10-15 14:45:05 +08:00
cdiep
84e4ef114d Update RefStack server URL to refstack.openstack.org.
Change-Id: I36308b2b0b15321369f2911f924653dddb2d089f
2015-10-12 10:53:43 -07:00
Daryl Walleck
02d9ba7529 Provides capability to use a Tempest accounts file
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
2015-10-05 18:08:26 -05:00
Matthew Edmonds
d16248ff02 fix v2 fetch of Cloud Provider ID
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
2015-09-17 20:09:37 -07:00
sslypushenko
ecba34b7dd Remove dependency on admin creds
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
2015-09-17 19:18:21 +03:00
cdiep
bd2205afc0 Update refstack-client to reflect movement to openstack namespace.
Change-Id: I65a1c0ab2658a0f5662ccafd49bc38557c63af2a
2015-09-14 09:45:45 -07:00
Paul Van Eck
1cb14d52c5 Allow insecure keystone connection
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
2015-09-03 14:41:50 -07:00