From 34f0b48ad209c787730cd57ba5bb0cb843f0d6f7 Mon Sep 17 00:00:00 2001 From: ccardenas Date: Sun, 9 Sep 2018 04:11:56 +0000 Subject: Add tests for disk format. Thanks to Ori Bernstein. --- regress/usr.sbin/vmd/config/Makefile | 8 +++++--- regress/usr.sbin/vmd/config/vmd-fail-bad-format.conf | 8 ++++++++ regress/usr.sbin/vmd/config/vmd-fail-bad-format.ok | 1 + regress/usr.sbin/vmd/config/vmd-fail-missing-format.conf | 8 ++++++++ regress/usr.sbin/vmd/config/vmd-fail-missing-format.ok | 1 + regress/usr.sbin/vmd/config/vmd-pass-format-keyword.conf | 8 ++++++++ regress/usr.sbin/vmd/config/vmd-pass-format-keyword.ok | 1 + 7 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 regress/usr.sbin/vmd/config/vmd-fail-bad-format.conf create mode 100644 regress/usr.sbin/vmd/config/vmd-fail-bad-format.ok create mode 100644 regress/usr.sbin/vmd/config/vmd-fail-missing-format.conf create mode 100644 regress/usr.sbin/vmd/config/vmd-fail-missing-format.ok create mode 100644 regress/usr.sbin/vmd/config/vmd-pass-format-keyword.conf create mode 100644 regress/usr.sbin/vmd/config/vmd-pass-format-keyword.ok (limited to 'regress/usr.sbin') 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 -- cgit v1.2.3