[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libvir-list
Subject:    Re: [PATCH 3/3] tests: Use virDirOpenSorted()
From:       Ján Tomko <jtomko () redhat ! com>
Date:       2022-12-23 13:40:08
Message-ID: Y6WvuMh6K5DKQ5ko () fedora
[Download RAW message or body]


On a Friday in 2022, Michal Privoznik wrote:
>Since the directory content is not returned in a sorted manner it
>may be harder than necessary to find a particular test case. For
>instance domaincapstest runs individual test cases in "random"
>order. At the first glance it may seem that we are missing a
>particular version test. Well, now that we have
>virDirOpenSorted() the test cases can run in more predictable
>way.
>

I'm not convinced such predictability is needed - the test cases should be
isolated. On a higher level we run the individual test programs in
parallel, with no expectation of ordering.

>Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>---
> tests/testutilsqemu.c | 4 ++--
> tests/virschematest.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
>index 7648ead735..5ca5558b45 100644
>--- a/tests/testutilsqemu.c
>+++ b/tests/testutilsqemu.c
>@@ -736,7 +736,7 @@ testQemuGetLatestCapsForArch(const char *arch,
>
>     fullsuffix = g_strdup_printf("%s.%s", arch, suffix);
>
>-    if (virDirOpen(&dir, TEST_QEMU_CAPS_PATH) < 0)
>+    if (virDirOpenSorted(&dir, TEST_QEMU_CAPS_PATH) < 0)
>         return NULL;

Here we only take note of the highest version number, sorting does not
give us anything extra.

Jano

>
>     while ((rc = virDirRead(dir, &ent, TEST_QEMU_CAPS_PATH)) > 0) {
>@@ -824,7 +824,7 @@ testQemuCapsIterate(const char *suffix,
>         return -1;
>     }
>
>-    if (virDirOpen(&dir, TEST_QEMU_CAPS_PATH) < 0)
>+    if (virDirOpenSorted(&dir, TEST_QEMU_CAPS_PATH) < 0)
>         return -1;
>

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic