diff options
Diffstat (limited to 'tests/bugs')
-rw-r--r-- | tests/bugs/glusterfs/bug-867253.t | 12 | ||||
-rwxr-xr-x | tests/bugs/rpc/bug-954057.t | 21 |
2 files changed, 18 insertions, 15 deletions
diff --git a/tests/bugs/glusterfs/bug-867253.t b/tests/bugs/glusterfs/bug-867253.t index 3df49a1bd61..aee27c87158 100644 --- a/tests/bugs/glusterfs/bug-867253.t +++ b/tests/bugs/glusterfs/bug-867253.t @@ -4,14 +4,6 @@ . $(dirname $0)/../../volume.rc . $(dirname $0)/../../nfs.rc -# Skip the entire test if /proc/sys/vm/drop_caches does not exist -if [ ! -f /proc/sys/vm/drop_caches ] ; then - echo "Skip test using /proc/sys/vm/drop_caches, "\ - "which does not exists on this system" >&2 - SKIP_TESTS - exit 0 -fi - cleanup; function file_count() @@ -45,7 +37,7 @@ touch $M0/files{1..1000}; # Kill a brick process kill -9 `cat $GLUSTERD_WORKDIR/vols/$V0/run/$H0-d-backends-${V0}0.pid`; -echo 3 >/proc/sys/vm/drop_caches; +( cd $M0 ; umount $M0 ) # fail but drops kernel cache ls -l $M0 >/dev/null; @@ -56,7 +48,7 @@ TEST $CLI volume start $V0 force # Kill a brick process kill -9 `cat $GLUSTERD_WORKDIR/vols/$V0/run/$H0-d-backends-${V0}1.pid`; -echo 3 >/proc/sys/vm/drop_caches; +( cd $M0 ; umount $M0 ) ls -l $M0 >/dev/null; diff --git a/tests/bugs/rpc/bug-954057.t b/tests/bugs/rpc/bug-954057.t index 9c48207b711..faaf261d88b 100755 --- a/tests/bugs/rpc/bug-954057.t +++ b/tests/bugs/rpc/bug-954057.t @@ -3,15 +3,25 @@ . $(dirname $0)/../../include.rc . $(dirname $0)/../../volume.rc -#This script checks if use-readdirp option works as accepted in mount options - +# This script checks if use-readdirp option works as accepted in mount options + +# Note on re-reading $M0/new after enabling root-squash: +# Since we have readen it once, the file is present in various caches. +# In order to actually fail on second attempt we must: +# 1) drop kernel cache, by ( cd $M0 ; umount $M0 ) +# 2) make sure FUSE does not cache the entry. This is also +# in the kernel, but not flushed by a failed umount. +# Using $GFS enforces this because it sets --entry-timeout=0 +# 3) make sure reading new permissins does not produce stale +# information from glusterfs metadata cache. Setting volume +# option performance.stat-prefetch off enforces that. TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 $H0:$B0/${V0} TEST $CLI volume start $V0 -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 +TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0 TEST mkdir $M0/dir TEST mkdir $M0/nobody @@ -21,8 +31,9 @@ TEST cp $M0/file $M0/new TEST chmod 700 $M0/new TEST cat $M0/new +TEST $CLI volume set $V0 performance.stat-prefetch off TEST $CLI volume set $V0 server.root-squash enable -TEST `echo 3 > /proc/sys/vm/drop_caches` +( cd $M0 ; umount $M0 ) # fails but drops kernel cache TEST ! mkdir $M0/other TEST mkdir $M0/nobody/other TEST cat $M0/file @@ -30,7 +41,7 @@ TEST ! cat $M0/new TEST `echo "nobody" >> $M0/nobody/file` #mount the client without root-squashing -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 --no-root-squash=yes $M1 +TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 --no-root-squash=yes $M1 TEST mkdir $M1/m1_dir TEST `echo "file" >> $M1/m1_file` TEST cp $M0/file $M1/new |