From 473f115cbf18dd5229636c817d49b2c60471e227 Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Tue, 19 Aug 2014 17:55:46 +0200 Subject: Regression test portability: mount Address various portability-related problems related to mount - In order to address the non-portability of NFS mount options, use the mount_nfs shell function everywhere, and use it to translate options. - Make sure NFS mounts are unmounted before shutting down the daemons in order to avoid deadlock. The change is done in every test that did not unmounted NFS mounts at the end of the script, and in global cleanup function as well. The force_umount shell function from volume.rc was duplicated as umount_nfs in nfs.rc so that we do not have to add an include on volume.rc for all NFS tests that do not need it. - The FUSE mount type on NetBSD is puffs|perfuse|fuse.glusterfs instead of just fuse.glusterfs, make the regexp configurable in include.rc - Finding wether the mount is RO or RW in mount output needs a system-dependent command configurable in include.rc - mount options in /proc/mounts may be limited to "rw", adjust the regexp for this case where there is no comma And while there change rm into rm -f in tests/basic/mount.t for removal opearation that should fail, since rm may ask for confirmation Change-Id: I1fb708486ec350b2885e2404879561c1020fa8fd BUG: 1129939 Signed-off-by: Emmanuel Dreyfus Reviewed-on: http://review.gluster.org/8494 Tested-by: Gluster Build System Reviewed-by: Harshavardhana Tested-by: Harshavardhana --- tests/basic/mount.t | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'tests/basic/mount.t') diff --git a/tests/basic/mount.t b/tests/basic/mount.t index c77317f37f5..d67bc8ab998 100755 --- a/tests/basic/mount.t +++ b/tests/basic/mount.t @@ -39,21 +39,21 @@ TEST $CLI volume set $V0 performance.stat-prefetch off; TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $M0; ## Check consistent "rw" option -TEST 'mount -t fuse.glusterfs | grep -E "^$H0:$V0 .+ \(rw,"'; -TEST 'grep -E "^$H0:$V0 .+ ,?rw," /proc/mounts'; +TEST 'mount -t $MOUNT_TYPE_FUSE | grep -E "^$H0:$V0 "|$GREP_MOUNT_OPT_RW'; +TEST 'grep -E "^$H0:$V0 .+ ,?rw,?" /proc/mounts'; ## Mount FUSE with caching disabled (read-only) TEST glusterfs --entry-timeout=0 --attribute-timeout=0 --read-only -s $H0 --volfile-id $V0 $M1; ## Check consistent "ro" option -TEST 'mount -t fuse.glusterfs | grep -E "^$H0:$V0 .+ \(ro,"'; -TEST 'grep -E "^$H0:$V0 .+ ,?ro,.+" /proc/mounts'; +TEST 'mount -t $MOUNT_TYPE_FUSE | grep -E "^$H0:$V0 "|$GREP_MOUNT_OPT_RO'; +TEST 'grep -E "^$H0:$V0 .+ ,?ro(,.+)?" /proc/mounts'; ## Wait for volume to register with rpc.mountd EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; ## Mount NFS -TEST mount -t nfs -o nolock,soft,intr $H0:/$V0 $N0; +TEST mount_nfs $H0:/$V0 $N0 nolock; ## Test for consistent views between NFS and FUSE mounts @@ -63,11 +63,13 @@ TEST ! touch $M1/newfile; TEST touch $M0/newfile; TEST stat $M1/newfile; TEST stat $N0/newfile; -TEST ! rm $M1/newfile; -TEST rm $N0/newfile; +TEST ! rm -f $M1/newfile; +TEST rm -f $N0/newfile; TEST ! stat $M0/newfile; TEST ! stat $M1/newfile; +## Before killing daemon to avoid deadlocks +EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" umount_nfs $N0 ## Finish up TEST $CLI volume stop $V0; -- cgit