From 6ba4e817cf71a69ddf6606dcc5005b8d8e8692e9 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Tue, 11 Oct 2016 15:42:56 +0200 Subject: Conform ODL to TestCasesBase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now ODLTestCases inherits from TestCasesBase what induces several modifications of function definitions. It also renames functest_run to run and run to main and they now return the code status defined in TestCasesBase instead of True and False (run_tests.py has been adapted as well). It checks if errno is equal to EEXIST when makedir raises an OSError exception. JIRA: FUNCTEST-353 Change-Id: I88240a9ce8e491dab4c7e6c604f3ecc62cf9edce Signed-off-by: Cédric Ollivier --- ci/run_tests.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'ci') diff --git a/ci/run_tests.py b/ci/run_tests.py index 638a6edf..834a29bf 100755 --- a/ci/run_tests.py +++ b/ci/run_tests.py @@ -17,12 +17,14 @@ import argparse import functest.ci.generate_report as generate_report import functest.ci.tier_builder as tb +import functest.core.TestCasesBase as TestCasesBase import functest.utils.functest_logger as ft_logger import functest.utils.functest_utils as ft_utils import functest.utils.openstack_clean as os_clean import functest.utils.openstack_snapshot as os_snapshot import functest.utils.openstack_utils as os_utils -from functest.testcases.Controllers.ODL.OpenDaylightTesting import ODLTestCases +import functest.testcases.Controllers.ODL.OpenDaylightTesting as odl_test + parser = argparse.ArgumentParser() parser.add_argument("-t", "--test", dest="test", action='store', @@ -101,10 +103,10 @@ def run_test(test, tier_name): flags += " -r" if test_name == 'odl': - result = ODLTestCases.functest_run() - if result and REPORT_FLAG: - result = ODLTestCases.push_to_db() - result = not result + odl = odl_test.ODLTestCases() + result = odl.run() + if result == TestCasesBase.TestCasesBase.EX_OK and REPORT_FLAG: + result = odl.push_to_db() else: cmd = ("%s%s" % (EXEC_SCRIPT, flags)) logger.debug("Executing command '%s'" % cmd) -- cgit 1.2.3-korg