aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/openstack/rally/test_rally.py
AgeCommit message (Collapse)AuthorFilesLines
2021-11-15Update linters and fix all new issuesCédric Ollivier1-11/+11
It mostly add encoding in open calls and leverage f-strings. Change-Id: Ifead18fc724a452c1067dcf91dc577032edc9c59 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-10-11Leverage on Rally task tagsCédric Ollivier1-9/+13
It avoids parsing rally task outputs which may hang (subprocess communicate) as seen in rally_full and rally_jobs. It simply selects test names as tags. Change-Id: I88b54a8f155e557f8a606fdbd7d86c1f4d5dae3b Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-10-08Count all hypervisors by defaultCédric Ollivier1-1/+1
If one hypervisor is down, few tempest test fails. User is free to set SKIP_DOWN_HYPERVISORS if it's down on purpose. Change-Id: I7b6a4d0d8f67755d8c1550fd1bc6fd707634f68b Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-09-30Count all active hypervisorsCédric Ollivier1-2/+2
Else tempest_slow fails if one hypervisor is down (detected in ONAP Openlab). It also improves Shaker, Rally and Vmtp which count them. Change-Id: Iee7c20e0357d9237501c5c451580d8f6409ac86b Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-07-27Switch to Python 3.7 and Alpine 3.10Cédric Ollivier1-3/+3
It also allows building docs as doc8 is broken due to latest OpenStack's upper-constraints. pylint is updated to 2.3.1 (lastest py3.7 version) It disables perm as umask is currently false on lf-virtual1. Change-Id: If09d4796d48b7d0591e7926621d3bbf5ca1b6c24 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-06-02Publish rally logsCédric Ollivier1-3/+14
Both Rally and Tempest publish Rally debug logs. It also moves the logics from tempest to rally. Change-Id: I5c057d830202baddd73577ade1b09ce304e3c5a5 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-05-25Set utf-8 in decode and encode callsCédric Ollivier1-3/+3
It eases backporting in iruya and hunter as a few logs can't be decoded as ascii [1]. [1] https://build.opnfv.org/ci/job/functest-opnfv-functest-vnf-iruya-juju_epc-run/56/console Change-Id: I52a6f9a25130cbf62e8ce3b9972064ab73177665 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-05-24Decode Bytes in logging callsCédric Ollivier1-3/+6
It fixes a few incorrect types in log calls [1]. [1] https://build.opnfv.org/ci/view/functest/job/functest-latest-daily/163/ Change-Id: I01790f6454694f434d31366f9c1cf9d98ff5a9cf Signed-off-by: Cédric Ollivier <ollivier.cedric@gmail.com>
2019-05-13Update to Python3Cédric Ollivier1-2/+2
Functest containers leverage on Python3 instead of python2. https://mail.python.org/pipermail/python-dev/2018-March/152348.html It also updates robotframework librairies to latest release and Vmtp to master ([1] is needed) It patches cloudify rest client to support python3. Vmtp is currently disabled because it currently supports python2 only. [1] https://github.com/openstack/vmtp/commit/a5d062881d91bf4f547d92c6e289bea30feb5d6e#diff-b4ef698db8ca845e5845c4618278f29a Change-Id: I39964a212ec2d4dbf53c9ea7c63f02e0b6a05b48 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-02-15Enrich Rally results outputStamatis Katsaounis1-4/+21
This patch adds success/failure information of rally test cases to summary output. Change-Id: Ie4f9b4972a26e187bb7afdddfd5ce51b16f3db12 Signed-off-by: Stamatis Katsaounis <mokats@intracom-telecom.com>
2019-02-14Generate xunit reports (rally and tempest)Cédric Ollivier1-14/+51
It adds xunit reports for rally-based and tempest-based testcases. It completes the reports provided by snaps (thanks to Xtesting). All rally related operations are moved to rally. It allows removing the rally dependency to tempest which was false. Change-Id: Ia7d2476f58f4f68b7c88442e50cad844037a36e9 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2019-02-13Specify which rally tests to runStamatis Katsaounis1-6/+2
This patch adds the ability to specify which rally test to run by setting the appropriate configuration value. Change-Id: I6cbc9d12aada4f8eab68d2219d94ae1391a79021 Signed-off-by: Stamatis Katsaounis <mokats@intracom-telecom.com>
2019-02-12Generate one single report for Rally testcasesCédric Ollivier1-0/+24
It eases sharing one single report including all task results. For the time being, rally_jobs only generates neutron.html. Then it only adds one report for rally_full and rally_sanity. We may consider generating only one json file but it asks for a refactoring (result parsing) which can be done in a second change. Change-Id: I8fa75ae80750336950f355c2aedc3dd4dc621cc5 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-12-19Add task arguments to rally_jobsJuha Kosonen1-4/+4
Define floating network as a Rally task argument. Enable rally_jobs subtest. Change-Id: I37d7c4718cfb3de3ad1980878e0529d652013ccb Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2018-10-15Do not create files in site-package directoryJuha Kosonen1-0/+3
Use /home/opnfv/functest/data/rally/task directory for storing temporary files when running rally tasks. Also removes unused vm scenario from task service list. Change-Id: Icfd4f99ebe6194360bda8bd88e497e018a9541a0 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2018-09-18Add support for Rally OpenStack CI test casesJuha Kosonen1-4/+6
Include Neutron rally-jobs. Change-Id: Ic1122962bd7d876d179729640a8a321bc36442d8 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2018-09-03Refactor RallyBaseJuha Kosonen1-27/+32
This provides a more generic way to integrate test case lists which are not hosted in Functest. Also removes vm scenarios since they have never been a part of actual rally runs. Change-Id: Ib0a020fe72800915bbf2d10ecc690a248d33c246 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2018-08-28Remove installer type from rally blacklistJuha Kosonen1-10/+0
Enables utilization of blacklist also on non-OPNFV environments since there is no link to installer type. JIRA: FUNCTEST-1008 Change-Id: I3eb4377af153480794c1a71c5d7ef3e78dacacb9 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2018-08-14Create new project/user for rally testJuha Kosonen1-6/+6
FUNCTEST-1002 Change-Id: Id19b9aa70aeded6d99978084b3de4a63e31a81ad Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2018-08-10Remove explicit Rally task validationJuha Kosonen1-14/+1
Utilize the output of Rally task execution since it internally validates the task. Use Popen.communicate to get the output from the running Rally task. Change-Id: I9b1299bc26129ff4f89adccec611c78195a3ab02 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2018-07-27Stop redirecting output to json filesCédric Ollivier1-0/+1
Rally may print additional data to console which results in an invalid json files. The json files are generated via rally instead of dumping stdout. It's mandatory to backport the next bugfix [1] in stable/fraser. [1] https://gerrit.opnfv.org/gerrit/#/c/60265/ Change-Id: Ifbd90e685a7b52c70b3110a46e3c7991eddc05f4 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-06-30Inherit rally from VmReady1Cédric Ollivier1-150/+19
It also fixes clean(). Change-Id: I42d1305d5cdb5a717cfa7fce26798ac7102310f7 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-06-14Add py3 support in tempest and rallyCédric Ollivier1-9/+9
Change-Id: I009d38a0db409ab4ec641cba9173ab2386d0ce2a Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-05-18Refactor task results manipulation in rallyJuha Kosonen1-17/+48
Use data provided by report generation since the output of task results is not available as valid JSON if task didn't finish gracefully. JIRA: FUNCTEST-966 Change-Id: Ieb906bc209cc26055babd5f4e6b2bb556724f9a8 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2018-05-05Switch to Shade in rallyJuha Kosonen1-91/+149
Use Shade for managing OpenStack resources in rally. Change-Id: Ic8b7aaef6886f6ca4930b2ea463317b75ed8d3c9 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2018-03-02Leverage on XtestingCédric Ollivier1-3/+2
It removes all the files which have moved to Xtesting. Vnf inheritances and env management will be improved in other changes. It keeps the same tree thanks to a symlink to allow publishing artifacts. Change-Id: I551bbd3f344cdab0158a50b7b09e541576695631 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-24Update Functest to meet last snaps updatesCédric Ollivier1-4/+0
It removes obsolete mockey patches in Rally unit tests and adds keystone client as params when needed in orchestra_*ims.py [1]. [1] https://gerrit.opnfv.org/gerrit/#/c/52473/ Change-Id: Id02954d16f5f54cc0c390fadb498e14c6bab6ff9 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-16Mock additional methods related to OpenStackFlavorCédric Ollivier1-0/+4
keystone_utils.keystone_client() and keystone_utils.get_project() have to be mocked when unit testing flavor creation since [1]. [1] https://gerrit.opnfv.org/gerrit/#/c/52157/ Change-Id: I898cde1001c14d0b450c3dd43ade7dca47b1ffb3 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-13Enhance variable manipulation in rallyJuha Kosonen1-9/+8
- utilize env vars directly via os module - use getattr to read CONST JIRA: FUNCTEST-931 Change-Id: I893a91331e26846f8effe2d3d58522950bd096fd Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2018-01-30Fix pylint errors/warnings in rallyJuha Kosonen1-32/+24
JIRA: FUNCTEST-906 Change-Id: I484f9a291d5adbedb855450e4ff067dfa4a3b2ae Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2018-01-30Remove duplicated code related to snaps credsJuha Kosonen1-1/+1
Add support for providing credentials in snaps_utils. JIRA: FUNCTEST-916 Change-Id: I3e027229d213d3791a115920f7012309cc027712 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2018-01-26Refactor rally report generationJuha Kosonen1-2/+12
- statistic data based on Rally results report - fix statistics calculations - use PrettyTable in generating the report Change-Id: Ic84adc5e30d446aea1f3045ba997c3ddf895e9f5 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2018-01-21Disable all missing-docstring warnings in unit testsCédric Ollivier1-0/+2
Change-Id: I22b7bbdab5f000b4ade6c2ba3a4029c146887cbd Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-01-16Fix Rally output retrievalJuha Kosonen1-11/+2
Read stdout until nothing left instead of stopping once the child process is terminated. Change-Id: I46a2eb93fd614e2e7ff676727eb9dc132c29d03f Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2017-11-21Fix "Broken pipe" IOErrors of rally runJuha Kosonen1-4/+1
Replace obsolete os.popen with subprocess module usage in command output retrieval. Do not use shell as the program to execute. Change-Id: Ic63bb0f393750c3b85a35a37fecd46c1c1b96602 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2017-11-13Move rally and tempest out of functest-coreLinda Wang1-1/+12
JIRA: FUNCTEST-889 Change-Id: I96776da7af50b2c33c34dd731b5500b891d263d6 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-10-17Update blacklist about migration tests for rallyLinda Wang1-2/+2
The test NovaServers.boot_and_migrate_server needs at least 2 compute nodes: https://github.com/openstack/rally/blob/stable/0.9/rally/plugins/openstack/scenarios/nova/servers.py#L763-L765 Change-Id: I4ddf99188094ced57225d886037b00e91f3b68e6 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-10-05Live migration support determination in rallyJuha Kosonen1-7/+24
Live migration test cases were excluded if tempest was not executed before rally since tempest config file is created during the execution of tempest. Remove the dependency to config file and define the support based on the number of computes as done in tempest. Change-Id: I57c18b7c57e6a4bc8bfbdfb4beb5f8d67c6269c4 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2017-09-21Remove void return value mocks in rally unit testsJuha Kosonen1-27/+16
Change-Id: I369b98fb9120830b1868f438c7da2a039a60d890 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2017-09-20Dedicated flavors for rally testsJuha Kosonen1-0/+46
Create flavors and use them in rally scenarios instead of expecting certain flavors to pre-exist. Change-Id: I77c94ab80fcabd7b80ffb36f9856a48121858009 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2017-09-15Refactor resource creation and cleanup in rallyJuha Kosonen1-38/+57
Use SNAPS to create and delete resources. Change-Id: Ic4d390382acea2be196e8a7518cb8cce25276a45 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2017-09-11Remove volume type handlingJuha Kosonen1-37/+4
Rally scenarios don't require volume type to exist as a precondition. Change-Id: Id735346e062af084635fd8f76f3686005b9b8add Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2017-07-11Use decorators for mock patchingMartin Kulhavy1-281/+272
Instead of using the `with` clause, mock patching is prepended to each testing method as a decorator. Change-Id: Ieb962d6fd0b9a6cdc649c44e39f69b543426dce9 Signed-off-by: Martin Kulhavy <martin.kulhavy@nokia.com>
2017-07-11Add decorators in testcases for energy recording.Benoit HERARD1-6/+6
Test cases are: - rally (sanity and full) - refstack - cloudify_ims - vping_ssh It also fix a bug on "energy_recording" decorator of energy module. Change-Id: I625c214552ad1b89eaf7e196e706d7c69b37da33 Signed-off-by: Benoit HERARD <benoit.herard@orange.com>
2017-07-10Allow regex for blacklist scenarios/installersMartin Kulhavy1-1/+32
Reasoning: Some blacklisted test cases apply to a range of scenarios, e.g. both 'ha' and 'noha' and possibly even to all scenarios for a specific installer -- therefore the list of excluded scenarios can get long and unclear. For consistency with rally test case scenarios also allow regex for installers specification. Additionally, log the excluded test cases (if any) to debug log. Change-Id: Ie0bec35d1a6443203d4719ea5428c437c12e5e12 Signed-off-by: Martin Kulhavy <martin.kulhavy@nokia.com>
2017-06-27Remove Rally requests scenarioJuha Kosonen1-8/+0
HttpRequests scenario is not directly related to OpenStack and not supported by Rally in https environment. Change-Id: I2e91d129d82dfaba62eca25e3e4890ff54f52ac6 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2017-05-19Merge "Replace CONST.* by getattribute/setattr for rally and tempest"Jose Lausuch1-7/+7
2017-05-19Replace CONST.* by getattribute/setattr for rally and tempestLinda Wang1-7/+7
Directories affected: - functest/opnfv_tests/openstack/rally - functest/opnfv_tests/openstack/tempest and respective unit test JIRA: FUNCTEST-796 Change-Id: I963f5947663f0b660337f3304defb697f5d338f3 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-05-19Merge "Modify how to disable logging in unit test."Jose Lausuch1-2/+1
2017-05-18Modify how to disable logging in unit test.Cédric Ollivier1-2/+1
Logs are only disabled when the unit tests are run from cmdline. It allows running them via pytest_suite_runner.py and printing their results to functest.log. You should notice that the unit test must disable the logger of the tested TestCase (e.g. testcase.TestCase.logger.disabled = 1). Otherwise false logs will be printed in console. Change-Id: Ic171e4575c8bab2e52db1897ae026b61a03b6247 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>