summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshylesh <shmohan@redhat.com>2012-01-04 12:31:27 +0530
committershylesh <shmohan@redhat.com>2012-01-07 14:13:24 +0530
commit93b51950c5e0e1bbc5064a4f83779ec4ef19fde8 (patch)
tree29f601319329bfa939a47d0047443c6645becbad
parent91032f3285a05598a3c0522c249129a9202c2c0d (diff)
Bug:765453: check whether xattrs preserved after rebalance
Change-Id: I4a5111ef8b00cc28488c7633a321e6c9866295bc BUG: 765453 Signed-off-by: shylesh <shmohan@redhat.com>
-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