diff options
Diffstat (limited to 'tests/bugs/md-cache')
| -rwxr-xr-x | tests/bugs/md-cache/afr-stale-read.t | 44 | ||||
| -rwxr-xr-x[-rw-r--r--] | tests/bugs/md-cache/bug-1211863.t | 2 | ||||
| -rw-r--r-- | tests/bugs/md-cache/bug-1476324.t | 27 | ||||
| -rwxr-xr-x | tests/bugs/md-cache/bug-1632503.t | 24 | ||||
| -rw-r--r-- | tests/bugs/md-cache/bug-1726205.t | 22 | ||||
| -rwxr-xr-x | tests/bugs/md-cache/setxattr-prepoststat.t | 38 |
6 files changed, 156 insertions, 1 deletions
diff --git a/tests/bugs/md-cache/afr-stale-read.t b/tests/bugs/md-cache/afr-stale-read.t new file mode 100755 index 00000000000..7cee5afe27e --- /dev/null +++ b/tests/bugs/md-cache/afr-stale-read.t @@ -0,0 +1,44 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +#. $(dirname $0)/../../volume.rc + +cleanup; + +#Basic checks +TEST glusterd +TEST pidof glusterd +TEST $CLI volume info + +TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1..2}; + +TEST $CLI volume set $V0 features.cache-invalidation on +TEST $CLI volume set $V0 features.cache-invalidation-timeout 600 +TEST $CLI volume set $V0 performance.cache-invalidation on +TEST $CLI volume set $V0 performance.md-cache-timeout 600 +TEST $CLI volume set $V0 performance.cache-samba-metadata on +TEST $CLI volume set $V0 cluster.self-heal-daemon off +TEST $CLI volume set $V0 read-subvolume $V0-client-0 +TEST $CLI volume set $V0 performance.quick-read off + +TEST $CLI volume start $V0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M1 + +#Write some data from M0 and read it from M1, +#so that M1 selects a read subvol, and caches the lookup +TEST `echo "one" > $M0/file1` +EXPECT "one" cat $M1/file1 + +#Fail few writes from M0 on brick-0, as a result of this failure +#upcall in brick-0 will invalidate the read subvolume of M1. +TEST chattr +i $B0/${V0}1/file1 +TEST `echo "two" > $M0/file1` +TEST `echo "three" > $M0/file1` +TEST `echo "four" > $M0/file1` +TEST `echo "five" > $M0/file1` + +EXPECT_WITHIN $MDC_TIMEOUT "five" cat $M1/file1 +TEST chattr -i $B0/${V0}1/file1 +cleanup; diff --git a/tests/bugs/md-cache/bug-1211863.t b/tests/bugs/md-cache/bug-1211863.t index ece42fe8d81..ba9bde9fee8 100644..100755 --- a/tests/bugs/md-cache/bug-1211863.t +++ b/tests/bugs/md-cache/bug-1211863.t @@ -16,7 +16,7 @@ TEST $CLI volume start $V0 ## 4. Enable the upcall xlator, and increase the md-cache timeout to max TEST $CLI volume set $V0 performance.md-cache-timeout 600 -TEST $CLI volume set $V0 performance.cache-samba-metadata on +TEST $CLI volume set $V0 performance.xattr-cache-list "user.*" ## 6. Create two gluster mounts TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 diff --git a/tests/bugs/md-cache/bug-1476324.t b/tests/bugs/md-cache/bug-1476324.t new file mode 100644 index 00000000000..c34f412a15e --- /dev/null +++ b/tests/bugs/md-cache/bug-1476324.t @@ -0,0 +1,27 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc + +cleanup; + +TEST glusterd; + +TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2,3}; + +TEST $CLI volume start $V0 + +TEST $CLI volume set $V0 performance.md-cache-timeout 600 +TEST $CLI volume set $V0 performance.cache-samba-metadata on + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 + +TEST touch $M0/file1 + +TEST "setfattr -n user.DOSATTRIB -v 0sAAOW $M0/file1" +TEST "getfattr -n user.DOSATTRIB $M0/file1 -e base64 | grep -q 0sAAOW" + +TEST "setfattr -n user.DOSATTRIB -v 0x00ff $M0/file1" +TEST "getfattr -n user.DOSATTRIB $M0/file1 -e hex | grep -q 0x00ff" + +cleanup; diff --git a/tests/bugs/md-cache/bug-1632503.t b/tests/bugs/md-cache/bug-1632503.t new file mode 100755 index 00000000000..aeb57f65639 --- /dev/null +++ b/tests/bugs/md-cache/bug-1632503.t @@ -0,0 +1,24 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc + +cleanup; +TESTS_EXPECTED_IN_LOOP=5 + +TEST glusterd; + +TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2,3}; + +TEST $CLI volume start $V0 + +TEST $CLI volume set $V0 performance.md-cache-timeout 600 +TEST $CLI volume set $V0 performance.md-cache-statfs on + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 + +for i in $(seq 1 5); do + TEST_IN_LOOP df $M0; +done + +cleanup; diff --git a/tests/bugs/md-cache/bug-1726205.t b/tests/bugs/md-cache/bug-1726205.t new file mode 100644 index 00000000000..795130e9bd8 --- /dev/null +++ b/tests/bugs/md-cache/bug-1726205.t @@ -0,0 +1,22 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc + +cleanup; + +TEST glusterd; + +TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2,3}; + +TEST $CLI volume start $V0 + +TEST $CLI volume set $V0 group samba + +TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0 + +TEST touch $M0/file +TEST "setfattr -n "user.DosStream.Zone.Identifier:\$DATA" -v '\0' $M0/file" +TEST "getfattr -n "user.DosStream.Zone.Identifier:\$DATA" -e hex $M0/file | grep -q 0x00" + +cleanup; diff --git a/tests/bugs/md-cache/setxattr-prepoststat.t b/tests/bugs/md-cache/setxattr-prepoststat.t new file mode 100755 index 00000000000..01fa768299c --- /dev/null +++ b/tests/bugs/md-cache/setxattr-prepoststat.t @@ -0,0 +1,38 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc + +cleanup; + +## 1. Start glusterd +TEST glusterd; + +## 2. Lets create volume +TEST $CLI volume create $V0 disperse 6 redundancy 2 $H0:$B0/${V0}{0..5} + +TEST $CLI volume set $V0 group metadata-cache +TEST $CLI volume set $V0 performance.xattr-cache-list "user.*" +TEST $CLI volume start $V0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M1 + +TEST touch $M0/file1 +TEST `echo "abakjshdjahskjdhakjhdskjac" >> $M0/file1` +size=`stat -c '%s' $M0/file1` + +## Setxattr from mount-0 +TEST "setfattr -n user.DOSATTRIB -v "abc" $M0/file1" +EXPECT $size stat -c '%s' $M0/file1 + +## Getxattr from mount-1, this should return the correct value +TEST "getfattr -n user.DOSATTRIB $M1/file1 | grep -q abc" + +TEST "setfattr -x user.DOSATTRIB $M1/file1" +EXPECT $size stat -c '%s' $M1/file1 + +EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0 +EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M1 + +cleanup; |
