diff options
Diffstat (limited to 'tests/bugs/glusterfs/bug-867253.t')
-rw-r--r-- | tests/bugs/glusterfs/bug-867253.t | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/tests/bugs/glusterfs/bug-867253.t b/tests/bugs/glusterfs/bug-867253.t new file mode 100644 index 00000000000..3df49a1bd61 --- /dev/null +++ b/tests/bugs/glusterfs/bug-867253.t @@ -0,0 +1,69 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(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() +{ + val=1 + + if [ "$1" == "0" ] + then + if [ "$2" == "0" ] + then + val=0 + fi + fi + echo $val +} + +BRICK_COUNT=2 + +TEST glusterd +TEST pidof glusterd + +TEST $CLI volume create $V0 $H0:$B0/${V0}0 $H0:$B0/${V0}1 +TEST $CLI volume start $V0 + +EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; +## Mount nfs, with nocache option +TEST mount_nfs $H0:/$V0 $M0 nolock,noac; + +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; + +ls -l $M0 >/dev/null; + +NEW_FILE_COUNT=`echo $?`; + +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; + +ls -l $M0 >/dev/null; + +NEW_FILE_COUNT1=`echo $?`; + +EXPECT "0" file_count $NEW_FILE_COUNT $NEW_FILE_COUNT1 + +EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0 + +cleanup |