summaryrefslogtreecommitdiff
path: root/regress/usr.sbin
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2018-07-20 22:18:50 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2018-07-20 22:18:50 +0000
commit3ff446171a171ce5c17c4513ce6603991fb389b1 (patch)
tree8adcc5d584144ea791005f6488db7d7846757f61 /regress/usr.sbin
parent1c15892b52ccf109aa0f3f8ad37c7ab9bd81d220 (diff)
The newly added realpath(3) in vmd's parse.y checks whether the
directories exist. Create the path and file for test vmd-fail-disk-path-too-long.
Diffstat (limited to 'regress/usr.sbin')
-rw-r--r--regress/usr.sbin/vmd/config/Makefile13
-rw-r--r--regress/usr.sbin/vmd/config/vmd-fail-disk-path-too-long.conf4
-rw-r--r--regress/usr.sbin/vmd/config/vmd-fail-disk-path-too-long.ok2
3 files changed, 15 insertions, 4 deletions
diff --git a/regress/usr.sbin/vmd/config/Makefile b/regress/usr.sbin/vmd/config/Makefile
index 4b602083c0a..2b41e49ac83 100644
--- a/regress/usr.sbin/vmd/config/Makefile
+++ b/regress/usr.sbin/vmd/config/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.4 2018/01/07 22:59:57 ccardenas Exp $
+# $OpenBSD: Makefile,v 1.5 2018/07/20 22:18:49 bluhm Exp $
VMD ?= /usr/sbin/vmd
@@ -28,6 +28,17 @@ vmd-fail-${n}:
diff -u ${.CURDIR}/vmd-fail-${n}.ok /dev/stdin
.endfor
+DISK_PATH_LONG = some/relativepath/somewhere/abcdefghijklmnopqrstuvwxyz0123456789/abcdefghijklmnopqrstuvwxyz0123456789/abcdefghijklmnopqrstuvwxyz0123456789/bsd.img
+
+vmd-fail-disk-path-too-long: ${DISK_PATH_LONG}
+
+${DISK_PATH_LONG}:
+ mkdir -p ${@:H}
+ touch $@
+
+clean:
+ rm -rf some
+
.PHONY: ${REGRESS_TARGETS}
.include <bsd.regress.mk>
diff --git a/regress/usr.sbin/vmd/config/vmd-fail-disk-path-too-long.conf b/regress/usr.sbin/vmd/config/vmd-fail-disk-path-too-long.conf
index 8770afa5019..32781ccd110 100644
--- a/regress/usr.sbin/vmd/config/vmd-fail-disk-path-too-long.conf
+++ b/regress/usr.sbin/vmd/config/vmd-fail-disk-path-too-long.conf
@@ -1,6 +1,6 @@
-# $OpenBSD: vmd-fail-disk-path-too-long.conf,v 1.1 2017/10/11 12:01:20 bluhm Exp $
+# $OpenBSD: vmd-fail-disk-path-too-long.conf,v 1.2 2018/07/20 22:18:49 bluhm Exp $
# Fail on disk path (> 128)
-rdisk="/some/absolutepath/somewhere/abcdefghijklmnopqrstuvwxyz0123456789/abcdefghijklmnopqrstuvwxyz0123456789/abcdefghijklmnopqrstuvwxyz0123456789/bsd.img"
+rdisk="some/relativepath/somewhere/abcdefghijklmnopqrstuvwxyz0123456789/abcdefghijklmnopqrstuvwxyz0123456789/abcdefghijklmnopqrstuvwxyz0123456789/bsd.img"
vm "x" {
disk $rdisk
}
diff --git a/regress/usr.sbin/vmd/config/vmd-fail-disk-path-too-long.ok b/regress/usr.sbin/vmd/config/vmd-fail-disk-path-too-long.ok
index a384c812362..5df11e932b1 100644
--- a/regress/usr.sbin/vmd/config/vmd-fail-disk-path-too-long.ok
+++ b/regress/usr.sbin/vmd/config/vmd-fail-disk-path-too-long.ok
@@ -1,2 +1,2 @@
disk path too long
-5: failed to parse disks: /some/absolutepath/somewhere/abcdefghijklmnopqrstuvwxyz0123456789/abcdefghijklmnopqrstuvwxyz0123456789/abcdefghijklmnopqrstuvwxyz0123456789/bsd.img
+5: failed to parse disks: some/relativepath/somewhere/abcdefghijklmnopqrstuvwxyz0123456789/abcdefghijklmnopqrstuvwxyz0123456789/abcdefghijklmnopqrstuvwxyz0123456789/bsd.img