summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2017-09-04 12:04:03 +0000
committerbluhm <bluhm@openbsd.org>2017-09-04 12:04:03 +0000
commit516b04ebf98b297f881edae6935f02cd6d9ab5d4 (patch)
treec113e4cfbf8c53d64ceab91e544678506fca61f0
parentRevert previous: "Fix a remaining length miscalculation in xhci(4)." (diff)
downloadwireguard-openbsd-516b04ebf98b297f881edae6935f02cd6d9ab5d4.tar.xz
wireguard-openbsd-516b04ebf98b297f881edae6935f02cd6d9ab5d4.zip
Before mounting NFS, wait until mountd(8) has exported the directory.
Fixes a race in the test setup. OK mpi@.
-rw-r--r--regress/sys/ffs/nfs/Makefile8
-rw-r--r--regress/sys/nfs/Makefile8
2 files changed, 14 insertions, 2 deletions
diff --git a/regress/sys/ffs/nfs/Makefile b/regress/sys/ffs/nfs/Makefile
index ec0d100fdd6..d3272a7cdb7 100644
--- a/regress/sys/ffs/nfs/Makefile
+++ b/regress/sys/ffs/nfs/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.4 2017/01/27 13:35:14 bluhm Exp $
+# $OpenBSD: Makefile,v 1.5 2017/09/04 12:04:03 bluhm Exp $
TESTS= chflags chmod chown link mkdir mkfifo open rename rmdir \
symlink truncate unlink
@@ -21,6 +21,12 @@ nfs:
mount: disk nfs
mkdir -p /mnt/regress-nfs-server
mount /dev/vnd0c /mnt/regress-nfs-server
+ # wait until mountd(8) has exported the directory
+ for i in `jot 100`; do \
+ mount | grep 'regress-nfs-server .*NFS exported' && break; \
+ [ $$i = 100 ] && exit 1; \
+ sleep .1; \
+ done
mkdir -p /mnt/regress-nfs-client
mount -t nfs 127.0.0.1:/mnt/regress-nfs-server /mnt/regress-nfs-client
diff --git a/regress/sys/nfs/Makefile b/regress/sys/nfs/Makefile
index 8f0e7305c94..848512c41a6 100644
--- a/regress/sys/nfs/Makefile
+++ b/regress/sys/nfs/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.6 2017/07/10 18:56:23 bluhm Exp $
+# $OpenBSD: Makefile,v 1.7 2017/09/04 12:04:03 bluhm Exp $
PROGS= mmap-sysctl-copyin mmap-sysctl-copyout
CLEANFILES= diskimage stamp-*
@@ -20,6 +20,12 @@ nfs:
mount: disk nfs
mkdir -p /mnt/regress-nfs-server
mount /dev/vnd0c /mnt/regress-nfs-server
+ # wait until mountd(8) has exported the directory
+ for i in `jot 100`; do \
+ mount | grep 'regress-nfs-server .*NFS exported' && break; \
+ [ $$i = 100 ] && exit 1; \
+ sleep .1; \
+ done
mkdir -p /mnt/regress-nfs-client
mount -t nfs 127.0.0.1:/mnt/regress-nfs-server /mnt/regress-nfs-client