]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Remove 'qemucapsfixreplies'
authorPeter Krempa <pkrempa@redhat.com>
Wed, 22 Dec 2021 13:01:07 +0000 (14:01 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 3 Jan 2022 12:14:43 +0000 (13:14 +0100)
The 'qemucapabilitiesnumbering' tool now replaces the role of this
script and provides way to programmatically modify the replies file on
top.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/domaincapstest.c
tests/qemucapabilitiestest.c
tests/qemucapsfixreplies [deleted file]

index 479bcb1c35441c4cf831b9d0c126fafd284a8445..da5c629fd42b7f2b80c754d6fcce043fabe309bb 100644 (file)
@@ -422,7 +422,8 @@ mymain(void)
      * to generate updated or new *.replies data files.
      *
      * If you manually edit replies files you can run
-     * "tests/qemucapsfixreplies foo.replies" to fix the replies ids.
+     * VIR_TEST_REGENERATE_OUTPUT=1 tests/qemucapabilitiesnumbering
+     * to fix the replies ids.
      *
      * Once a replies file has been generated and tweaked if necessary,
      * you can drop it into tests/qemucapabilitiesdata/ (with a sensible
index 99534ab9a1429d4eb4b0bd62f35f92600ca9a077..ae208f442ca3b7950b1aefaea6308314fe659872 100644 (file)
@@ -212,7 +212,9 @@ mymain(void)
      * to generate updated or new *.replies data files.
      *
      * If you manually edit replies files you can run
-     * "tests/qemucapsfixreplies foo.replies" to fix the replies ids.
+     * VIR_TEST_REGENERATE_OUTPUT=1 tests/qemucapabilitiesnumbering
+     * to fix the replies ids. The tool also allows for programatic modification
+     * of the replies file.
      *
      * Once a replies file has been generated and tweaked if necessary,
      * you can drop it into tests/qemucapabilitiesdata/ (with a sensible
diff --git a/tests/qemucapsfixreplies b/tests/qemucapsfixreplies
deleted file mode 100755 (executable)
index 597f9ec..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-if [ "$#" -ne 1 ] || [ "$1" = "--help" ] || [ ! -f "$1" ]; then
-    echo "This script fixes replies ids in QEMU replies files."
-    echo ""
-    echo "      Usage: $0 path/to/qemu.replies"
-    exit 0
-fi
-
-awk -i inplace \
-    'BEGIN {last=0; pattern="libvirt-[0-9]+"}
-    {
-        if (match($0, "libvirt-1[^0-9]")) {
-            count=1;
-        }
-        if (match($0, pattern)) {
-            str="libvirt-" count;
-            sub(pattern, str, $0);
-            if (last != count) {
-                last=count;
-            } else {
-                count++;
-            }
-        }
-        print
-    }' "$1"