b971b8
From 0e378fc059e8fc52e665910b6c87719750cb6dbe Mon Sep 17 00:00:00 2001
b971b8
Message-Id: <0e378fc059e8fc52e665910b6c87719750cb6dbe@dist-git>
b971b8
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
b971b8
Date: Wed, 1 Apr 2020 17:19:25 +0200
b971b8
Subject: [PATCH] tests: qemu: add disk-error-policy tests for s390x
b971b8
MIME-Version: 1.0
b971b8
Content-Type: text/plain; charset=UTF-8
b971b8
Content-Transfer-Encoding: 8bit
b971b8
b971b8
To demonstrate the move of these attributes from -drive to -device.
b971b8
b971b8
Signed-off-by: Ján Tomko <jtomko@redhat.com>
b971b8
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
b971b8
(cherry picked from commit 248d205171c9927b6d0e0077d2f3d9996c5540d9)
b971b8
Signed-off-by: Ján Tomko <jtomko@redhat.com>
b971b8
https://bugzilla.redhat.com/show_bug.cgi?id=1819250
b971b8
b971b8
Conflicts: the -latest.args file has an extra "-cpu qemu" upstream
b971b8
Message-Id: <5bec690d10f7d452d47fbf2db7dd24e7e855fe1b.1585754141.git.jtomko@redhat.com>
b971b8
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
b971b8
---
b971b8
 .../disk-error-policy-s390x.s390x-2.12.0.args | 42 +++++++++++++++++++
b971b8
 .../disk-error-policy-s390x.s390x-latest.args | 42 +++++++++++++++++++
b971b8
 .../disk-error-policy-s390x.xml               | 37 ++++++++++++++++
b971b8
 tests/qemuxml2argvtest.c                      |  2 +
b971b8
 4 files changed, 123 insertions(+)
b971b8
 create mode 100644 tests/qemuxml2argvdata/disk-error-policy-s390x.s390x-2.12.0.args
b971b8
 create mode 100644 tests/qemuxml2argvdata/disk-error-policy-s390x.s390x-latest.args
b971b8
 create mode 100644 tests/qemuxml2argvdata/disk-error-policy-s390x.xml
b971b8
b971b8
diff --git a/tests/qemuxml2argvdata/disk-error-policy-s390x.s390x-2.12.0.args b/tests/qemuxml2argvdata/disk-error-policy-s390x.s390x-2.12.0.args
b971b8
new file mode 100644
b971b8
index 0000000000..cf932d1fad
b971b8
--- /dev/null
b971b8
+++ b/tests/qemuxml2argvdata/disk-error-policy-s390x.s390x-2.12.0.args
b971b8
@@ -0,0 +1,42 @@
b971b8
+LC_ALL=C \
b971b8
+PATH=/bin \
b971b8
+HOME=/tmp/lib/domain--1-guest \
b971b8
+USER=test \
b971b8
+LOGNAME=test \
b971b8
+XDG_DATA_HOME=/tmp/lib/domain--1-guest/.local/share \
b971b8
+XDG_CACHE_HOME=/tmp/lib/domain--1-guest/.cache \
b971b8
+XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
b971b8
+QEMU_AUDIO_DRV=none \
b971b8
+/usr/bin/qemu-system-s390x \
b971b8
+-name guest=guest,debug-threads=on \
b971b8
+-S \
b971b8
+-object secret,id=masterKey0,format=raw,\
b971b8
+file=/tmp/lib/domain--1-guest/master-key.aes \
b971b8
+-machine s390-ccw-virtio-2.12,accel=tcg,usb=off,dump-guest-core=off \
b971b8
+-m 214 \
b971b8
+-realtime mlock=off \
b971b8
+-smp 1,sockets=1,cores=1,threads=1 \
b971b8
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
b971b8
+-display none \
b971b8
+-no-user-config \
b971b8
+-nodefaults \
b971b8
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
b971b8
+-mon chardev=charmonitor,id=monitor,mode=control \
b971b8
+-rtc base=utc \
b971b8
+-no-shutdown \
b971b8
+-boot strict=on \
b971b8
+-drive file=/var/images/image1,format=qcow2,if=none,id=drive-virtio-disk0,\
b971b8
+werror=stop,rerror=stop,cache=none \
b971b8
+-device virtio-blk-ccw,scsi=off,devno=fe.0.0000,drive=drive-virtio-disk0,\
b971b8
+id=virtio-disk0,bootindex=1,write-cache=on \
b971b8
+-drive file=/var/images/image2,format=qcow2,if=none,id=drive-virtio-disk1,\
b971b8
+werror=enospc,cache=none \
b971b8
+-device virtio-blk-ccw,scsi=off,devno=fe.0.0001,drive=drive-virtio-disk1,\
b971b8
+id=virtio-disk1,write-cache=on \
b971b8
+-drive file=/var/images/image3,format=qcow2,if=none,id=drive-virtio-disk2,\
b971b8
+werror=report,rerror=ignore,cache=none \
b971b8
+-device virtio-blk-ccw,scsi=off,devno=fe.0.0002,drive=drive-virtio-disk2,\
b971b8
+id=virtio-disk2,write-cache=on \
b971b8
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
b971b8
+resourcecontrol=deny \
b971b8
+-msg timestamp=on
b971b8
diff --git a/tests/qemuxml2argvdata/disk-error-policy-s390x.s390x-latest.args b/tests/qemuxml2argvdata/disk-error-policy-s390x.s390x-latest.args
b971b8
new file mode 100644
b971b8
index 0000000000..5748ad7823
b971b8
--- /dev/null
b971b8
+++ b/tests/qemuxml2argvdata/disk-error-policy-s390x.s390x-latest.args
b971b8
@@ -0,0 +1,42 @@
b971b8
+LC_ALL=C \
b971b8
+PATH=/bin \
b971b8
+HOME=/tmp/lib/domain--1-guest \
b971b8
+USER=test \
b971b8
+LOGNAME=test \
b971b8
+XDG_DATA_HOME=/tmp/lib/domain--1-guest/.local/share \
b971b8
+XDG_CACHE_HOME=/tmp/lib/domain--1-guest/.cache \
b971b8
+XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
b971b8
+QEMU_AUDIO_DRV=none \
b971b8
+/usr/bin/qemu-system-s390x \
b971b8
+-name guest=guest,debug-threads=on \
b971b8
+-S \
b971b8
+-object secret,id=masterKey0,format=raw,\
b971b8
+file=/tmp/lib/domain--1-guest/master-key.aes \
b971b8
+-machine s390-ccw-virtio,accel=tcg,usb=off,dump-guest-core=off \
b971b8
+-m 214 \
b971b8
+-overcommit mem-lock=off \
b971b8
+-smp 1,sockets=1,cores=1,threads=1 \
b971b8
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
b971b8
+-display none \
b971b8
+-no-user-config \
b971b8
+-nodefaults \
b971b8
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
b971b8
+-mon chardev=charmonitor,id=monitor,mode=control \
b971b8
+-rtc base=utc \
b971b8
+-no-shutdown \
b971b8
+-boot strict=on \
b971b8
+-drive file=/var/images/image1,format=qcow2,if=none,id=drive-virtio-disk0,\
b971b8
+werror=stop,rerror=stop,cache=none \
b971b8
+-device virtio-blk-ccw,scsi=off,devno=fe.0.0000,drive=drive-virtio-disk0,\
b971b8
+id=virtio-disk0,bootindex=1,write-cache=on \
b971b8
+-drive file=/var/images/image2,format=qcow2,if=none,id=drive-virtio-disk1,\
b971b8
+werror=enospc,cache=none \
b971b8
+-device virtio-blk-ccw,scsi=off,devno=fe.0.0001,drive=drive-virtio-disk1,\
b971b8
+id=virtio-disk1,write-cache=on \
b971b8
+-drive file=/var/images/image3,format=qcow2,if=none,id=drive-virtio-disk2,\
b971b8
+werror=report,rerror=ignore,cache=none \
b971b8
+-device virtio-blk-ccw,scsi=off,devno=fe.0.0002,drive=drive-virtio-disk2,\
b971b8
+id=virtio-disk2,write-cache=on \
b971b8
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
b971b8
+resourcecontrol=deny \
b971b8
+-msg timestamp=on
b971b8
diff --git a/tests/qemuxml2argvdata/disk-error-policy-s390x.xml b/tests/qemuxml2argvdata/disk-error-policy-s390x.xml
b971b8
new file mode 100644
b971b8
index 0000000000..7149e66d70
b971b8
--- /dev/null
b971b8
+++ b/tests/qemuxml2argvdata/disk-error-policy-s390x.xml
b971b8
@@ -0,0 +1,37 @@
b971b8
+<domain type='qemu'>
b971b8
+  <name>guest</name>
b971b8
+  <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
b971b8
+  <memory unit='KiB'>219136</memory>
b971b8
+  <currentMemory unit='KiB'>219136</currentMemory>
b971b8
+  <vcpu placement='static'>1</vcpu>
b971b8
+  <os>
b971b8
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
b971b8
+    <boot dev='hd'/>
b971b8
+  </os>
b971b8
+  <clock offset='utc'/>
b971b8
+  <on_poweroff>destroy</on_poweroff>
b971b8
+  <on_reboot>restart</on_reboot>
b971b8
+  <on_crash>destroy</on_crash>
b971b8
+  <devices>
b971b8
+    <emulator>/usr/bin/qemu-system-s390x</emulator>
b971b8
+    <disk type='file' device='disk'>
b971b8
+      <driver name='qemu' type='qcow2' cache='none' error_policy='stop'/>
b971b8
+      <source file='/var/images/image1'/>
b971b8
+      <target dev='vda' bus='virtio'/>
b971b8
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
b971b8
+    </disk>
b971b8
+    <disk type='file' device='disk'>
b971b8
+      <driver name='qemu' type='qcow2' cache='none' error_policy='enospace'/>
b971b8
+      <source file='/var/images/image2'/>
b971b8
+      <target dev='vdb' bus='virtio'/>
b971b8
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
b971b8
+    </disk>
b971b8
+    <disk type='file' device='disk'>
b971b8
+      <driver name='qemu' type='qcow2' cache='none' error_policy='report' rerror_policy='ignore'/>
b971b8
+      <source file='/var/images/image3'/>
b971b8
+      <target dev='vdc' bus='virtio'/>
b971b8
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0002'/>
b971b8
+    </disk>
b971b8
+    <memballoon model='none'/>
b971b8
+  </devices>
b971b8
+</domain>
b971b8
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
b971b8
index 7bc01d55d5..d6c5f436ae 100644
b971b8
--- a/tests/qemuxml2argvtest.c
b971b8
+++ b/tests/qemuxml2argvtest.c
b971b8
@@ -1051,6 +1051,8 @@ mymain(void)
b971b8
     DO_TEST("disk-error-policy", NONE);
b971b8
     DO_TEST_CAPS_VER("disk-error-policy", "2.12.0");
b971b8
     DO_TEST_CAPS_LATEST("disk-error-policy");
b971b8
+    DO_TEST_CAPS_ARCH_VER("disk-error-policy-s390x", "s390x", "2.12.0");
b971b8
+    DO_TEST_CAPS_ARCH_LATEST("disk-error-policy-s390x", "s390x");
b971b8
     DO_TEST_CAPS_VER("disk-cache", "1.5.3");
b971b8
     DO_TEST_CAPS_VER("disk-cache", "2.6.0");
b971b8
     DO_TEST_CAPS_VER("disk-cache", "2.7.0");
b971b8
-- 
b971b8
2.26.2
b971b8