summaryrefslogtreecommitdiffstats
path: root/TestUnits/cli/volume/replace_brick/testunit.py
diff options
context:
space:
mode:
authorShwetha-H-Panduranga <shwetha@gluster.com>2012-02-06 18:21:55 +0530
committerShwetha-H-Panduranga <shwetha@gluster.com>2012-03-05 12:19:03 +0530
commitc1a19ed78f8d00487819c01973a71ccb225a1e9d (patch)
tree9b5b49bedab1eaaf50358f9926d8d4d43c9d85a4 /TestUnits/cli/volume/replace_brick/testunit.py
parent94603abafce645dea8144b0c564805a44808fec9 (diff)
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 <shwetha@gluster.com>
Diffstat (limited to 'TestUnits/cli/volume/replace_brick/testunit.py')
-rw-r--r--TestUnits/cli/volume/replace_brick/testunit.py46
1 files changed, 10 insertions, 36 deletions
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