Add regression tests for cdrom keyword
authorccardenas <ccardenas@openbsd.org>
Sun, 7 Jan 2018 22:59:57 +0000 (22:59 +0000)
committerccardenas <ccardenas@openbsd.org>
Sun, 7 Jan 2018 22:59:57 +0000 (22:59 +0000)
ok mlarkin@

regress/usr.sbin/vmd/config/Makefile
regress/usr.sbin/vmd/config/vmd-fail-cdrom-name-too-long.conf [new file with mode: 0644]
regress/usr.sbin/vmd/config/vmd-fail-cdrom-name-too-long.ok [new file with mode: 0644]
regress/usr.sbin/vmd/config/vmd-pass-cdrom-keyword.conf [new file with mode: 0644]
regress/usr.sbin/vmd/config/vmd-pass-cdrom-keyword.ok [new file with mode: 0644]

index b52ca21..4b60208 100644 (file)
@@ -1,11 +1,11 @@
-#      $OpenBSD: Makefile,v 1.3 2017/11/11 02:54:42 mlarkin Exp $
+#      $OpenBSD: Makefile,v 1.4 2018/01/07 22:59:57 ccardenas Exp $
 
 VMD ?= /usr/sbin/vmd
 
-VMD_PASS=boot-keyword memory-round memory-just-enough
+VMD_PASS=boot-keyword memory-round memory-just-enough cdrom-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
+        switch-no-interface switch-no-add cdrom-name-too-long
 
 REGRESS_TARGETS=
 
diff --git a/regress/usr.sbin/vmd/config/vmd-fail-cdrom-name-too-long.conf b/regress/usr.sbin/vmd/config/vmd-fail-cdrom-name-too-long.conf
new file mode 100644 (file)
index 0000000..70ad4e9
--- /dev/null
@@ -0,0 +1,6 @@
+#      $OpenBSD: vmd-fail-cdrom-name-too-long.conf,v 1.1 2018/01/07 22:59:57 ccardenas Exp $
+# Fail on cdrom path (> 128)
+iso="/some/absolutepath/somewhere/abcdefghijklmnopqrstuvwxyz0123456789/abcdefghijklmnopqrstuvwxyz0123456789/abcdefghijklmnopqrstuvwxyz0123456789/cd62.iso"
+vm "x" {
+    cdrom $iso
+}
diff --git a/regress/usr.sbin/vmd/config/vmd-fail-cdrom-name-too-long.ok b/regress/usr.sbin/vmd/config/vmd-fail-cdrom-name-too-long.ok
new file mode 100644 (file)
index 0000000..e94f1e3
--- /dev/null
@@ -0,0 +1 @@
+5: cdrom name too long
diff --git a/regress/usr.sbin/vmd/config/vmd-pass-cdrom-keyword.conf b/regress/usr.sbin/vmd/config/vmd-pass-cdrom-keyword.conf
new file mode 100644 (file)
index 0000000..36db51e
--- /dev/null
@@ -0,0 +1,8 @@
+#      $OpenBSD: vmd-pass-cdrom-keyword.conf,v 1.1 2018/01/07 22:59:57 ccardenas Exp $
+# Pass on cdrom keyword
+
+vm "x" {
+    memory 1G
+    cdrom "cd62.iso"
+    disable
+}
diff --git a/regress/usr.sbin/vmd/config/vmd-pass-cdrom-keyword.ok b/regress/usr.sbin/vmd/config/vmd-pass-cdrom-keyword.ok
new file mode 100644 (file)
index 0000000..403d828
--- /dev/null
@@ -0,0 +1 @@
+configuration OK