Skip to content

Commit

Permalink
test-execute: also check python3 is installed or not
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwata committed Sep 20, 2018
1 parent 767eab4 commit 738c74d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/test/test-execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ static void test_exec_temporaryfilesystem(Manager *m) {

static void test_exec_systemcallfilter(Manager *m) {
#if HAVE_SECCOMP
int r;

if (!is_seccomp_available()) {
log_notice("Seccomp not available, skipping %s", __func__);
return;
Expand All @@ -346,18 +348,33 @@ static void test_exec_systemcallfilter(Manager *m) {
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);

r = find_binary("python3", NULL);
if (r < 0) {
log_notice_errno(r, "Skipping remaining tests in %s, could not find python3 binary: %m", __func__);
return;
}

test(m, "exec-systemcallfilter-with-errno-name.service", errno_from_name("EILSEQ"), CLD_EXITED);
test(m, "exec-systemcallfilter-with-errno-number.service", 255, CLD_EXITED);
#endif
}

static void test_exec_systemcallerrornumber(Manager *m) {
#if HAVE_SECCOMP
int r;

if (!is_seccomp_available()) {
log_notice("Seccomp not available, skipping %s", __func__);
return;
}

r = find_binary("python3", NULL);
if (r < 0) {
log_notice_errno(r, "Skipping %s, could not find python3 binary: %m", __func__);
return;
}

test(m, "exec-systemcallerrornumber-name.service", errno_from_name("EACCES"), CLD_EXITED);
test(m, "exec-systemcallerrornumber-number.service", 255, CLD_EXITED);
#endif
Expand Down

0 comments on commit 738c74d

Please sign in to comment.