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 --- libs/utils/rbutils.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 libs/utils/rbutils.py (limited to 'libs') diff --git a/libs/utils/rbutils.py b/libs/utils/rbutils.py new file mode 100644 index 0000000..0b67777 --- /dev/null +++ b/libs/utils/rbutils.py @@ -0,0 +1,27 @@ +""" Utilities for Replace Brick Testing +""" +import time +import atfutils +import glusterutils + +def wait_till_rb_completes(timeout, serverkey, from_brick, to_brick, + expected_message="migration complete"): + """ + Description: Wait till the replace brick operation completes. + Parameters: + timeout: The wait period to check the status of replace brick. + serverkey : server on which the replace brick status has to be checked. + from_brick : replace brick operation on from_brick + to_brick : replace brick operation on to_brick + """ + operation = "status" + time.sleep(timeout) + output = glusterutils.volume_replacebrick(serverkey, from_brick, + to_brick, operation) + validation_status = atfutils.validate_output(output, 0, expected_message) + if validation_status is not 0: + rb_completion_status = 1 + else: + rb_completion_status = 0 + + return rb_completion_status -- cgit