The Python 2.7 Support has been removed by:
https://review.opendev.org/#/c/704096/
So remove hacking rules for compatibility between python 2 and 3
Change-Id: I0e78b982b79674520c7695c0cca7352677d7b7a0
This commit makes to use os.path.join instead of using the Unix path
character '/'. This change is not mandatory since we don't support
Windows environments as Tempest execution and, it seems Windows supports
'/' as a path separator. However, using both os.path.join and '/' is a
bit awkward.
Change-Id: I117acb281c352179d526808009e761335bb314fc
in order to enhance the cmd to support kubernetes url based
routing over port based routing. Once this is merged I will
submit another patch set to subunit_describe_calls to support
-u --urls (Optional) The path to a JSON file describing the urls
being used by different services. Note Can not be used with -p.
Added test cases for cliff subprocess and found a bug with the
-v. The standard -v --verbose of cliff conflict with this command
so I changed the -v --verbose to -a --all for print header
with printing to stdout I am also getting ready to add test cases
for cliff subprocess support for different options. Bug #1890060
Correct os join in test cases to avoid a conflict with
https://review.opendev.org/#/c/683026
Closes-bug: #1890060
Change-Id: I9459db0dbeda721187ea5f4802c7453c2092dac3
Concurrency parameter for account-generator command was accepting
negative values and zero.
This patch makes sure that when the account-generator is passed
a negative value or zero, it ends with an error.
Closes-Bug: #1811349
Partially-Implements: blueprint tempest-cli-unit-test-coverage
Change-Id: I4d7de89b2ad3ee91d113da3746fe393d8cce2aa2
* add additional handler so that INFO messages are printed to stdout
besided tempest.log
* replace print commands by LOG.info calls
* when --debug argument used print DEBUG messages to stdout
* add additional debug messages to improve transparency of the cleanup
execution
* use --debug argument within tempest-cleanup ansible role to see more
details directly in the output
Change-Id: Iee72dc411fdf5cda8a8eed8dd7f349e0866648ab
Running verify_tempest_config, it complains with:
/opt/stack/tempest/tempest/cmd/verify_tempest_config.py:444:
DeprecationWarning: This method will be removed in future versions.
Use 'parser.read_file()' instead.
Use read_file.
Also, remove one extra use of six in this file.
Change-Id: Ia32df8e2be29bb0951efd08db9eed9e67d749e1f
This patch add the option --worker-file on tempest run command.
This will enable users to specify a worker file that will be used
by stestr to manually schedule how the tests will run.
Change-Id: I747f3abe179492da063fcaaf1123ffcf6362f966
Network quotas could be deleted after deletion of project. This
caused the cleanup to fail as network quotas have to be deleted
before the deletion of project.
This fix makes sure that network quotas are deleted before the
deletion of project.
Change-Id: I8576e2c6f1ae6dc90850dd3d8eade7c10942e413
Images weren't deleted properly due to bad request sent to
glance API. Also ImageService ignored 'next' parameter returned from
glance API when listing images which is required when more images
are present.
The fix lists all images properly. If 'next' parameter is present
in the glance API response then the API is asked to send next part
of image list.
Closes-Bug: 1866988
Change-Id: I9ebeccb545576e43ef0fc96c29169ae16f261f34
Tempest CLI tempest-account-generator was deprecated
4 years ago.
devstack still uses the deprecated CLI for which
patch has been proposed.
As deprecation is done long time back,
'tempest-account-generator' should be now used as
'tempest account-generator'
The following commit gives the idea of deprecation
message:-
68b8b9d26f
Depends-on: I624e1dc57a3d3533322fb298c01f70241d0400ed
Signed-off by: Soniya Vyas<svyas@redhat.com>
Change-Id: I7c18998dd877d7fd065e4d1d0950b6f6413587c3
NetworkQuotaService class enables deletion of network quotas which
were neglected by tempest cleanup before.
Change-Id: I83ac30960c0be39fc5147d445cb39cb3ff4c56b2
Use of os-tenant-name or OS_TENANT_NAME is deprecated.
Instead of it, os-project-name is expected to be used.
This patch depends on below mentioned patch, since
devstack still uses the deprecated argument.
Depends-on: I624e1dc57a3d3533322fb298c01f70241d0400ed
Signed-off by: Soniya Vyas<svyas@redhat.com>
Change-Id: I3b926f8abb6fce3d2eab93310ce3959c68aa9a6d
Tempest CLI verify-tempest-config was deprecated
4 years ago.
With assumption of all the users of this CLI have
moved to new CLI 'tempest verify_config', it is
time to remove the old deprecated CLI now.
'verify_tempest_config' should be now used as
'tempest verify_config'
The following commit gives the idea of deprecation
message:-
e45aa842bc
Signed-off by: Soniya Vyas<svyas@redhat.com>
Change-Id: Ic3dbd6f5e854e017a5bec4b1a625730ab68e767d
Currently cleanup iterates over projects and deletes all resources
tied to a particular project. However, most of the resources can be
deleted all at once without iteration over the projects.
This will fix the mentioned bug and also make the tool much more
efficient as we'll avoid many iterations and queries.
Closes-bug: #1830943
Change-Id: I82c7899a32bee0e714e71d703195085e10ea224f
RegionService class enables deletion of regions which were
neglected by tempest cleanup before.
Change-Id: I2c978a7b2151b37bb0a224bafd1be490f04950ee
Closes-Bug: #1848672
We are adding a subcommand to tempest that is a parser for subunit
streams to determine what REST API calls are made inside of a test
and in what order they are called. Right now the implementation of
utility is as a console script and which is in argparse.
We are porting it to cliff to give a similar experience across
the codebase.
Change-Id: If95042898d8b2a148246c991d73d1a577fbcf7a0
Signed-off-by: Soniya Vyas <svyas@redhat.com>
Avoid using temporary managers and use only the admin one. The tool
has been using the admin_mgr for listing projects, roles, for listing
all resources during initializing a saved state so why don't use it also
for deleting all of the resources?
This wil solve the Unauthorized issue happening when the tool
was requesting credentials for the project from a different
domain.
Closes-bug: #1766582
Change-Id: Ibb5599ce48712b94dbf591e4a30cf3906cb5cdde
It's a follow up fix for tempest cleanup NotImplemented error issue.
Tempest cleanup shouldn't return a non-zero return code for
NotImplemented errors as they are actually not errors, they are just
an outcome of tempest not checking availability of extensions in order
to keep it simple without any complicated logic.
Closes-bug: #1832566
Change-Id: I09e28c245c11dd3dd061df786bd137eceb97be07
This commit removes python shebangs from the python modules. They're
just python modules, so we don't need to have python shebangs for them.
Change-Id: I6f4428cf20be6f5ef2142030b4ede235444a4336
tempest cleanup returns an error when it's initializing a saved
state, because it uses already deprecated v2 client.
The patch makes tempest cleanup use keystone role v3 client.
Closes-Bug: #1788561
Change-Id: Id607dec012ce48af6d4c7ee263a90c3ea2e1799c
This commit fixes the tempest run documentation indentations for more
appropriate rendering[0]. Currently, it's rendered as a quote which is
weird.
[0] https://docs.openstack.org/tempest/latest/run.html#test-selection
Change-Id: I764cfff7dd07214fa44dacfa2a86476471e8fb20
tempest cleanup doesn't check if the APIs it uses are
implemented or not. Therefore the patch adds a try
except block preventing tempest cleanup to fail when
some of the APIs are not implemented.
Closes-bug: #1832566
Change-Id: I9ced4af40eb0c2a22e3557caded56045a397d539
Improve logging in tempest cleanup when a router and
its interfaces are being deleted. The review adds a
try except block for every attempt to remove a port.
By that addition any port error will not be hidden
behind the router error the port is attached to.
It will provide more precise error logging.
Change-Id: I475deec7b29600627f68ff07c5546e55cdab100f
This PS will check config file passed from command line is actually
existing or not in tempest run command. If file exists, only then it
will go for set config path otherwise will fail with value error.
Also adding and modifying unit test cases for this change.
Partially-Implements: blueprint tempest-cli-unit-test-coverage
Change-Id: I09d756be69cb3a9be8d0638c41d45a089d62b238
Closes-Bug: #1808473
autopep8 is an automated code formatting tool for python,
it does not know everything, also not super fast,
but it is faster than I can manually reformat the code.
tools/format.sh will call the formatting,
the tox will check did you called it.
Also adding a tox -eautopep8 way to use it.
autopep8 formats the lines in one way,
where tempest used a another way it was changed.
Change-Id: I6d51b14a5a5b87761071d0927fca23ba1651aa41
oslo project provide jsonutils, and we use it in many place[1],
this PS to update the remained json moudule to oslo jsonutils for
consistency.
[1]: 9594233ffd/tempest/lib/services/volume/v1/quotas_client.py (L15)
Change-Id: Ib8d9f49a1fdfa0f5e0cfb05a193dffb83e4cfe69
This commit sets the default value 0 for tempest run command.
Because stestr's run_command() requires an int value for that, but we
passes `None` if users don't specify a concurrency value. We found that
behavior with recent stestr change[0]. But we also have the bug in
tempest side.
[0] https://github.com/mtreinish/stestr/issues/231
Change-Id: I83f76acb6a106f7401904a910a5dced47c2db839
The review adds support for NetworkSubnetPools service,
so if there are leftover subnet pools, tempest cleanup
is able to detect them and remove eventually.
Change-Id: Ieecde490d5eb20e1a894a7bdf3bcf0e7a54c08e2
Related-Bug: #1812660
Edit service classes so that they discover initial
state of resources before deleting any.
Unify service names - f.e. if a service returns resources
in a list named server_groups, server_groups should be
the key of initial resources in the saved_state.json.
When is_preserve is True, security groups in
NetworkSecGroupService were filtered by networks present
in tempest.conf, however, these groups are associated
with a project_id, therefore it should be filtered
against projects present in tempest.conf.
Change-Id: I97d0115bbb43a089b33602df7c98e153984ceaf1
Related-Bug: #1812660
The patch removes deprecated services from
cleanup_service.py:
* NetworkVipService
* NetworkMemberService
* NetworkHealthMonitorService
* NetworkPoolService
* FloatingIpService
* SecurityGroupService
The above services are not used by the cleanup tool, they
call clients which were already removed from Tempest or
the clients are marked as deprecated ones.
Change-Id: I55ddbce64404c67688600dc6b1231d0bd8ff7006
Related-Bug: #1812660
When using python3 the file which is read and
loaded by jsonutils needs to be opened in binary
mode, otherwise, it's causing problems.
It is a known bug [1] in jsonutils from
oslo.serialization module.
The patch also adds a unit test which tests
the loading of a json file.
[1] https://bugs.launchpad.net/oslo.serialization/+bug/1515231
Closes-Bug: #1806089
Change-Id: I3db71c6662d9137a4b75381de7d6dbddd3de4e09