render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
Blob Blame History Raw
From 0e378fc059e8fc52e665910b6c87719750cb6dbe Mon Sep 17 00:00:00 2001
Message-Id: <0e378fc059e8fc52e665910b6c87719750cb6dbe@dist-git>
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Wed, 1 Apr 2020 17:19:25 +0200
Subject: [PATCH] tests: qemu: add disk-error-policy tests for s390x
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

To demonstrate the move of these attributes from -drive to -device.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 248d205171c9927b6d0e0077d2f3d9996c5540d9)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=1819250

Conflicts: the -latest.args file has an extra "-cpu qemu" upstream
Message-Id: <5bec690d10f7d452d47fbf2db7dd24e7e855fe1b.1585754141.git.jtomko@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
---
 .../disk-error-policy-s390x.s390x-2.12.0.args | 42 +++++++++++++++++++
 .../disk-error-policy-s390x.s390x-latest.args | 42 +++++++++++++++++++
 .../disk-error-policy-s390x.xml               | 37 ++++++++++++++++
 tests/qemuxml2argvtest.c                      |  2 +
 4 files changed, 123 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/disk-error-policy-s390x.s390x-2.12.0.args
 create mode 100644 tests/qemuxml2argvdata/disk-error-policy-s390x.s390x-latest.args
 create mode 100644 tests/qemuxml2argvdata/disk-error-policy-s390x.xml

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
new file mode 100644
index 0000000000..cf932d1fad
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-error-policy-s390x.s390x-2.12.0.args
@@ -0,0 +1,42 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-guest \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-guest/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-guest/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-s390x \
+-name guest=guest,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-guest/master-key.aes \
+-machine s390-ccw-virtio-2.12,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-boot strict=on \
+-drive file=/var/images/image1,format=qcow2,if=none,id=drive-virtio-disk0,\
+werror=stop,rerror=stop,cache=none \
+-device virtio-blk-ccw,scsi=off,devno=fe.0.0000,drive=drive-virtio-disk0,\
+id=virtio-disk0,bootindex=1,write-cache=on \
+-drive file=/var/images/image2,format=qcow2,if=none,id=drive-virtio-disk1,\
+werror=enospc,cache=none \
+-device virtio-blk-ccw,scsi=off,devno=fe.0.0001,drive=drive-virtio-disk1,\
+id=virtio-disk1,write-cache=on \
+-drive file=/var/images/image3,format=qcow2,if=none,id=drive-virtio-disk2,\
+werror=report,rerror=ignore,cache=none \
+-device virtio-blk-ccw,scsi=off,devno=fe.0.0002,drive=drive-virtio-disk2,\
+id=virtio-disk2,write-cache=on \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/disk-error-policy-s390x.s390x-latest.args b/tests/qemuxml2argvdata/disk-error-policy-s390x.s390x-latest.args
new file mode 100644
index 0000000000..5748ad7823
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-error-policy-s390x.s390x-latest.args
@@ -0,0 +1,42 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-guest \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-guest/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-guest/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-s390x \
+-name guest=guest,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-guest/master-key.aes \
+-machine s390-ccw-virtio,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-boot strict=on \
+-drive file=/var/images/image1,format=qcow2,if=none,id=drive-virtio-disk0,\
+werror=stop,rerror=stop,cache=none \
+-device virtio-blk-ccw,scsi=off,devno=fe.0.0000,drive=drive-virtio-disk0,\
+id=virtio-disk0,bootindex=1,write-cache=on \
+-drive file=/var/images/image2,format=qcow2,if=none,id=drive-virtio-disk1,\
+werror=enospc,cache=none \
+-device virtio-blk-ccw,scsi=off,devno=fe.0.0001,drive=drive-virtio-disk1,\
+id=virtio-disk1,write-cache=on \
+-drive file=/var/images/image3,format=qcow2,if=none,id=drive-virtio-disk2,\
+werror=report,rerror=ignore,cache=none \
+-device virtio-blk-ccw,scsi=off,devno=fe.0.0002,drive=drive-virtio-disk2,\
+id=virtio-disk2,write-cache=on \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/disk-error-policy-s390x.xml b/tests/qemuxml2argvdata/disk-error-policy-s390x.xml
new file mode 100644
index 0000000000..7149e66d70
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-error-policy-s390x.xml
@@ -0,0 +1,37 @@
+<domain type='qemu'>
+  <name>guest</name>
+  <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</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>
+    <disk type='file' device='disk'>
+      <driver name='qemu' type='qcow2' cache='none' error_policy='stop'/>
+      <source file='/var/images/image1'/>
+      <target dev='vda' bus='virtio'/>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+    </disk>
+    <disk type='file' device='disk'>
+      <driver name='qemu' type='qcow2' cache='none' error_policy='enospace'/>
+      <source file='/var/images/image2'/>
+      <target dev='vdb' bus='virtio'/>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+    </disk>
+    <disk type='file' device='disk'>
+      <driver name='qemu' type='qcow2' cache='none' error_policy='report' rerror_policy='ignore'/>
+      <source file='/var/images/image3'/>
+      <target dev='vdc' bus='virtio'/>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0002'/>
+    </disk>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 7bc01d55d5..d6c5f436ae 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1051,6 +1051,8 @@ mymain(void)
     DO_TEST("disk-error-policy", NONE);
     DO_TEST_CAPS_VER("disk-error-policy", "2.12.0");
     DO_TEST_CAPS_LATEST("disk-error-policy");
+    DO_TEST_CAPS_ARCH_VER("disk-error-policy-s390x", "s390x", "2.12.0");
+    DO_TEST_CAPS_ARCH_LATEST("disk-error-policy-s390x", "s390x");
     DO_TEST_CAPS_VER("disk-cache", "1.5.3");
     DO_TEST_CAPS_VER("disk-cache", "2.6.0");
     DO_TEST_CAPS_VER("disk-cache", "2.7.0");
-- 
2.26.2