summaryrefslogtreecommitdiff
path: root/src/test/test-execute.c
diff options
context:
space:
mode:
authorFelipe Sateler <fsateler@users.noreply.github.com>2016-08-22 16:40:58 -0300
committerEvgeny Vereshchagin <evvers@ya.ru>2016-08-22 22:40:58 +0300
commit83f12b27d14853e7c89a326f7cd31a6c739d378e (patch)
treea422aeadd910a844174690dea8e415069e799470 /src/test/test-execute.c
parent05b4d3b55c0a60aa17817d51129f2bc83914c1f4 (diff)
core: do not fail at step SECCOMP if there is no kernel support (#4004)
Fixes #3882
Diffstat (limited to 'src/test/test-execute.c')
-rw-r--r--src/test/test-execute.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/test/test-execute.c b/src/test/test-execute.c
index 1d24115b5c..05ec1d2eb1 100644
--- a/src/test/test-execute.c
+++ b/src/test/test-execute.c
@@ -30,6 +30,9 @@
#include "mkdir.h"
#include "path-util.h"
#include "rm-rf.h"
+#ifdef HAVE_SECCOMP
+#include "seccomp-util.h"
+#endif
#include "test-helper.h"
#include "unit.h"
#include "util.h"
@@ -132,21 +135,27 @@ static void test_exec_privatedevices(Manager *m) {
static void test_exec_systemcallfilter(Manager *m) {
#ifdef HAVE_SECCOMP
+ if (!is_seccomp_available())
+ return;
test(m, "exec-systemcallfilter-not-failing.service", 0, CLD_EXITED);
test(m, "exec-systemcallfilter-not-failing2.service", 0, CLD_EXITED);
test(m, "exec-systemcallfilter-failing.service", SIGSYS, CLD_KILLED);
test(m, "exec-systemcallfilter-failing2.service", SIGSYS, CLD_KILLED);
+
#endif
}
static void test_exec_systemcallerrornumber(Manager *m) {
#ifdef HAVE_SECCOMP
- test(m, "exec-systemcallerrornumber.service", 1, CLD_EXITED);
+ if (is_seccomp_available())
+ test(m, "exec-systemcallerrornumber.service", 1, CLD_EXITED);
#endif
}
static void test_exec_systemcall_system_mode_with_user(Manager *m) {
#ifdef HAVE_SECCOMP
+ if (!is_seccomp_available())
+ return;
if (getpwnam("nobody"))
test(m, "exec-systemcallfilter-system-user.service", 0, CLD_EXITED);
else if (getpwnam("nfsnobody"))