]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Improve ABI_UPDATE macros
authorAndrea Bolognani <abologna@redhat.com>
Fri, 26 Jan 2024 10:57:21 +0000 (11:57 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Fri, 26 Jan 2024 14:47:30 +0000 (15:47 +0100)
There are a number of cases in which we want to test both the
normal behavior and the ABI_UPDATE behavior for the same input
XML.

The way this is currently implemented is ad-hoc, and involves
symlinking the input XML as well as coming up with an
alternative name for the ABI_UPDATE variant: in most cases the
-abi-update suffix is added, but since this is not enforced
there are a couple of cases where we do something else instead.

To make things simpler and more consistent, implement the
naming convention at the macro level. This way, we no longer
need to create any symlinks for the input file, and the output
files are automatically named correctly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
25 files changed:
tests/qemuxmlconfdata/firmware-auto-efi-aarch64.aarch64-latest.abi-update.args [moved from tests/qemuxmlconfdata/firmware-auto-efi-abi-update-aarch64.aarch64-latest.args with 100% similarity]
tests/qemuxmlconfdata/firmware-auto-efi-aarch64.aarch64-latest.abi-update.xml [moved from tests/qemuxmlconfdata/firmware-auto-efi-abi-update-aarch64.aarch64-latest.xml with 100% similarity]
tests/qemuxmlconfdata/firmware-auto-efi-abi-update-aarch64.xml [deleted symlink]
tests/qemuxmlconfdata/firmware-auto-efi-abi-update.xml [deleted symlink]
tests/qemuxmlconfdata/firmware-auto-efi-format-loader-raw-abi-update.xml [deleted symlink]
tests/qemuxmlconfdata/firmware-auto-efi-format-loader-raw.aarch64-latest.abi-update.args [moved from tests/qemuxmlconfdata/firmware-auto-efi-format-loader-raw-abi-update.aarch64-latest.args with 100% similarity]
tests/qemuxmlconfdata/firmware-auto-efi-format-loader-raw.aarch64-latest.abi-update.xml [moved from tests/qemuxmlconfdata/firmware-auto-efi-format-loader-raw-abi-update.aarch64-latest.xml with 100% similarity]
tests/qemuxmlconfdata/firmware-auto-efi-loader-secure-abi-update.xml [deleted symlink]
tests/qemuxmlconfdata/firmware-auto-efi-loader-secure.x86_64-latest.abi-update.args [moved from tests/qemuxmlconfdata/firmware-auto-efi-abi-update.x86_64-latest.args with 100% similarity]
tests/qemuxmlconfdata/firmware-auto-efi-loader-secure.x86_64-latest.abi-update.xml [moved from tests/qemuxmlconfdata/firmware-auto-efi-abi-update.x86_64-latest.xml with 100% similarity]
tests/qemuxmlconfdata/firmware-auto-efi-rw-abi-update.xml [deleted symlink]
tests/qemuxmlconfdata/firmware-auto-efi-rw.x86_64-latest.abi-update.err [moved from tests/qemuxmlconfdata/firmware-auto-efi-rw-abi-update.x86_64-latest.err with 100% similarity]
tests/qemuxmlconfdata/firmware-auto-efi.x86_64-latest.abi-update.args [moved from tests/qemuxmlconfdata/firmware-auto-efi-loader-secure-abi-update.x86_64-latest.args with 100% similarity]
tests/qemuxmlconfdata/firmware-auto-efi.x86_64-latest.abi-update.xml [moved from tests/qemuxmlconfdata/firmware-auto-efi-loader-secure-abi-update.x86_64-latest.xml with 100% similarity]
tests/qemuxmlconfdata/firmware-manual-efi-features.x86_64-latest.abi-update.err [moved from tests/qemuxmlconfdata/firmware-manual-efi-features.x86_64-latest.err with 100% similarity]
tests/qemuxmlconfdata/memory-hotplug-nvdimm-ppc64-abi-update.xml [deleted symlink]
tests/qemuxmlconfdata/memory-hotplug-nvdimm-ppc64.ppc64-latest.abi-update.args [moved from tests/qemuxmlconfdata/memory-hotplug-nvdimm-ppc64-abi-update.ppc64-latest.args with 100% similarity]
tests/qemuxmlconfdata/memory-hotplug-nvdimm-ppc64.ppc64-latest.abi-update.xml [moved from tests/qemuxmlconfdata/memory-hotplug-nvdimm-ppc64-abi-update.ppc64-latest.xml with 100% similarity]
tests/qemuxmlconfdata/memory-hotplug-ppc64-nonuma-abi-update.xml [deleted symlink]
tests/qemuxmlconfdata/memory-hotplug-ppc64-nonuma.ppc64-latest.abi-update.args [moved from tests/qemuxmlconfdata/memory-hotplug-ppc64-nonuma-abi-update.ppc64-latest.args with 100% similarity]
tests/qemuxmlconfdata/memory-hotplug-ppc64-nonuma.ppc64-latest.abi-update.xml [moved from tests/qemuxmlconfdata/memory-hotplug-ppc64-nonuma-abi-update.ppc64-latest.xml with 100% similarity]
tests/qemuxmlconfdata/ppc64-usb-controller-qemu-xhci.xml [deleted symlink]
tests/qemuxmlconfdata/ppc64-usb-controller.ppc64-latest.abi-update.args [moved from tests/qemuxmlconfdata/ppc64-usb-controller-qemu-xhci.ppc64-latest.args with 100% similarity]
tests/qemuxmlconfdata/ppc64-usb-controller.ppc64-latest.abi-update.xml [moved from tests/qemuxmlconfdata/ppc64-usb-controller-qemu-xhci.ppc64-latest.xml with 100% similarity]
tests/qemuxmlconftest.c

diff --git a/tests/qemuxmlconfdata/firmware-auto-efi-abi-update-aarch64.xml b/tests/qemuxmlconfdata/firmware-auto-efi-abi-update-aarch64.xml
deleted file mode 120000 (symlink)
index 5510822..0000000
+++ /dev/null
@@ -1 +0,0 @@
-firmware-auto-efi-aarch64.xml
\ No newline at end of file
diff --git a/tests/qemuxmlconfdata/firmware-auto-efi-abi-update.xml b/tests/qemuxmlconfdata/firmware-auto-efi-abi-update.xml
deleted file mode 120000 (symlink)
index 348bfcc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-firmware-auto-efi.xml
\ No newline at end of file
diff --git a/tests/qemuxmlconfdata/firmware-auto-efi-format-loader-raw-abi-update.xml b/tests/qemuxmlconfdata/firmware-auto-efi-format-loader-raw-abi-update.xml
deleted file mode 120000 (symlink)
index bdd4a9f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-firmware-auto-efi-format-loader-raw.xml
\ No newline at end of file
diff --git a/tests/qemuxmlconfdata/firmware-auto-efi-loader-secure-abi-update.xml b/tests/qemuxmlconfdata/firmware-auto-efi-loader-secure-abi-update.xml
deleted file mode 120000 (symlink)
index a723eb2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-firmware-auto-efi-loader-secure.xml
\ No newline at end of file
diff --git a/tests/qemuxmlconfdata/firmware-auto-efi-rw-abi-update.xml b/tests/qemuxmlconfdata/firmware-auto-efi-rw-abi-update.xml
deleted file mode 120000 (symlink)
index 252c7f4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-firmware-auto-efi-rw.xml
\ No newline at end of file
diff --git a/tests/qemuxmlconfdata/memory-hotplug-nvdimm-ppc64-abi-update.xml b/tests/qemuxmlconfdata/memory-hotplug-nvdimm-ppc64-abi-update.xml
deleted file mode 120000 (symlink)
index c7d7190..0000000
+++ /dev/null
@@ -1 +0,0 @@
-memory-hotplug-nvdimm-ppc64.xml
\ No newline at end of file
diff --git a/tests/qemuxmlconfdata/memory-hotplug-ppc64-nonuma-abi-update.xml b/tests/qemuxmlconfdata/memory-hotplug-ppc64-nonuma-abi-update.xml
deleted file mode 120000 (symlink)
index 0341002..0000000
+++ /dev/null
@@ -1 +0,0 @@
-memory-hotplug-ppc64-nonuma.xml
\ No newline at end of file
diff --git a/tests/qemuxmlconfdata/ppc64-usb-controller-qemu-xhci.xml b/tests/qemuxmlconfdata/ppc64-usb-controller-qemu-xhci.xml
deleted file mode 120000 (symlink)
index a63a806..0000000
+++ /dev/null
@@ -1 +0,0 @@
-ppc64-usb-controller.xml
\ No newline at end of file
index 840c01b2d742f84b5e160bb5b8a9a40d662fa422..e693a3fc7c7de5107e9d05630cc6b2bf594968d6 100644 (file)
@@ -1129,9 +1129,11 @@ mymain(void)
     DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ARG_END)
 
 # define DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE(name, arch) \
-    DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, \
-                                  ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, \
-                                  ARG_END)
+    DO_TEST_FULL(name, "." arch "-latest.abi-update", \
+                 ARG_CAPS_ARCH, arch, \
+                 ARG_CAPS_VER, "latest", \
+                 ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, \
+                 ARG_END)
 
 # define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \
     DO_TEST_CAPS_ARCH_VER_FULL(name, arch, ver, ARG_END)
@@ -1165,9 +1167,12 @@ mymain(void)
                                   ARG_FLAGS, FLAG_EXPECT_FAILURE)
 
 # define DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE_FAILURE(name, arch) \
-    DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, \
-                                  ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, \
-                                  ARG_FLAGS, FLAG_EXPECT_FAILURE)
+    DO_TEST_FULL(name, "." arch "-latest.abi-update", \
+                 ARG_CAPS_ARCH, arch, \
+                 ARG_CAPS_VER, "latest", \
+                 ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, \
+                 ARG_FLAGS, FLAG_EXPECT_FAILURE, \
+                 ARG_END)
 
 # define DO_TEST_CAPS_ARCH_VER_FAILURE(name, arch, ver) \
     DO_TEST_CAPS_ARCH_VER_FULL(name, arch, ver, \
@@ -1187,9 +1192,12 @@ mymain(void)
                                   ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR)
 
 # define DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE_PARSE_ERROR(name, arch) \
-    DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, \
-                                  ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, \
-                                  ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR)
+    DO_TEST_FULL(name, "." arch "-latest.abi-update", \
+                 ARG_CAPS_ARCH, arch, \
+                 ARG_CAPS_VER, "latest", \
+                 ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, \
+                 ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, \
+                 ARG_END)
 
 # define DO_TEST_CAPS_ARCH_VER_PARSE_ERROR(name, arch, ver) \
     DO_TEST_CAPS_ARCH_VER_FULL(name, arch, ver, \
@@ -1370,12 +1378,12 @@ mymain(void)
     DO_TEST_CAPS_LATEST_PARSE_ERROR("firmware-auto-bios-not-stateless");
     DO_TEST_CAPS_LATEST_PARSE_ERROR("firmware-auto-bios-nvram");
     DO_TEST_CAPS_LATEST("firmware-auto-efi");
-    DO_TEST_CAPS_LATEST_ABI_UPDATE("firmware-auto-efi-abi-update");
+    DO_TEST_CAPS_LATEST_ABI_UPDATE("firmware-auto-efi");
     DO_TEST_CAPS_LATEST("firmware-auto-efi-stateless");
     DO_TEST_CAPS_LATEST_FAILURE("firmware-auto-efi-rw");
-    DO_TEST_CAPS_LATEST_ABI_UPDATE_PARSE_ERROR("firmware-auto-efi-rw-abi-update");
+    DO_TEST_CAPS_LATEST_ABI_UPDATE_PARSE_ERROR("firmware-auto-efi-rw");
     DO_TEST_CAPS_LATEST("firmware-auto-efi-loader-secure");
-    DO_TEST_CAPS_LATEST_ABI_UPDATE("firmware-auto-efi-loader-secure-abi-update");
+    DO_TEST_CAPS_LATEST_ABI_UPDATE("firmware-auto-efi-loader-secure");
     DO_TEST_CAPS_LATEST("firmware-auto-efi-loader-insecure");
     DO_TEST_CAPS_LATEST("firmware-auto-efi-loader-path");
     DO_TEST_CAPS_LATEST_FAILURE("firmware-auto-efi-loader-path-nonstandard");
@@ -1386,7 +1394,7 @@ mymain(void)
     DO_TEST_CAPS_LATEST_PARSE_ERROR("firmware-auto-efi-enrolled-keys-no-secboot");
     DO_TEST_CAPS_LATEST("firmware-auto-efi-smm-off");
     DO_TEST_CAPS_ARCH_LATEST("firmware-auto-efi-aarch64", "aarch64");
-    DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("firmware-auto-efi-abi-update-aarch64", "aarch64");
+    DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("firmware-auto-efi-aarch64", "aarch64");
     DO_TEST_CAPS_LATEST("firmware-auto-efi-nvram-path");
     DO_TEST_CAPS_LATEST("firmware-auto-efi-nvram-template");
     DO_TEST_CAPS_LATEST_FAILURE("firmware-auto-efi-nvram-template-nonstandard");
@@ -1400,7 +1408,7 @@ mymain(void)
     DO_TEST_CAPS_LATEST("firmware-auto-efi-format-nvram-qcow2-path");
     DO_TEST_CAPS_LATEST("firmware-auto-efi-format-nvram-qcow2-network-nbd");
     DO_TEST_CAPS_ARCH_LATEST("firmware-auto-efi-format-loader-raw", "aarch64");
-    DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("firmware-auto-efi-format-loader-raw-abi-update", "aarch64");
+    DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("firmware-auto-efi-format-loader-raw", "aarch64");
     DO_TEST_CAPS_LATEST_PARSE_ERROR("firmware-auto-efi-format-mismatch");
 
     DO_TEST_CAPS_LATEST("clock-utc");
@@ -2491,7 +2499,7 @@ mymain(void)
     DO_TEST_CAPS_LATEST("memory-hotplug-dimm");
     DO_TEST_CAPS_LATEST("memory-hotplug-dimm-addr");
     DO_TEST_CAPS_ARCH_LATEST("memory-hotplug-ppc64-nonuma", "ppc64");
-    DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("memory-hotplug-ppc64-nonuma-abi-update", "ppc64");
+    DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("memory-hotplug-ppc64-nonuma", "ppc64");
     DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm");
     DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-access");
     DO_TEST_CAPS_VER("memory-hotplug-nvdimm-label", "5.2.0");
@@ -2503,7 +2511,7 @@ mymain(void)
     DO_TEST_CAPS_VER("memory-hotplug-nvdimm-readonly", "5.2.0");
     DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-readonly");
     DO_TEST_CAPS_ARCH_LATEST("memory-hotplug-nvdimm-ppc64", "ppc64");
-    DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("memory-hotplug-nvdimm-ppc64-abi-update", "ppc64");
+    DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("memory-hotplug-nvdimm-ppc64", "ppc64");
     DO_TEST_CAPS_VER("memory-hotplug-virtio-pmem", "5.2.0");
     DO_TEST_CAPS_LATEST("memory-hotplug-virtio-pmem");
     DO_TEST_CAPS_LATEST("memory-hotplug-virtio-mem");
@@ -2541,7 +2549,7 @@ mymain(void)
     DO_TEST_CAPS_LATEST("input-linux");
 
     DO_TEST_CAPS_ARCH_LATEST("ppc64-usb-controller", "ppc64");
-    DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("ppc64-usb-controller-qemu-xhci", "ppc64");
+    DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("ppc64-usb-controller", "ppc64");
 
     DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("ppc64-tpmproxy-double", "ppc64");
     DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("ppc64-tpm-double", "ppc64");