]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: add explicit test case for pflash loader lacking path
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 7 Feb 2022 12:45:38 +0000 (12:45 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 22 Feb 2022 14:54:31 +0000 (14:54 +0000)
The following is expected to raise an error:

  <os>
    <loader readonly='yes' type='pflash'/>
  </os>

because no path to the pflash loader is given and there is
no default built-in.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
tests/qemuxml2argvdata/bios-nvram-no-path.err [new file with mode: 0644]
tests/qemuxml2argvdata/bios-nvram-no-path.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c

diff --git a/tests/qemuxml2argvdata/bios-nvram-no-path.err b/tests/qemuxml2argvdata/bios-nvram-no-path.err
new file mode 100644 (file)
index 0000000..7953860
--- /dev/null
@@ -0,0 +1 @@
+no loader path specified and firmware auto selection disabled
diff --git a/tests/qemuxml2argvdata/bios-nvram-no-path.xml b/tests/qemuxml2argvdata/bios-nvram-no-path.xml
new file mode 100644 (file)
index 0000000..bf97f0b
--- /dev/null
@@ -0,0 +1,19 @@
+<domain type='qemu'>
+  <name>test-bios</name>
+  <uuid>362d1fc1-df7d-193e-5c18-49a71bd1da66</uuid>
+  <memory unit='KiB'>1048576</memory>
+  <currentMemory unit='KiB'>1048576</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64' machine='pc'>hvm</type>
+    <loader readonly='yes' type='pflash'/>
+    <boot dev='hd'/>
+    <bootmenu enable='yes'/>
+  </os>
+  <features>
+    <acpi/>
+  </features>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+  </devices>
+</domain>
index 9c5c394e03204540792e545d6b021341a7b32285..43d22016d6d908a45445433060085bebff88065c 100644 (file)
@@ -1188,6 +1188,7 @@ mymain(void)
     DO_TEST("bios",
             QEMU_CAPS_DEVICE_ISA_SERIAL);
     DO_TEST_NOCAPS("bios-nvram");
+    DO_TEST_PARSE_ERROR_NOCAPS("bios-nvram-no-path");
     DO_TEST_CAPS_LATEST("bios-nvram-rw");
     DO_TEST_CAPS_LATEST("bios-nvram-rw-implicit");
     DO_TEST("bios-nvram-secure",