Adding tests for the panic device model s390.

Signed-off-by: Boris Fiuczynski <fiu...@linux.vnet.ibm.com>
---
 tests/qemuxml2argvdata/qemuxml2argv-panic-s390.xml | 22 ++++++++++++++++
 .../qemuxml2argv-s390-panic-address.xml            | 26 +++++++++++++++++++
 .../qemuxml2argv-s390-panic-missing.args           | 25 +++++++++++++++++++
 .../qemuxml2argv-s390-panic-missing.xml            | 23 +++++++++++++++++
 .../qemuxml2argv-s390-panic-no-address.args        | 25 +++++++++++++++++++
 .../qemuxml2argv-s390-panic-no-address.xml         | 24 ++++++++++++++++++
 tests/qemuxml2argvtest.c                           | 11 +++++++-
 .../qemuxml2xmlout-panic-s390.xml                  | 28 +++++++++++++++++++++
 .../qemuxml2xmlout-s390-panic-missing.xml          | 29 ++++++++++++++++++++++
 tests/qemuxml2xmltest.c                            |  4 +++
 10 files changed, 216 insertions(+), 1 deletion(-)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-panic-s390.xml
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic-address.xml
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.xml
 create mode 100644 
tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.args
 create mode 100644 
tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-s390.xml
 create mode 100644 
tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic-missing.xml

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-panic-s390.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-panic-s390.xml
new file mode 100644
index 0000000..432a04c
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-panic-s390.xml
@@ -0,0 +1,22 @@
+<domain type='kvm'>
+  <name>test</name>
+  <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid>
+  <memory>262144</memory>
+  <currentMemory>262144</currentMemory>
+  <os>
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-kvm</emulator>
+    <controller type='virtio-serial' index='0'>
+    </controller>
+    <console type='pty'>
+      <target type='virtio'/>
+    </console>
+    <panic/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-address.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-address.xml
new file mode 100644
index 0000000..94521d0
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-address.xml
@@ -0,0 +1,26 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid>
+  <memory>262144</memory>
+  <currentMemory>262144</currentMemory>
+  <os>
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-s390x</emulator>
+    <controller type='virtio-serial' index='0'>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+    </controller>
+    <console type='pty'>
+      <target type='virtio'/>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+    </console>
+    <panic model='s390'>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0005'/>
+    </panic>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.args 
b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.args
new file mode 100644
index 0000000..f2eec5b
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.args
@@ -0,0 +1,25 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-s390x \
+-name QEMUGuest1 \
+-S \
+-M s390-ccw-virtio \
+-m 256 \
+-smp 1 \
+-uuid 9aa4b45c-b9dd-45ef-91fe-862b27b4231f \
+-nographic \
+-nodefconfig \
+-nodefaults \
+-chardev 
socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline \
+-no-acpi \
+-boot c \
+-device virtio-serial-ccw,id=virtio-serial0,devno=fe.0.0000 \
+-chardev pty,id=charconsole0 \
+-device virtconsole,chardev=charconsole0,id=console0 \
+-device virtio-balloon-ccw,id=balloon0,devno=fe.0.0002
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.xml
new file mode 100644
index 0000000..8955433
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.xml
@@ -0,0 +1,23 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid>
+  <memory>262144</memory>
+  <currentMemory>262144</currentMemory>
+  <os>
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-s390x</emulator>
+    <controller type='virtio-serial' index='0'>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+    </controller>
+    <console type='pty'>
+      <target type='virtio'/>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+    </console>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.args 
b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.args
new file mode 100644
index 0000000..f2eec5b
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.args
@@ -0,0 +1,25 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-s390x \
+-name QEMUGuest1 \
+-S \
+-M s390-ccw-virtio \
+-m 256 \
+-smp 1 \
+-uuid 9aa4b45c-b9dd-45ef-91fe-862b27b4231f \
+-nographic \
+-nodefconfig \
+-nodefaults \
+-chardev 
socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline \
+-no-acpi \
+-boot c \
+-device virtio-serial-ccw,id=virtio-serial0,devno=fe.0.0000 \
+-chardev pty,id=charconsole0 \
+-device virtconsole,chardev=charconsole0,id=console0 \
+-device virtio-balloon-ccw,id=balloon0,devno=fe.0.0002
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.xml
new file mode 100644
index 0000000..856bcbe
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.xml
@@ -0,0 +1,24 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid>
+  <memory>262144</memory>
+  <currentMemory>262144</currentMemory>
+  <os>
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-s390x</emulator>
+    <controller type='virtio-serial' index='0'>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+    </controller>
+    <console type='pty'>
+      <target type='virtio'/>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+    </console>
+    <panic model='s390'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index be74178..5d6b69c 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1462,11 +1462,20 @@ mymain(void)
             QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG,
             QEMU_CAPS_BOOTINDEX, QEMU_CAPS_VIRTIO_S390,
             QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM);
-
     DO_TEST("s390-allow-bogus-usb-controller",
             QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG,
             QEMU_CAPS_BOOTINDEX, QEMU_CAPS_VIRTIO_S390,
             QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM);
+    DO_TEST("s390-panic-no-address",
+            QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG,
+            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+    DO_TEST_FAILURE("s390-panic-address",
+            QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG,
+            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+    DO_TEST("s390-panic-missing",
+            QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG,
+            QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+
 
     DO_TEST("ppc-dtb", QEMU_CAPS_KVM, QEMU_CAPS_DTB);
     DO_TEST("ppce500-serial", QEMU_CAPS_KVM, QEMU_CAPS_CHARDEV);
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-s390.xml 
b/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-s390.xml
new file mode 100644
index 0000000..12fc687
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-s390.xml
@@ -0,0 +1,28 @@
+<domain type='kvm'>
+  <name>test</name>
+  <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid>
+  <memory unit='KiB'>262144</memory>
+  <currentMemory unit='KiB'>262144</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-kvm</emulator>
+    <controller type='virtio-serial' index='0'>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+    </controller>
+    <console type='pty'>
+      <target type='virtio' port='0'/>
+    </console>
+    <memballoon model='virtio'>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+    </memballoon>
+    <panic model='s390'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic-missing.xml 
b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic-missing.xml
new file mode 100644
index 0000000..8864157
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic-missing.xml
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid>
+  <memory unit='KiB'>262144</memory>
+  <currentMemory unit='KiB'>262144</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-s390x</emulator>
+    <controller type='virtio-serial' index='0'>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+    </controller>
+    <console type='pty'>
+      <target type='virtio' port='0'/>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+    </console>
+    <memballoon model='virtio'>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0002'/>
+    </memballoon>
+    <panic model='s390'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index f4093f1..4f3faee 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -686,6 +686,10 @@ mymain(void)
 
     DO_TEST_FULL("s390-defaultconsole", WHEN_ACTIVE,
                  QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+    DO_TEST_FULL("panic-s390", WHEN_ACTIVE,
+                 QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+    DO_TEST_FULL("s390-panic-missing", WHEN_ACTIVE,
+                 QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
 
     DO_TEST("pcihole64");
     DO_TEST("pcihole64-gib");
-- 
2.3.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to