test: Skip landlock specific tests if unavailble during compile time

This commit is contained in:
2021-11-20 17:03:04 +01:00
parent 2a4cee2ece
commit 435bcefa48
2 changed files with 29 additions and 1 deletions

12
test.c
View File

@ -199,6 +199,7 @@ static int test_seccomp_group()
return 0;
}
#if HAVE_LANDLOCK == 1
int test_landlock()
{
struct qssb_policy *policy = qssb_init_policy();
@ -226,6 +227,17 @@ int test_landlock_deny_write()
}
return 1;
}
#else
int test_landlock()
{
return 2;
}
int test_landlock_deny_write()
{
return 2;
}
#endif
int test_nofs()
{