aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/utils
AgeCommit message (Collapse)AuthorFilesLines
2018-06-30Inherit rally from VmReady1Cédric Ollivier1-66/+0
It also fixes clean(). Change-Id: I42d1305d5cdb5a717cfa7fce26798ac7102310f7 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-05-05Implement get_external_network via shadeCédric Ollivier1-0/+66
It fixes the current issues as EXTERNAL_NETWORK is mainly unset by all Installers [1]. [1] https://build.opnfv.org/ci/view/functest/job/functest-fuel-armband-baremetal-arm-daily-fraser/31/console Change-Id: I8ee62623701c15b9ff962d0a0e07a77934ff03ac Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-03-11Fix many pylint warningsCédric Ollivier1-8/+10
Only pylint warnings in vnf modules has to be fixed now. Change-Id: Ie71230072a51bb72ec0b1d4fef2652494d29948e Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-03-02Leverage on XtestingCédric Ollivier1-125/+0
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-26Remove obsolete Functest utilsCédric Ollivier1-85/+2
Only 3 functions are kept as part of our framework: - execute_command_raise() - execute_command() - get_parameter_from_yaml() Change-Id: I966a1d6122391dae85aa3c77813ad2f1698ceb45 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-26Remove openstack utilsCédric Ollivier1-1784/+0
They have been obsolete since we fully switched to snaps. The files are being moved to SDNVPN which is the last project using them [1]. [1] https://gerrit.opnfv.org/gerrit/#/c/52631/ Change-Id: I277b92a04cf6bc7b30015eed76f03f17830fad2b Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-22Switch from CONST to CONFCédric Ollivier1-39/+0
It also removes constants.CONST and env.Environment which are now useless. Depends-On: I764a0a2a24447c941d1e726f3116593b29dd1c1e Depends-On: I6cfa832466dcefd737314633d807512e46267a69 Change-Id: Ife41c59d9f2e6ec4e49df38af962039f99554bc5 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-16Get properly env vars or their default valuesCédric Ollivier2-1/+97
It defines env.get() as an unique way to get Functest env vars or their default values. It can be considered as a wrapper above os.environ. It enforces backward compatibility via CONST which mustn't be used for that purpose. It should be noted that it also stops using CONST for getting OpenStack env vars. Change-Id: I333dc1afbc0123166a7eaff8b551370098efa341 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-12Export env vars via os.environ in test_openstack_utils.pyCédric Ollivier1-2/+2
CONST shouldn't be used for getting/setting env vars. It adds complexity and may raise side effects. Change-Id: I8319748dd2f0abb95b82a2f65191cac8ccba7f5e Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-09Move get_dict_by_test() into run_tests.pyCédric Ollivier1-28/+0
It also removes functest_utils.get_criteria_by_test() Change-Id: I3f265642acd053755e32f8e92f1086b93517c247 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-08Move source_credentials() into run_tests.pyCédric Ollivier1-29/+0
It's also renamed source_envfile(). Change-Id: I0e7c38c2def125961f86dc2bc9a63cfb6ad87c03 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-01-26Fix pylint errors in several utils modulesCédric Ollivier1-6/+6
All utils which are moving to xtesting are now fixed. It remains OpenStack and Functest utils (+ the related unit tests) which doesn't move to the new package. Change-Id: If13c627c8444c62d5c6bf9c8057d6413aa0e56c7 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-01-21Disable all missing-docstring warnings in unit testsCédric Ollivier2-0/+4
Change-Id: I22b7bbdab5f000b4ade6c2ba3a4029c146887cbd Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-01-21Move push_results_to_db to TestCaseCédric Ollivier2-132/+34
It removes the link between TestCase and Functest utils (xtesting). It should be noted that testresults url can only be set by env var. Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com> Change-Id: Ie072c675890d0ae2e63619c599d2684a8c7d762d Signed-off-by: Jose Lausuch <jalausuch@suse.com> Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-12-21Merge "Remove logger_test_results"Cedric Ollivier1-32/+0
2017-12-20Remove logger_test_resultsCédric Ollivier1-32/+0
It was only called in Feature which the result is already printed (see __str__()). It also eases moving Feature to xtesting as it breaks the link to functest_utils. Change-Id: Ib72d651dc7d89598704ff4d52d8b1ecb2bdade5b Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-12-19Remove openstack_[clean,snapshot]Cédric Ollivier2-982/+0
It also removes the related unit tests and updates docs and cli. Change-Id: Ie11f77402f2b5b7055a0c7c5d931c8ff21124482 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-12-12Mock time.sleep() to decrease test durationCédric Ollivier1-11/+24
It also returns None when getting floating ips after deleting them. It now runs 40 tests in 0.084s. Change-Id: If4b1032ab9890fd291d99beb57166ead8729d822 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-12-12Add python3 for Functest utilsCédric Ollivier3-4/+5
It also fixes test_utils RegexMatch and SubstrMatch. Change-Id: I124aa7d0c4110dcd2f50220aae7ba9b299799e93 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-09-11Remove volume type handlingJuha Kosonen1-64/+0
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-09-01Merge "Remove tacker library from functest"Morgan Richomme1-524/+0
2017-09-01Remove tacker library from functestManuel Buil1-524/+0
This library is moved to the SFC repo https://gerrit.opnfv.org/gerrit/#/c/40265/2 Change-Id: I339337e4c2f17933a74bf85259e36f8f5742a17a Signed-off-by: Manuel Buil <mbuil@suse.com>
2017-08-29Remove get_installer_typeLinda Wang1-17/+0
JIRA: FUNCTEST-763 Change-Id: Ib05f699063393eb6eaa9f559854aca50b77aead3 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-08-28Obtain scenario by CONST instead of get functionLinda Wang1-23/+3
JIRA: FUNCTEST-763 Change-Id: Ic9fa3243b50a09de8a5e531fed8298997367dd84 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-08-17Obtain pod_name by CONST instead of get functionLinda Wang1-23/+3
JIRA: FUNCTEST-763 Change-Id: Id334745a1eac8b933d77f9cb36a506a02366d760 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-08-17Merge "Fix domain in tenant creation"Juha Kosonen1-0/+15
2017-08-15Fix domain in tenant creationJuha Kosonen1-0/+15
Use the ID of the domain when creating a tenant on keystone v3. Change-Id: Ic415237e2bb2d537f07ab2245816a575f977aaa0 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
2017-08-15Obtain build_tag by CONST instead of get functionLinda Wang1-32/+10
JIRA: FUNCTEST-763 Change-Id: I86b0b515a3d51df20a35c2aeb461a95d0c5797fd Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-07-27Omit space line in openrc fileLinda Wang1-2/+0
For alpine testing in compass OSA, sourcing openrc failed due to space lines included. Change-Id: I23166090a2fa7c2ce0aa03be581231cbb3cea34a Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-06-29Remove BGPVPN utils in Functestjose.lausuch1-53/+0
These util functions should be under control of the SDNVPN project. After [1] and [2] it is safe to remove them in Functest [1] https://gerrit.opnfv.org/gerrit/#/c/36655/ [2] https://gerrit.opnfv.org/gerrit/#/c/36505/ Change-Id: I2f6596cd60678bb0c50adb9b4bc0d59545c3fb0a Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
2017-06-26Fix floating ips issue in openstack_cleanjose.lausuch1-4/+9
floatingips is a list of dictionaries where the attributes are a bit different than in the previous implementation. Change-Id: I8e8429b1819bba35a4a829f274c60b77ab2eea7e Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
2017-06-26Merge "Make rally support https insecure deployment"Jose Lausuch1-2/+4
2017-06-26Merge "Use glance to list images"Jose Lausuch3-3/+5
2017-06-26Change floating ips management from nova to neutronjose.lausuch2-13/+16
Nova does not longer support floating ip creation/deletion. This patch moves that logic to neutron client. Change-Id: I2c4146149fe5be534d9c50d78d831b5af1957ad7 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
2017-06-24Make rally support https insecure deploymentLinda Wang1-2/+4
When running in https environment, rally should support insecure deployment if no cacert file is provided. JIRA: FUNCTEST-828 Change-Id: I29b0fc8c2e1b74a1ce08293706cd9f11f975b6d5 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-06-24Use glance to list imagesLinda Wang3-3/+5
1. Images list is not supported by novaclient 8.0.0 2. It moves images list out of nova and into glance Change-Id: I2a2d40a2ca3a0cf1ebfb55697b3c58af8748a805 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-06-20Remove all references to /home/opnfv/repos/functestCédric Ollivier1-13/+1
It also removes relative (and incomplete) references which could be defined in modules instead of this global configuration. Change-Id: Ie20dc3547e49b6224aa8100cd380d37b87ece5a9 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-06-19Stop getting git data from functest dirCédric Ollivier1-22/+0
Functest is no longer a git clone. Change-Id: Ieaceacaa820e9a7a3c64e8c1fbd2a8a9321f234d Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-06-19Remove module references __file__Cédric Ollivier1-2/+3
It allows functest to be run directly from a zip file [1]. [1] https://setuptools.readthedocs.io/en/latest/setuptools.html#setting-the-zip-safe-flag Change-Id: I596a71e8cf2bed6dd79655bd5beeb047876a188c Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-06-06Refactor core VNF classMorgan Richomme1-0/+71
- Simplify processing - Implement run method to inherit testcase methods - Add unit tests - Fix all pylint issues It also obliges vnf and its uts to be rated 10/10 by pylint. JIRA: FUNCTEST-830 Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com> Change-Id: I8dd24eea55089277c9e5b2b51fb14dc377f2fcaf Signed-off-by: Morgan Richomme <morgan.richomme@orange.com> Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-06-01Use CONST to retrieve db_url rather than getter functionLinda Wang2-56/+33
1. Remove get_db_url() 2. If TEST_DB_URL declared in env, update test_db_url in config_functest.yaml file during env preparation 3. No matter TEST_DB_URL declared in env or not, Result_DB = CONST.__getattribute__("results_test_db_url") JIRA: FUNCTEST-763 Change-Id: I20da7ef98bbcc56731e0ff7061b05c1dde6cbfc3 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-05-23Stop printing in console when testing functest_utils.pyCédric Ollivier1-6/+4
Change-Id: I6fa0f6f449270199cc4d5b2c88e171091bf92773 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-21Sort keys when dumping jsonCédric Ollivier1-1/+1
Otherwise dumping them could break some unit tests as they are unordered collections [1]. [1] https://build.opnfv.org/ci/job/functest-verify-master/4122/ Change-Id: I108e946926ae9690cf2421e565f2bb81500f9160 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-19Set default value for CONFIG_FUNCTEST_YAMLCédric Ollivier1-1/+2
It calculates via the full path of env.py. Change-Id: Ief958833f5116cdb116d0153d85a0ae03063ec5c Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-19Merge "Modify how to disable logging in unit test."Jose Lausuch6-13/+6
2017-05-18Modify how to disable logging in unit test.Cédric Ollivier6-13/+6
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>
2017-05-18Remove check_success_ratejose.lausuch1-16/+0
After the introduction of is_successful method in TestCase class, this is not needed anymore. Change-Id: I70f6f9e10495601cd5443467347b97efe27b81a3 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
2017-05-17Update self.result value to INTjose.lausuch1-2/+2
So far, the test cases are storing a string "PASS" "FAIL" in the self.result variable. The way the new framework works is with INT Values. Change-Id: I45e8693327740faadd8254b21569adfb2cefa6c8 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
2017-05-17Add Python3 support to the ODL testcaseCédric Ollivier1-16/+18
It also adds this support to its dependencies. Change-Id: I0534f0c7b0e15a9ee89f522f314cf5200874454c Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-15Fully cover the decoratorCédric Ollivier1-0/+135
Change-Id: I1f1c938f0715e6afb7edbb8242f9a6c9cbfa65b5 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>