Add tests for disk format.
authorccardenas <ccardenas@openbsd.org>
Sun, 9 Sep 2018 04:11:55 +0000 (04:11 +0000)
committerccardenas <ccardenas@openbsd.org>
Sun, 9 Sep 2018 04:11:55 +0000 (04:11 +0000)
Thanks to Ori Bernstein.

regress/usr.sbin/vmd/config/Makefile
regress/usr.sbin/vmd/config/vmd-fail-bad-format.conf [new file with mode: 0644]
regress/usr.sbin/vmd/config/vmd-fail-bad-format.ok [new file with mode: 0644]
regress/usr.sbin/vmd/config/vmd-fail-missing-format.conf [new file with mode: 0644]
regress/usr.sbin/vmd/config/vmd-fail-missing-format.ok [new file with mode: 0644]
regress/usr.sbin/vmd/config/vmd-pass-format-keyword.conf [new file with mode: 0644]
regress/usr.sbin/vmd/config/vmd-pass-format-keyword.ok [new file with mode: 0644]

index 2b41e49..c829731 100644 (file)
@@ -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 (file)
index 0000000..8edc0e7
--- /dev/null
@@ -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 (file)
index 0000000..1f79afa
--- /dev/null
@@ -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 (file)
index 0000000..5e1fd7a
--- /dev/null
@@ -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 (file)
index 0000000..c88cb26
--- /dev/null
@@ -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 (file)
index 0000000..fbfb510
--- /dev/null
@@ -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 (file)
index 0000000..403d828
--- /dev/null
@@ -0,0 +1 @@
+configuration OK