aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/core/test_feature.py
AgeCommit message (Collapse)AuthorFilesLines
2017-08-07Add copper and domino in functest-featuresCédric Ollivier1-2/+2
Change-Id: I6f7a35b84c9b7f8cde88998f545b30cc200c8ff1 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-06-21Define logger as Feature instance attributeJose Lausuch1-4/+19
It allows any Feature subclass to print warning messages in console and debug messages in a dedicated file. Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com> Change-Id: Ic5b1b1184c16cf50f0baadc3904075d0acdf3c6d Signed-off-by: Jose Lausuch <jose.lausuch@ericsson.com> Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-18Modify how to disable logging in unit test.Cédric Ollivier1-4/+3
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-05Replace project_name by case_name in result file nameCédric Ollivier1-1/+1
It avoids erasing functest.log when project_name = functest. Change-Id: Icae898abb8b51c89b79bb1124adfadab8b0b3b99 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-04-26Manage criteria in TestCaseCédric Ollivier1-2/+2
It converts all criteria values to the corresponding percent in functest/ci/testcases.yaml. Result is expected to be equal or greater than criteria. If both are 0, result is considered as false. It is compatible with the old behavior but warns to update. It will allow a safer remove. It also fixes a bug in test_tempest to allow merging [1] and tier_handler.py which required that type criteria was str. [1] https://gerrit.opnfv.org/gerrit/#/c/27949/ Change-Id: Ib6edcfa3103b7d51b0bdc83119f1cea2a8be9fbc Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-04-26Switch TestCase attribute criteria to resultCédric Ollivier1-2/+2
It mainly avoids mixing input and output. Criteria is now an input set in functest/ci/testcases.yaml and then must be passed as __init__() args (which will be proposed in an additional change). Then it also renames the related TestCase method to check_result(). Change-Id: Ifc3c8e3ea6cde7e3edf7174bed4bf2bf0894e8e3 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-04-14Remove deprecated feature modulesCédric Ollivier1-5/+19
All features running bash programs are now simply defined in testcases.yaml. All deprecated modules and unit tests are removed. Change-Id: I7047b6f7a1e43cb8ed5ba2d569d5dcecae68fb86 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-04-12Refactor the Feature frameworkCédric Ollivier1-75/+51
run() returns the expected status code (see following JIRA tickets). repo, pre() and post() are removed as they were quite useless. A dedicated class is proposed for bash programs. Unit tests have been added to fully cover this module. All features have been modified to conform with these modifications. It also removes the decorators which skipped several unit tests. JIRA: FUNCTEST-778 JIRA: FUNCTEST-779 JIRA: FUNCTEST-780 JIRA: FUNCTEST-781 Change-Id: Ifb1e4c4f68260a4e20d895f67f07f369ca959374 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-04-04Add unit tests for featureCédric Ollivier1-0/+108
They partially cover feature but already highlight bugs. Several tests are skipped to allow merging. Their decorators could be removed as soon as feature is fixed. I think bad-continuation is false positive so it's disabled (pep8 and flake8 return ok). JIRA: FUNCTEST-779 Change-Id: I89b9e2ec0388eea2471d941b2c653deca7fbddf6 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>