From: ccardenas Date: Sun, 9 Sep 2018 04:11:55 +0000 (+0000) Subject: Add tests for disk format. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0523a246ec3d8511b61fafc64d17ebc2f2e6d4e1;p=openbsd Add tests for disk format. Thanks to Ori Bernstein. --- diff --git a/regress/usr.sbin/vmd/config/Makefile b/regress/usr.sbin/vmd/config/Makefile index 2b41e49ac83..c829731e3be 100644 --- a/regress/usr.sbin/vmd/config/Makefile +++ b/regress/usr.sbin/vmd/config/Makefile @@ -1,11 +1,13 @@ -# $OpenBSD: Makefile,v 1.5 2018/07/20 22:18:49 bluhm Exp $ +# $OpenBSD: Makefile,v 1.6 2018/09/09 04:11:55 ccardenas Exp $ VMD ?= /usr/sbin/vmd -VMD_PASS=boot-keyword memory-round memory-just-enough cdrom-keyword +VMD_PASS=boot-keyword memory-round memory-just-enough cdrom-keyword \ + format-keyword VMD_FAIL=kernel-keyword too-few-ram vm-name-too-long too-many-ifs \ boot-name-too-long disk-path-too-long too-many-disks \ - switch-no-interface switch-no-add cdrom-name-too-long + switch-no-interface switch-no-add cdrom-name-too-long \ + bad-format missing-format REGRESS_TARGETS= diff --git a/regress/usr.sbin/vmd/config/vmd-fail-bad-format.conf b/regress/usr.sbin/vmd/config/vmd-fail-bad-format.conf new file mode 100644 index 00000000000..8edc0e7361c --- /dev/null +++ b/regress/usr.sbin/vmd/config/vmd-fail-bad-format.conf @@ -0,0 +1,8 @@ +# $OpenBSD: vmd-fail-bad-format.conf,v 1.1 2018/09/09 04:11:55 ccardenas Exp $ +# Pass on cdrom keyword + +vm "x" { + memory 1G + disk "foo.img" format "rotten" + disable +} diff --git a/regress/usr.sbin/vmd/config/vmd-fail-bad-format.ok b/regress/usr.sbin/vmd/config/vmd-fail-bad-format.ok new file mode 100644 index 00000000000..1f79afafa1e --- /dev/null +++ b/regress/usr.sbin/vmd/config/vmd-fail-bad-format.ok @@ -0,0 +1 @@ +6: unrecognized disk format rotten diff --git a/regress/usr.sbin/vmd/config/vmd-fail-missing-format.conf b/regress/usr.sbin/vmd/config/vmd-fail-missing-format.conf new file mode 100644 index 00000000000..5e1fd7af968 --- /dev/null +++ b/regress/usr.sbin/vmd/config/vmd-fail-missing-format.conf @@ -0,0 +1,8 @@ +# $OpenBSD: vmd-fail-missing-format.conf,v 1.1 2018/09/09 04:11:55 ccardenas Exp $ +# Pass on cdrom keyword + +vm "x" { + memory 1G + disk "foo.img" format + disable +} diff --git a/regress/usr.sbin/vmd/config/vmd-fail-missing-format.ok b/regress/usr.sbin/vmd/config/vmd-fail-missing-format.ok new file mode 100644 index 00000000000..c88cb26bf39 --- /dev/null +++ b/regress/usr.sbin/vmd/config/vmd-fail-missing-format.ok @@ -0,0 +1 @@ +6: syntax error diff --git a/regress/usr.sbin/vmd/config/vmd-pass-format-keyword.conf b/regress/usr.sbin/vmd/config/vmd-pass-format-keyword.conf new file mode 100644 index 00000000000..fbfb51098ad --- /dev/null +++ b/regress/usr.sbin/vmd/config/vmd-pass-format-keyword.conf @@ -0,0 +1,8 @@ +# $OpenBSD: vmd-pass-format-keyword.conf,v 1.1 2018/09/09 04:11:55 ccardenas Exp $ +# Pass on cdrom keyword + +vm "x" { + memory 1G + disk "foo.img" format "raw" + disable +} diff --git a/regress/usr.sbin/vmd/config/vmd-pass-format-keyword.ok b/regress/usr.sbin/vmd/config/vmd-pass-format-keyword.ok new file mode 100644 index 00000000000..403d828b763 --- /dev/null +++ b/regress/usr.sbin/vmd/config/vmd-pass-format-keyword.ok @@ -0,0 +1 @@ +configuration OK