1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

test-execute: update test for SystemCallErrorNumber=

This commit is contained in:
Yu Watanabe 2017-11-11 21:41:05 +09:00
parent 3df90f24cc
commit 7a18854fe7
4 changed files with 15 additions and 4 deletions

View File

@ -270,8 +270,10 @@ static void test_exec_systemcallfilter(Manager *m) {
static void test_exec_systemcallerrornumber(Manager *m) {
#if HAVE_SECCOMP
if (is_seccomp_available())
test(m, "exec-systemcallerrornumber.service", 1, CLD_EXITED);
if (!is_seccomp_available())
return;
test(m, "exec-systemcallerrornumber-name.service", errno_from_name("EACCES"), CLD_EXITED);
test(m, "exec-systemcallerrornumber-number.service", 255, CLD_EXITED);
#endif
}

View File

@ -100,7 +100,8 @@ test_data_files = '''
test-execute/exec-supplementarygroups-single-group-user.service
test-execute/exec-supplementarygroups-single-group.service
test-execute/exec-supplementarygroups.service
test-execute/exec-systemcallerrornumber.service
test-execute/exec-systemcallerrornumber-name.service
test-execute/exec-systemcallerrornumber-number.service
test-execute/exec-systemcallfilter-failing.service
test-execute/exec-systemcallfilter-failing2.service
test-execute/exec-systemcallfilter-not-failing.service

View File

@ -2,7 +2,7 @@
Description=Test for SystemCallErrorNumber
[Service]
ExecStart=/bin/sh -x -c 'uname -a'
ExecStart=/bin/python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
Type=oneshot
SystemCallFilter=~uname
SystemCallErrorNumber=EACCES

View File

@ -0,0 +1,8 @@
[Unit]
Description=Test for SystemCallErrorNumber
[Service]
ExecStart=/bin/python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
Type=oneshot
SystemCallFilter=~uname
SystemCallErrorNumber=255