summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2012-12-04 18:21:08 +0530
committerAnand Avati <avati@redhat.com>2012-12-04 14:49:28 -0800
commit0adc7fd1a76e6868a940cc0725c2f8d93cbb9f29 (patch)
tree44b6d51f236121497794d54e36ce129f0a45bbb3 /tests
parent98879ebdddd4ca77440defad6a73acf4fa1e75ab (diff)
tests: Test afr mknod, create when one of the bricks is offline.
Also tests the test case in bug 858212. Change-Id: I00e1c3f6142e9dab6868d8fd9ef66d39a7d3fae2 BUG: 858212 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/4238 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/bugs/bug-858212.t48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/bugs/bug-858212.t b/tests/bugs/bug-858212.t
new file mode 100755
index 00000000000..ead92b276ea
--- /dev/null
+++ b/tests/bugs/bug-858212.t
@@ -0,0 +1,48 @@
+#!/bin/bash
+. $(dirname $0)/../include.rc
+. $(dirname $0)/../volume.rc
+
+cleanup;
+
+B0_hiphenated=`echo $B0 | tr '/' '-'`
+TEST glusterd
+TEST pidof glusterd
+TEST $CLI volume create $V0 replica 2 $H0:$B0/r2d2_0 $H0:$B0/r2d2_1 $H0:$B0/r2d2_2 $H0:$B0/r2d2_3
+TEST $CLI volume set $V0 self-heal-daemon off
+TEST $CLI volume set $V0 data-self-heal off
+TEST $CLI volume set $V0 metadata-self-heal off
+TEST $CLI volume set $V0 entry-self-heal off
+TEST $CLI volume start $V0
+TEST glusterfs --volfile-server=$H0 --volfile-id=/$V0 $M0
+
+#test case of 858212
+for i in {13,14,16}; do echo abc > $M0/$i; done
+TEST mv -f $M0/14 $M0/13
+kill -9 $(cat /var/lib/glusterd/vols/$V0/run/$H0$B0_hiphenated-r2d2_3.pid)
+TEST $CLI volume add-brick $V0 $H0:$B0/r2d2_4 $H0:$B0/r2d2_5
+TEST $CLI volume rebalance $V0 start
+EXPECT_WITHIN 20 "completed" rebalance_status_completed_field
+TEST mv -f $M0/13 $M0/16
+$CLI volume remove-brick $V0 $H0:$B0/r2d2_{4,5} start
+EXPECT_WITHIN 20 "completed" remove_brick_status_completed_field
+$CLI volume remove-brick $V0 $H0:$B0/r2d2_{4,5} commit
+TEST mv -f $M0/16 $M0/13
+TEST $CLI volume set $V0 self-heal-daemon on
+TEST $CLI volume start $V0 force
+EXPECT_WITHIN 10 "1" afr_child_up_status $V0 3
+EXPECT_WITHIN 10 "Y" glustershd_up_status
+TEST $CLI volume heal $V0
+sleep 2
+linkto2=$(getfattr -n trusted.glusterfs.dht.linkto $B0/r2d2_2/13 2>/dev/null | grep -v ^#)
+linkto3=$(getfattr -n trusted.glusterfs.dht.linkto $B0/r2d2_3/13 2>/dev/null | grep -v ^#)
+TEST [ $linkto2 = $linkto3 ]
+EXPECT "0" stat -c "%s" $B0/r2d2_2/13
+EXPECT "0" stat -c "%s" $B0/r2d2_3/13
+
+#Test that mknod and create fops are marking the changelog properly
+kill -9 $(cat /var/lib/glusterd/vols/$V0/run/$H0$B0_hiphenated-r2d2_2.pid)
+TEST touch $M0/a
+TEST mknod $M0/b b 0 0
+EXPECT "trusted.afr.$V0-client-2=0x000000010000000200000000" echo $(getfattr -n trusted.afr.$V0-client-2 -e hex $B0/r2d2_3/a 2>/dev/null | grep -v ^#)
+EXPECT "trusted.afr.$V0-client-2=0x000000000000000100000000" echo $(getfattr -n trusted.afr.$V0-client-2 -e hex $B0/r2d2_3/b 2>/dev/null | grep -v ^#)
+cleanup;