summaryrefslogtreecommitdiffstats
path: root/libs
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 /libs
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 'libs')
-rw-r--r--libs/utils/rbutils.py27
1 files changed, 27 insertions, 0 deletions
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