aboutsummaryrefslogtreecommitdiffstats
path: root/functest/core/pytest_suite_runner.py
AgeCommit message (Collapse)AuthorFilesLines
2017-05-23Rename pytest_suite_runner.py to unit.pyCédric Ollivier1-61/+0
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-19Precise self.result in pytest_suite_runner.pyCédric Ollivier1-29/+13
It also adds the related unit tests. Change-Id: I8325bd9a55c69b229e3c48a9e64aa963e685e03d Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
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-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.lausuch1-4/+4
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-16Converted vPing to leverage the object-oriented SNAPS library.spisarski1-1/+1
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-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-09Bugfix: initialize the logger for snapsLinda Wang1-0/+1
Testcases about snaps failed due to the absence of attribute 'logger'. Change-Id: I78c85e51f63afa767fa73aa12faea066ad432371 Signed-off-by: Linda Wang <wangwulin@huawei.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-11Modify TestCase constructor attributesCédric Ollivier1-2/+2
Every feature/testcase now allows receiving the data defined in testcases.yaml as args (name is renamed to case_name). From the time being, only project and case names are handled. Next pending patches will add criteria, cmd and repo to this list. It keeps the default values for case names except for features which will be aggregated into Feature. Change-Id: Id742d100b8183d7f10894c24ae6879d1b2b60ac9 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-04-05Bugfix: Add case_name as constructor arg for snaps and rallyLinda Wang1-2/+2
When running healthcheck tier and rally, it complains " __init__() got an unexpected keyword argument 'case_name'" Change-Id: I078094921f08b457b88beabee60eabf40b657411 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-03-27Rename testcase_base to testcaseCédric Ollivier1-1/+1
It simply removes the useless suffix. Change-Id: Ib9a682b57d8f33518359d817a593bb3786577390 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-03-27Switch TestcaseBase to TestCaseCédric Ollivier1-3/+3
It partially reverts "Rename TestCasesBase into TestcaseBase" [1] and removes the useless suffix too. [1] https://gerrit.opnfv.org/gerrit/#/c/25391/ Change-Id: Iddf2ec8d6c1dafe6e4c6713c2e69969613317471 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-03-08Added support for scenario-based flavor creation.spisarski1-2/+0
As certain scenarios such as, DPDK, FDIO, and OVS use cases require special 'hw:' settings to flavors, SNAPS-OO has just implemented the ability to take in these configuration values to apply to its integration tests. This change checks the scenario and should be configuring the flavor metadata accordingly. Also see SNAPS-38 Used this as an opportunity to refactor the SNAPS test classes as well... JIRA: FUNCTEST-746 Change-Id: I63535776acde088a7461f602966a324b6207592d Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-01-31Tempest and SNAPS not pushing results to DB in case of FAILMorgan Richomme1-2/+6
this problem was due to the fact that we add exit condition EX_ERROR when the result was FAIL EX_ERROR shall be used as exit condition when there is an execution error, i.e the test case cannot be run if it can be run, there is no execution error the result can be PASS or FAIL, but from the CI, execution is OK JIRA: FUNCTEST-714 Change-Id: Id434bb9aa88b50277c40c717259304f26f7b3966 Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
2017-01-04Reverted the file permissionhelenyao1-0/+0
There are some files whose permissions are changed unintendedly. Revert all of them. mode change 100644 <= 100755 functest/core/pytest_suite_runner.py mode change 100644 <= 100755 functest/opnfv_tests/openstack/vping/vping_base.py mode change 100644 <= 100755 functest/utils/openstack_tacker.py mode change 100644 <= 100755 functest/tests/unit/odl/test_odl.py mode change 100644 <= 100755 requirements.txt mode change 100644 <= 100755 test-requirements.txt Historical comments that changed the permission for reference changeID: Ia02760fd98aaab59a6cf0a90a2020b76e0c92df6 changeID: Id6815f96a11f2918bc2c7bc1c33f38c3f5754e11 changeID: Ic8c01b9b7ed86d3bdd9f5125504bc47f46a37700 changeID: I9f1a408f0e43bff4499575fa57cabd1a83d99b3a Change-Id: I1deadd77cc78f2186f82de79233aabe97ac21b26 Signed-off-by: helenyao <yaohelan@huawei.com>
2016-12-20Remove backslash to meet PEP8 requirementhelenyao1-2/+2
JIRA: FUNCTEST-630 Change-Id: Ia02760fd98aaab59a6cf0a90a2020b76e0c92df6 Signed-off-by: helenyao <yaohelan@huawei.com>
2016-12-09Snaps integrationMorgan Richomme1-9/+8
Fix testcase class name Minor change on criteria, start_time, stop_time Change-Id: I9ba49781c3a3212f03b7ab822f9ab311a4fafd3d Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
2016-12-08Added test cases for running the Python Tests included with SNAPS.spisarski1-0/+56
JIRA: FUNCTEST-570 The three new tests are: 1. healthcheck/connecton_check - Retrieves different OpenStack clients and may exercise a query function 2. healthcheck/api_check - Exercises many of the OpenStack APIs by performing basic CRUD operations 3. smoke/snaps_smoke - Creates VMs and some optionally test SSH into floating IPs Removed configured exernal network name and replaced it with a dynamic lookup. Fixed typo in run_tests.py Change-Id: Icb87a77c7cdd99dd9aa3a66bcc5a25b4b5935fef Signed-off-by: spisarski <s.pisarski@cablelabs.com>