From ac40081621ec299a55246519726a18dd2b08678c Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Fri, 30 Oct 2015 18:03:18 +0100 Subject: test-execute: move all files related to a specific directory To avoid polluting test/ --- Makefile.am | 68 +++++++++++----------- src/test/test-execute.c | 2 +- test/exec-capabilityboundingset-invert.service | 6 -- test/exec-capabilityboundingset-merge.service | 7 --- test/exec-capabilityboundingset-reset.service | 7 --- test/exec-capabilityboundingset-simple.service | 6 -- test/exec-environment-empty.service | 7 --- test/exec-environment-multiple.service | 7 --- test/exec-environment.service | 6 -- test/exec-environmentfile.service | 7 --- test/exec-group.service | 6 -- test/exec-ignoresigpipe-no.service | 7 --- test/exec-ignoresigpipe-yes.service | 7 --- test/exec-ioschedulingclass-best-effort.service | 7 --- test/exec-ioschedulingclass-idle.service | 7 --- test/exec-ioschedulingclass-none.service | 7 --- test/exec-ioschedulingclass-realtime.service | 7 --- test/exec-oomscoreadjust-negative.service | 7 --- test/exec-oomscoreadjust-positive.service | 7 --- test/exec-personality-s390.service | 7 --- test/exec-personality-x86-64.service | 7 --- test/exec-personality-x86.service | 7 --- test/exec-privatedevices-no.service | 7 --- test/exec-privatedevices-yes.service | 7 --- test/exec-privatenetwork-yes.service | 6 -- test/exec-privatetmp-no.service | 7 --- test/exec-privatetmp-yes.service | 7 --- test/exec-runtimedirectory-mode.service | 8 --- test/exec-runtimedirectory-owner.service | 9 --- test/exec-runtimedirectory.service | 7 --- test/exec-systemcallerrornumber.service | 7 --- test/exec-systemcallfilter-failing.service | 8 --- test/exec-systemcallfilter-failing2.service | 6 -- test/exec-systemcallfilter-not-failing.service | 9 --- test/exec-systemcallfilter-not-failing2.service | 6 -- test/exec-umask-0177.service | 7 --- test/exec-umask-default.service | 6 -- test/exec-user.service | 6 -- test/exec-workingdirectory.service | 7 --- .../exec-capabilityboundingset-invert.service | 6 ++ .../exec-capabilityboundingset-merge.service | 7 +++ .../exec-capabilityboundingset-reset.service | 7 +++ .../exec-capabilityboundingset-simple.service | 6 ++ test/test-execute/exec-environment-empty.service | 7 +++ .../test-execute/exec-environment-multiple.service | 7 +++ test/test-execute/exec-environment.service | 6 ++ test/test-execute/exec-environmentfile.service | 7 +++ test/test-execute/exec-group.service | 6 ++ test/test-execute/exec-ignoresigpipe-no.service | 7 +++ test/test-execute/exec-ignoresigpipe-yes.service | 7 +++ .../exec-ioschedulingclass-best-effort.service | 7 +++ .../exec-ioschedulingclass-idle.service | 7 +++ .../exec-ioschedulingclass-none.service | 7 +++ .../exec-ioschedulingclass-realtime.service | 7 +++ .../exec-oomscoreadjust-negative.service | 7 +++ .../exec-oomscoreadjust-positive.service | 7 +++ test/test-execute/exec-personality-s390.service | 7 +++ test/test-execute/exec-personality-x86-64.service | 7 +++ test/test-execute/exec-personality-x86.service | 7 +++ test/test-execute/exec-privatedevices-no.service | 7 +++ test/test-execute/exec-privatedevices-yes.service | 7 +++ test/test-execute/exec-privatenetwork-yes.service | 6 ++ test/test-execute/exec-privatetmp-no.service | 7 +++ test/test-execute/exec-privatetmp-yes.service | 7 +++ .../exec-runtimedirectory-mode.service | 8 +++ .../exec-runtimedirectory-owner.service | 9 +++ test/test-execute/exec-runtimedirectory.service | 7 +++ .../exec-systemcallerrornumber.service | 7 +++ .../exec-systemcallfilter-failing.service | 8 +++ .../exec-systemcallfilter-failing2.service | 6 ++ .../exec-systemcallfilter-not-failing.service | 9 +++ .../exec-systemcallfilter-not-failing2.service | 6 ++ test/test-execute/exec-umask-0177.service | 7 +++ test/test-execute/exec-umask-default.service | 6 ++ test/test-execute/exec-user.service | 6 ++ test/test-execute/exec-workingdirectory.service | 7 +++ 76 files changed, 291 insertions(+), 291 deletions(-) delete mode 100644 test/exec-capabilityboundingset-invert.service delete mode 100644 test/exec-capabilityboundingset-merge.service delete mode 100644 test/exec-capabilityboundingset-reset.service delete mode 100644 test/exec-capabilityboundingset-simple.service delete mode 100644 test/exec-environment-empty.service delete mode 100644 test/exec-environment-multiple.service delete mode 100644 test/exec-environment.service delete mode 100644 test/exec-environmentfile.service delete mode 100644 test/exec-group.service delete mode 100644 test/exec-ignoresigpipe-no.service delete mode 100644 test/exec-ignoresigpipe-yes.service delete mode 100644 test/exec-ioschedulingclass-best-effort.service delete mode 100644 test/exec-ioschedulingclass-idle.service delete mode 100644 test/exec-ioschedulingclass-none.service delete mode 100644 test/exec-ioschedulingclass-realtime.service delete mode 100644 test/exec-oomscoreadjust-negative.service delete mode 100644 test/exec-oomscoreadjust-positive.service delete mode 100644 test/exec-personality-s390.service delete mode 100644 test/exec-personality-x86-64.service delete mode 100644 test/exec-personality-x86.service delete mode 100644 test/exec-privatedevices-no.service delete mode 100644 test/exec-privatedevices-yes.service delete mode 100644 test/exec-privatenetwork-yes.service delete mode 100644 test/exec-privatetmp-no.service delete mode 100644 test/exec-privatetmp-yes.service delete mode 100644 test/exec-runtimedirectory-mode.service delete mode 100644 test/exec-runtimedirectory-owner.service delete mode 100644 test/exec-runtimedirectory.service delete mode 100644 test/exec-systemcallerrornumber.service delete mode 100644 test/exec-systemcallfilter-failing.service delete mode 100644 test/exec-systemcallfilter-failing2.service delete mode 100644 test/exec-systemcallfilter-not-failing.service delete mode 100644 test/exec-systemcallfilter-not-failing2.service delete mode 100644 test/exec-umask-0177.service delete mode 100644 test/exec-umask-default.service delete mode 100644 test/exec-user.service delete mode 100644 test/exec-workingdirectory.service create mode 100644 test/test-execute/exec-capabilityboundingset-invert.service create mode 100644 test/test-execute/exec-capabilityboundingset-merge.service create mode 100644 test/test-execute/exec-capabilityboundingset-reset.service create mode 100644 test/test-execute/exec-capabilityboundingset-simple.service create mode 100644 test/test-execute/exec-environment-empty.service create mode 100644 test/test-execute/exec-environment-multiple.service create mode 100644 test/test-execute/exec-environment.service create mode 100644 test/test-execute/exec-environmentfile.service create mode 100644 test/test-execute/exec-group.service create mode 100644 test/test-execute/exec-ignoresigpipe-no.service create mode 100644 test/test-execute/exec-ignoresigpipe-yes.service create mode 100644 test/test-execute/exec-ioschedulingclass-best-effort.service create mode 100644 test/test-execute/exec-ioschedulingclass-idle.service create mode 100644 test/test-execute/exec-ioschedulingclass-none.service create mode 100644 test/test-execute/exec-ioschedulingclass-realtime.service create mode 100644 test/test-execute/exec-oomscoreadjust-negative.service create mode 100644 test/test-execute/exec-oomscoreadjust-positive.service create mode 100644 test/test-execute/exec-personality-s390.service create mode 100644 test/test-execute/exec-personality-x86-64.service create mode 100644 test/test-execute/exec-personality-x86.service create mode 100644 test/test-execute/exec-privatedevices-no.service create mode 100644 test/test-execute/exec-privatedevices-yes.service create mode 100644 test/test-execute/exec-privatenetwork-yes.service create mode 100644 test/test-execute/exec-privatetmp-no.service create mode 100644 test/test-execute/exec-privatetmp-yes.service create mode 100644 test/test-execute/exec-runtimedirectory-mode.service create mode 100644 test/test-execute/exec-runtimedirectory-owner.service create mode 100644 test/test-execute/exec-runtimedirectory.service create mode 100644 test/test-execute/exec-systemcallerrornumber.service create mode 100644 test/test-execute/exec-systemcallfilter-failing.service create mode 100644 test/test-execute/exec-systemcallfilter-failing2.service create mode 100644 test/test-execute/exec-systemcallfilter-not-failing.service create mode 100644 test/test-execute/exec-systemcallfilter-not-failing2.service create mode 100644 test/test-execute/exec-umask-0177.service create mode 100644 test/test-execute/exec-umask-default.service create mode 100644 test/test-execute/exec-user.service create mode 100644 test/test-execute/exec-workingdirectory.service diff --git a/Makefile.am b/Makefile.am index 2f8bfd4d34..4319c2fdb7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1544,40 +1544,40 @@ EXTRA_DIST += \ test/path-makedirectory.path \ test/path-modified.path \ test/path-unit.path \ - test/exec-environment-empty.service \ - test/exec-environment-multiple.service \ - test/exec-environment.service \ - test/exec-group.service \ - test/exec-ignoresigpipe-no.service \ - test/exec-ignoresigpipe-yes.service \ - test/exec-personality-x86-64.service \ - test/exec-personality-x86.service \ - test/exec-personality-s390.service \ - test/exec-privatedevices-no.service \ - test/exec-privatedevices-yes.service \ - test/exec-privatetmp-no.service \ - test/exec-privatetmp-yes.service \ - test/exec-systemcallerrornumber.service \ - test/exec-systemcallfilter-failing2.service \ - test/exec-systemcallfilter-failing.service \ - test/exec-systemcallfilter-not-failing2.service \ - test/exec-systemcallfilter-not-failing.service \ - test/exec-user.service \ - test/exec-workingdirectory.service \ - test/exec-umask-0177.service \ - test/exec-umask-default.service \ - test/exec-privatenetwork-yes.service \ - test/exec-environmentfile.service \ - test/exec-oomscoreadjust-positive.service \ - test/exec-oomscoreadjust-negative.service \ - test/exec-ioschedulingclass-best-effort.service \ - test/exec-ioschedulingclass-idle.service \ - test/exec-ioschedulingclass-none.service \ - test/exec-ioschedulingclass-realtime.service \ - test/exec-capabilityboundingset-invert.service \ - test/exec-capabilityboundingset-merge.service \ - test/exec-capabilityboundingset-reset.service \ - test/exec-capabilityboundingset-simple.service \ + test/test-execute/exec-environment-empty.service \ + test/test-execute/exec-environment-multiple.service \ + test/test-execute/exec-environment.service \ + test/test-execute/exec-group.service \ + test/test-execute/exec-ignoresigpipe-no.service \ + test/test-execute/exec-ignoresigpipe-yes.service \ + test/test-execute/exec-personality-x86-64.service \ + test/test-execute/exec-personality-x86.service \ + test/test-execute/exec-personality-s390.service \ + test/test-execute/exec-privatedevices-no.service \ + test/test-execute/exec-privatedevices-yes.service \ + test/test-execute/exec-privatetmp-no.service \ + test/test-execute/exec-privatetmp-yes.service \ + test/test-execute/exec-systemcallerrornumber.service \ + test/test-execute/exec-systemcallfilter-failing2.service \ + test/test-execute/exec-systemcallfilter-failing.service \ + test/test-execute/exec-systemcallfilter-not-failing2.service \ + test/test-execute/exec-systemcallfilter-not-failing.service \ + test/test-execute/exec-user.service \ + test/test-execute/exec-workingdirectory.service \ + test/test-execute/exec-umask-0177.service \ + test/test-execute/exec-umask-default.service \ + test/test-execute/exec-privatenetwork-yes.service \ + test/test-execute/exec-environmentfile.service \ + test/test-execute/exec-oomscoreadjust-positive.service \ + test/test-execute/exec-oomscoreadjust-negative.service \ + test/test-execute/exec-ioschedulingclass-best-effort.service \ + test/test-execute/exec-ioschedulingclass-idle.service \ + test/test-execute/exec-ioschedulingclass-none.service \ + test/test-execute/exec-ioschedulingclass-realtime.service \ + test/test-execute/exec-capabilityboundingset-invert.service \ + test/test-execute/exec-capabilityboundingset-merge.service \ + test/test-execute/exec-capabilityboundingset-reset.service \ + test/test-execute/exec-capabilityboundingset-simple.service \ test/bus-policy/hello.conf \ test/bus-policy/methods.conf \ test/bus-policy/ownerships.conf \ diff --git a/src/test/test-execute.c b/src/test/test-execute.c index 158626f715..e2ec53ee51 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -258,7 +258,7 @@ int main(int argc, char *argv[]) { } assert_se(setenv("XDG_RUNTIME_DIR", "/tmp/", 1) == 0); - assert_se(set_unit_path(TEST_DIR) >= 0); + assert_se(set_unit_path(TEST_DIR "/test-execute/") >= 0); r = manager_new(MANAGER_USER, true, &m); if (IN_SET(r, -EPERM, -EACCES, -EADDRINUSE, -EHOSTDOWN, -ENOENT)) { diff --git a/test/exec-capabilityboundingset-invert.service b/test/exec-capabilityboundingset-invert.service deleted file mode 100644 index e2b09e1550..0000000000 --- a/test/exec-capabilityboundingset-invert.service +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=Test for CapabilityBoundingSet - -[Service] -ExecStart=/bin/sh -c 'c=$(capsh --print | grep "Bounding set " | grep "cap_chown"); echo $c; exit $(test -z $c)' -CapabilityBoundingSet=~CAP_CHOWN diff --git a/test/exec-capabilityboundingset-merge.service b/test/exec-capabilityboundingset-merge.service deleted file mode 100644 index b0f4732529..0000000000 --- a/test/exec-capabilityboundingset-merge.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for CapabilityBoundingSet - -[Service] -ExecStart=/bin/sh -c 'c=$(capsh --print | grep "Bounding set " | cut -f 2 -d "="); echo $c; exit $(test $c = "cap_chown,cap_fowner,cap_kill")' -CapabilityBoundingSet=CAP_FOWNER -CapabilityBoundingSet=CAP_KILL CAP_CHOWN diff --git a/test/exec-capabilityboundingset-reset.service b/test/exec-capabilityboundingset-reset.service deleted file mode 100644 index 51092ab0d5..0000000000 --- a/test/exec-capabilityboundingset-reset.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for CapabilityBoundingSet - -[Service] -ExecStart=/bin/sh -c 'c=$(capsh --print | grep "Bounding set " | cut -f 2 -d "="); echo $c; exit $(test -z $c)' -CapabilityBoundingSet=CAP_FOWNER CAP_KILL -CapabilityBoundingSet= diff --git a/test/exec-capabilityboundingset-simple.service b/test/exec-capabilityboundingset-simple.service deleted file mode 100644 index b9037a0ddf..0000000000 --- a/test/exec-capabilityboundingset-simple.service +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=Test for CapabilityBoundingSet - -[Service] -ExecStart=/bin/sh -c 'c=$(capsh --print | grep "Bounding set " | cut -f 2 -d "="); echo $c; exit $(test $c = "cap_fowner,cap_kill")' -CapabilityBoundingSet=CAP_FOWNER CAP_KILL diff --git a/test/exec-environment-empty.service b/test/exec-environment-empty.service deleted file mode 100644 index 0219ca4fd7..0000000000 --- a/test/exec-environment-empty.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for Environment - -[Service] -ExecStart=/bin/sh -c 'exit $(test ! "$VAR1" = "word1 word2") && $(test ! "$VAR2" = word3) && $(test ! "$VAR3" = \'$word 5 6\')' -Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" -Environment= diff --git a/test/exec-environment-multiple.service b/test/exec-environment-multiple.service deleted file mode 100644 index 479005a5d8..0000000000 --- a/test/exec-environment-multiple.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for Environment - -[Service] -ExecStart=/bin/sh -c 'exit $(test "$VAR1" = "word1 word2") && $(test "$VAR2" = word3) && $(test "$VAR3" = foobar)' -Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" -Environment="VAR3=foobar" diff --git a/test/exec-environment.service b/test/exec-environment.service deleted file mode 100644 index 4586b4c4a9..0000000000 --- a/test/exec-environment.service +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=Test for Environment - -[Service] -ExecStart=/bin/sh -c 'exit $(test "$VAR1" = "word1 word2") && $(test "$VAR2" = word3) && $(test "$VAR3" = \'$word 5 6\')' -Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" diff --git a/test/exec-environmentfile.service b/test/exec-environmentfile.service deleted file mode 100644 index 848f2a120c..0000000000 --- a/test/exec-environmentfile.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for EnvironmentFile - -[Service] -ExecStart=/bin/sh -c 'exit $(test "$VAR1" = "word1 word2") && $(test "$VAR2" = word3) && $(test "$VAR3" = \'$word 5 6\')' -Type=oneshot -EnvironmentFile=/tmp/test-exec_environmentfile.conf diff --git a/test/exec-group.service b/test/exec-group.service deleted file mode 100644 index 1aa04b5bd2..0000000000 --- a/test/exec-group.service +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=Test for Group - -[Service] -ExecStart=/bin/sh -c 'exit $(test $(id -n -g) = nobody)' -Group=nobody diff --git a/test/exec-ignoresigpipe-no.service b/test/exec-ignoresigpipe-no.service deleted file mode 100644 index 69b2e9d8a8..0000000000 --- a/test/exec-ignoresigpipe-no.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for IgnoreSIGPIPE=no - -[Service] -ExecStart=/bin/sh -c 'kill -PIPE 0' -Type=oneshot -IgnoreSIGPIPE=no diff --git a/test/exec-ignoresigpipe-yes.service b/test/exec-ignoresigpipe-yes.service deleted file mode 100644 index 877ec8aed0..0000000000 --- a/test/exec-ignoresigpipe-yes.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for IgnoreSIGPIPE=yes - -[Service] -ExecStart=/bin/sh -c 'kill -PIPE 0' -Type=oneshot -IgnoreSIGPIPE=yes diff --git a/test/exec-ioschedulingclass-best-effort.service b/test/exec-ioschedulingclass-best-effort.service deleted file mode 100644 index 56e2718505..0000000000 --- a/test/exec-ioschedulingclass-best-effort.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for IOSchedulingClass=best-effort - -[Service] -ExecStart=/bin/bash -c 'c=$(ionice); echo $c; [[ "$c" == best-effort* ]]' -Type=oneshot -IOSchedulingClass=best-effort diff --git a/test/exec-ioschedulingclass-idle.service b/test/exec-ioschedulingclass-idle.service deleted file mode 100644 index b45795cab7..0000000000 --- a/test/exec-ioschedulingclass-idle.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for IOSchedulingClass=idle - -[Service] -ExecStart=/bin/bash -c 'c=$(ionice); echo $c; [[ "$c" == idle* ]]' -Type=oneshot -IOSchedulingClass=idle diff --git a/test/exec-ioschedulingclass-none.service b/test/exec-ioschedulingclass-none.service deleted file mode 100644 index 36b546ca01..0000000000 --- a/test/exec-ioschedulingclass-none.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for IOSchedulingClass=none - -[Service] -ExecStart=/bin/bash -c 'c=$(ionice); echo $c; [[ "$c" == none* ]]' -Type=oneshot -IOSchedulingClass=none diff --git a/test/exec-ioschedulingclass-realtime.service b/test/exec-ioschedulingclass-realtime.service deleted file mode 100644 index 74936d8079..0000000000 --- a/test/exec-ioschedulingclass-realtime.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for IOSchedulingClass=realtime - -[Service] -ExecStart=/bin/bash -c 'c=$(ionice); echo $c; [[ "$c" == realtime* ]]' -Type=oneshot -IOSchedulingClass=realtime diff --git a/test/exec-oomscoreadjust-negative.service b/test/exec-oomscoreadjust-negative.service deleted file mode 100644 index 63ab501c63..0000000000 --- a/test/exec-oomscoreadjust-negative.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for OOMScoreAdjust - -[Service] -ExecStart=/bin/bash -c 'c=$(cat /proc/self/oom_score_adj); echo $c; exit $(test $c -eq -100)' -OOMScoreAdjust=-100 -Type=oneshot diff --git a/test/exec-oomscoreadjust-positive.service b/test/exec-oomscoreadjust-positive.service deleted file mode 100644 index e47a4f1392..0000000000 --- a/test/exec-oomscoreadjust-positive.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for OOMScoreAdjust - -[Service] -ExecStart=/bin/bash -c 'c=$(cat /proc/self/oom_score_adj); echo $c; exit $(test $c -eq 100)' -OOMScoreAdjust=100 -Type=oneshot diff --git a/test/exec-personality-s390.service b/test/exec-personality-s390.service deleted file mode 100644 index f3c3b03e3d..0000000000 --- a/test/exec-personality-s390.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for Personality=s390 - -[Service] -ExecStart=/bin/sh -c 'echo $(uname -m); exit $(test $(uname -m) = "s390")' -Type=oneshot -Personality=s390 diff --git a/test/exec-personality-x86-64.service b/test/exec-personality-x86-64.service deleted file mode 100644 index 5bb5d910d0..0000000000 --- a/test/exec-personality-x86-64.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for Personality=x86-64 - -[Service] -ExecStart=/bin/sh -c 'echo $(uname -m); exit $(test $(uname -m) = "x86_64")' -Type=oneshot -Personality=x86-64 diff --git a/test/exec-personality-x86.service b/test/exec-personality-x86.service deleted file mode 100644 index 0b370a6480..0000000000 --- a/test/exec-personality-x86.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for Personality=x86 - -[Service] -ExecStart=/bin/sh -c 'echo $(uname -m); exit $(test $(uname -m) = "i686")' -Type=oneshot -Personality=x86 diff --git a/test/exec-privatedevices-no.service b/test/exec-privatedevices-no.service deleted file mode 100644 index cf4f275fb6..0000000000 --- a/test/exec-privatedevices-no.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for PrivateDev=no - -[Service] -ExecStart=/bin/sh -c 'exit $(test -c /dev/mem)' -Type=oneshot -PrivateDevices=no diff --git a/test/exec-privatedevices-yes.service b/test/exec-privatedevices-yes.service deleted file mode 100644 index 85b3f4f981..0000000000 --- a/test/exec-privatedevices-yes.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for PrivateDev=yes - -[Service] -ExecStart=/bin/sh -c 'exit $(test ! -c /dev/mem)' -Type=oneshot -PrivateDevices=yes diff --git a/test/exec-privatenetwork-yes.service b/test/exec-privatenetwork-yes.service deleted file mode 100644 index 494712e6a7..0000000000 --- a/test/exec-privatenetwork-yes.service +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=Test for PrivateNetwork - -[Service] -ExecStart=/bin/sh -c 'i=$(ip link | grep ": " | grep -v lo); echo $i; exit $(test -z $i)' -PrivateNetwork=yes diff --git a/test/exec-privatetmp-no.service b/test/exec-privatetmp-no.service deleted file mode 100644 index d69e552a63..0000000000 --- a/test/exec-privatetmp-no.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for PrivateTmp=no - -[Service] -ExecStart=/bin/sh -c 'exit $(test -f /tmp/test-exec_privatetmp)' -Type=oneshot -PrivateTmp=no diff --git a/test/exec-privatetmp-yes.service b/test/exec-privatetmp-yes.service deleted file mode 100644 index 881a040b87..0000000000 --- a/test/exec-privatetmp-yes.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for PrivateTmp=yes - -[Service] -ExecStart=/bin/sh -c 'exit $(test ! -f /tmp/test-exec_privatetmp)' -Type=oneshot -PrivateTmp=yes diff --git a/test/exec-runtimedirectory-mode.service b/test/exec-runtimedirectory-mode.service deleted file mode 100644 index ba6d7ee39f..0000000000 --- a/test/exec-runtimedirectory-mode.service +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Test for RuntimeDirectoryMode - -[Service] -ExecStart=/bin/sh -c 's=$(stat -c %a /tmp/test-exec_runtimedirectory-mode); echo $s; exit $(test $s = "750")' -Type=oneshot -RuntimeDirectory=test-exec_runtimedirectory-mode -RuntimeDirectoryMode=0750 diff --git a/test/exec-runtimedirectory-owner.service b/test/exec-runtimedirectory-owner.service deleted file mode 100644 index 077e08d1c5..0000000000 --- a/test/exec-runtimedirectory-owner.service +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Test for RuntimeDirectory owner (must not be the default group of the user if Group is set) - -[Service] -ExecStart=/bin/sh -c 'f=/tmp/test-exec_runtimedirectory-owner;g=$(stat -c %G $f); echo "$g"; exit $(test $g = "nobody")' -Type=oneshot -Group=nobody -User=root -RuntimeDirectory=test-exec_runtimedirectory-owner diff --git a/test/exec-runtimedirectory.service b/test/exec-runtimedirectory.service deleted file mode 100644 index c12a6c63d6..0000000000 --- a/test/exec-runtimedirectory.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for RuntimeDirectory - -[Service] -ExecStart=/bin/sh -c 'exit $(test -d /tmp/test-exec_runtimedirectory)' -Type=oneshot -RuntimeDirectory=test-exec_runtimedirectory diff --git a/test/exec-systemcallerrornumber.service b/test/exec-systemcallerrornumber.service deleted file mode 100644 index 255a8b231a..0000000000 --- a/test/exec-systemcallerrornumber.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for SystemCallErrorNumber - -[Service] -ExecStart=/usr/bin/uname -a -SystemCallFilter=~uname -SystemCallErrorNumber=EACCES diff --git a/test/exec-systemcallfilter-failing.service b/test/exec-systemcallfilter-failing.service deleted file mode 100644 index c6ce9368c9..0000000000 --- a/test/exec-systemcallfilter-failing.service +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Test for SystemCallFilter - -[Service] -ExecStart=/bin/echo "This should not be seen" -SystemCallFilter=ioperm -SystemCallFilter=~ioperm -SystemCallFilter=ioperm diff --git a/test/exec-systemcallfilter-failing2.service b/test/exec-systemcallfilter-failing2.service deleted file mode 100644 index b7f7c2aff9..0000000000 --- a/test/exec-systemcallfilter-failing2.service +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=Test for SystemCallFilter - -[Service] -ExecStart=/bin/echo "This should not be seen" -SystemCallFilter=~write open execve exit_group close mmap munmap fstat DONOTEXIST diff --git a/test/exec-systemcallfilter-not-failing.service b/test/exec-systemcallfilter-not-failing.service deleted file mode 100644 index feb206ab6d..0000000000 --- a/test/exec-systemcallfilter-not-failing.service +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Test for SystemCallFilter - -[Service] -ExecStart=/bin/echo "Foo bar" -SystemCallFilter=~read write open execve ioperm -SystemCallFilter=ioctl -SystemCallFilter=read write open execve -SystemCallFilter=~ioperm diff --git a/test/exec-systemcallfilter-not-failing2.service b/test/exec-systemcallfilter-not-failing2.service deleted file mode 100644 index cca469aa3d..0000000000 --- a/test/exec-systemcallfilter-not-failing2.service +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=Test for SystemCallFilter - -[Service] -ExecStart=/bin/echo "Foo bar" -SystemCallFilter= diff --git a/test/exec-umask-0177.service b/test/exec-umask-0177.service deleted file mode 100644 index af9295888e..0000000000 --- a/test/exec-umask-0177.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for UMask - -[Service] -ExecStart=/bin/sh -c 'touch /tmp/test-exec-umask; s=$(stat -c %a /tmp/test-exec-umask); echo $s; exit $(test $s = "600")' -UMask=0177 -PrivateTmp=yes diff --git a/test/exec-umask-default.service b/test/exec-umask-default.service deleted file mode 100644 index 41e20a60a1..0000000000 --- a/test/exec-umask-default.service +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=Test for UMask default - -[Service] -ExecStart=/bin/sh -c 'touch /tmp/test-exec-umask; s=$(stat -c %a /tmp/test-exec-umask); echo $s; exit $(test $s = "644")' -PrivateTmp=yes diff --git a/test/exec-user.service b/test/exec-user.service deleted file mode 100644 index 2ca08ebb42..0000000000 --- a/test/exec-user.service +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=Test for User - -[Service] -ExecStart=/bin/sh -c 'exit $(test "$USER" = nobody)' -User=nobody diff --git a/test/exec-workingdirectory.service b/test/exec-workingdirectory.service deleted file mode 100644 index 10855d682a..0000000000 --- a/test/exec-workingdirectory.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Test for WorkingDirectory - -[Service] -ExecStart=/bin/sh -c 'echo $PWD; exit $(test $PWD = "/tmp/test-exec_workingdirectory")' -Type=oneshot -WorkingDirectory=/tmp/test-exec_workingdirectory diff --git a/test/test-execute/exec-capabilityboundingset-invert.service b/test/test-execute/exec-capabilityboundingset-invert.service new file mode 100644 index 0000000000..e2b09e1550 --- /dev/null +++ b/test/test-execute/exec-capabilityboundingset-invert.service @@ -0,0 +1,6 @@ +[Unit] +Description=Test for CapabilityBoundingSet + +[Service] +ExecStart=/bin/sh -c 'c=$(capsh --print | grep "Bounding set " | grep "cap_chown"); echo $c; exit $(test -z $c)' +CapabilityBoundingSet=~CAP_CHOWN diff --git a/test/test-execute/exec-capabilityboundingset-merge.service b/test/test-execute/exec-capabilityboundingset-merge.service new file mode 100644 index 0000000000..b0f4732529 --- /dev/null +++ b/test/test-execute/exec-capabilityboundingset-merge.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for CapabilityBoundingSet + +[Service] +ExecStart=/bin/sh -c 'c=$(capsh --print | grep "Bounding set " | cut -f 2 -d "="); echo $c; exit $(test $c = "cap_chown,cap_fowner,cap_kill")' +CapabilityBoundingSet=CAP_FOWNER +CapabilityBoundingSet=CAP_KILL CAP_CHOWN diff --git a/test/test-execute/exec-capabilityboundingset-reset.service b/test/test-execute/exec-capabilityboundingset-reset.service new file mode 100644 index 0000000000..51092ab0d5 --- /dev/null +++ b/test/test-execute/exec-capabilityboundingset-reset.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for CapabilityBoundingSet + +[Service] +ExecStart=/bin/sh -c 'c=$(capsh --print | grep "Bounding set " | cut -f 2 -d "="); echo $c; exit $(test -z $c)' +CapabilityBoundingSet=CAP_FOWNER CAP_KILL +CapabilityBoundingSet= diff --git a/test/test-execute/exec-capabilityboundingset-simple.service b/test/test-execute/exec-capabilityboundingset-simple.service new file mode 100644 index 0000000000..b9037a0ddf --- /dev/null +++ b/test/test-execute/exec-capabilityboundingset-simple.service @@ -0,0 +1,6 @@ +[Unit] +Description=Test for CapabilityBoundingSet + +[Service] +ExecStart=/bin/sh -c 'c=$(capsh --print | grep "Bounding set " | cut -f 2 -d "="); echo $c; exit $(test $c = "cap_fowner,cap_kill")' +CapabilityBoundingSet=CAP_FOWNER CAP_KILL diff --git a/test/test-execute/exec-environment-empty.service b/test/test-execute/exec-environment-empty.service new file mode 100644 index 0000000000..0219ca4fd7 --- /dev/null +++ b/test/test-execute/exec-environment-empty.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for Environment + +[Service] +ExecStart=/bin/sh -c 'exit $(test ! "$VAR1" = "word1 word2") && $(test ! "$VAR2" = word3) && $(test ! "$VAR3" = \'$word 5 6\')' +Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" +Environment= diff --git a/test/test-execute/exec-environment-multiple.service b/test/test-execute/exec-environment-multiple.service new file mode 100644 index 0000000000..479005a5d8 --- /dev/null +++ b/test/test-execute/exec-environment-multiple.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for Environment + +[Service] +ExecStart=/bin/sh -c 'exit $(test "$VAR1" = "word1 word2") && $(test "$VAR2" = word3) && $(test "$VAR3" = foobar)' +Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" +Environment="VAR3=foobar" diff --git a/test/test-execute/exec-environment.service b/test/test-execute/exec-environment.service new file mode 100644 index 0000000000..4586b4c4a9 --- /dev/null +++ b/test/test-execute/exec-environment.service @@ -0,0 +1,6 @@ +[Unit] +Description=Test for Environment + +[Service] +ExecStart=/bin/sh -c 'exit $(test "$VAR1" = "word1 word2") && $(test "$VAR2" = word3) && $(test "$VAR3" = \'$word 5 6\')' +Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" diff --git a/test/test-execute/exec-environmentfile.service b/test/test-execute/exec-environmentfile.service new file mode 100644 index 0000000000..848f2a120c --- /dev/null +++ b/test/test-execute/exec-environmentfile.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for EnvironmentFile + +[Service] +ExecStart=/bin/sh -c 'exit $(test "$VAR1" = "word1 word2") && $(test "$VAR2" = word3) && $(test "$VAR3" = \'$word 5 6\')' +Type=oneshot +EnvironmentFile=/tmp/test-exec_environmentfile.conf diff --git a/test/test-execute/exec-group.service b/test/test-execute/exec-group.service new file mode 100644 index 0000000000..1aa04b5bd2 --- /dev/null +++ b/test/test-execute/exec-group.service @@ -0,0 +1,6 @@ +[Unit] +Description=Test for Group + +[Service] +ExecStart=/bin/sh -c 'exit $(test $(id -n -g) = nobody)' +Group=nobody diff --git a/test/test-execute/exec-ignoresigpipe-no.service b/test/test-execute/exec-ignoresigpipe-no.service new file mode 100644 index 0000000000..69b2e9d8a8 --- /dev/null +++ b/test/test-execute/exec-ignoresigpipe-no.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for IgnoreSIGPIPE=no + +[Service] +ExecStart=/bin/sh -c 'kill -PIPE 0' +Type=oneshot +IgnoreSIGPIPE=no diff --git a/test/test-execute/exec-ignoresigpipe-yes.service b/test/test-execute/exec-ignoresigpipe-yes.service new file mode 100644 index 0000000000..877ec8aed0 --- /dev/null +++ b/test/test-execute/exec-ignoresigpipe-yes.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for IgnoreSIGPIPE=yes + +[Service] +ExecStart=/bin/sh -c 'kill -PIPE 0' +Type=oneshot +IgnoreSIGPIPE=yes diff --git a/test/test-execute/exec-ioschedulingclass-best-effort.service b/test/test-execute/exec-ioschedulingclass-best-effort.service new file mode 100644 index 0000000000..56e2718505 --- /dev/null +++ b/test/test-execute/exec-ioschedulingclass-best-effort.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for IOSchedulingClass=best-effort + +[Service] +ExecStart=/bin/bash -c 'c=$(ionice); echo $c; [[ "$c" == best-effort* ]]' +Type=oneshot +IOSchedulingClass=best-effort diff --git a/test/test-execute/exec-ioschedulingclass-idle.service b/test/test-execute/exec-ioschedulingclass-idle.service new file mode 100644 index 0000000000..b45795cab7 --- /dev/null +++ b/test/test-execute/exec-ioschedulingclass-idle.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for IOSchedulingClass=idle + +[Service] +ExecStart=/bin/bash -c 'c=$(ionice); echo $c; [[ "$c" == idle* ]]' +Type=oneshot +IOSchedulingClass=idle diff --git a/test/test-execute/exec-ioschedulingclass-none.service b/test/test-execute/exec-ioschedulingclass-none.service new file mode 100644 index 0000000000..36b546ca01 --- /dev/null +++ b/test/test-execute/exec-ioschedulingclass-none.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for IOSchedulingClass=none + +[Service] +ExecStart=/bin/bash -c 'c=$(ionice); echo $c; [[ "$c" == none* ]]' +Type=oneshot +IOSchedulingClass=none diff --git a/test/test-execute/exec-ioschedulingclass-realtime.service b/test/test-execute/exec-ioschedulingclass-realtime.service new file mode 100644 index 0000000000..74936d8079 --- /dev/null +++ b/test/test-execute/exec-ioschedulingclass-realtime.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for IOSchedulingClass=realtime + +[Service] +ExecStart=/bin/bash -c 'c=$(ionice); echo $c; [[ "$c" == realtime* ]]' +Type=oneshot +IOSchedulingClass=realtime diff --git a/test/test-execute/exec-oomscoreadjust-negative.service b/test/test-execute/exec-oomscoreadjust-negative.service new file mode 100644 index 0000000000..63ab501c63 --- /dev/null +++ b/test/test-execute/exec-oomscoreadjust-negative.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for OOMScoreAdjust + +[Service] +ExecStart=/bin/bash -c 'c=$(cat /proc/self/oom_score_adj); echo $c; exit $(test $c -eq -100)' +OOMScoreAdjust=-100 +Type=oneshot diff --git a/test/test-execute/exec-oomscoreadjust-positive.service b/test/test-execute/exec-oomscoreadjust-positive.service new file mode 100644 index 0000000000..e47a4f1392 --- /dev/null +++ b/test/test-execute/exec-oomscoreadjust-positive.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for OOMScoreAdjust + +[Service] +ExecStart=/bin/bash -c 'c=$(cat /proc/self/oom_score_adj); echo $c; exit $(test $c -eq 100)' +OOMScoreAdjust=100 +Type=oneshot diff --git a/test/test-execute/exec-personality-s390.service b/test/test-execute/exec-personality-s390.service new file mode 100644 index 0000000000..f3c3b03e3d --- /dev/null +++ b/test/test-execute/exec-personality-s390.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for Personality=s390 + +[Service] +ExecStart=/bin/sh -c 'echo $(uname -m); exit $(test $(uname -m) = "s390")' +Type=oneshot +Personality=s390 diff --git a/test/test-execute/exec-personality-x86-64.service b/test/test-execute/exec-personality-x86-64.service new file mode 100644 index 0000000000..5bb5d910d0 --- /dev/null +++ b/test/test-execute/exec-personality-x86-64.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for Personality=x86-64 + +[Service] +ExecStart=/bin/sh -c 'echo $(uname -m); exit $(test $(uname -m) = "x86_64")' +Type=oneshot +Personality=x86-64 diff --git a/test/test-execute/exec-personality-x86.service b/test/test-execute/exec-personality-x86.service new file mode 100644 index 0000000000..0b370a6480 --- /dev/null +++ b/test/test-execute/exec-personality-x86.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for Personality=x86 + +[Service] +ExecStart=/bin/sh -c 'echo $(uname -m); exit $(test $(uname -m) = "i686")' +Type=oneshot +Personality=x86 diff --git a/test/test-execute/exec-privatedevices-no.service b/test/test-execute/exec-privatedevices-no.service new file mode 100644 index 0000000000..cf4f275fb6 --- /dev/null +++ b/test/test-execute/exec-privatedevices-no.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for PrivateDev=no + +[Service] +ExecStart=/bin/sh -c 'exit $(test -c /dev/mem)' +Type=oneshot +PrivateDevices=no diff --git a/test/test-execute/exec-privatedevices-yes.service b/test/test-execute/exec-privatedevices-yes.service new file mode 100644 index 0000000000..85b3f4f981 --- /dev/null +++ b/test/test-execute/exec-privatedevices-yes.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for PrivateDev=yes + +[Service] +ExecStart=/bin/sh -c 'exit $(test ! -c /dev/mem)' +Type=oneshot +PrivateDevices=yes diff --git a/test/test-execute/exec-privatenetwork-yes.service b/test/test-execute/exec-privatenetwork-yes.service new file mode 100644 index 0000000000..494712e6a7 --- /dev/null +++ b/test/test-execute/exec-privatenetwork-yes.service @@ -0,0 +1,6 @@ +[Unit] +Description=Test for PrivateNetwork + +[Service] +ExecStart=/bin/sh -c 'i=$(ip link | grep ": " | grep -v lo); echo $i; exit $(test -z $i)' +PrivateNetwork=yes diff --git a/test/test-execute/exec-privatetmp-no.service b/test/test-execute/exec-privatetmp-no.service new file mode 100644 index 0000000000..d69e552a63 --- /dev/null +++ b/test/test-execute/exec-privatetmp-no.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for PrivateTmp=no + +[Service] +ExecStart=/bin/sh -c 'exit $(test -f /tmp/test-exec_privatetmp)' +Type=oneshot +PrivateTmp=no diff --git a/test/test-execute/exec-privatetmp-yes.service b/test/test-execute/exec-privatetmp-yes.service new file mode 100644 index 0000000000..881a040b87 --- /dev/null +++ b/test/test-execute/exec-privatetmp-yes.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for PrivateTmp=yes + +[Service] +ExecStart=/bin/sh -c 'exit $(test ! -f /tmp/test-exec_privatetmp)' +Type=oneshot +PrivateTmp=yes diff --git a/test/test-execute/exec-runtimedirectory-mode.service b/test/test-execute/exec-runtimedirectory-mode.service new file mode 100644 index 0000000000..ba6d7ee39f --- /dev/null +++ b/test/test-execute/exec-runtimedirectory-mode.service @@ -0,0 +1,8 @@ +[Unit] +Description=Test for RuntimeDirectoryMode + +[Service] +ExecStart=/bin/sh -c 's=$(stat -c %a /tmp/test-exec_runtimedirectory-mode); echo $s; exit $(test $s = "750")' +Type=oneshot +RuntimeDirectory=test-exec_runtimedirectory-mode +RuntimeDirectoryMode=0750 diff --git a/test/test-execute/exec-runtimedirectory-owner.service b/test/test-execute/exec-runtimedirectory-owner.service new file mode 100644 index 0000000000..077e08d1c5 --- /dev/null +++ b/test/test-execute/exec-runtimedirectory-owner.service @@ -0,0 +1,9 @@ +[Unit] +Description=Test for RuntimeDirectory owner (must not be the default group of the user if Group is set) + +[Service] +ExecStart=/bin/sh -c 'f=/tmp/test-exec_runtimedirectory-owner;g=$(stat -c %G $f); echo "$g"; exit $(test $g = "nobody")' +Type=oneshot +Group=nobody +User=root +RuntimeDirectory=test-exec_runtimedirectory-owner diff --git a/test/test-execute/exec-runtimedirectory.service b/test/test-execute/exec-runtimedirectory.service new file mode 100644 index 0000000000..c12a6c63d6 --- /dev/null +++ b/test/test-execute/exec-runtimedirectory.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for RuntimeDirectory + +[Service] +ExecStart=/bin/sh -c 'exit $(test -d /tmp/test-exec_runtimedirectory)' +Type=oneshot +RuntimeDirectory=test-exec_runtimedirectory diff --git a/test/test-execute/exec-systemcallerrornumber.service b/test/test-execute/exec-systemcallerrornumber.service new file mode 100644 index 0000000000..255a8b231a --- /dev/null +++ b/test/test-execute/exec-systemcallerrornumber.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for SystemCallErrorNumber + +[Service] +ExecStart=/usr/bin/uname -a +SystemCallFilter=~uname +SystemCallErrorNumber=EACCES diff --git a/test/test-execute/exec-systemcallfilter-failing.service b/test/test-execute/exec-systemcallfilter-failing.service new file mode 100644 index 0000000000..c6ce9368c9 --- /dev/null +++ b/test/test-execute/exec-systemcallfilter-failing.service @@ -0,0 +1,8 @@ +[Unit] +Description=Test for SystemCallFilter + +[Service] +ExecStart=/bin/echo "This should not be seen" +SystemCallFilter=ioperm +SystemCallFilter=~ioperm +SystemCallFilter=ioperm diff --git a/test/test-execute/exec-systemcallfilter-failing2.service b/test/test-execute/exec-systemcallfilter-failing2.service new file mode 100644 index 0000000000..b7f7c2aff9 --- /dev/null +++ b/test/test-execute/exec-systemcallfilter-failing2.service @@ -0,0 +1,6 @@ +[Unit] +Description=Test for SystemCallFilter + +[Service] +ExecStart=/bin/echo "This should not be seen" +SystemCallFilter=~write open execve exit_group close mmap munmap fstat DONOTEXIST diff --git a/test/test-execute/exec-systemcallfilter-not-failing.service b/test/test-execute/exec-systemcallfilter-not-failing.service new file mode 100644 index 0000000000..feb206ab6d --- /dev/null +++ b/test/test-execute/exec-systemcallfilter-not-failing.service @@ -0,0 +1,9 @@ +[Unit] +Description=Test for SystemCallFilter + +[Service] +ExecStart=/bin/echo "Foo bar" +SystemCallFilter=~read write open execve ioperm +SystemCallFilter=ioctl +SystemCallFilter=read write open execve +SystemCallFilter=~ioperm diff --git a/test/test-execute/exec-systemcallfilter-not-failing2.service b/test/test-execute/exec-systemcallfilter-not-failing2.service new file mode 100644 index 0000000000..cca469aa3d --- /dev/null +++ b/test/test-execute/exec-systemcallfilter-not-failing2.service @@ -0,0 +1,6 @@ +[Unit] +Description=Test for SystemCallFilter + +[Service] +ExecStart=/bin/echo "Foo bar" +SystemCallFilter= diff --git a/test/test-execute/exec-umask-0177.service b/test/test-execute/exec-umask-0177.service new file mode 100644 index 0000000000..af9295888e --- /dev/null +++ b/test/test-execute/exec-umask-0177.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for UMask + +[Service] +ExecStart=/bin/sh -c 'touch /tmp/test-exec-umask; s=$(stat -c %a /tmp/test-exec-umask); echo $s; exit $(test $s = "600")' +UMask=0177 +PrivateTmp=yes diff --git a/test/test-execute/exec-umask-default.service b/test/test-execute/exec-umask-default.service new file mode 100644 index 0000000000..41e20a60a1 --- /dev/null +++ b/test/test-execute/exec-umask-default.service @@ -0,0 +1,6 @@ +[Unit] +Description=Test for UMask default + +[Service] +ExecStart=/bin/sh -c 'touch /tmp/test-exec-umask; s=$(stat -c %a /tmp/test-exec-umask); echo $s; exit $(test $s = "644")' +PrivateTmp=yes diff --git a/test/test-execute/exec-user.service b/test/test-execute/exec-user.service new file mode 100644 index 0000000000..2ca08ebb42 --- /dev/null +++ b/test/test-execute/exec-user.service @@ -0,0 +1,6 @@ +[Unit] +Description=Test for User + +[Service] +ExecStart=/bin/sh -c 'exit $(test "$USER" = nobody)' +User=nobody diff --git a/test/test-execute/exec-workingdirectory.service b/test/test-execute/exec-workingdirectory.service new file mode 100644 index 0000000000..10855d682a --- /dev/null +++ b/test/test-execute/exec-workingdirectory.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for WorkingDirectory + +[Service] +ExecStart=/bin/sh -c 'echo $PWD; exit $(test $PWD = "/tmp/test-exec_workingdirectory")' +Type=oneshot +WorkingDirectory=/tmp/test-exec_workingdirectory -- cgit v1.2.3-54-g00ecf