test-execute: move all files related to a specific directory
authorRonny Chevalier <chevalier.ronny@gmail.com>
Fri, 30 Oct 2015 17:03:18 +0000 (18:03 +0100)
committerRonny Chevalier <chevalier.ronny@gmail.com>
Sat, 31 Oct 2015 14:07:19 +0000 (15:07 +0100)
To avoid polluting test/

76 files changed:
Makefile.am
src/test/test-execute.c
test/exec-capabilityboundingset-invert.service [deleted file]
test/exec-capabilityboundingset-merge.service [deleted file]
test/exec-capabilityboundingset-reset.service [deleted file]
test/exec-capabilityboundingset-simple.service [deleted file]
test/exec-environment-empty.service [deleted file]
test/exec-environment-multiple.service [deleted file]
test/exec-environment.service [deleted file]
test/exec-environmentfile.service [deleted file]
test/exec-group.service [deleted file]
test/exec-ignoresigpipe-no.service [deleted file]
test/exec-ignoresigpipe-yes.service [deleted file]
test/exec-ioschedulingclass-best-effort.service [deleted file]
test/exec-ioschedulingclass-idle.service [deleted file]
test/exec-ioschedulingclass-none.service [deleted file]
test/exec-ioschedulingclass-realtime.service [deleted file]
test/exec-oomscoreadjust-negative.service [deleted file]
test/exec-oomscoreadjust-positive.service [deleted file]
test/exec-personality-s390.service [deleted file]
test/exec-personality-x86-64.service [deleted file]
test/exec-personality-x86.service [deleted file]
test/exec-privatedevices-no.service [deleted file]
test/exec-privatedevices-yes.service [deleted file]
test/exec-privatenetwork-yes.service [deleted file]
test/exec-privatetmp-no.service [deleted file]
test/exec-privatetmp-yes.service [deleted file]
test/exec-runtimedirectory-mode.service [deleted file]
test/exec-runtimedirectory-owner.service [deleted file]
test/exec-runtimedirectory.service [deleted file]
test/exec-systemcallerrornumber.service [deleted file]
test/exec-systemcallfilter-failing.service [deleted file]
test/exec-systemcallfilter-failing2.service [deleted file]
test/exec-systemcallfilter-not-failing.service [deleted file]
test/exec-systemcallfilter-not-failing2.service [deleted file]
test/exec-umask-0177.service [deleted file]
test/exec-umask-default.service [deleted file]
test/exec-user.service [deleted file]
test/exec-workingdirectory.service [deleted file]
test/test-execute/exec-capabilityboundingset-invert.service [new file with mode: 0644]
test/test-execute/exec-capabilityboundingset-merge.service [new file with mode: 0644]
test/test-execute/exec-capabilityboundingset-reset.service [new file with mode: 0644]
test/test-execute/exec-capabilityboundingset-simple.service [new file with mode: 0644]
test/test-execute/exec-environment-empty.service [new file with mode: 0644]
test/test-execute/exec-environment-multiple.service [new file with mode: 0644]
test/test-execute/exec-environment.service [new file with mode: 0644]
test/test-execute/exec-environmentfile.service [new file with mode: 0644]
test/test-execute/exec-group.service [new file with mode: 0644]
test/test-execute/exec-ignoresigpipe-no.service [new file with mode: 0644]
test/test-execute/exec-ignoresigpipe-yes.service [new file with mode: 0644]
test/test-execute/exec-ioschedulingclass-best-effort.service [new file with mode: 0644]
test/test-execute/exec-ioschedulingclass-idle.service [new file with mode: 0644]
test/test-execute/exec-ioschedulingclass-none.service [new file with mode: 0644]
test/test-execute/exec-ioschedulingclass-realtime.service [new file with mode: 0644]
test/test-execute/exec-oomscoreadjust-negative.service [new file with mode: 0644]
test/test-execute/exec-oomscoreadjust-positive.service [new file with mode: 0644]
test/test-execute/exec-personality-s390.service [new file with mode: 0644]
test/test-execute/exec-personality-x86-64.service [new file with mode: 0644]
test/test-execute/exec-personality-x86.service [new file with mode: 0644]
test/test-execute/exec-privatedevices-no.service [new file with mode: 0644]
test/test-execute/exec-privatedevices-yes.service [new file with mode: 0644]
test/test-execute/exec-privatenetwork-yes.service [new file with mode: 0644]
test/test-execute/exec-privatetmp-no.service [new file with mode: 0644]
test/test-execute/exec-privatetmp-yes.service [new file with mode: 0644]
test/test-execute/exec-runtimedirectory-mode.service [new file with mode: 0644]
test/test-execute/exec-runtimedirectory-owner.service [new file with mode: 0644]
test/test-execute/exec-runtimedirectory.service [new file with mode: 0644]
test/test-execute/exec-systemcallerrornumber.service [new file with mode: 0644]
test/test-execute/exec-systemcallfilter-failing.service [new file with mode: 0644]
test/test-execute/exec-systemcallfilter-failing2.service [new file with mode: 0644]
test/test-execute/exec-systemcallfilter-not-failing.service [new file with mode: 0644]
test/test-execute/exec-systemcallfilter-not-failing2.service [new file with mode: 0644]
test/test-execute/exec-umask-0177.service [new file with mode: 0644]
test/test-execute/exec-umask-default.service [new file with mode: 0644]
test/test-execute/exec-user.service [new file with mode: 0644]
test/test-execute/exec-workingdirectory.service [new file with mode: 0644]

index 2f8bfd4d34c568676ad246d0ecf541f50c2dd8aa..4319c2fdb7a504d067dd3daa648e0a2466d75ebd 100644 (file)
@@ -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 \
index 158626f7157373974281e8d887ebe4037b228180..e2ec53ee51d6fb3820376d4aed9eab918f4570c8 100644 (file)
@@ -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 (file)
index e2b09e1..0000000
+++ /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 (file)
index b0f4732..0000000
+++ /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 (file)
index 51092ab..0000000
+++ /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 (file)
index b9037a0..0000000
+++ /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 (file)
index 0219ca4..0000000
+++ /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 (file)
index 479005a..0000000
+++ /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 (file)
index 4586b4c..0000000
+++ /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 (file)
index 848f2a1..0000000
+++ /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 (file)
index 1aa04b5..0000000
+++ /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 (file)
index 69b2e9d..0000000
+++ /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 (file)
index 877ec8a..0000000
+++ /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 (file)
index 56e2718..0000000
+++ /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 (file)
index b45795c..0000000
+++ /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 (file)
index 36b546c..0000000
+++ /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 (file)
index 74936d8..0000000
+++ /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 (file)
index 63ab501..0000000
+++ /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 (file)
index e47a4f1..0000000
+++ /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 (file)
index f3c3b03..0000000
+++ /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 (file)
index 5bb5d91..0000000
+++ /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 (file)
index 0b370a6..0000000
+++ /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 (file)
index cf4f275..0000000
+++ /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 (file)
index 85b3f4f..0000000
+++ /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 (file)
index 494712e..0000000
+++ /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 (file)
index d69e552..0000000
+++ /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 (file)
index 881a040..0000000
+++ /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 (file)
index ba6d7ee..0000000
+++ /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 (file)
index 077e08d..0000000
+++ /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 (file)
index c12a6c6..0000000
+++ /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 (file)
index 255a8b2..0000000
+++ /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 (file)
index c6ce936..0000000
+++ /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 (file)
index b7f7c2a..0000000
+++ /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 (file)
index feb206a..0000000
+++ /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 (file)
index cca469a..0000000
+++ /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 (file)
index af92958..0000000
+++ /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 (file)
index 41e20a6..0000000
+++ /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 (file)
index 2ca08eb..0000000
+++ /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 (file)
index 10855d6..0000000
+++ /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 (file)
index 0000000..e2b09e1
--- /dev/null
@@ -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 (file)
index 0000000..b0f4732
--- /dev/null
@@ -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 (file)
index 0000000..51092ab
--- /dev/null
@@ -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 (file)
index 0000000..b9037a0
--- /dev/null
@@ -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 (file)
index 0000000..0219ca4
--- /dev/null
@@ -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 (file)
index 0000000..479005a
--- /dev/null
@@ -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 (file)
index 0000000..4586b4c
--- /dev/null
@@ -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 (file)
index 0000000..848f2a1
--- /dev/null
@@ -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 (file)
index 0000000..1aa04b5
--- /dev/null
@@ -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 (file)
index 0000000..69b2e9d
--- /dev/null
@@ -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 (file)
index 0000000..877ec8a
--- /dev/null
@@ -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 (file)
index 0000000..56e2718
--- /dev/null
@@ -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 (file)
index 0000000..b45795c
--- /dev/null
@@ -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 (file)
index 0000000..36b546c
--- /dev/null
@@ -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 (file)
index 0000000..74936d8
--- /dev/null
@@ -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 (file)
index 0000000..63ab501
--- /dev/null
@@ -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 (file)
index 0000000..e47a4f1
--- /dev/null
@@ -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 (file)
index 0000000..f3c3b03
--- /dev/null
@@ -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 (file)
index 0000000..5bb5d91
--- /dev/null
@@ -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 (file)
index 0000000..0b370a6
--- /dev/null
@@ -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 (file)
index 0000000..cf4f275
--- /dev/null
@@ -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 (file)
index 0000000..85b3f4f
--- /dev/null
@@ -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 (file)
index 0000000..494712e
--- /dev/null
@@ -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 (file)
index 0000000..d69e552
--- /dev/null
@@ -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 (file)
index 0000000..881a040
--- /dev/null
@@ -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 (file)
index 0000000..ba6d7ee
--- /dev/null
@@ -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 (file)
index 0000000..077e08d
--- /dev/null
@@ -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 (file)
index 0000000..c12a6c6
--- /dev/null
@@ -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 (file)
index 0000000..255a8b2
--- /dev/null
@@ -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 (file)
index 0000000..c6ce936
--- /dev/null
@@ -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 (file)
index 0000000..b7f7c2a
--- /dev/null
@@ -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 (file)
index 0000000..feb206a
--- /dev/null
@@ -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 (file)
index 0000000..cca469a
--- /dev/null
@@ -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 (file)
index 0000000..af92958
--- /dev/null
@@ -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 (file)
index 0000000..41e20a6
--- /dev/null
@@ -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 (file)
index 0000000..2ca08eb
--- /dev/null
@@ -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 (file)
index 0000000..10855d6
--- /dev/null
@@ -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