37 Commits

Author SHA1 Message Date
Chandan Kumar
7c355f403e Fixed SafeConfigParser deprecation warning for py3
Using six.PY3 as configparser.SafeConfigParser in py2 got
renamed to configparser.ConfigParser in py3. In order to
keep the codebase running on both version, we are using
it.

Change-Id: I78471e3d0962cda610c22641787d80103eb413b0
2019-01-03 17:04:02 +05:30
Martin Kopec
af57dd6719 Add profile argument
The patch implements --profile argument, which defines a path to
a profile.yaml file - a file which contains python-tempestconf
arguments and their values.
Also --generate-profile argument is introduced. A user can generate
a sample profile.yaml file using this argument. The sample contains
definitions of all python-tempestconf arguments set to their default
values.

Story: 2004503
Task: 28225

Change-Id: I80848d8ef9868ed3975b938d61880753eadc5ae9
2018-12-17 16:52:39 +00:00
Martin Kopec
3a4c6c7f6f Add argument which allows users to add extensions
--append argument appends a value or values to the specified
section.key pair. It may be helpful in cases when a user wants
to add custom extensions to tempest.conf in an automated job.

Change-Id: I116f4456823913f21b5f8f01ff2b14d42ec67dc2
Story: 2004429
Task: 28088
2018-12-17 16:43:05 +00:00
Zuul
7401f2d66e Merge "Set region_name from os-client-config to set identity.region" 2018-11-22 14:24:32 +00:00
Rabi Mishra
ef2bc15127 Set region_name from os-client-config to set identity.region
We don't seem to set idenity.region which may not work in certain
scenarios.

Change-Id: Iebd24700420883a8993881cd8392bed8c772353e
2018-11-20 21:20:59 +05:30
Martin Kopec
6c8b05f3cf Set use_dynamic_credentials with a priority
When an accounts.yaml file is used, python-tempestconf
has to set use_dynamic_credentials to False, otherwise
the generated tempest.conf doesn't work with Tempest.
However, values from a deployer input file are set with
a priority, so that they are not overriden during
discovery.

To fix the issue, use_dynamic_credentials has to be set
with priority too.

The related unit tests checks only a return value from
set function. The patch improves them, so that they
check if a value was overriden when it was supposed to
and the other way around.

Story: 2004140
Task: 27606
Depends-On: https://review.openstack.org/#/c/614312/
Change-Id: I76b8cf694116801e36587929bf320e5743534791
2018-10-31 10:26:38 +00:00
Zuul
e09e0b55a9 Merge "Don't expose credentials" 2018-08-17 01:35:00 +00:00
Martin Kopec
c6ec0bdc79 Don't expose credentials
Don't expose credentials to tempest.conf when
--create-test-accounts is used.

When generating tempest.conf with demo creds, use
--create-accounts-file argument so that the argument
is tested in the gates.
The argument is used only on Devstack.

Tempest concurrency of devstack demo job is reduced to 1
because the minimal accounts file is used.

Change-Id: Id5c90810666d783cf3939086ef27149ef53277f8
Story: 2003016
Task: 23036
2018-08-10 14:38:15 +00:00
Martin Kopec
3b4c3f7bdc Document CLI options
Change-Id: Iee1ba9ed82fd8bab88fffc96e292a5336082d884
Story: 2002703
Task: 22570
2018-08-03 18:14:02 +05:30
Martin Kopec
37b5e60948 Allow usage images already in glance
--image argument can now contain an image name already present in
glance.

Change-Id: I95195fb6ab968ec0e45a996eb87c8716baf3e07f
2018-07-28 08:43:32 +00:00
Martin Kopec
dcc4e9a5dd Fix http_image uploading to glance
image.http_image was during the refactoring mistaken for an image
which is uploaded to glance and that caused the issues described
in the linked story.
image.http_image is a tempest option which defines http accessible
image. It can be also in a compressed format, so it can't be
uploaded to glance before it's unpacked first.
The patch introduces a new python-tempestconf option in tempest.conf
defining an image which will be uploaded to glance.

Story: 2002931
Task: 22918
Change-Id: Idc03155b345d341903c2941f41ec4677a503b531
2018-07-10 14:59:37 +00:00
Martin Kopec
03ab541473 Remove default-overrides.conf
Remove the file completely.

Change-Id: Ibec27eaa1212a0b46d66be0c97869419849f4cb7
2018-07-02 09:21:17 +00:00
Zuul
2f013e2c94 Merge "Remove the content of default-overrides.conf" 2018-06-27 15:42:12 +00:00
Zuul
ab4e518bab Merge "Replace tenant by project, part 2" 2018-06-27 12:44:52 +00:00
Luigi Toscano
cdbc98572d More compatibility with Python 3
- use the six version of configparser and urllib, and depends on six;
- remove relative imports;
- adapt few tests to the changes.

The changes above should be noop from the point of view of
functionalities, at least on python 2.

And also:
- replace the py34 tox virtualenv with py35;
- add a non-voting py35 job (locally for now, it will be enabled
  to project-config also for gating when stable).

Story: 2002574
Task: 22142
Change-Id: I0a35abaae6f5b7095ebae765fbe2163046e0a4da
2018-06-26 23:20:52 +02:00
Martin Kopec
77fa9ad160 Remove the content of default-overrides.conf
Move all needed values to the load_basic_defaults method and
remove the rest.
The default-overrides.conf itself will be removed in a following
patch.

Change-Id: I47a12560bee4746efb54eb9b3c841b2783aa15f6
2018-06-26 08:46:30 +00:00
Martin Kopec
1bd20dca53 Replace tenant by project, part 2
Story: 2002116
Task: 20023
Change-Id: I465fe96120ed5609c2747b587963d2e5f57b55be
2018-06-22 10:42:06 +00:00
Zuul
6935a898bb Merge "Generate accounts.yaml" 2018-06-15 17:39:28 +00:00
Martin Kopec
243ab6cb47 Generate accounts.yaml
Generate accounts.yaml file when create_accounts_file
is specified and test_accounts is not.

Story: 2001693
Task: 8685

Change-Id: I7ed8390b29a430d97e1846f8f868f5b6af8eb02b
2018-06-14 12:54:01 +00:00
Zuul
cf2b33b5df Merge "Allow non admin users to upload image to glance" 2018-06-13 10:56:12 +00:00
Chandan Kumar
a5c6dc0977 Allow non admin users to upload image to glance
* Currently only users having admin related permission, has the
  ability to upload image to glance which later used to set Image/
  image_alt ref in tempest.conf. In order to make easier for non-admin
  user, this changes allow the same and if the user does not have
  permission to do the same, it will log an exception with the
  proper message as non-admin user can upload the image from CLI.

* Fixed set_default_tempest_options method for image as it is giving
  AttributeError: 'ImageService' object has no attribute 'image_path
  because image_path is set in set_image_preferences which is called
  after service_class in main.py which leads to the above error.

* Removed additional overrides image.http_image from roles

Change-Id: I3ab32b6c5628281f55193291cd367dcdb76a5571
2018-06-12 15:44:06 +00:00
Martin Kopec
4912283b03 Remove admin_* from identity section
Since Tempest 12 following values are removed from
identity section:
 - admin_username
 - admin_password
 - admin_project_name
The values were moved to auth section.

Change-Id: Ia98c9449b3fdc7aae40d204f0e2da44f987a5f9d
2018-06-11 14:46:56 +00:00
Martin Kopec
283de20574 Replace tenant by project, part 1
Replace use of tenant when it's setting to or reading from
tempest.conf (conf object).
The change is needed for correct reading of that value in
dependent patches - need to count on that it's project not
tenant anymore.

Change-Id: Ic2987ce322a0cd4a92d35b06a86aec95226f981e
Story: 2002116
Task: 19795
2018-06-11 12:06:56 +00:00
Martin Kopec
154fe8878d Move configuring of services to services class
Move checking availability of services from main:config_tempest
to services:services:set_service_availability.

Change-Id: Iafa1ff774c70216d22442eeaaba42d90f66bda62
2018-06-05 14:19:42 +00:00
Zuul
ebbd17a1ce Merge "Validation support" 2018-06-04 16:52:14 +00:00
Zuul
32761d4175 Merge "Load deployer input file automatically" 2018-06-04 12:04:18 +00:00
Martin Kopec
275b6b7591 Validation support
validation.image_ssh_user option is heavily used in CI and it's also needed
in refstack. Therefor set the value automatically when image used is cirros.

Change-Id: Ib823380225fda78462c727e50a0f4f82b6da4e74
2018-06-04 11:54:31 +00:00
Martin Kopec
ed5163e729 Don't expose user credentials
When --test-accounts is used, don't print any user credentials
to a tempest.conf file.

Depends-On: https://review.openstack.org/#/c/570822/
Change-Id: Ic7977ed9e0e03d04aca446407b22a9a73c2dca98
2018-06-01 12:17:42 +00:00
Arx Cruz
42ba94a164 Load deployer input file automatically
This patch add the load of deployer-input automatically, if exists in
default path (~/tempest-deployer-input.conf).
It also add the option to not load it, with --no-default-deployer
This will fix the cases that user miss to add --deployer-input and
tempestconf miss some configuration due of that.

Change-Id: I17ce46bac06158dd3cca298f33c6ea929051fb06
2018-06-01 10:21:13 +00:00
Martin Kopec
0f363c03a8 Make tempestconf easier to use as an library
Make main and method responsible for parsing arguments more
modular, so that, it's easier to import them.

Now the argument parser can be imported to an other project,
we want to integrate to. This way, we achieve the CLI which
will be maintained at only one place.

Split main to two parts:
1. arguments handling
2. the rest of config_tempest, which can be importable
as an external module.

Change-Id: I3b1b9cbd05ccdb7ccae1b34211c4c955e831d32d
2018-05-17 09:21:19 +00:00
Arx Cruz
ff5fbcbdb3 Load basic default config
This patch reduce the requirements of the values in the
defaults-overrides file when the user run the tool without
it.

Change-Id: I2a6d375598ee39789f81da750ba02783da2a83c2
2018-05-15 11:51:42 +02:00
Martin Kopec
0e085cdf85 Refactor to improve modularity, scalability, OOP
* each service class was moved to a new file
* Service and VersionedService were moved from api_discovery to service_base.py
* api_discovery.py is removed and methods for discovery were moved to a newly
  created class Services - class holds methods related to instantiating
  services, discovering their versions and extensions, configuring them
* constants were moved to an independent file - constants.py

Change-Id: I00880f4bd30cc4d1609c20aecca820854312b1e7
2018-04-16 14:48:14 +00:00
Martin Kopec
c1951c379e Fix failing of listing services
Non admin user or a user with no such privileges can't list
services. Therefor cinder-backup and metering services can't
be discovered for such a user.
The patch adds a warning to inform the user.

Change-Id: I48119b7a48f49f58dfac7bf34c75a08681b9ae32
2018-04-05 12:49:21 +00:00
Zuul
6a10dbb153 Merge "Split ClientManager" 2018-03-27 11:47:47 +00:00
melissaml
f9d956f59c fix a typo in documentation
Change-Id: Ie006ed2a964b6a10e57af9e34d19d7a8554556da
2018-03-23 08:06:22 +08:00
Martin Kopec
e397415132 Split ClientManager
* ClientManager and ProjectsClient class were moved to clients.py
* tests related to ClientManager class were moved to test_clients.py
* Credentials and auth_provider were decoupled from ClientManager and moved
  to credentials.py into a Credentials class - credentials are now accessible
  from everywhere and can be reused.

Change-Id: I7251d6353a91f4bbd7b9b7839ad36bb946b660c8
2018-03-20 08:53:26 +00:00
Martin Kopec
026269dcc1 Decouple TempestConf class
* config_tempest.py was renamed to main.py - entrypoint for console-script
  (discover-tempest-config) was changed too
* TempestConf class was decoupled from main.py and moved to tempest_conf.py
  file. Imports of related tests were edited and the order of imports in each
  file was changed so that other dependencies are first followed by a blank
  space and then local dependencies are listed.
* tests related to TempestConf class were moved to test_tempest_conf.py file

Change-Id: Idb235b969ba3c1e320aa3efa7fe77b5c59f4ffc6
2018-03-20 08:40:43 +00:00