libvirt/SOURCES/libvirt-tests-Add-test-case-for-the-armvtimer-timer.patch
2021-09-10 11:58:15 +00:00

137 lines
5.0 KiB
Diff

From 18f28324129e34a486c5df049785d7ee04960f1d Mon Sep 17 00:00:00 2001
Message-Id: <18f28324129e34a486c5df049785d7ee04960f1d@dist-git>
From: Andrea Bolognani <abologna@redhat.com>
Date: Fri, 14 Feb 2020 14:14:51 +0100
Subject: [PATCH] tests: Add test case for the armvtimer timer
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 76121fc9c49d26c1ca4f596c3cac5c05eb02fc76)
https://bugzilla.redhat.com/show_bug.cgi?id=1762634
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Message-Id: <20200214131451.707092-1-abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
.../clock-timer-armvtimer.aarch64-latest.args | 32 +++++++++++++++++++
.../clock-timer-armvtimer.xml | 27 ++++++++++++++++
tests/qemuxml2argvtest.c | 2 ++
.../clock-timer-armvtimer.aarch64-latest.xml | 1 +
tests/qemuxml2xmltest.c | 1 +
5 files changed, 63 insertions(+)
create mode 100644 tests/qemuxml2argvdata/clock-timer-armvtimer.aarch64-latest.args
create mode 100644 tests/qemuxml2argvdata/clock-timer-armvtimer.xml
create mode 120000 tests/qemuxml2xmloutdata/clock-timer-armvtimer.aarch64-latest.xml
diff --git a/tests/qemuxml2argvdata/clock-timer-armvtimer.aarch64-latest.args b/tests/qemuxml2argvdata/clock-timer-armvtimer.aarch64-latest.args
new file mode 100644
index 0000000000..a1faa97b9f
--- /dev/null
+++ b/tests/qemuxml2argvdata/clock-timer-armvtimer.aarch64-latest.args
@@ -0,0 +1,32 @@
+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-aarch64 \
+-name guest=guest,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-guest/master-key.aes \
+-machine virt,accel=kvm,usb=off,dump-guest-core=off,gic-version=3 \
+-cpu host,kvm-no-adjvtime=on \
+-m 4096 \
+-overcommit mem-lock=off \
+-smp 4,sockets=4,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 \
+-no-acpi \
+-boot strict=on \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/clock-timer-armvtimer.xml b/tests/qemuxml2argvdata/clock-timer-armvtimer.xml
new file mode 100644
index 0000000000..295ab64d75
--- /dev/null
+++ b/tests/qemuxml2argvdata/clock-timer-armvtimer.xml
@@ -0,0 +1,27 @@
+<domain type='kvm'>
+ <name>guest</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='aarch64' machine='virt'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <gic version='3'/>
+ </features>
+ <cpu mode='host-passthrough' check='none'/>
+ <clock offset='utc'>
+ <timer name='armvtimer' tickpolicy='discard'/>
+ </clock>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <controller type='usb' index='0' model='none'/>
+ <controller type='pci' index='0' model='pcie-root'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 4d26fe0b55..508dfee3fb 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2721,6 +2721,8 @@ mymain(void)
/* SVE aarch64 CPU features work on modern QEMU */
DO_TEST_CAPS_ARCH_LATEST("aarch64-features-sve", "aarch64");
+ DO_TEST_CAPS_ARCH_LATEST("clock-timer-armvtimer", "aarch64");
+
qemuTestSetHostArch(&driver, VIR_ARCH_NONE);
DO_TEST("kvm-pit-delay", QEMU_CAPS_KVM_PIT_TICK_POLICY);
diff --git a/tests/qemuxml2xmloutdata/clock-timer-armvtimer.aarch64-latest.xml b/tests/qemuxml2xmloutdata/clock-timer-armvtimer.aarch64-latest.xml
new file mode 120000
index 0000000000..4bfddd6573
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/clock-timer-armvtimer.aarch64-latest.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/clock-timer-armvtimer.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index e54c540ef6..6a8ae9f7eb 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -269,6 +269,7 @@ mymain(void)
DO_TEST("clock-catchup", QEMU_CAPS_KVM_PIT_TICK_POLICY);
DO_TEST("kvmclock", NONE);
DO_TEST("clock-timer-hyperv-rtc", NONE);
+ DO_TEST_CAPS_ARCH_LATEST("clock-timer-armvtimer", "aarch64");
DO_TEST("cpu-eoi-disabled", NONE);
DO_TEST("cpu-eoi-enabled", NONE);
--
2.25.0