summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2014-05-15 14:40:16 +0530
committerVijay Bellur <vbellur@redhat.com>2014-05-16 03:28:16 -0700
commit05a5ffe97222ca7c49828f0d762a47e85411ab61 (patch)
treedf7a905a80ac87c1e924394ba72f66f94171d5d0 /tests
parent07e8f0226d5263501d2b23ed008c59ed45a5a5bd (diff)
tests: Wait for nfs export to be available
Change-Id: I59a5e0cb78f2b670761a65272b8ab1d7bdb3668a BUG: 1092850 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/7773 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/bugs/bug-1043886.t2
-rwxr-xr-xtests/bugs/bug-1053579.t2
-rwxr-xr-xtests/bugs/bug-1070734.t4
-rw-r--r--tests/bugs/bug-1087198.t4
-rwxr-xr-xtests/bugs/bug-830665.t11
-rwxr-xr-xtests/bugs/bug-847622.t6
-rwxr-xr-xtests/bugs/bug-847624.t5
-rwxr-xr-xtests/bugs/bug-864222.t6
-rwxr-xr-xtests/bugs/bug-872923.t5
-rwxr-xr-xtests/bugs/bug-877885.t8
-rwxr-xr-xtests/bugs/bug-887145.t2
-rwxr-xr-xtests/bugs/bug-904065.t6
-rwxr-xr-xtests/bugs/bug-904300.t10
-rwxr-xr-xtests/bugs/bug-915280.t6
-rwxr-xr-xtests/bugs/bug-921072.t32
-rwxr-xr-xtests/bugs/bug-927616.t6
-rw-r--r--tests/bugs/bug-958691.t5
-rw-r--r--tests/bugs/bug-966018.t5
-rwxr-xr-xtests/bugs/bug-974972.t5
-rw-r--r--tests/nfs.rc11
20 files changed, 78 insertions, 63 deletions
diff --git a/tests/bugs/bug-1043886.t b/tests/bugs/bug-1043886.t
index fb7ecb194d1..b9ee320ae96 100755
--- a/tests/bugs/bug-1043886.t
+++ b/tests/bugs/bug-1043886.t
@@ -17,7 +17,7 @@ TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $
EXPECT_WITHIN 20 "1" is_nfs_export_available;
## Mount volume as NFS export
-TEST mount -t nfs -o vers=3,nolock $H0:/$V0 $N0;
+TEST mount_nfs $H0:/$V0 $N0 nolock;
# just a random uid/gid
uid=22162
diff --git a/tests/bugs/bug-1053579.t b/tests/bugs/bug-1053579.t
index b7b9d5b12ed..afbc4c9579a 100755
--- a/tests/bugs/bug-1053579.t
+++ b/tests/bugs/bug-1053579.t
@@ -31,7 +31,7 @@ TEST $CLI volume start $V0
EXPECT_WITHIN 20 "1" is_nfs_export_available
# mount the volume
-TEST mount -t nfs -o vers=3,nolock $H0:/$V0 $N0
+TEST mount_nfs $H0:/$V0 $N0 nolock
TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0
# the actual test, this used to crash
diff --git a/tests/bugs/bug-1070734.t b/tests/bugs/bug-1070734.t
index efe6c626f3a..f35189eb871 100755
--- a/tests/bugs/bug-1070734.t
+++ b/tests/bugs/bug-1070734.t
@@ -2,6 +2,7 @@
. $(dirname $0)/../include.rc
. $(dirname $0)/../volume.rc
+. $(dirname $0)/../nfs.rc
cleanup;
@@ -21,7 +22,8 @@ EXPECT 'Created' volinfo_field $V0 'Status';
TEST $CLI volume start $V0;
EXPECT 'Started' volinfo_field $V0 'Status';
-TEST mount -t nfs -o vers=3 $H0:/$V0 $N0;
+EXPECT_WITHIN 20 "1" is_nfs_export_available;
+TEST mount_nfs $H0:/$V0 $N0;
############################################################################
#TEST-PLAN:
diff --git a/tests/bugs/bug-1087198.t b/tests/bugs/bug-1087198.t
index b16a413f1d8..29a81c3abbb 100644
--- a/tests/bugs/bug-1087198.t
+++ b/tests/bugs/bug-1087198.t
@@ -14,6 +14,7 @@
. $(dirname $0)/../include.rc
. $(dirname $0)/../fileio.rc
+. $(dirname $0)/../nfs.rc
cleanup;
@@ -29,7 +30,8 @@ EXPECT 'Created' volinfo_field $V0 'Status';
TEST $CLI volume start $V0;
EXPECT 'Started' volinfo_field $V0 'Status';
-TEST mount -t nfs -o noac,soft,nolock,vers=3 $H0:/$V0 $N0
+EXPECT_WITHIN 20 "1" is_nfs_export_available;
+TEST mount_nfs $H0:/$V0 $N0 noac,nolock
QUOTA_LIMIT_DIR="quota_limit_dir"
diff --git a/tests/bugs/bug-830665.t b/tests/bugs/bug-830665.t
index dd6f3ce2f12..e6804891e02 100755
--- a/tests/bugs/bug-830665.t
+++ b/tests/bugs/bug-830665.t
@@ -1,6 +1,7 @@
#!/bin/bash
. $(dirname $0)/../include.rc
+. $(dirname $0)/../nfs.rc
cleanup;
@@ -42,11 +43,9 @@ TEST $CLI volume start $V0;
EXPECT 'Started' volinfo_field $V0 'Status';
-## Wait for volume to register with rpc.mountd
-sleep 5;
-
+EXPECT_WITHIN 20 "1" is_nfs_export_available;
## Mount NFS
-TEST mount -t nfs -o vers=3,nolock,soft,intr $H0:/$V0 $N0;
+TEST mount_nfs $H0:/$V0 $N0 nolock;
## Create some files and directories
echo "test_data" > $N0/a_file;
@@ -70,8 +69,8 @@ setfattr -n trusted.glusterfs.volume-id -v $volid $B0/${V0}-0
## Restart and remount. Note that we use actimeo=0 so that the stat calls
## we need for self-heal don't get blocked by the NFS client.
TEST $CLI volume start $V0;
-sleep 5
-TEST mount -t nfs -o vers=3,nolock,soft,intr,actimeo=0 $H0:/$V0 $N0;
+EXPECT_WITHIN 20 "1" is_nfs_export_available;
+TEST mount_nfs $H0:/$V0 $N0 nolock,actimeo=0;
## The Linux NFS client has a really charming habit of caching stuff right
## after mount, even though we set actimeo=0 above. Life would be much easier
diff --git a/tests/bugs/bug-847622.t b/tests/bugs/bug-847622.t
index 1384995271f..ffc5b54194f 100755
--- a/tests/bugs/bug-847622.t
+++ b/tests/bugs/bug-847622.t
@@ -1,6 +1,7 @@
#!/bin/bash
. $(dirname $0)/../include.rc
+. $(dirname $0)/../nfs.rc
cleanup;
@@ -9,9 +10,8 @@ TEST pidof glusterd
TEST $CLI volume create $V0 $H0:$B0/brick0
TEST $CLI volume start $V0
-sleep 5
-
-TEST mount -t nfs -o vers=3,nolock $H0:/$V0 $N0
+EXPECT_WITHIN 20 "1" is_nfs_export_available;
+TEST mount_nfs $H0:/$V0 $N0 nolock
cd $N0
# simple getfacl setfacl commands
diff --git a/tests/bugs/bug-847624.t b/tests/bugs/bug-847624.t
index f4e9942e94b..40dd13de399 100755
--- a/tests/bugs/bug-847624.t
+++ b/tests/bugs/bug-847624.t
@@ -1,6 +1,7 @@
#!/bin/bash
. $(dirname $0)/../include.rc
+. $(dirname $0)/../nfs.rc
cleanup
#1
@@ -10,8 +11,8 @@ TEST pidof glusterd
TEST $CLI volume create $V0 $H0:$B0/$V0
TEST $CLI volume set $V0 nfs.drc on
TEST $CLI volume start $V0
-sleep 5
-TEST mount -t nfs -o vers=3,nolock,soft,intr $H0:/$V0 $N0
+EXPECT_WITHIN 20 "1" is_nfs_export_available;
+TEST mount_nfs $H0:/$V0 $N0 nolock
cd $N0
#7
TEST dbench -t 10 10
diff --git a/tests/bugs/bug-864222.t b/tests/bugs/bug-864222.t
index 6e02ab60bca..958fcb9dd78 100755
--- a/tests/bugs/bug-864222.t
+++ b/tests/bugs/bug-864222.t
@@ -1,6 +1,7 @@
#!/bin/bash
. $(dirname $0)/../include.rc
+. $(dirname $0)/../nfs.rc
cleanup;
@@ -9,9 +10,8 @@ TEST pidof glusterd
TEST $CLI volume create $V0 $H0:$B0/brick0
TEST $CLI volume start $V0
-sleep 5
-
-TEST mount -t nfs -o vers=3,nolock $H0:/$V0 $N0
+EXPECT_WITHIN 20 "1" is_nfs_export_available;
+TEST mount_nfs $H0:/$V0 $N0 nolock
cd $N0
TEST ls
diff --git a/tests/bugs/bug-872923.t b/tests/bugs/bug-872923.t
index 6757846dcda..68d2e116769 100755
--- a/tests/bugs/bug-872923.t
+++ b/tests/bugs/bug-872923.t
@@ -1,6 +1,7 @@
#!/bin/bash
. $(dirname $0)/../include.rc
+. $(dirname $0)/../nfs.rc
cleanup;
@@ -9,9 +10,9 @@ TEST pidof glusterd
TEST $CLI volume info
TEST $CLI volume create $V0 replica 2 $H0:$B0/brick0 $H0:$B0/brick1
TEST $CLI volume start $V0
-sleep 5
-mount -t nfs -o vers=3,nolock `hostname`:/$V0 $N0
+EXPECT_WITHIN 20 "1" is_nfs_export_available;
+TEST mount_nfs $H0:/$V0 $N0 nolock
cd $N0
mkdir test_hardlink_self_heal;
diff --git a/tests/bugs/bug-877885.t b/tests/bugs/bug-877885.t
index 0d4620b0092..05b4f1cdf2b 100755
--- a/tests/bugs/bug-877885.t
+++ b/tests/bugs/bug-877885.t
@@ -1,6 +1,7 @@
#!/bin/bash
. $(dirname $0)/../include.rc
+. $(dirname $0)/../nfs.rc
cleanup;
@@ -9,8 +10,6 @@ TEST pidof glusterd
TEST $CLI volume create $V0 replica 2 $H0:$B0/brick0 $H0:$B0/brick1
TEST $CLI volume start $V0
-sleep 5
-
## Mount FUSE with caching disabled
TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 \
$M0;
@@ -18,12 +17,13 @@ $M0;
TEST touch $M0/file
TEST mkdir $M0/dir
-TEST mount -t nfs -o vers=3,nolock $H0:/$V0 $N0
+EXPECT_WITHIN 20 "1" is_nfs_export_available;
+TEST mount_nfs $H0:/$V0 $N0 nolock
cd $N0
rm -rf * &
-TEST mount -t nfs -o retry=0,nolock,vers=3 $H0:/$V0 $N1;
+TEST mount_nfs $H0:/$V0 $N1 retry=0,nolock;
cd;
diff --git a/tests/bugs/bug-887145.t b/tests/bugs/bug-887145.t
index e2013e50bbb..b80f4bd392f 100755
--- a/tests/bugs/bug-887145.t
+++ b/tests/bugs/bug-887145.t
@@ -25,7 +25,7 @@ cp /etc/passwd $M0/;
cp $M0/passwd $M0/file;
chmod 600 $M0/file;
-TEST mount -t nfs -o vers=3,nolock $H0:/$V0 $N0;
+TEST mount_nfs $H0:/$V0 $N0 nolock;
chown -R nfsnobody:nfsnobody $M0/dir;
chown -R tmp_user:tmp_user $M0/other;
diff --git a/tests/bugs/bug-904065.t b/tests/bugs/bug-904065.t
index 505854d9b09..5d5045bb734 100755
--- a/tests/bugs/bug-904065.t
+++ b/tests/bugs/bug-904065.t
@@ -39,7 +39,7 @@ EXPECT_WITHIN 20 1 is_nfs_export_available
# before mounting the rmtab should be empty
EXPECT '0' count_lines /var/lib/glusterd/nfs/rmtab
-TEST mount -t nfs -o vers=3,nolock $H0:/$V0 $N0
+TEST mount_nfs $H0:/$V0 $N0 nolock
# the output would looks similar to:
#
# hostname-0=172.31.122.104
@@ -48,7 +48,7 @@ TEST mount -t nfs -o vers=3,nolock $H0:/$V0 $N0
EXPECT '2' count_lines /var/lib/glusterd/nfs/rmtab
# duplicate mounts should not be recorded (client could have crashed)
-TEST mount -t nfs -o vers=3,nolock $H0:/$V0 $N1
+TEST mount_nfs $H0:/$V0 $N1 nolock
EXPECT '2' count_lines /var/lib/glusterd/nfs/rmtab
# removing a mount should (even if there are two) should remove the entry
@@ -76,7 +76,7 @@ TEST gluster volume set $V0 nfs.mount-rmtab $M0/rmtab
EXPECT_WITHIN 20 1 is_nfs_export_available
# a new mount should be added to the rmtab, not overwrite exiting ones
-TEST mount -t nfs -o vers=3,nolock $H0:/$V0 $N0
+TEST mount_nfs $H0:/$V0 $N0 nolock
EXPECT '4' count_lines $M0/rmtab
TEST umount $N0
diff --git a/tests/bugs/bug-904300.t b/tests/bugs/bug-904300.t
index 4276ee22921..1e6917463ec 100755
--- a/tests/bugs/bug-904300.t
+++ b/tests/bugs/bug-904300.t
@@ -13,7 +13,7 @@ TEST $CLI volume create $V0 $H0:$B0/$V0;
TEST $CLI volume start $V0
EXPECT_WITHIN 20 1 is_nfs_export_available
-TEST mount -t nfs -o vers=3,nolock,soft,intr $H0:/$V0 $N0
+TEST mount_nfs $H0:/$V0 $N0 nolock
TEST mkdir $N0/dir1
TEST umount $N0
@@ -23,7 +23,7 @@ TEST umount $N0
TEST $CLI volume set $V0 export-dir \""/dir1(127.0.0.1)"\"
EXPECT_WITHIN 20 2 is_nfs_export_available
-TEST mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0/dir1 $N0
+TEST mount_nfs localhost:/$V0/dir1 $N0 nolock
TEST umount $N0
#
@@ -33,7 +33,7 @@ TEST umount $N0
TEST $CLI volume set $V0 export-dir \""/dir1(8.8.8.8)"\"
EXPECT_WITHIN 20 2 is_nfs_export_available
-TEST ! mount -t nfs -o vers=3,nolock,soft,intr $H0:/$V0/dir1 $N0
+TEST ! mount_nfs $H0:/$V0/dir1 $N0 nolock
TEST ! umount $N0
@@ -43,7 +43,7 @@ TEST ! umount $N0
TEST $CLI volume set $V0 export-dir \""/dir1($H0)"\"
EXPECT_WITHIN 20 2 is_nfs_export_available
-TEST mount -t nfs -o vers=3,nolock,soft,intr $H0:/$V0/dir1 $N0
+TEST mount_nfs $H0:/$V0/dir1 $N0 nolock
TEST umount $N0
# Case 4: Variation of test case1. Here we are checking with IP range
@@ -51,7 +51,7 @@ TEST umount $N0
TEST $CLI volume set $V0 export-dir \""/dir1(127.0.0.0/24)"\"
EXPECT_WITHIN 20 2 is_nfs_export_available
-TEST mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0/dir1 $N0
+TEST mount_nfs localhost:/$V0/dir1 $N0 nolock
TEST umount $N0
## Finish up
diff --git a/tests/bugs/bug-915280.t b/tests/bugs/bug-915280.t
index a1f92f2019c..218fa7baf89 100755
--- a/tests/bugs/bug-915280.t
+++ b/tests/bugs/bug-915280.t
@@ -2,6 +2,7 @@
. $(dirname $0)/../include.rc
. $(dirname $0)/../volume.rc
+. $(dirname $0)/../nfs.rc
cleanup;
@@ -22,10 +23,9 @@ EXPECT 'Created' volinfo_field $V0 'Status';
TEST $CLI volume start $V0;
EXPECT 'Started' volinfo_field $V0 'Status';
-sleep 3
-
MOUNTDIR=$N0;
-TEST mount -t nfs -o vers=3,nolock,soft,timeo=30,retrans=1 $H0:/$V0 $N0
+EXPECT_WITHIN 20 "1" is_nfs_export_available;
+TEST mount_nfs $H0:/$V0 $N0 nolock,timeo=30,retrans=1
TEST touch $N0/testfile
TEST $CLI volume set $V0 debug.error-gen client
diff --git a/tests/bugs/bug-921072.t b/tests/bugs/bug-921072.t
index 37f8fde52ec..8ccdea90399 100755
--- a/tests/bugs/bug-921072.t
+++ b/tests/bugs/bug-921072.t
@@ -12,7 +12,7 @@ TEST pidof glusterd
TEST $CLI volume create $V0 $H0:$B0/$V0
TEST $CLI volume start $V0
EXPECT_WITHIN 20 1 is_nfs_export_available
-TEST mount -t nfs -o vers=3,nolock,soft,intr $H0:/$V0 $N0
+TEST mount_nfs $H0:/$V0 $N0 nolock
TEST umount $N0
# based on ip addresses (1-4)
@@ -20,26 +20,26 @@ TEST umount $N0
TEST $CLI volume set $V0 nfs.rpc-auth-allow 127.0.0.1
EXPECT_WITHIN 20 1 is_nfs_export_available
-TEST mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0 $N0
+TEST mount_nfs localhost:/$V0 $N0 nolock
TEST umount $N0
# case 2: allow only non-localhost ip
TEST $CLI volume set $V0 nfs.rpc-auth-allow 192.168.1.1
EXPECT_WITHIN 20 1 is_nfs_export_available
#11
-TEST ! mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0 $N0
+TEST ! mount_nfs localhost:/$V0 $N0 nolock
TEST $CLI volume reset --mode=script $V0
# case 3: reject only localhost ip
TEST $CLI volume set $V0 nfs.rpc-auth-reject 127.0.0.1
EXPECT_WITHIN 20 1 is_nfs_export_available
-TEST ! mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0 $N0
+TEST ! mount_nfs localhost:/$V0 $N0 nolock
# case 4: reject only non-localhost ip
TEST $CLI volume set $V0 nfs.rpc-auth-reject 192.168.1.1
EXPECT_WITHIN 20 1 is_nfs_export_available
-TEST mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0 $N0
+TEST mount_nfs localhost:/$V0 $N0 nolock
TEST umount $N0
@@ -50,21 +50,21 @@ TEST $CLI volume reset --mode=script $V0
TEST $CLI volume set $V0 nfs.addr-namelookup on
EXPECT_WITHIN 20 1 is_nfs_export_available
#20
-TEST mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0 $N0
+TEST mount_nfs localhost:/$V0 $N0 nolock
TEST umount $N0
# case 5: allow only localhost
TEST $CLI volume set $V0 nfs.rpc-auth-allow localhost
EXPECT_WITHIN 20 1 is_nfs_export_available
-TEST mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0 $N0
+TEST mount_nfs localhost:/$V0 $N0 nolock
TEST umount $N0
# case 6: allow only somehost
TEST $CLI volume set $V0 nfs.rpc-auth-allow somehost
EXPECT_WITHIN 20 1 is_nfs_export_available
-TEST ! mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0 $N0
+TEST ! mount_nfs localhost:/$V0 $N0 nolock
# case 7: reject only localhost
TEST $CLI volume reset --mode=script $V0
@@ -72,13 +72,13 @@ TEST $CLI volume set $V0 nfs.addr-namelookup on
TEST $CLI volume set $V0 nfs.rpc-auth-reject localhost
EXPECT_WITHIN 20 1 is_nfs_export_available
#30
-TEST ! mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0 $N0
+TEST ! mount_nfs localhost:/$V0 $N0 nolock
# case 8: reject only somehost
TEST $CLI volume set $V0 nfs.rpc-auth-reject somehost
EXPECT_WITHIN 20 1 is_nfs_export_available
-TEST mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0 $N0
+TEST mount_nfs localhost:/$V0 $N0 nolock
TEST umount $N0
# based on ip addresses: repeat of cases 1-4
@@ -88,7 +88,7 @@ TEST $CLI volume set $V0 nfs.addr-namelookup on
TEST $CLI volume set $V0 nfs.rpc-auth-allow 127.0.0.1
EXPECT_WITHIN 20 1 is_nfs_export_available
-TEST mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0 $N0
+TEST mount_nfs localhost:/$V0 $N0 nolock
TEST mkdir -p $N0/subdir
TEST umount $N0
@@ -96,7 +96,7 @@ TEST umount $N0
TEST $CLI volume set $V0 nfs.rpc-auth-allow 192.168.1.1
EXPECT_WITHIN 20 1 is_nfs_export_available
#41
-TEST ! mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0 $N0
+TEST ! mount_nfs localhost:/$V0 $N0 nolock
# case 11: reject only localhost ip
TEST $CLI volume reset --mode=script $V0
@@ -104,17 +104,17 @@ TEST $CLI volume set $V0 nfs.addr-namelookup on
TEST $CLI volume set $V0 nfs.rpc-auth-reject 127.0.0.1
EXPECT_WITHIN 20 1 is_nfs_export_available
-TEST ! mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0 $N0
-TEST ! mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0/subdir $N0
+TEST ! mount_nfs localhost:/$V0 $N0 nolock
+TEST ! mount_nfs localhost:/$V0/subdir $N0 nolock
# case 12: reject only non-localhost ip
TEST $CLI volume set $V0 nfs.rpc-auth-reject 192.168.1.1
EXPECT_WITHIN 20 1 is_nfs_export_available
-TEST mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0 $N0
+TEST mount_nfs localhost:/$V0 $N0 nolock
TEST umount $N0
-TEST mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0/subdir $N0
+TEST mount_nfs localhost:/$V0/subdir $N0 nolock
TEST umount $N0
TEST $CLI volume stop --mode=script $V0
diff --git a/tests/bugs/bug-927616.t b/tests/bugs/bug-927616.t
index 22b20aff2df..d8fe7520d8c 100755
--- a/tests/bugs/bug-927616.t
+++ b/tests/bugs/bug-927616.t
@@ -1,6 +1,7 @@
#!/bin/bash
. $(dirname $0)/../include.rc
+. $(dirname $0)/../nfs.rc
cleanup;
@@ -14,9 +15,8 @@ sleep 1;
## Mount FUSE with caching disabled
TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $M0;
-sleep 1;
-
-TEST mount -t nfs -o vers=3,nolock $H0:/$V0 $N0;
+EXPECT_WITHIN 20 "1" is_nfs_export_available;
+TEST mount_nfs $H0:/$V0 $N0 nolock;
TEST mkdir $M0/dir;
diff --git a/tests/bugs/bug-958691.t b/tests/bugs/bug-958691.t
index a5ac406c9c6..3f6b93eb1c3 100644
--- a/tests/bugs/bug-958691.t
+++ b/tests/bugs/bug-958691.t
@@ -1,6 +1,7 @@
#!/bin/bash
. $(dirname $0)/../include.rc
. $(dirname $0)/../volume.rc
+. $(dirname $0)/../nfs.rc
cleanup;
@@ -10,8 +11,8 @@ TEST $CLI volume create $V0 $H0:$B0/${V0}{0,1}
TEST $CLI volume start $V0;
TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0;
-sleep 1;
-TEST mount -t nfs -o vers=3,nolock $H0:/$V0 $N0;
+EXPECT_WITHIN 20 "1" is_nfs_export_available;
+TEST mount_nfs $H0:/$V0 $N0 nolock;
sleep 2;
diff --git a/tests/bugs/bug-966018.t b/tests/bugs/bug-966018.t
index 2a46972413f..55a01b8b7b3 100644
--- a/tests/bugs/bug-966018.t
+++ b/tests/bugs/bug-966018.t
@@ -2,6 +2,7 @@
. $(dirname $0)/../include.rc
. $(dirname $0)/../volume.rc
+. $(dirname $0)/../nfs.rc
#This tests if eager-lock blocks metadata operations on nfs/fuse mounts.
#If it is not woken up, INODELK from the next command waits
@@ -18,8 +19,8 @@ TEST $CLI volume set $V0 cluster.post-op-delay-secs 3
TEST $CLI volume start $V0
TEST $CLI volume profile $V0 start
-sleep 5
-TEST mount -t nfs -o vers=3,nolock $H0:/$V0 $N0;
+EXPECT_WITHIN 20 "1" is_nfs_export_available;
+TEST mount_nfs $H0:/$V0 $N0 nolock;
TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id=$V0 $M0
echo 1 > $N0/1 && chmod +x $N0/1
echo 1 > $M0/1 && chmod +x $M0/1
diff --git a/tests/bugs/bug-974972.t b/tests/bugs/bug-974972.t
index 15deac090e9..1b57307e76d 100755
--- a/tests/bugs/bug-974972.t
+++ b/tests/bugs/bug-974972.t
@@ -2,6 +2,7 @@
. $(dirname $0)/../include.rc
. $(dirname $0)/../volume.rc
+. $(dirname $0)/../nfs.rc
#This script checks that nfs mount does not fail lookup on files with split-brain
cleanup;
@@ -11,8 +12,8 @@ TEST pidof glusterd
TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0,1}
TEST $CLI volume set $V0 self-heal-daemon off
TEST $CLI volume start $V0
-sleep 5
-TEST mount -t nfs -o vers=3 $H0:/$V0 $N0
+EXPECT_WITHIN 20 "1" is_nfs_export_available;
+TEST mount_nfs $H0:/$V0 $N0
TEST touch $N0/1
TEST kill_brick ${V0} ${H0} ${B0}/${V0}1
echo abc > $N0/1
diff --git a/tests/nfs.rc b/tests/nfs.rc
index f3abee84280..ed80c1b426b 100644
--- a/tests/nfs.rc
+++ b/tests/nfs.rc
@@ -8,7 +8,7 @@
#
function is_nfs_export_available ()
{
- vol=$1
+ local vol=$1
if [ "$vol" == "" ]; then
vol=$V0
@@ -18,4 +18,11 @@ function is_nfs_export_available ()
echo "$exp"
}
-
+function mount_nfs ()
+{
+ local e=$1
+ local m=$2
+ local opt=$3
+ if [ ! -z "$opt" ]; then opt=",$opt"; fi
+ mount -t nfs -o soft,intr,vers=3"$opt" $e $m
+}