From c1a19ed78f8d00487819c01973a71ccb225a1e9d Mon Sep 17 00:00:00 2001 From: Shwetha-H-Panduranga Date: Mon, 6 Feb 2012 18:21:55 +0530 Subject: Modifying the testcases to reflect the changes made to the return value from the libraries.Adding new module for replace brick libraries Change-Id: I3a886cd799d11b948eb87dd929546bdde3561dd7 Signed-off-by: Shwetha-H-Panduranga --- TestUnits/cli/volume/replace_brick/testunit.py | 46 ++++++-------------------- 1 file changed, 10 insertions(+), 36 deletions(-) (limited to 'TestUnits/cli/volume/replace_brick/testunit.py') diff --git a/TestUnits/cli/volume/replace_brick/testunit.py b/TestUnits/cli/volume/replace_brick/testunit.py index 222140c..9ec28d2 100644 --- a/TestUnits/cli/volume/replace_brick/testunit.py +++ b/TestUnits/cli/volume/replace_brick/testunit.py @@ -13,32 +13,6 @@ reload(testcases) filename = os.path.abspath(__file__) dir_path = os.path.dirname(filename) -def initialize(): - """ - """ - logger = GlobalObj.getLoggerObj() - return_status = 1 - testenv_file = GlobalObj.testenv_file - testenv_abspath = os.path.join(dir_path, testenv_file) - - if not (os.path.isfile(testenv_abspath)): - logger.error("%s not found in %s" % (testenv_file, dir_path)) - - if parser.parse_testenv_configfile(testenv_abspath): - return return_status - if managerutils.ssh_connect_allhosts(): - return return_status - - return 0 - -def setup(): - """ - """ - return_status = 1 - if atfutils.set_active_volume("volume1"): - return return_status - return 0 - def execute(): """ """ @@ -67,20 +41,18 @@ def execute(): for testcase in testcaseslist: function_obj = getattr(testcases, testcase) if function_obj: - logger.debug("Starting Test: ' %s '" % testcase) + logger.info("Starting Test: %s" % testcase) return_status = function_obj() - if return_status: - logger.debug("TestCase '%s' Failed" % testcase) + if return_status is not 0: + logger.info("TestCase %s Failed" % testcase) failedtestcases +=1 else: - logger.debug("TestCase '%s' Passed" % testcase) + logger.info("TestCase %s Passed" % testcase) passedtestcases +=1 - logger.debug("Ending Test: '%s'" % testcase) + logger.info("Ending Test: %s" % testcase) else: logger.info("TestCase %s not defined in 'testcases' module" % testcase) - continue - logger.info("Selected %d : Passed %d, Failed %d" % (selectedtestcases, @@ -99,10 +71,12 @@ def cleanup(): def main(): """ """ - return_status = 1 - if execute(): + return_status = execute() + if return_status is not 0: return return_status - if cleanup(): + + return_status = cleanup() + if return_status is not 0: return return_status return 0 -- cgit