The newly added realpath(3) in vmd's parse.y checks whether the
authorbluhm <bluhm@openbsd.org>
Fri, 20 Jul 2018 22:18:49 +0000 (22:18 +0000)
committerbluhm <bluhm@openbsd.org>
Fri, 20 Jul 2018 22:18:49 +0000 (22:18 +0000)
directories exist.  Create the path and file for test
vmd-fail-disk-path-too-long.

regress/usr.sbin/vmd/config/Makefile
regress/usr.sbin/vmd/config/vmd-fail-disk-path-too-long.conf
regress/usr.sbin/vmd/config/vmd-fail-disk-path-too-long.ok

index 4b60208..2b41e49 100644 (file)
@@ -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>
index 402058f..32781cc 100644 (file)
@@ -1,6 +1,6 @@
-#      $OpenBSD: vmd-fail-disk-path-too-long.conf,v 1.1.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
 }
index a384c81..5df11e9 100644 (file)
@@ -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