]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Add firmware-auto-bios-rw
authorAndrea Bolognani <abologna@redhat.com>
Fri, 12 Dec 2025 15:18:24 +0000 (16:18 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 8 Jan 2026 23:26:16 +0000 (00:26 +0100)
This test cases demonstrates that the firmware autoselection
process is unable to find a BIOS image that is read/write.

This is expected, as BIOS is loaded as ROM and is thus by
definition read-only.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/qemuxmlconfdata/firmware-auto-bios-rw.x86_64-latest.err [new file with mode: 0644]
tests/qemuxmlconfdata/firmware-auto-bios-rw.x86_64-latest.xml [new file with mode: 0644]
tests/qemuxmlconfdata/firmware-auto-bios-rw.xml [new file with mode: 0644]
tests/qemuxmlconftest.c

diff --git a/tests/qemuxmlconfdata/firmware-auto-bios-rw.x86_64-latest.err b/tests/qemuxmlconfdata/firmware-auto-bios-rw.x86_64-latest.err
new file mode 100644 (file)
index 0000000..743fe27
--- /dev/null
@@ -0,0 +1 @@
+operation failed: Unable to find 'bios' firmware that is compatible with the current configuration
diff --git a/tests/qemuxmlconfdata/firmware-auto-bios-rw.x86_64-latest.xml b/tests/qemuxmlconfdata/firmware-auto-bios-rw.x86_64-latest.xml
new file mode 100644 (file)
index 0000000..b8916c3
--- /dev/null
@@ -0,0 +1,35 @@
+<domain type='kvm'>
+  <name>guest</name>
+  <uuid>63840878-0deb-4095-97e6-fc444d9bc9fa</uuid>
+  <memory unit='KiB'>1048576</memory>
+  <currentMemory unit='KiB'>1048576</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os firmware='bios'>
+    <type arch='x86_64' machine='pc-q35-10.0'>hvm</type>
+    <loader readonly='no' format='raw'/>
+    <boot dev='hd'/>
+  </os>
+  <features>
+    <acpi/>
+  </features>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>qemu64</model>
+  </cpu>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <controller type='usb' index='0' model='none'/>
+    <controller type='sata' index='0'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
+    </controller>
+    <controller type='pci' index='0' model='pcie-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <audio id='1' type='none'/>
+    <watchdog model='itco' action='reset'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxmlconfdata/firmware-auto-bios-rw.xml b/tests/qemuxmlconfdata/firmware-auto-bios-rw.xml
new file mode 100644 (file)
index 0000000..444273e
--- /dev/null
@@ -0,0 +1,18 @@
+<domain type='kvm'>
+  <name>guest</name>
+  <uuid>63840878-0deb-4095-97e6-fc444d9bc9fa</uuid>
+  <memory unit='KiB'>1048576</memory>
+  <vcpu placement='static'>1</vcpu>
+  <os firmware='bios'>
+    <type arch='x86_64' machine='pc-q35-10.0'>hvm</type>
+    <loader readonly='no'/>
+  </os>
+  <features>
+    <acpi/>
+  </features>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <controller type='usb' model='none'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
index 1a9dd3b1531f8d535560877a2af82517513ea7bb..37ddda56f69e73202f07fcb88342b55952d39e01 100644 (file)
@@ -1568,6 +1568,7 @@ mymain(void)
 
     DO_TEST_CAPS_LATEST("firmware-auto-bios");
     DO_TEST_CAPS_LATEST("firmware-auto-bios-stateless");
+    DO_TEST_CAPS_LATEST_FAILURE("firmware-auto-bios-rw");
     DO_TEST_CAPS_LATEST_PARSE_ERROR("firmware-auto-bios-not-stateless");
     DO_TEST_CAPS_LATEST_PARSE_ERROR("firmware-auto-bios-nvram");
     DO_TEST_CAPS_LATEST("firmware-auto-efi");