59 Commits

Author SHA1 Message Date
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
cdiep
4d141d885e Rename "Refstack" to "RefStack"
The RefStack team has decided to use "RefStack" as the name of our
project.

Change-Id: Ibd3fa01f0904549f22eaf4883116631a4e5b3d01
2015-08-31 16:15:36 -07:00
Paul Van Eck
1ed86f22c0 Update default RefStack API endpoint
The refstack.net site was updated to use a single domain in order for
the new patches to work. Thus, the default api endpoint should reflect
the new api endpoint which is refstack.net/api.

Change-Id: Icc7b501a65792a79635c4a7263eb9a3e0767d33e
2015-08-19 08:22:08 -07:00
sslypushenko
67de4f69dc Add command to generate pubkey's signature
Uploading public key in to Refstack requires pub key self-signature
This signature can be generated with refstac-client using "sign"
command. For example:

./refstack-client sign ~/.ssh/id_rsa

Will print public key ~/.ssh/id_rsa.pub and self signature for it.

Change-Id: I0ee3e89c5e8bcae85eae63500a5fd98cea12c273
2015-08-19 12:48:02 +03:00
Paul Van Eck
43777f9820 Add argument for specifying test-list directly
Because test attributes can constantly change in test lists, refstack-client
should have a native argument for passing in test lists (instead of '-- --load-list')
Refstack-client will normalize the tests in the given list by matching it to
test IDs in the current Tempest environment.

Closes-Bug: #1475407
Change-Id: I1e3f026f5cd706cf73b6febfce98cb96b742d4d6
2015-07-17 15:31:16 -07:00
Paul Van Eck
29c9ecea66 Replace -t with --
To better support passing in arbitrary arguments to the Tempest
runner, we now allow the '--' delimeter as an argument. Anything after
'--' will be passed to the Tempest runner as is. This better matches how
run_tempest.sh does things, and will make including test lists clearer.

Closes-Bug: #1467737
Change-Id: I8e091ef7c126cbeb4c388bb19e8343efb1c4c8ab
2015-07-08 23:18:05 -07:00
sslypushenko
3c37e809bb Allow to post results on https endpoint
Add key which alllows to drop ssl verification.
Without this patch it is not possible to post test results on
https endpoint with selfsigned sertificate.

Change-Id: Idd6b0e2f9ee1057f9ae1d3078f70a2cdcee4e360
2015-06-12 19:02:38 +03:00
sslypushenko
31cd05d8e1 Change defaults for --url
Defaults for --url param has been changed to env[REFSTACK_URL] if
it is set and 'http://api.refstack.net' if env[REFSTACK_URL] is not set.
It will be helpull during development and for upload to local refstack
server.

Change-Id: I8de8dfba1f6741133585815ace5cfd2ca2780fa2
2015-05-07 21:14:34 +03:00
sslypushenko
a84af82925 Show URL to test results page
User gets url to test results page after successfull upload.
Added 'list' command. It allows user to retrieve links on last uploaded
test results.

Change-Id: Id3a33179ad551cf95640d4c9fde147048592a1a4
2015-04-28 21:55:44 +03:00
sslypushenko
29bd7040d2 Post test results signed with RSA key
Added feature to upload test results in to Refstack API signed with
your personal RSA key. Just do upload with key '-i PATH_TO_PRIVATE_KEY'.
You can use your general OpenSSH key ~/.ssh/id-rsa or
generate a new one with 'ssh-keygen -b 4096'.

Change-Id: Icce6d7146f0fa9de892d1f4785ef24f17fc9b286
2015-04-13 22:01:03 +03:00
Paul Van Eck
748d259296 Add argument for renaming result file
A user can use the -r/--result-file-tag argument to change the name of the output
json file. The name will always include the subunit stream ID, for example if a user
input '--result-file-tag my-test' and the next-stream id was "2", the output filename
would be my-test-2.json.

Change-Id: Ie7302470fe1b63a21f61451ef62687634b6e0932
2015-02-26 13:51:31 +00:00
Jenkins
f1113714af Merge "Remove upload as default behavior after testing" 2015-01-28 21:27:47 +00:00
Paul Van Eck
0de601f65e Remove upload as default behavior after testing
The --offline argument was removed and an --upload argument was
added. Adding this argument will have your test results be uploaded to
the default Refstack API server or the server specified by --url.

Story: https://storyboard.openstack.org/#!/story/2000136
Change-Id: I93302e1cacdd9d0f996ea5545fbe21e1fb6aaa23
2015-01-28 11:48:04 -08:00
David Lenwell
51907ce792 Changed default url to api.refstack.net rather than .org
Change-Id: Ie5e70bb46eef6637066c8106e0b90d6c217d81b3
2015-01-23 01:28:00 -08:00
sslypushenko
9403991171 Updating tests results format according to spec
Spec:
https://github.com/stackforge/refstack/blob/master/specs/approved/api-v1.md

Update patch:
https://review.openstack.org/#/c/146680/

Change-Id: I75c62090a45d742b88acdfe080e24d62658976ce
2015-01-15 19:51:10 +02:00