summaryrefslogtreecommitdiffstats
path: root/dvm/765453/testcase
diff options
context:
space:
mode:
Diffstat (limited to 'dvm/765453/testcase')
-rwxr-xr-xdvm/765453/testcase76
1 files changed, 76 insertions, 0 deletions
diff --git a/dvm/765453/testcase b/dvm/765453/testcase
new file mode 100755
index 0000000..3a9792c
--- /dev/null
+++ b/dvm/765453/testcase
@@ -0,0 +1,76 @@
+#!/bin/bash
+
+source $cwd/regression_helpers
+
+
+
+ATTR=trusted.glusterfs.testattr
+VAL="thisistestattrib"
+START="start"
+STATUS="status"
+
+$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/brick1\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick2 2>/dev/null 1>/dev/null
+
+ret=$?
+
+if [ $ret -ne 0 ]; then
+ exit 1
+fi
+
+
+$GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null;
+sleep 5;
+
+ret=$?
+if [ $ret -ne 0 ]; then
+ exit 1
+fi
+
+
+
+mount_glusterfs $global_bug_id;
+
+for i in {1..10}
+do
+ touch $FUSE_MOUNT/$i
+ setfattr -n $ATTR -v $VAL $FUSE_MOUNT/$i 2>/dev/null 1>/dev/null
+done
+
+#add a new brick to the volume
+$GLUSTERFSDIR/gluster volume add-brick $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/brick3\
+ $(hostname):$EXPORT_DIR/$global_bug_id/brick4 2>/dev/null 1>/dev/null
+
+#Initiate rebalance
+
+$GLUSTERFSDIR/gluster volume rebalance $global_bug_id $START 2>/dev/null 1>/dev/null
+
+status=0
+
+time_out=0
+while [[ $status -ne 1 && $time_out -le 300 ]]
+do
+ status=$($GLUSTERFSDIR/gluster volume rebalance $global_bug_id status| grep 'rebalance completed'|wc -l);
+ time_out=$(( $time_out + 1))
+ sleep 1;
+done
+
+# for some reason rebalance is hung so we errout
+# assuming 300 is fairly enough for rebalancing
+# 10 files
+if [ $time_out -gt 300 ]; then
+ exit 1
+fi
+
+#check whether xattrs are preserved after rebalance
+
+for i in {1..10}
+do
+ getfattr -d -e text -n $ATTR -m . $FUSE_MOUNT/$i 2>/dev/null | grep "$VAL" 2>/dev/null 1>/dev/null
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ exit 1
+ fi
+done
+
+exit 0