render / rpms / libvirt

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