aboutsummaryrefslogtreecommitdiffstats
path: root/functest
AgeCommit message (Collapse)AuthorFilesLines
2017-05-19Print stack when catching exceptions in run_tests.pyCédric Ollivier1-7/+8
Change-Id: Id94475dd519ce04b87da470f6e6bb5a1c1aa2d75 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-19Merge "Add a new directory to hold pre-downloaded images"Helen Yao7-5/+52
2017-05-18Merge "Use logger instead of printing in console"Jose Lausuch1-3/+13
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-18Merge "Remove check_success_rate"Jose Lausuch7-79/+34
2017-05-18Use StringIO in odl.pyCédric Ollivier2-53/+5
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-18Merge "Fix 2 issues related to logger in pytest_suite_runer.py"Jose Lausuch1-3/+1
2017-05-18Merge "Allow running unittest.TestCase via run_tests.py"Jose Lausuch1-0/+5
2017-05-18Use logger instead of printing in consoleCédric Ollivier1-3/+13
It modifies pytest_suite_runner.py to dump unit test results in functest.log via logging. Change-Id: Ic4e7567c5e52e00ad0e485ccb070029b135041b2 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-18Remove check_success_ratejose.lausuch7-79/+34
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-18Merge "Fix the opera ims instance initialization error"Jose Lausuch1-4/+4
2017-05-18Replace CONST.* by getattribute/setattr for cliLinda Wang8-66/+85
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 imageshelenyao7-5/+52
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-18Fix 2 issues related to logger in pytest_suite_runer.pyCédric Ollivier1-3/+1
logging.ini requires the full name otherwise all log messages are lost. Calling basicConfig() is useless as it has been correctly configured by run_tests.py before. Change-Id: I03663c01f795b1b844239a9e24379faa529829aa Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-18Allow running unittest.TestCase via run_tests.pyCédric Ollivier1-0/+5
pytest_suite_runner can run any unittest.TestCase thanks to name passed as run arg. Here is the related functest/ci/testcases.yaml: run: module: 'functest.core.pytest_suite_runner' class: 'PyTestSuiteRunner' args: name: 'functest.tests.unit.odl.test_odl' Change-Id: I7c2c611c4afbad1e52bfdca4a3288ccc21491389 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-17Update self.result value to INTjose.lausuch4-9/+11
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-17Merge "Conform constants.py with the minimal standards"Cedric Ollivier3-21/+21
2017-05-17Conform constants.py with the minimal standardsCédric Ollivier3-21/+21
It adds the shebang to constants.py and its dependencies and stops importing from a relative path. It stops printing obsolete values too. It adds python3 support to them by the way. Change-Id: Ie7bddcf253eb245844d9e11c17acc69943c1ba63 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-17Merge "Fix an unorderable types error (if python 3)"Jose Lausuch1-0/+1
2017-05-17Merge "Add Python3 support to the ODL testcase"Jose Lausuch6-91/+93
2017-05-17Merge "Converted vPing to leverage the object-oriented SNAPS library."Jose Lausuch8-404/+471
2017-05-17Fix an unorderable types error (if python 3)Cédric Ollivier1-0/+1
Change-Id: I07c5a548f10a1779faead4d9c596a1976aff8866 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-17Add Python3 support to the ODL testcaseCédric Ollivier6-91/+93
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-16Converted vPing to leverage the object-oriented SNAPS library.spisarski8-404/+471
JIRA: FUNCTEST-577 1. Replaced procedural openstack_utils with the object-oriented SNAPS library 2. Tests now clean themselves up. 3. Improved code documentation. 4. Removed dependency on file-based Cirros image and now leveraging the download URL. 5. Removed hardcoded location to the testcases.yaml file to leverage the value in config_functest.yaml 6. Included optional flavor metadata based on the scenario being tested 7. Included support for multi-part images. 8. Added enhanced support for configurable images. see SNAPS-76 Fixed line length verification problem with the previous submission Fixed retrieval of external network name to be dynamic. Changed external network name retrieval to leverage the newly merged snap_util.get_ext_net_name() function Added the creation and deletion of flavors. SNAPS now has the ability to add/remove security groups from running instances. Changed VMInstance constructor by moving userdata to configuration object. Change-Id: I0ef5e268eb153d696bb4d9a7533f780e5c603d26 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-05-16Define Runner classCédric Ollivier2-275/+300
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 "Assign the wrapped function’s attributes"Jose Lausuch1-0/+2
2017-05-16Merge "Additional Unit Tests for core modules"Jose Lausuch2-13/+180
2017-05-16Merge "Get a logger before printing"Jose Lausuch1-6/+12
2017-05-16Add enabled flag in testcases.yamljose.lausuch6-17/+65
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 Ollivier7-333/+30
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 Ollivier3-1/+14
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>
2017-05-16Merge "Modify TestCase.__str__() to use PrettyTable"Jose Lausuch2-8/+14
2017-05-15Fix one minor typoCédric Ollivier1-1/+1
Change-Id: Id17070985adfbe7817f3be25b47f583cb9ef90b6 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-15Additional Unit Tests for core modulesashishk19942-13/+180
This patch adds unit tests for vnf and pytest_suite_runner. It also fixes several pylint warnings/errors. Additional tests are required to check args values. Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com> Change-Id: I75a829233481655c794402830e1da037ab7cdb8d Signed-off-by: ashishk1994 <ashishk.iiit@gmail.com>
2017-05-15Get a logger before printingCédric Ollivier1-6/+12
It also fixes pylint errors. Change-Id: I0d973360574a517724d0be3986c788c3ce7f54d4 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>
2017-05-14Assign the wrapped function’s attributesCédric Ollivier1-0/+2
It mainly assigns to the wrapper push_results_to_db's __name__, __module__ and __doc__ and the documentation string. Change-Id: Idc882ac4e743699a4887e46c5066e0983c90afd9 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-12Merge "Add Energy recording support"Morgan Richomme6-1/+491
2017-05-11Modify TestCase.__str__() to use PrettyTableCédric Ollivier2-8/+14
It adds PrettyTable as requirement even if it's already defined in OpenStack client dependencies. If the TestCase object is considered as invalid, it simply returns the default str. Change-Id: Iee788aef2a13694d9482560977cbbf21c7f2c967 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-10Merge "Conform ODL with last framework updates"Morgan Richomme3-9/+38
2017-05-10Merge changes from topic 'add_testcase_str'Morgan Richomme5-10/+57
* changes: Remove the former results in DB url Implement TestCase __str__()
2017-05-09Merge "Bugfix: initialize the logger for snaps"Cedric Ollivier2-0/+4
2017-05-09Remove the former results in DB urlCédric Ollivier2-7/+7
It conforms generate_report.py with the previous change [1]. [1] https://gerrit.opnfv.org/gerrit/#/c/33511/ Change-Id: I677ebd416f462a591439fc7b637c02d7964e6173 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-09Add Energy recording supportBenoit HERARD6-1/+491
It adds helpers to send notifications to Energy recording API and related unit tests. It requires a dedicated section in functest config file to set connectivity parameters to Energy recording API. It is using shared API Recording at http://161.105.253.100:8888 Change-Id: Idcb74d1bf7341ccce7cc1c3926f22338ce24f714 Signed-off-by: Benoit HERARD <benoit.herard@orange.com>
2017-05-09Conform ODL with last framework updatesCédric Ollivier3-9/+38
Now ODL TestCase calculates the ratio between critical tests passed and failed and saves it in result. Non-critical test cases can fail as result doesn't take them into account [1]. It also updates default attribute values in TestCase and allows result to be float. [1] http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#setting-criticality Change-Id: Id4a89271b5b1a90cd3c1e2b08591ff26ffaffee0 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-09Rename VnfOnBoardingBase to VnfOnBoardingCédric Ollivier5-7/+7
Change-Id: I514340fc6180e29b31ef11bdea9f719aa2bbb738 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-09Rename vnf_base to vnfCédric Ollivier5-10/+10
Change-Id: I0b8b9b2e85717fc92a233e4f7344b3419421778d Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>