aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests
AgeCommit message (Collapse)AuthorFilesLines
2017-05-31Added unit tests for the connection_check test case.spisarski2-0/+73
JIRA: FUNCTEST-813 Change-Id: Ib851a3942e181b1a91cad695504613868a340d15 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-05-30Define create_snapshot() and clean() in TestCaseCédric Ollivier4-19/+59
They replace the former calls in run_tests which are not suitable for all test cases. Now any test case can define how to clean its resources. If the snapshot cannot be created, the test case is considered as failed. Only a message is printed if any failure during cleaning. It also defines a new class called OSGCTestCase useful for test cases which don't clean their OpenStack resources. All test cases located in opnfv_tests/openstack inherit from it to keep the global behavior unchanged. It also deletes exit instructions in openstack_clean and openstack_snapshot, removes clean flags in testcases.yaml and updates the related utils. All Docs are modified as well. JIRA: FUNCTEST-438 Change-Id: I8938e6255708012380389763a24059ace4ce45d8 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-29Protect against self.suite = NoneCédric Ollivier1-1/+5
Change-Id: Ie3370ebfdd51b9aff707e50b754ca52796e49fbf Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-24Merge "Stop printing in console when testing functest_utils.py"Jose Lausuch1-6/+4
2017-05-24Merge "Rename the class TestSuiteRunner to Suite"valentin boucher1-1/+1
2017-05-24Merge "Rename test_pytest_suite_runner.py to test_unit.py"valentin boucher1-0/+0
2017-05-24Merge "Rename pytest_suite_runner.py to unit.py"valentin boucher1-6/+4
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-23Rename the class TestSuiteRunner to SuiteCédric Ollivier1-1/+1
It conforms with [1]. [1] https://gerrit.opnfv.org/gerrit/#/c/35211/ Change-Id: I11bbdcd63a1691835fb7c6198549edbaf6b758a1 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-23Rename test_pytest_suite_runner.py to test_unit.pyCédric Ollivier1-0/+0
It conforms with [1]. [1] https://gerrit.opnfv.org/gerrit/#/c/35211/ Change-Id: Ife7a161970997cf6cd74e86c343d4879f87b5cf4 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-23Rename pytest_suite_runner.py to unit.pyCédric Ollivier1-6/+4
It also adds the rst files to include this module in apidoc. Change-Id: Iabbb17bc8601265bd9436c75d1afc0b470df1eb4 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-23Call fetch_os_creds.sh from $PATHLinda Wang1-9/+6
Now it's defined as script in releng/modules' setup.py [1] [1] https://gerrit.opnfv.org/gerrit/#/c/35183/ Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com> Depends-On: Ic77f4e46d6d3396f9891b73105a0eb7aa037754f JIRA: FUNCTEST-829 Change-Id: Ief821b7326e0a6c2bbcab31bb21629455e4bc9ea Signed-off-by: Linda Wang <wangwulin@huawei.com> Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-22Merge "Update test_vnf.py to support py3"valentin boucher1-2/+2
2017-05-22Merge "Sort keys when dumping json"valentin boucher1-1/+1
2017-05-22Merge "Tox utility to run unit tests"valentin boucher1-27/+0
2017-05-22Merge "Add baro_tests as requirements"valentin boucher1-3/+2
2017-05-22Merge "Set default value for CONFIG_FUNCTEST_YAML"valentin boucher1-1/+2
2017-05-22Merge "Fully cover pytest_suite_runner.py"valentin boucher1-6/+36
2017-05-22Merge "Precise self.result in pytest_suite_runner.py"valentin boucher1-20/+32
2017-05-22Merge "Replace CONST.* by getattribute/setattr for refstack"Morgan Richomme1-10/+14
2017-05-22Update test_vnf.py to support py3Cédric Ollivier1-2/+2
Change-Id: I86dc83b1fc9205f7b8209d63e18439a7e05c646b 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-20Tox utility to run unit testsashishk19941-27/+0
Now run_unit_tests.sh only calls tox to allow merging. It can be safely deleted as soon as the related jjob is updated. It also removes test_logging.ini. Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com> Change-Id: I934f4ac739d99d0cb29bea8c6aac6d6780b30901 Signed-off-by: ashishk1994 <ashishk.iiit@gmail.com> Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-20Add baro_tests as requirementsCédric Ollivier1-3/+2
It also stops cloning it when building the docker container and updates the related unit tests. It bypasses the bug when importing collectd [1]. [1] https://jira.opnfv.org/browse/BAROMETER-79 Change-Id: Ie9f8ea2b3c95d6b1f5405d76b018cdcb62343a58 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-19Fully cover pytest_suite_runner.pyCédric Ollivier1-6/+36
Change-Id: I766afb1d5c6ef53a5b551539662ee363ae8eadee Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-19Precise self.result in pytest_suite_runner.pyCédric Ollivier1-20/+32
It also adds the related unit tests. Change-Id: I8325bd9a55c69b229e3c48a9e64aa963e685e03d Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-19Merge "Replace CONST.* by getattribute/setattr for rally and tempest"Jose Lausuch3-29/+29
2017-05-19Merge "Define Runner class"Jose Lausuch1-73/+98
2017-05-19Replace CONST.* by getattribute/setattr for refstackLinda Wang1-10/+14
Directories affected: - functest/opnfv_tests/openstack/refstack_client and respective unit test JIRA: FUNCTEST-796 Change-Id: I7f7047d44d71e82bcc1f66ec0b760ff30a13dbd5 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-05-19Replace CONST.* by getattribute/setattr for rally and tempestLinda Wang3-29/+29
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 Lausuch30-65/+36
2017-05-19Merge "Use StringIO in odl.py"Morgan Richomme1-40/+0
2017-05-19Merge "Replace CONST.* by getattribute/setattr for cli"Morgan Richomme4-39/+51
2017-05-19Merge "Add a new directory to hold pre-downloaded images"Helen Yao1-0/+8
2017-05-18Modify how to disable logging in unit test.Cédric Ollivier30-65/+36
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-18Use StringIO in odl.pyCédric Ollivier1-40/+0
It avoids creating and removing the temporary file to dump robot output. Change-Id: Ia5ea66e76ffb8b8327f2da938f177e8ef4c61dd4 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-18Remove check_success_ratejose.lausuch3-47/+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-18Replace CONST.* by getattribute/setattr for cliLinda Wang4-39/+51
Directories affected: - functest/cli/commands and respective unit test JIRA: FUNCTEST-796 Change-Id: I2ad721819d4b8f97098c589c3b5ed3dcc945409d Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-05-18Add a new directory to hold pre-downloaded imageshelenyao1-0/+8
Put all images in the new direcotry. If users want to use the local image, map the local directory to the ${HOME}/functest/images Change-Id: I0d309b93f52b3da23d6130056f1a19907313ef68 Signed-off-by: helenyao <yaohelan@huawei.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 Ollivier2-20/+22
It also adds this support to its dependencies. Change-Id: I0534f0c7b0e15a9ee89f522f314cf5200874454c Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-17Update/Add requirements to run ODL robot CSITJamo Luhrsen1-6/+4
It conforms test_odl.py with the new RobotFramework API too. It also updates test-requirements.txt as required by the current implementation of run_unit_tests.sh. Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com> Change-Id: Ibca0150a40d3b8a3f736be1e9dcbf9ce56af0299 Signed-off-by: Jamo Luhrsen <jluhrsen@redhat.com> Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-16Define Runner classCédric Ollivier1-73/+98
It simply converts run_tests.py's functions to Runner's methods. This proposal could be enhanced in a second step to fully leverage on object programming. It defines as instance variables the former static variables to allow multiple runs (it's mandatory for unit testing). All false positives in unit tests are fixed but run_tests.py is still not fully covered. Change-Id: I8f91c132aa8b2248041f31e46238dd5598344d34 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-16Merge "Fix one minor typo"Jose Lausuch1-1/+1
2017-05-16Merge "Fully cover the decorator"Jose Lausuch1-0/+135
2017-05-16Merge "Additional Unit Tests for core modules"Jose Lausuch2-13/+180
2017-05-16Add enabled flag in testcases.yamljose.lausuch2-0/+6
This will allow enable/disable test cases directly using true/false. Change-Id: Iaa7d051ebb8dd9e5a6f835a823f58f1e17a87b8d Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
2017-05-16Switch from generate_report to PrettyTableCédric Ollivier3-156/+5
run_tests.py now relies on PrettyTable as most of the openstack clients. generate_report.py and its related unit tests are simply removed. It sets padding_width=5 in testcase.py too to conform with run_tests.py. Now report is printed in every case. Change-Id: Id9ce93f984503f25d6a2150482f397853fa3dd64 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-16Fix how to get tier_nameCédric Ollivier1-0/+7
The tier name was incorrect when passing a test case as run_test.py arg. Change-Id: I6f439fc7b90facb3f0553798bd1fe06ac9f09475 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>