Commit Graph

183 Commits (cd147631f8254c2f727ccfc937566a7a200349f9)

Author SHA1 Message Date
likui 7d91c87345 Remove six.PY3/six.PY2
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
3 years ago
Masayuki Igawa 9e492eee81 Use os.path.join as possible
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
3 years ago
Zuul 2321f00e84 Merge "Improve unit tests for subunit_describe_calls" 3 years ago
Doug Schveninger 6aa733e0f3 Improve unit tests for subunit_describe_calls
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
3 years ago
Zuul 8c277fcad0 Merge "Add response schema validation for volumes" 3 years ago
Martin Kopec e1eebfa845 Replace mock by unittest.mock in 2 forgotten cases
We replaced usage of third party mock by the standard library in:
https://review.opendev.org/#/c/721021/
There are 2 forgotten occurrences where we still use the third
party mock, the patch fixes that.

Change-Id: I7d00be25bb0b70ce55e27790df33d9134c2a52ae
3 years ago
Zuul b721a6709b Merge "Add check_service_availability test" 3 years ago
Tomas Krchnak 7cbe8b6b51 Add check_service_availability test
This patch increases test coverage of verify_tempest_config

partially-implements: blueprint tempest-cli-unit-test-coverage

Change-Id: I87966469df42f0fbabfa2b265398a101af414c9f
3 years ago
Lukas Piwowarski 58b0538670 Fix the argument check for account-generator
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
3 years ago
zhufl 3cb4772db4 Add response schema validation for volumes
This is to add response schema validation for volumes.

NOTE: upload_volume schema is under discussion, so will be merged
in a seperate patch.
https://bugs.launchpad.net/cinder/+bug/1880566

Change-Id: I0613c36e9cc512a1aba1f7952ffbc7447b05198b
partially-implements: blueprint volume-response-schema-validation
3 years ago
Zuul df5eef915b Merge "Use unittest.mock instead of third party mock" 3 years ago
zhufl adb162024d Add response schema validation for volume snapshots
This is to add response schema validation for volume snapshots.

Change-Id: I7de5569ed58fb6a3bf8115f89163cd951c19d951
partially-implements: blueprint volume-response-schema-validation
3 years ago
Sean McGinnis eed8074e64 Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: If1de2f48da1fd6ed3f96c98b8dce9eace4f8095d
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
3 years ago
Arx Cruz c06c371b32 Add --worker-file option in tempest
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
3 years ago
Lukas Piwowarski e530f24160 Delete network quotas
NetworkQuotaService class enables deletion of network quotas which
were neglected by tempest cleanup before.

Change-Id: I83ac30960c0be39fc5147d445cb39cb3ff4c56b2
3 years ago
Zuul 0970274c55 Merge "Removal of deprecated argument[os-tenant-name]" 3 years ago
Soniya Vyas 195767a062 Removal of deprecated argument[os-tenant-name]
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
3 years ago
Lukas Piwowarski 3b1311f604 Extend cleanup CLI to delete regions
RegionService class enables deletion of regions which were
neglected by tempest cleanup before.

Change-Id: I2c978a7b2151b37bb0a224bafd1be490f04950ee
Closes-Bug: #1848672
4 years ago
zhufl e1afe4e75a Fix invalid assertIsNone state
This is to fix invalid assertIsNone state of
"self.assertIsNone(None, self.run_cmd._build_regex(args))".

Change-Id: I4878632cabc75097b6e975a5a2dcce6945d30958
4 years ago
Martin Kopec 97857948d9 Fix cleanup NotImplemented error
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
4 years ago
Manik Bindlish 21491dff81 Checking config file actually exist or not in tempest run
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
4 years ago
afazekas 40fcb9ba28 Add autopep8 to tox.ini
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
4 years ago
Martin Kopec e681998023 Add NetworkSubnetPools to tempest cleanup
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
4 years ago
Martin Kopec 470aca738c Add unit tests for tempest cleanup
In the previous patches, tempest cleanup got improved
and new methods were implemented. This review adds
more unit tests to exercise those changes and to
improve tempest cleanup test coverage.

Change-Id: Ibf30162e49a8cf87accdbe7f0a6cc38941873d5e
Related-Bug: #1812660
4 years ago
Martin Kopec 6caf3fabbb Fix tempest cleanup for python3
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
4 years ago
Zuul 311ef3d2eb Merge "Add whitelist based tests for tempest run command." 4 years ago
Zuul 452908d3ef Merge "Add black-list based tests for tempest run command" 4 years ago
Zuul 225190e3a0 Merge "Adding missing test cases of tempest workspace" 4 years ago
Manik Bindlish 71c8237711 Adding missing tests for regex and black-regex in tempest run
This patch will add the missing test cases for regex parameter
and black-regex parameter in tempest run command.
These tests will helps in coverage of tempest run CLI.

Change-Id: I860689178ddaf927fdfb2921561e6c124bc0da49
Partially-Implements: blueprint tempest-cli-unit-test-coverage
4 years ago
Manik Bindlish 9334ddb6ea Add black-list based tests for tempest run command
Blacklist-file parameter is used to exclude the regex
and will run the tests using tempest run command.
This patch will add the tests for tempest run based
on blacklist-file parameter.

Change-Id: Ib4070dddffb241556d34c877cc537b5eb971df5e
Partially-Implements: blueprint tempest-cli-unit-test-coverage
4 years ago
Manik Bindlish 5a276eab41 Add whitelist based tests for tempest run command.
Whitelist-file parameter is used to include the regex
and will run the tests using tempest run command.
This patch will add the tests for tempest run based
on whitelist-file parameter.

Change-Id: Ic20588c2eb553039bedc7f9de75da052a800246a
Partially-Implements: blueprint tempest-cli-unit-test-coverage
4 years ago
Manik Bindlish c825424a54 Adding missing test cases of tempest workspace
There are multiple cases found as missing for tempest workspace.
This patch set will cover both positive and negative missing tests.

It will improve tempest workspace CLI.

Change-Id: I06d04acad43533d7f2e912a4a8425da06561b0fa
Partially-Implements: blueprint tempest-cli-unit-test-coverage
5 years ago
Zuul 6b08b5e1fd Merge "Handling invalid path of workspace register and move" 5 years ago
Manik Bindlish 6c95678a76 Handling invalid path of workspace register and move
This PS will fix the invalid value handling.
Error will be raised if no/blank value will be specified for
workspace register and workspace move for path parameter.

Change-Id: I0d9956cac27fd4dbb527fd865aa152e4724c01f9
Closes-Bug: #1799883
Partially-Implements: blueprint tempest-cli-unit-test-coverage
5 years ago
Zuul 085a04ba67 Merge "Adding missing test cases in "test_run.py"" 5 years ago
Manik Bindlish 087d4d05d3 Adding missing test cases in "test_run.py"
There is lack of unit tests for CLI of tempest run.
This patch will add the missing unit tests.
It will cover both positive and negative cases.

Change-Id: If8565f3452193031cf72ee16c7e60c2fa202367f
Partially-Implements: blueprint tempest-cli-unit-test-coverage
5 years ago
Manik Bindlish ece4ae6e42 Adding missing test case of account generator resources
Adding a new test which is missing from account generator resources.
Test name: test_generate_resources_swift_no_admin

This patch set will add the test to check generate resources when
Swift is enable but admin is not. It will also add some missing
checks in another tests.

Change-Id: I2b8991dd8aa20736d2b9f978a977fc227ed0ab8b
Partially-Implements: blueprint tempest-cli-unit-test-coverage
5 years ago
Zuul d6ffc93c2b Merge "Handling invalid name of workspace register and rename." 5 years ago
Felipe Monteiro 65ed8331fa Fix test_get_config_file to always work
This patch set changes logic in test_get_config_file which
is currently referencing environment variables for test
execution, but this leads to non-deterministic behavior.
Tests are failing sometimes (e.g. [0]) because of cross-pollination
between tests, meaning that one test can change the value of
os.environ['TEMPEST_CONFIG_DIR'] (for example) causing this
test to fail. To make the test always pass, the same
values are always returned via mocking.

This assumes that tempest/etc exists which is a valid
assumption since it should always be in the repo [1].

[0] http://logs.openstack.org/30/577730/17/check/openstack-tox-py36/207ab05/testr_results.html.gz
[1] dfe511eef2/etc

Change-Id: I5e3b608b8813e33cc45a2d45e384a4cf91a01a39
Closes-Bug: #1796073
5 years ago
Zuul dfe511eef2 Merge "Adding unit test of setting config path for "tempest run"" 5 years ago
Manik Bindlish 864f37eb66 Handling invalid name of workspace register and rename.
This PS will fix the invalid value handling.
Error will be raised if no/blank value will be specified for
workspace register name and workspace rename.

Change-Id: Id8a3f496a8902bd7f0d66254ee8fa148675974e9
Closes-Bug: #1791007
5 years ago
Zuul 1d3aaf6cd1 Merge "Adding missing test cases of "test_verify_tempest_config"" 5 years ago
Zuul d2cb025c5f Merge "Removing redundant spec value in account_generator.py" 5 years ago
Manik Bindlish ebc7f5eda3 Adding missing test cases of "test_verify_tempest_config"
Some of test cases are missing from "test_verify_tempest_config"
This patch will add them.
It will cover both positive and negative unit tests.

Change-Id: I0c929749039ec8d30dc801a1d3d0f53e3415a102
Partially-Implements: blueprint tempest-cli-unit-test-coverage
5 years ago
Manik Bindlish a794e85304 Removing redundant spec value in account_generator.py
There is redundant value used for spec in account_generator.py
There is no use of duplicate value as it makes the
code inconsistent.

This patch set will correct the code and also the test
cases which are wrongly designed as per redundant code.

Change-Id: I4bd31f7bb88943b0981c7081f82d80aa28dcdfa4
5 years ago
nh202b c67bb194ed Add test coverage CMD cleanup_service
Added new MockFunctions base class to mock one or more functions
Added test_cleanup_services to run cleanup tests for global services
(flavor, image, user, project, domain, role)

tests
  -dry_run
  -save_state
  -delete
  -preserve

Network service tests up-coming.

Change-Id: If6d5f8de282f4f291c0f51f44938f2febc0efda4
5 years ago
Manik Bindlish 321c85c87c Adding unit test of setting config path for "tempest run"
It will check the positive and negative case for sending data
and sending no data to ensure path variable is set properly.

Partially-Implements: blueprint tempest-cli-unit-test-coverage

Related-Bug: #1783751
Change-Id: I996ec912ed39ecc3c3ca293c257126b910b3e958
5 years ago
Manik Bindlish a067405c4d Removing duplicate variable "parsed_args.config_file"
In test_run.py, there is a variable "parsed_args.config_file"
which is used twice during it's assignment.
Second time assignment is overwriting the assignment of first time.

So this patch set will remove the un-necessary duplicity.

Change-Id: I03dfb6990984a165d49ed9742f20e243370dc765
Partially-Implements: blueprint tempest-cli-unit-test-coverage
5 years ago
zhufl dc68af740b Set CONF.image_feature_enabled.api_v1 default to False
Glance v1 APIs are deprecated and v2 APIs are current one,
but CONF.image_feature_enabled.api_v1 now defaults to True,
so CONF.image_feature_enabled.api_v1 must be explicitly set
to False in tempest.conf to avoid using api_v1, which is
annoying. So this is to set CONF.image_feature_enabled.api_v1
default to False.

Change-Id: Iab3a209c744375bf2618afc00a3f7731b62f557e
5 years ago
Zuul fe84ecb516 Merge "Prevent verify-config from IndexError" 5 years ago