summaryrefslogtreecommitdiffstats
path: root/dvm/764302/testcase
diff options
context:
space:
mode:
authorshylesh <shmohan@redhat.com>2012-02-04 17:50:33 +0530
committershylesh <shmohan@redhat.com>2012-02-04 21:49:41 +0530
commit636d71dd3e60e2cdc03dfa63f7148aeba1749715 (patch)
tree3084b9bb1150e15bf37b44b52513ad6b2483cd9d /dvm/764302/testcase
parent060e2ec30d1f38f225bcb9298e23661a1a65d3f5 (diff)
BUG:764775-replacing an offline brick
Change-Id: Id5e85df5f779d73215f4e6f67a47011d4860c9f9 BUG: 764775 Signed-off-by: shylesh <shmohan@redhat.com>
Diffstat (limited to 'dvm/764302/testcase')
-rwxr-xr-xdvm/764302/testcase43
1 files changed, 43 insertions, 0 deletions
diff --git a/dvm/764302/testcase b/dvm/764302/testcase
new file mode 100755
index 0000000..0257549
--- /dev/null
+++ b/dvm/764302/testcase
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+source $cwd/regression_helpers
+
+$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/brick1\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick2 1>/dev/null 2>/dev/null
+
+
+$GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null
+sleep 5
+
+# kill first brick process
+$GLUSTERFSDIR/gluster volume status $global_bug_id| tr "\t" " " |head -5| tail -1| awk '{print $4}'| xargs kill -9
+
+ret=$?
+if [ $ret -ne 0 ]; then
+ exit 1
+fi
+
+# Check whether brick is in offline state
+$GLUSTERFSDIR/gluster volume status $global_bug_id| tr "\t" " " |head -5| \
+ tail -1| awk '{print $3}'| grep N 1>/dev/null 2>/dev/null
+
+ret=$?
+if [ $ret -ne 0 ]; then
+ exit 1;
+fi
+
+# Now replace the dead brick
+$GLUSTERFSDIR/gluster volume replace-brick $global_bug_id\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick1\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick3 start\
+ | grep "Source brick $(hostname):$EXPORT_DIR/$global_bug_id/brick1 is not online."\
+ 1>/dev/null 2>/dev/null
+
+ret=$?
+
+if [ $ret -ne 0 ]; then
+ exit 1
+fi
+
+
+exit 0