From aa938247e19afa419476fb2d0b7cb2d054c6dd47 Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Wed, 29 Apr 2015 15:52:37 +0200 Subject: 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. BUG: 1129939 Change-Id: I54929e899d55c04dcd9d947809133549f01fd0e1 Signed-off-by: Emmanuel Dreyfus Reviewed-on: http://review.gluster.org/10411 Reviewed-by: Dan Lambright Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- tests/basic/tier/tier.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/basic') diff --git a/tests/basic/tier/tier.t b/tests/basic/tier/tier.t index afe1e8cf053..ce2c7c36c1b 100755 --- a/tests/basic/tier/tier.t +++ b/tests/basic/tier/tier.t @@ -110,7 +110,7 @@ sleep 12 uuidgen >> d1/data2.txt # Check promotion on read to slow tier -echo 3 > /proc/sys/vm/drop_caches +( cd $M0 ; umount $M0 ) # fail but drops kernel cache cat d1/data3.txt sleep 5 EXPECT_WITHIN $PROMOTE_TIMEOUT "0" file_on_fast_tier d1/data2.txt -- cgit