[PATCH] viridentitytest: Drop #if !WITH_SELINUX block

Michal Privoznik posted 1 patch 3 years, 5 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/09694950320de0ce15e582424476e0aee50c0d3a.1604653497.git.mprivozn@redhat.com
tests/viridentitytest.c | 8 --------
1 file changed, 8 deletions(-)
[PATCH] viridentitytest: Drop #if !WITH_SELINUX block
Posted by Michal Privoznik 3 years, 5 months ago
The whole test is built only if SELinux secdriver is enabled and
thus the !WITH_SELINUX can't be satisfied really. Also, the block
references @ret variable which exists no more after v5.9.0-rc1~269.

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

diff --git a/tests/viridentitytest.c b/tests/viridentitytest.c
index fd01eeaa80..7a7101ba2a 100644
--- a/tests/viridentitytest.c
+++ b/tests/viridentitytest.c
@@ -85,14 +85,6 @@ static int testIdentityGetSystem(const void *data)
     const char *val;
     int rc;
 
-#if !WITH_SELINUX
-    if (context) {
-        VIR_DEBUG("libvirt not compiled with SELinux, skipping this test");
-        ret = EXIT_AM_SKIP;
-        return -1;
-    }
-#endif
-
     if (!(ident = virIdentityGetSystem())) {
         VIR_DEBUG("Unable to get system identity");
         return -1;
-- 
2.26.2

Re: [PATCH] viridentitytest: Drop #if !WITH_SELINUX block
Posted by Ján Tomko 3 years, 5 months ago
On a Friday in 2020, Michal Privoznik wrote:
>The whole test is built only if SELinux secdriver is enabled and
>thus the !WITH_SELINUX can't be satisfied really.

Which seems like a mistake. testIdentityAttrs does not depend on SELinux
and the virIdentity APIs it tests are called even from code that does
not require SELinux.

Jano

>Also, the block
>references @ret variable which exists no more after v5.9.0-rc1~269.
>
>Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>---
> tests/viridentitytest.c | 8 --------
> 1 file changed, 8 deletions(-)
>
>diff --git a/tests/viridentitytest.c b/tests/viridentitytest.c
>index fd01eeaa80..7a7101ba2a 100644
>--- a/tests/viridentitytest.c
>+++ b/tests/viridentitytest.c
>@@ -85,14 +85,6 @@ static int testIdentityGetSystem(const void *data)
>     const char *val;
>     int rc;
>
>-#if !WITH_SELINUX
>-    if (context) {
>-        VIR_DEBUG("libvirt not compiled with SELinux, skipping this test");
>-        ret = EXIT_AM_SKIP;
>-        return -1;
>-    }
>-#endif
>-
>     if (!(ident = virIdentityGetSystem())) {
>         VIR_DEBUG("Unable to get system identity");
>         return -1;
>-- 
>2.26.2
>
Re: [PATCH] viridentitytest: Drop #if !WITH_SELINUX block
Posted by Michal Prívozník 3 years, 5 months ago
On 11/6/20 11:17 AM, Ján Tomko wrote:
> On a Friday in 2020, Michal Privoznik wrote:
>> The whole test is built only if SELinux secdriver is enabled and
>> thus the !WITH_SELINUX can't be satisfied really.
> 
> Which seems like a mistake. testIdentityAttrs does not depend on SELinux
> and the virIdentity APIs it tests are called even from code that does
> not require SELinux.
> 

Well, it's like that for 6+ years :-) 
cdc5f3f1a3a960cbc988ad6a21078f135c936457

But okay, let me see if I can make the test run more often.

Michal