diff options
author | Emmanuel Dreyfus <manu@netbsd.org> | 2015-06-07 21:32:32 +0200 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-06-09 06:24:47 -0700 |
commit | c51eb694bce443ae7c0584b1545c14254569ae49 (patch) | |
tree | e478e1ecf698ec92ad61736522a70e96b57d5a0c /tests/bugs/distribute | |
parent | a2a370db6db80e9365d0777701786ce706957f42 (diff) |
Tests portability: umount(8)
1) Avoid hangs on unmounting NFS on NetBSD
NetBSD umount(8) on a NFS mount whose server is gone will wait forever
because umount(8) calls realpath(3) and tries to access the mount before
it calls unmount(2). The non-portable, NetBSD-specific umount -R flag
prevent that behavior.
We therefore introduce UMOUNT_F, defined as "umount -f" on Linux and
"umount -f -R" on NetBSD to take care of forced unmounts, especially
in the NFS case.
2) Enforce usage of force_umount wrapper with timeout
Whenever umount is used it should be wrapped in force_umount with
tiemout handling. That saves us timing issues, and it handles the
NetBSD NFS case.
3) Cleanup kernel cache flush.
We used (cd $M0 && umount $M0 ) as a portable kernel cache flush
trick, but it does not flush everything we need on Linux. Introduce
a drop_cache() shell function that reverts to previously used
echo 3 > /proc/sys/vm/drop_caches on Linux, and keeps
(cd $M0 && umount $M0 ) on other systems.
BUG: 1129939
Change-Id: Iab1f5a023405f1f7270c42b595573702ca1eb6f3
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/11114
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests/bugs/distribute')
-rwxr-xr-x | tests/bugs/distribute/bug-1117851.t | 4 | ||||
-rwxr-xr-x | tests/bugs/distribute/bug-1161311.t | 2 | ||||
-rw-r--r-- | tests/bugs/distribute/bug-1190734.t | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/tests/bugs/distribute/bug-1117851.t b/tests/bugs/distribute/bug-1117851.t index 4e35debae9d..678103869cf 100755 --- a/tests/bugs/distribute/bug-1117851.t +++ b/tests/bugs/distribute/bug-1117851.t @@ -85,8 +85,8 @@ TEST move_files $M1 EXPECT_WITHIN 120 "done" cat $M0/status_0 EXPECT_WITHIN 120 "done" cat $M1/status_1 -TEST umount $M0 -TEST umount $M1 +EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0 +EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M1 TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $M0; TEST check_files $M0 diff --git a/tests/bugs/distribute/bug-1161311.t b/tests/bugs/distribute/bug-1161311.t index d1bd47826f9..c5a7f041ac8 100755 --- a/tests/bugs/distribute/bug-1161311.t +++ b/tests/bugs/distribute/bug-1161311.t @@ -63,7 +63,7 @@ dd if=/dev/urandom of=$M0/dir1/FILE2 bs=64k count=10240 TEST mv $M0/dir1/FILE2 $M0/dir1/FILE1 # unmount and remount the volume -TEST umount $M0 +EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0 TEST glusterfs -s $H0 --volfile-id $V0 $M0; # Start the rebalance diff --git a/tests/bugs/distribute/bug-1190734.t b/tests/bugs/distribute/bug-1190734.t index 895dd771ed6..ae34ec84729 100644 --- a/tests/bugs/distribute/bug-1190734.t +++ b/tests/bugs/distribute/bug-1190734.t @@ -22,7 +22,7 @@ function get_file_count { function reset { $CLI volume stop $V0 - umount $1 + ${UMOUNT_F} $1 $CLI volume delete $V0 } |