summaryrefslogtreecommitdiffstats
path: root/dvm/764302/testcase
diff options
context:
space:
mode:
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