summaryrefslogtreecommitdiffstats
path: root/tests/include.rc
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2014-08-19 17:55:46 +0200
committerHarshavardhana <harsha@harshavardhana.net>2014-08-20 13:41:08 -0700
commit473f115cbf18dd5229636c817d49b2c60471e227 (patch)
tree7c0f2c6c239600024ea8e28acf53c72315d48539 /tests/include.rc
parent22d5361cec8ec2a101e0896a9642a995122ffad3 (diff)
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 <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8494 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Harshavardhana <harsha@harshavardhana.net>
Diffstat (limited to 'tests/include.rc')
-rw-r--r--tests/include.rc24
1 files changed, 17 insertions, 7 deletions
diff --git a/tests/include.rc b/tests/include.rc
index 78488b37975..e6648a7ad73 100644
--- a/tests/include.rc
+++ b/tests/include.rc
@@ -20,12 +20,21 @@ if [ ! -f ${PWD}/tests/env.rc ]; then
fi
. ${PWD}/tests/env.rc
+H0=${H0:=`hostname`}; # hostname
+MOUNT_TYPE_FUSE="fuse.glusterfs"
+GREP_MOUNT_OPT_RO="grep (ro"
+GREP_MOUNT_OPT_RW="grep (rw"
+
case $OSTYPE in
Linux)
H0=${H0:=`hostname --fqdn`}; # hostname
;;
+NetBSD)
+ MOUNT_TYPE_FUSE="puffs|perfuse|fuse.glusterfs"
+ GREP_MOUNT_OPT_RO="grep (read-only"
+ GREP_MOUNT_OPT_RW="grep -v (read-only"
+ ;;
*)
- H0=${H0:=`hostname`}; # hostname
;;
esac
@@ -297,6 +306,13 @@ stat -c %s /dev/null > /dev/null 2>&1 || {
function cleanup()
{
+ # unmount filesystems before killing daemons to avoid deadllocks
+ MOUNTPOINTS=`mount | grep "$B0/" | awk '{print $3}'`
+ for m in $MOUNTPOINTS;
+ do
+ umount $m
+ done
+
killall -15 glusterfs glusterfsd glusterd 2>/dev/null || true;
test "x`uname -s` = "xNetBSD" && pkill -15 perfused || true
# allow completion of signal handlers for SIGTERM before issue SIGKILL
@@ -304,12 +320,6 @@ function cleanup()
killall -9 glusterfs glusterfsd glusterd 2>/dev/null || true;
test "x`uname -s` = "xNetBSD" && pkill -9 perfused || true
- MOUNTPOINTS=`mount | grep "$B0/" | awk '{print $3}'`
- for m in $MOUNTPOINTS;
- do
- umount $m
- done
-
# unregister nfs and related services from portmapper/rpcbind
## nfs
rpcinfo -d 100003 3