[PATCH] securityselinuxlabeltest: Add debug statements for testUserXattrEnabled return value

Peter Krempa posted 1 patch 2 years, 9 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/f32192290eebebd1c05a048837205e9c9468f12b.1627046744.git.pkrempa@redhat.com
tests/securityselinuxlabeltest.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
[PATCH] securityselinuxlabeltest: Add debug statements for testUserXattrEnabled return value
Posted by Peter Krempa 2 years, 9 months ago
I've noticed the test being skipped in my build scenario (tmpfs) and
the output doesn't make it clear why it's happening.

Add debug statements for the various return values of
testUserXattrEnabled.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 tests/securityselinuxlabeltest.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c
index b1a6735d33..f7dd3c866a 100644
--- a/tests/securityselinuxlabeltest.c
+++ b/tests/securityselinuxlabeltest.c
@@ -325,10 +325,15 @@ mymain(void)
     int rc = testUserXattrEnabled();
     g_autoptr(virQEMUCaps) qemuCaps = NULL;

-    if (rc < 0)
+    if (rc < 0) {
+        VIR_TEST_VERBOSE("failed to determine xattr support");
         return EXIT_FAILURE;
-    if (!rc)
+    }
+
+    if (rc == 0) {
+        VIR_TEST_VERBOSE("xattr unsupported");
         return EXIT_AM_SKIP;
+    }

     if (!(mgr = virSecurityManagerNew("selinux", "QEMU",
                                       VIR_SECURITY_MANAGER_DEFAULT_CONFINED |
-- 
2.31.1

Re: [PATCH] securityselinuxlabeltest: Add debug statements for testUserXattrEnabled return value
Posted by Michal Prívozník 2 years, 9 months ago
On 7/23/21 3:25 PM, Peter Krempa wrote:
> I've noticed the test being skipped in my build scenario (tmpfs) and
> the output doesn't make it clear why it's happening.
> 
> Add debug statements for the various return values of
> testUserXattrEnabled.
> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  tests/securityselinuxlabeltest.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal