]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Reorganize and simplify GIC test cases
authorAndrea Bolognani <abologna@redhat.com>
Wed, 3 Feb 2016 15:58:20 +0000 (16:58 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 16 Feb 2016 14:39:57 +0000 (15:39 +0100)
Unify the naming to prepare for new test cases that will be added
later on.

Convert a couple of output XML files for the qemuxml2xml test to
symlinks while at it, since they were identical to the corresponding
input XML files anyways.

Moreover, since we're only interested in testing GIC support here,
simplify XML files by getting rid of the unrelevant bits.

tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.args [moved from tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic.args with 57% similarity]
tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.xml [moved from tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic.xml with 61% similarity]
tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v3.args [moved from tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.args with 55% similarity]
tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v3.xml [moved from tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gicv3.xml with 61% similarity]
tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic.xml [deleted file]
tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.xml [deleted file]
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-v2.xml [new symlink]
tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-v3.xml [new symlink]
tests/qemuxml2xmltest.c

similarity index 57%
rename from tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic.args
rename to tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.args
index be19ea4e1695e7ea5425f7a56fc9551c7065700a..d30f4493b2b5727bfcbd8b648932795eee87584f 100644 (file)
@@ -7,19 +7,14 @@ QEMU_AUDIO_DRV=none \
 /usr/bin/qemu-system-aarch64 \
 -name aarch64test \
 -S \
--M virt \
--no-kvm \
--cpu cortex-a53 \
+-machine virt,accel=kvm \
+-cpu host \
 -m 1024 \
 -smp 1 \
 -uuid 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f \
 -nographic \
 -nodefaults \
 -monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi \
 -boot c \
--kernel /aarch64.kernel \
--initrd /aarch64.initrd \
--append console=ttyAMA0 \
--usb \
--net nic,macaddr=52:54:00:09:a4:37,vlan=0,model=virtio,name=net0 \
--net user,vlan=0,name=hostnet0
+-usb
similarity index 61%
rename from tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic.xml
rename to tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.xml
index cb595e4a7a6b1183a49a471728791942f6d9f43e..9ccba9904228de87fa1bc69e58ff375da2df4dd9 100644 (file)
@@ -1,4 +1,4 @@
-<domain type='qemu'>
+<domain type='kvm'>
   <name>aarch64test</name>
   <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid>
   <memory unit='KiB'>1048576</memory>
@@ -6,27 +6,17 @@
   <vcpu placement='static'>1</vcpu>
   <os>
     <type arch='aarch64' machine='virt'>hvm</type>
-    <kernel>/aarch64.kernel</kernel>
-    <initrd>/aarch64.initrd</initrd>
-    <cmdline>console=ttyAMA0</cmdline>
     <boot dev='hd'/>
   </os>
   <features>
-    <acpi/>
     <gic version='2'/>
   </features>
-  <cpu mode='custom' match='exact'>
-    <model fallback='allow'>cortex-a53</model>
-  </cpu>
+  <cpu mode='host-passthrough'/>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-aarch64</emulator>
-    <interface type='user'>
-      <mac address='52:54:00:09:a4:37'/>
-      <model type='virtio'/>
-    </interface>
   </devices>
 </domain>
similarity index 55%
rename from tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.args
rename to tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v3.args
index a3530bbc0dcbb2b061e1a01a3fcde1cd4f258146..9cd86acc67104037d133015d38febf78998a4ed0 100644 (file)
@@ -7,18 +7,14 @@ QEMU_AUDIO_DRV=none \
 /usr/bin/qemu-system-aarch64 \
 -name aarch64test \
 -S \
--machine virt,accel=tcg,gic-version=3 \
--cpu cortex-a53 \
+-machine virt,accel=kvm,gic-version=3 \
+-cpu host \
 -m 1024 \
 -smp 1 \
 -uuid 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f \
 -nographic \
 -nodefaults \
 -monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi \
 -boot c \
--kernel /aarch64.kernel \
--initrd /aarch64.initrd \
--append console=ttyAMA0 \
--usb \
--net nic,macaddr=52:54:00:09:a4:37,vlan=0,model=virtio,name=net0 \
--net user,vlan=0,name=hostnet0
+-usb
similarity index 61%
rename from tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gicv3.xml
rename to tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v3.xml
index 72aaaf7fe5cdabd9b02d3f3bc7da41dc71f6d913..7c9ee92b3923ce61089d8600468820ce47b939cb 100644 (file)
@@ -1,4 +1,4 @@
-<domain type='qemu'>
+<domain type='kvm'>
   <name>aarch64test</name>
   <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid>
   <memory unit='KiB'>1048576</memory>
@@ -6,27 +6,17 @@
   <vcpu placement='static'>1</vcpu>
   <os>
     <type arch='aarch64' machine='virt'>hvm</type>
-    <kernel>/aarch64.kernel</kernel>
-    <initrd>/aarch64.initrd</initrd>
-    <cmdline>console=ttyAMA0</cmdline>
     <boot dev='hd'/>
   </os>
   <features>
-    <acpi/>
     <gic version='3'/>
   </features>
-  <cpu mode='custom' match='exact'>
-    <model fallback='allow'>cortex-a53</model>
-  </cpu>
+  <cpu mode='host-passthrough'/>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-aarch64</emulator>
-    <interface type='user'>
-      <mac address='52:54:00:09:a4:37'/>
-      <model type='virtio'/>
-    </interface>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic.xml
deleted file mode 100644 (file)
index cb595e4..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<domain type='qemu'>
-  <name>aarch64test</name>
-  <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid>
-  <memory unit='KiB'>1048576</memory>
-  <currentMemory unit='KiB'>1048576</currentMemory>
-  <vcpu placement='static'>1</vcpu>
-  <os>
-    <type arch='aarch64' machine='virt'>hvm</type>
-    <kernel>/aarch64.kernel</kernel>
-    <initrd>/aarch64.initrd</initrd>
-    <cmdline>console=ttyAMA0</cmdline>
-    <boot dev='hd'/>
-  </os>
-  <features>
-    <acpi/>
-    <gic version='2'/>
-  </features>
-  <cpu mode='custom' match='exact'>
-    <model fallback='allow'>cortex-a53</model>
-  </cpu>
-  <clock offset='utc'/>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>destroy</on_crash>
-  <devices>
-    <emulator>/usr/bin/qemu-system-aarch64</emulator>
-    <interface type='user'>
-      <mac address='52:54:00:09:a4:37'/>
-      <model type='virtio'/>
-    </interface>
-  </devices>
-</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.xml
deleted file mode 100644 (file)
index 72aaaf7..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<domain type='qemu'>
-  <name>aarch64test</name>
-  <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid>
-  <memory unit='KiB'>1048576</memory>
-  <currentMemory unit='KiB'>1048576</currentMemory>
-  <vcpu placement='static'>1</vcpu>
-  <os>
-    <type arch='aarch64' machine='virt'>hvm</type>
-    <kernel>/aarch64.kernel</kernel>
-    <initrd>/aarch64.initrd</initrd>
-    <cmdline>console=ttyAMA0</cmdline>
-    <boot dev='hd'/>
-  </os>
-  <features>
-    <acpi/>
-    <gic version='3'/>
-  </features>
-  <cpu mode='custom' match='exact'>
-    <model fallback='allow'>cortex-a53</model>
-  </cpu>
-  <clock offset='utc'/>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>destroy</on_crash>
-  <devices>
-    <emulator>/usr/bin/qemu-system-aarch64</emulator>
-    <interface type='user'>
-      <mac address='52:54:00:09:a4:37'/>
-      <model type='virtio'/>
-    </interface>
-  </devices>
-</domain>
index 3c7693bf25f4fc549d773581cc0db0ab01947afb..360ba25c79ef04c62df61881c108b68cc07f4baa 100644 (file)
@@ -1679,13 +1679,14 @@ mymain(void)
     DO_TEST("aarch64-cpu-passthrough",
             QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_VIRTIO_MMIO,
             QEMU_CAPS_CPU_HOST, QEMU_CAPS_KVM);
-    DO_TEST("aarch64-gic",
-            QEMU_CAPS_KVM);
-    DO_TEST("aarch64-gicv3",
-            QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT,
+    DO_TEST("aarch64-gic-v2",
+            QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST,
             QEMU_CAPS_MACH_VIRT_GIC_VERSION);
-    DO_TEST_FAILURE("aarch64-gicv3",
-            QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT);
+    DO_TEST("aarch64-gic-v3",
+            QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST,
+            QEMU_CAPS_MACH_VIRT_GIC_VERSION);
+    DO_TEST_FAILURE("aarch64-gic-v3",
+            QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST);
 
     driver.caps->host.cpu->arch = VIR_ARCH_AARCH64;
     DO_TEST("aarch64-kvm-32-on-64",
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-v2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-v2.xml
new file mode 120000 (symlink)
index 0000000..80a01c2
--- /dev/null
@@ -0,0 +1 @@
+../qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-v3.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-v3.xml
new file mode 120000 (symlink)
index 0000000..f586fa1
--- /dev/null
@@ -0,0 +1 @@
+../qemuxml2argvdata/qemuxml2argv-aarch64-gic-v3.xml
\ No newline at end of file
index d9550ccee89a3968993d49b07443740e6bce72db..b13e2bd95de65f4c4b58bad3a9921e03510cc077 100644 (file)
@@ -737,8 +737,8 @@ mymain(void)
             QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM,
             QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE,
             QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_VIRTIO_SCSI);
-    DO_TEST("aarch64-gic");
-    DO_TEST("aarch64-gicv3");
+    DO_TEST("aarch64-gic-v2");
+    DO_TEST("aarch64-gic-v3");
 
     DO_TEST("memory-hotplug");
     DO_TEST("memory-hotplug-nonuma");