summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-03-13 20:07:08 -0700
committerGerrit Code Review <root@dev.gluster.com>2012-03-13 20:07:08 -0700
commitd3d0fc6a3e74ada81ec28bd0d67a2bca566602bf (patch)
tree5e65f887265a367f510727736f1f739c64d1bfde
parent1dd25696749d4bbf992bdf7378c65443378e9a50 (diff)
parent636d71dd3e60e2cdc03dfa63f7148aeba1749715 (diff)
Merge "BUG:764775-replacing an offline brick"
-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