[PATCH 03/21] qemuxml2argvtest: Use real capabilities in tests for picking the aarch64 GIC version

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Convert 'aarch64-gic-default' and 'aarch64-gic-none' cases to use real
capabilities both latest and locked to 4.2.0 to show what would happen
with a real qemu.

Note that the qemuTestSetHostArch() calls are needed as real caps
override the setting once used. Once we convert all tests to real data
this can be dropped.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 ...=> aarch64-gic-default.aarch64-4.2.0.args} |  3 +-
 .../aarch64-gic-default.aarch64-latest.args   | 32 +++++++++++++++++++
 ...gs => aarch64-gic-none.aarch64-4.2.0.args} |  3 +-
 .../aarch64-gic-none.aarch64-latest.args      | 32 +++++++++++++++++++
 tests/qemuxml2argvtest.c                      | 26 ++++++++++++---
 5 files changed, 90 insertions(+), 6 deletions(-)
 rename tests/qemuxml2argvdata/{aarch64-gic-default.args => aarch64-gic-default.aarch64-4.2.0.args} (86%)
 create mode 100644 tests/qemuxml2argvdata/aarch64-gic-default.aarch64-latest.args
 rename tests/qemuxml2argvdata/{aarch64-gic-none.args => aarch64-gic-none.aarch64-4.2.0.args} (86%)
 create mode 100644 tests/qemuxml2argvdata/aarch64-gic-none.aarch64-latest.args

diff --git a/tests/qemuxml2argvdata/aarch64-gic-default.args b/tests/qemuxml2argvdata/aarch64-gic-default.aarch64-4.2.0.args
similarity index 86%
rename from tests/qemuxml2argvdata/aarch64-gic-default.args
rename to tests/qemuxml2argvdata/aarch64-gic-default.aarch64-4.2.0.args
index 07dd297842..34c9f79ea1 100644
--- a/tests/qemuxml2argvdata/aarch64-gic-default.args
+++ b/tests/qemuxml2argvdata/aarch64-gic-default.aarch64-4.2.0.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \
 -name guest=aarch64test,debug-threads=on \
 -S \
 -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes \
--machine virt,usb=off,gic-version=2,dump-guest-core=off \
+-machine virt-4.2,usb=off,gic-version=3,dump-guest-core=off \
 -accel kvm \
 -cpu host \
 -m 1024 \
@@ -27,4 +27,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \
 -no-acpi \
 -boot strict=on \
 -audiodev '{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
diff --git a/tests/qemuxml2argvdata/aarch64-gic-default.aarch64-latest.args b/tests/qemuxml2argvdata/aarch64-gic-default.aarch64-latest.args
new file mode 100644
index 0000000000..0d7a1c259a
--- /dev/null
+++ b/tests/qemuxml2argvdata/aarch64-gic-default.aarch64-latest.args
@@ -0,0 +1,32 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \
+/usr/bin/qemu-system-aarch64 \
+-name guest=aarch64test,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \
+-machine virt,usb=off,gic-version=3,dump-guest-core=off,memory-backend=mach-virt.ram \
+-accel kvm \
+-cpu host \
+-m 1024 \
+-object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":1073741824}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/aarch64-gic-none.args b/tests/qemuxml2argvdata/aarch64-gic-none.aarch64-4.2.0.args
similarity index 86%
rename from tests/qemuxml2argvdata/aarch64-gic-none.args
rename to tests/qemuxml2argvdata/aarch64-gic-none.aarch64-4.2.0.args
index 07dd297842..34c9f79ea1 100644
--- a/tests/qemuxml2argvdata/aarch64-gic-none.args
+++ b/tests/qemuxml2argvdata/aarch64-gic-none.aarch64-4.2.0.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \
 -name guest=aarch64test,debug-threads=on \
 -S \
 -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes \
--machine virt,usb=off,gic-version=2,dump-guest-core=off \
+-machine virt-4.2,usb=off,gic-version=3,dump-guest-core=off \
 -accel kvm \
 -cpu host \
 -m 1024 \
@@ -27,4 +27,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \
 -no-acpi \
 -boot strict=on \
 -audiodev '{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
diff --git a/tests/qemuxml2argvdata/aarch64-gic-none.aarch64-latest.args b/tests/qemuxml2argvdata/aarch64-gic-none.aarch64-latest.args
new file mode 100644
index 0000000000..0d7a1c259a
--- /dev/null
+++ b/tests/qemuxml2argvdata/aarch64-gic-none.aarch64-latest.args
@@ -0,0 +1,32 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \
+/usr/bin/qemu-system-aarch64 \
+-name guest=aarch64test,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \
+-machine virt,usb=off,gic-version=3,dump-guest-core=off,memory-backend=mach-virt.ram \
+-accel kvm \
+-cpu host \
+-m 1024 \
+-object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":1073741824}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 2e72ebf8e3..772caca47e 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2390,8 +2390,17 @@ mymain(void)
     DO_TEST("aarch64-cpu-passthrough",
             QEMU_CAPS_DEVICE_VIRTIO_MMIO,
             QEMU_CAPS_KVM);
-    DO_TEST_GIC("aarch64-gic-none", GIC_NONE,
-            QEMU_CAPS_KVM);
+    DO_TEST_FULL("aarch64-gic-none", ".aarch64-4.2.0",
+                 ARG_GIC, GIC_NONE,
+                 ARG_CAPS_ARCH, "aarch64",
+                 ARG_CAPS_VER, "4.2.0",
+                 ARG_END);
+    DO_TEST_FULL("aarch64-gic-none", ".aarch64-latest",
+                 ARG_GIC, GIC_NONE,
+                 ARG_CAPS_ARCH, "aarch64",
+                 ARG_CAPS_VER, "latest",
+                 ARG_END);
+    qemuTestSetHostArch(&driver, VIR_ARCH_AARCH64);
     DO_TEST_GIC("aarch64-gic-none-v2", GIC_V2,
             QEMU_CAPS_KVM);
     DO_TEST_GIC("aarch64-gic-none-v3", GIC_V3,
@@ -2399,8 +2408,17 @@ mymain(void)
     DO_TEST_GIC("aarch64-gic-none-both", GIC_BOTH,
             QEMU_CAPS_KVM);
     DO_TEST_FULL("aarch64-gic-none-tcg", "", ARG_GIC, GIC_BOTH, ARG_END);
-    DO_TEST_GIC("aarch64-gic-default", GIC_NONE,
-            QEMU_CAPS_KVM);
+    DO_TEST_FULL("aarch64-gic-default", ".aarch64-4.2.0",
+                 ARG_GIC, GIC_NONE,
+                 ARG_CAPS_ARCH, "aarch64",
+                 ARG_CAPS_VER, "4.2.0",
+                 ARG_END);
+    DO_TEST_FULL("aarch64-gic-default", ".aarch64-latest",
+                 ARG_GIC, GIC_NONE,
+                 ARG_CAPS_ARCH, "aarch64",
+                 ARG_CAPS_VER, "latest",
+                 ARG_END);
+    qemuTestSetHostArch(&driver, VIR_ARCH_AARCH64);
     DO_TEST_GIC("aarch64-gic-default-v2", GIC_V2,
             QEMU_CAPS_KVM);
     DO_TEST_GIC("aarch64-gic-default-v3", GIC_V3,
-- 
2.39.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux