render / rpms / libvirt

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