summaryrefslogtreecommitdiffstats
path: root/dvm
diff options
context:
space:
mode:
authorshylesh <shmohan@redhat.com>2012-02-04 13:17:19 +0530
committershylesh <shmohan@redhat.com>2012-02-04 13:18:27 +0530
commit599d340ed04988e8ffbf3f69e0a73b798a11da1a (patch)
treee1d035ea2a535fff3849d446ed8e6e72fe9b0b8a /dvm
parent060e2ec30d1f38f225bcb9298e23661a1a65d3f5 (diff)
BUG:763924-check brick ordering after remove and add brick
Change-Id: If2d12c0014daab9f6fa4df88b1634c9c061065ed BUG: 763924 Signed-off-by: shylesh <shmohan@redhat.com>
Diffstat (limited to 'dvm')
-rwxr-xr-xdvm/763924/testcase81
1 files changed, 81 insertions, 0 deletions
diff --git a/dvm/763924/testcase b/dvm/763924/testcase
new file mode 100755
index 0000000..cee5c1f
--- /dev/null
+++ b/dvm/763924/testcase
@@ -0,0 +1,81 @@
+#!/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\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick3\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick4\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick5\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick6\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick7\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick8\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick9\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick10 1>/dev/null 2>/dev/null
+
+ret=$?
+
+if [ $ret -ne 0 ]; then
+ exit 1
+fi
+
+# check the brick ordering first
+# i.e. Brick1:$(hostname):$EXPORT_DIR/$global_bug_id/brick1 so on..
+
+for i in {1..10}
+do
+ gluster volume info $global_bug_id | grep Brick[0-9].|\
+ cut -d ":" -f 1,3|grep "Brick$i:$EXPORT_DIR/$global_bug_id/brick$i"\
+ 1>/dev/null 2>/dev/null
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+done
+
+# Remove some of the bricks
+$GLUSTERFSDIR/gluster --mode=script volume remove-brick $global_bug_id\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick5\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick6\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick7\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick8\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick9\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick10\
+ 1>/dev/null 2>/dev/null
+
+ret=$?
+
+if [ $ret -ne 0 ]; then
+ exit 1
+fi
+
+# add same bricks in the same order and
+# check whether order is preserved
+$GLUSTERFSDIR/gluster volume add-brick $global_bug_id \
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick5\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick6\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick7\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick8\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick9\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick10\
+ 1>/dev/null 2>/dev/null
+
+ret=$?
+
+if [ $ret -ne 0 ]; then
+ exit 1
+fi
+
+# Now check the order of the bricks
+
+for i in {1..10}
+do
+ gluster volume info $global_bug_id | grep Brick[0-9].|\
+ cut -d ":" -f 1,3|grep "Brick$i:$EXPORT_DIR/$global_bug_id/brick$i"\
+ 1>/dev/null 2>/dev/null
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+done
+
+exit 0