[PATCH] qemusecuritytest: Honour EXIT_AM_SKIP

Michal Privoznik posted 1 patch 2 years, 11 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/f9f403e438efdd8e28f5264a0dc1c61670e1d16b.1621336060.git.mprivozn@redhat.com
tests/qemusecuritytest.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
[PATCH] qemusecuritytest: Honour EXIT_AM_SKIP
Posted by Michal Privoznik 2 years, 11 months ago
There is a case where qemusecuritytest is skipped - on MacOS and
MinGW. In such case, EXIT_AM_SKIP should be returned.  However,
my recent patch of 5d99b157bc completely missed that and made the
test return EXIT_FAILURE even though the test exited early
without performing any test case.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 tests/qemusecuritytest.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/tests/qemusecuritytest.c b/tests/qemusecuritytest.c
index f7186700c4..a7e87fdf8f 100644
--- a/tests/qemusecuritytest.c
+++ b/tests/qemusecuritytest.c
@@ -143,15 +143,13 @@ mymain(void)
 #endif
     int ret = 0;
 
+    if (!virSecurityXATTRNamespaceDefined())
+        return EXIT_AM_SKIP;
+
     if (virInitialize() < 0 ||
         qemuTestDriverInit(&driver) < 0)
         return -1;
 
-    if (!virSecurityXATTRNamespaceDefined()) {
-        ret = EXIT_AM_SKIP;
-        goto cleanup;
-    }
-
     /* Now fix the secdriver */
     virObjectUnref(driver.securityManager);
 
-- 
2.26.3

Re: [PATCH] qemusecuritytest: Honour EXIT_AM_SKIP
Posted by Ján Tomko 2 years, 11 months ago
On a Tuesday in 2021, Michal Privoznik wrote:
>There is a case where qemusecuritytest is skipped - on MacOS and
>MinGW. In such case, EXIT_AM_SKIP should be returned.  However,
>my recent patch of 5d99b157bc completely missed that and made the
>test return EXIT_FAILURE even though the test exited early
>without performing any test case.
>
>Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>---
> tests/qemusecuritytest.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano