summaryrefslogtreecommitdiff
path: root/tests/qemusecuritytest.c
diff options
context:
space:
mode:
authorMichal Privoznik <mprivozn@redhat.com>2020-11-03 13:26:00 +0100
committerMichal Privoznik <mprivozn@redhat.com>2020-11-06 09:14:53 +0100
commit995394c5a36a58fd0dbb9b6adb5779b37fb8f108 (patch)
tree2df838418bb046f425aa7f87c742ea14348760c9 /tests/qemusecuritytest.c
parentdf8ff46a16c903115796ed35a292e9857d7ec6c1 (diff)
downloadlibvirt-995394c5a36a58fd0dbb9b6adb5779b37fb8f108.tar.gz
qemusecuritytest: Skip on non supported platforms
For seclabel remembering we need to have XATTRs and a special namespace that is accessibly to CAP_SYS_ADMIN only (we don't want regular users to trick us into restoring to a different label). And what qemusecuritytest does is it checks whether we have not left any path behind with XATTRs or not restored to original seclabel after setAll + restoreAll round trip. But it can hardly do so if ran on a platform where there's no XATTR namespace we can use. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Diffstat (limited to 'tests/qemusecuritytest.c')
-rw-r--r--tests/qemusecuritytest.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/qemusecuritytest.c b/tests/qemusecuritytest.c
index 7ee1ccd1b6..dc3deb37d2 100644
--- a/tests/qemusecuritytest.c
+++ b/tests/qemusecuritytest.c
@@ -22,6 +22,7 @@
#include "testutils.h"
#include "testutilsqemu.h"
#include "security/security_manager.h"
+#include "security/security_util.h"
#include "conf/domain_conf.h"
#include "qemu/qemu_domain.h"
#include "qemu/qemu_security.h"
@@ -148,6 +149,11 @@ mymain(void)
qemuTestDriverInit(&driver) < 0)
return -1;
+ if (!virSecurityXATTRNamespaceDefined()) {
+ ret = EXIT_AM_SKIP;
+ goto cleanup;
+ }
+
/* Now fix the secdriver */
virObjectUnref(driver.securityManager);