From f71dfe227dccbad877deb2ecf9c55a1138f18985 Mon Sep 17 00:00:00 2001 From: bluhm Date: Fri, 20 Jul 2018 22:18:49 +0000 Subject: [PATCH] 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. --- regress/usr.sbin/vmd/config/Makefile | 13 ++++++++++++- .../vmd/config/vmd-fail-disk-path-too-long.conf | 4 ++-- .../vmd/config/vmd-fail-disk-path-too-long.ok | 2 +- 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 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 402058f55e6..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.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 -- 2.20.1