render / rpms / libvirt

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