summaryrefslogtreecommitdiffstats
path: root/tests/bugs/glusterfs/bug-867253.t
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2015-05-07 16:45:53 +0200
committerVijay Bellur <vbellur@redhat.com>2015-05-07 20:10:49 -0700
commitd27ecba4f8b453a6d4f2466a5583a8360a068a14 (patch)
treecdbfb31562aa39fa678f48ba346508217919bb07 /tests/bugs/glusterfs/bug-867253.t
parentc0ca8aee8085bce0418c6e0cfc3504bc59f60cdb (diff)
Tests: use a portable way to flush kernel cache
On Linux, kernel cache can be flushed using echo 3 > /proc/sys/vm/drop_caches This non-portable approach can be replaced by an on-purpose failed attempt to unmount: if the mount point is the current directory and umount is called, the kernel will flush inodes until it realize it cannot complete the operation because root of filesystem is busy: ( cd $M0 ; umount $M0 ) Unfortunately this does not flush everything. Entries may still be present in the kenrel FUSE cache. Using $GFS to mount the filesystem ensure --entry-timeout=0 and clears this problem. Some stall information may also remain in glusterfs caches, and that may have to be adressed by appropriate volume option. For instance tests/bugs/rpc/bug-954057.t needs to disable performance.stat-prefetch. Qtherwise, root's new credentials are not evaluated after root-quash is enabled. The test could also be done with performance.stat-prefetch enabled using various tricks: copying the file to read, creating a hard link on it, or just waiting long enough for metadata cache to expire. Backport of: I54929e899d55c04dcd9d947809133549f01fd0e1 BUG: 1212676 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Change-Id: I2849a27acaa0334ef30aae3b852019b5a6eeb419 Reviewed-on: http://review.gluster.org/10648 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System
Diffstat (limited to 'tests/bugs/glusterfs/bug-867253.t')
-rw-r--r--tests/bugs/glusterfs/bug-867253.t12
1 files changed, 2 insertions, 10 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;