summaryrefslogtreecommitdiff
path: root/src/test/test-execute.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-09-12 18:18:33 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-09-21 00:45:00 +0900
commit738c74d7b163ea18e3c68115c3ed8ceed166cbf7 (patch)
tree950f1a9df9b2c8b02215e7c199be6a16bcb2733f /src/test/test-execute.c
parent767eab47501b06327a0e6030e5c54860a3fc427f (diff)
downloadsystemd-738c74d7b163ea18e3c68115c3ed8ceed166cbf7.tar.gz
test-execute: also check python3 is installed or not
Diffstat (limited to 'src/test/test-execute.c')
-rw-r--r--src/test/test-execute.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/test-execute.c b/src/test/test-execute.c
index c3ea5f6469..80b60d0317 100644
--- a/src/test/test-execute.c
+++ b/src/test/test-execute.c
@@ -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;
@@ -346,6 +348,13 @@ 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
@@ -353,11 +362,19 @@ static void test_exec_systemcallfilter(Manager *m) {
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