]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Add pseries-spaprvio-invalid
authorAndrea Bolognani <abologna@redhat.com>
Fri, 14 Jun 2019 10:50:43 +0000 (12:50 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 20 Jun 2019 10:50:01 +0000 (12:50 +0200)
This test case shows that we now reject invalid spapr-vio
addresses.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/qemuxml2argvdata/pseries-spaprvio-invalid.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c

diff --git a/tests/qemuxml2argvdata/pseries-spaprvio-invalid.xml b/tests/qemuxml2argvdata/pseries-spaprvio-invalid.xml
new file mode 100644 (file)
index 0000000..cd658e3
--- /dev/null
@@ -0,0 +1,17 @@
+<domain type='qemu'>
+  <name>guest</name>
+  <uuid>b35969f7-e7cf-4d90-a9a0-4dd9000f9824</uuid>
+  <memory unit='KiB'>4194304</memory>
+  <vcpu placement='static'>4</vcpu>
+  <os>
+    <type arch='ppc64le' machine='pseries'>hvm</type>
+  </os>
+  <devices>
+    <emulator>/usr/bin/qemu-system-ppc64</emulator>
+    <serial type='pty'>
+      <!-- spapr-vio addresses are 32-bit, so they can go up to 0xffffffff:
+           the value below is too big and should be rejected -->
+      <address type='spapr-vio' reg='0x0000000100000000'/>
+    </serial>
+  </devices>
+</domain>
index 90a35e7fd66d5373bbf65259db8b9013e677cd90..dc56e7ac6240fda1d87f87cc61af5091f00c9152 100644 (file)
@@ -1910,6 +1910,7 @@ mymain(void)
     DO_TEST("pseries-console-virtio",
             QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE);
     DO_TEST_PARSE_ERROR("pseries-serial-invalid-machine", NONE);
+    DO_TEST_PARSE_ERROR("pseries-spaprvio-invalid", "ppc64");
 
     DO_TEST("mach-virt-serial-native",
             QEMU_CAPS_DEVICE_PL011);