summaryrefslogtreecommitdiff
path: root/regress/sys/kern
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2017-01-11 17:10:33 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2017-01-11 17:10:33 +0000
commitf568f9282fd076f83aa914635723c74efe427962 (patch)
tree27b184ebe30b3e067890a504e237df84c92fd222 /regress/sys/kern
parentba75f6601d05d101ec5133f08c668abd4b09525f (diff)
Add a test that creates a nested tree of mount points. All partitions
of a vnd(4) device are mounted under /mnt. A single umount(8) of /mnt should unmount all of them.
Diffstat (limited to 'regress/sys/kern')
-rw-r--r--regress/sys/kern/mount/Makefile40
-rw-r--r--regress/sys/kern/mount/disktemplate15
2 files changed, 55 insertions, 0 deletions
diff --git a/regress/sys/kern/mount/Makefile b/regress/sys/kern/mount/Makefile
new file mode 100644
index 00000000000..d000f42dc00
--- /dev/null
+++ b/regress/sys/kern/mount/Makefile
@@ -0,0 +1,40 @@
+# $OpenBSD: Makefile,v 1.1.1.1 2017/01/11 17:10:32 bluhm Exp $
+
+.PHONY: disk mount unconfig clean
+
+disk: clean
+ dd if=/dev/zero of=diskimage bs=100k count=16
+ vnconfig vnd0 diskimage
+ disklabel -wA -T ${.CURDIR}/disktemplate vnd0
+ disklabel vnd0
+.for p in a b d e f g h i j k l m n o p
+ newfs vnd0${p}
+.endfor
+ disklabel vnd0 | grep -q '16 partitions:'
+ [ `disklabel vnd0 | grep -c '\<4.2BSD\>'` -eq 15 ]
+
+mount: disk
+ mount /dev/vnd0a /mnt
+ mkdir /mnt/b
+ mount /dev/vnd0b /mnt/b
+ f=/mnt; for p in d e f g h i j k l m n o p;\
+ do f=$$f/$$p; mkdir $$f; mount /dev/vnd0$$p $$f; done
+ mount
+ [ `mount | grep -c '/dev/vnd0. on /mnt\>'` -eq 15 ]
+
+unconfig:
+ -umount -f /mnt 2>/dev/null || true
+ -vnconfig -u vnd0 2>/dev/null || true
+
+clean: unconfig
+ -rm -f diskimage
+
+REGRESS_TARGETS= run-regress-unmount-nested
+run-regress-unmount-nested: mount
+ ! umount /mnt
+ umount -f /mnt
+ mount
+ [ `mount | grep -c '/dev/vnd0. on /mnt\>'` -eq 0 ]
+ cd ${.CURDIR} && ${.MAKE} unconfig
+
+.include <bsd.regress.mk>
diff --git a/regress/sys/kern/mount/disktemplate b/regress/sys/kern/mount/disktemplate
new file mode 100644
index 00000000000..9199795373b
--- /dev/null
+++ b/regress/sys/kern/mount/disktemplate
@@ -0,0 +1,15 @@
+/mnt 100k
+/mnt/b 100k
+/mnt/d 100k
+/mnt/d/e 100k
+/mnt/d/e/f 100k
+/mnt/d/e/f/g 100k
+/mnt/d/e/f/g/h 100k
+/mnt/d/e/f/g/h/i 100k
+/mnt/d/e/f/g/h/i/j 100k
+/mnt/d/e/f/g/h/i/j/k 100k
+/mnt/d/e/f/g/h/i/j/k/l 100k
+/mnt/d/e/f/g/h/i/j/k/l/m 100k
+/mnt/d/e/f/g/h/i/j/k/l/m/n 100k
+/mnt/d/e/f/g/h/i/j/k/l/m/n/o 100k
+/mnt/d/e/f/g/h/i/j/k/l/m/n/o/p 100k