From 63447f1153093c883b2488e53f46ff581d904e6a Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Fri, 30 Oct 2015 13:51:51 +0100 Subject: test-execute: add test for PrivateNetwork --- src/test/test-execute.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/test') diff --git a/src/test/test-execute.c b/src/test/test-execute.c index afbaa12e94..fb0cb3fdc4 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -178,6 +178,18 @@ static void test_exec_capabilityboundingset(Manager *m) { test(m, "exec-capabilityboundingset-invert.service", 0, CLD_EXITED); } +static void test_exec_privatenetwork(Manager *m) { + int r; + + r = find_binary("ip", NULL); + if (r < 0) { + log_error_errno(r, "Skipping test_exec_privatenetwork, could not find ip binary: %m"); + return; + } + + test(m, "exec-privatenetwork-yes.service", 0, CLD_EXITED); +} + int main(int argc, char *argv[]) { test_function_t tests[] = { test_exec_workingdirectory, @@ -185,6 +197,7 @@ int main(int argc, char *argv[]) { test_exec_ignoresigpipe, test_exec_privatetmp, test_exec_privatedevices, + test_exec_privatenetwork, test_exec_systemcallfilter, test_exec_systemcallerrornumber, test_exec_user, -- cgit v1.2.3-54-g00ecf From 03bd70dd01c61c7a4b1e17d4b7235bab68c1ebd1 Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Fri, 30 Oct 2015 16:55:44 +0100 Subject: test-execute: add test for EnvironmentFile --- Makefile.am | 1 + src/test/test-execute.c | 22 ++++++++++++++++++++++ test/exec-environmentfile.service | 7 +++++++ 3 files changed, 30 insertions(+) create mode 100644 test/exec-environmentfile.service (limited to 'src/test') diff --git a/Makefile.am b/Makefile.am index cd5ea6f32c..64c0ca64f2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1567,6 +1567,7 @@ EXTRA_DIST += \ test/exec-umask-0177.service \ test/exec-umask-default.service \ test/exec-privatenetwork-yes.service \ + test/exec-environmentfile.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 fb0cb3fdc4..5898b3fb71 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -22,6 +22,7 @@ #include #include +#include "fileio.h" #include "fs-util.h" #include "macro.h" #include "manager.h" @@ -147,6 +148,26 @@ static void test_exec_environment(Manager *m) { test(m, "exec-environment-empty.service", 0, CLD_EXITED); } +static void test_exec_environmentfile(Manager *m) { + static const char e[] = + "VAR1='word1 word2'\n" + "VAR2=word3 \n" + "# comment1\n" + "\n" + "; comment2\n" + " ; # comment3\n" + "line without an equal\n" + "VAR3='$word 5 6'\n"; + int r; + + r = write_string_file("/tmp/test-exec_environmentfile.conf", e, WRITE_STRING_FILE_CREATE); + assert_se(r == 0); + + test(m, "exec-environmentfile.service", 0, CLD_EXITED); + + unlink("/tmp/test-exec_environmentfile.conf"); +} + static void test_exec_umask(Manager *m) { test(m, "exec-umask-default.service", 0, CLD_EXITED); test(m, "exec-umask-0177.service", 0, CLD_EXITED); @@ -203,6 +224,7 @@ int main(int argc, char *argv[]) { test_exec_user, test_exec_group, test_exec_environment, + test_exec_environmentfile, test_exec_umask, test_exec_runtimedirectory, test_exec_capabilityboundingset, diff --git a/test/exec-environmentfile.service b/test/exec-environmentfile.service new file mode 100644 index 0000000000..848f2a120c --- /dev/null +++ b/test/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 -- cgit v1.2.3-54-g00ecf From c388dfea5a9de5771283fbf0f5ebc5a45c895b79 Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Fri, 30 Oct 2015 17:09:22 +0100 Subject: test-execute: add tests for OOMScoreAdjust --- Makefile.am | 2 ++ src/test/test-execute.c | 6 ++++++ test/exec-oomscoreadjust-negative.service | 7 +++++++ test/exec-oomscoreadjust-positive.service | 7 +++++++ 4 files changed, 22 insertions(+) create mode 100644 test/exec-oomscoreadjust-negative.service create mode 100644 test/exec-oomscoreadjust-positive.service (limited to 'src/test') diff --git a/Makefile.am b/Makefile.am index 64c0ca64f2..e2e3bca340 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1568,6 +1568,8 @@ EXTRA_DIST += \ 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/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 5898b3fb71..d708878a4d 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -211,6 +211,11 @@ static void test_exec_privatenetwork(Manager *m) { test(m, "exec-privatenetwork-yes.service", 0, CLD_EXITED); } +static void test_exec_oomscoreadjust(Manager *m) { + test(m, "exec-oomscoreadjust-positive.service", 0, CLD_EXITED); + test(m, "exec-oomscoreadjust-negative.service", 0, CLD_EXITED); +} + int main(int argc, char *argv[]) { test_function_t tests[] = { test_exec_workingdirectory, @@ -228,6 +233,7 @@ int main(int argc, char *argv[]) { test_exec_umask, test_exec_runtimedirectory, test_exec_capabilityboundingset, + test_exec_oomscoreadjust, NULL, }; test_function_t *test = NULL; diff --git a/test/exec-oomscoreadjust-negative.service b/test/exec-oomscoreadjust-negative.service new file mode 100644 index 0000000000..63ab501c63 --- /dev/null +++ b/test/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/exec-oomscoreadjust-positive.service b/test/exec-oomscoreadjust-positive.service new file mode 100644 index 0000000000..e47a4f1392 --- /dev/null +++ b/test/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 -- cgit v1.2.3-54-g00ecf From a622675862ca59cae4662bff21a0c795e0108c65 Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Fri, 30 Oct 2015 17:46:32 +0100 Subject: test-execute: add tests for IOSchedulingClass --- Makefile.am | 4 ++++ src/test/test-execute.c | 8 ++++++++ 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 +++++++ 6 files changed, 40 insertions(+) create mode 100644 test/exec-ioschedulingclass-best-effort.service create mode 100644 test/exec-ioschedulingclass-idle.service create mode 100644 test/exec-ioschedulingclass-none.service create mode 100644 test/exec-ioschedulingclass-realtime.service (limited to 'src/test') diff --git a/Makefile.am b/Makefile.am index e2e3bca340..3d211deefc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1570,6 +1570,10 @@ EXTRA_DIST += \ 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/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 d708878a4d..158626f715 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -216,6 +216,13 @@ static void test_exec_oomscoreadjust(Manager *m) { test(m, "exec-oomscoreadjust-negative.service", 0, CLD_EXITED); } +static void test_exec_ioschedulingclass(Manager *m) { + test(m, "exec-ioschedulingclass-none.service", 0, CLD_EXITED); + test(m, "exec-ioschedulingclass-idle.service", 0, CLD_EXITED); + test(m, "exec-ioschedulingclass-realtime.service", 0, CLD_EXITED); + test(m, "exec-ioschedulingclass-best-effort.service", 0, CLD_EXITED); +} + int main(int argc, char *argv[]) { test_function_t tests[] = { test_exec_workingdirectory, @@ -234,6 +241,7 @@ int main(int argc, char *argv[]) { test_exec_runtimedirectory, test_exec_capabilityboundingset, test_exec_oomscoreadjust, + test_exec_ioschedulingclass, NULL, }; test_function_t *test = NULL; diff --git a/test/exec-ioschedulingclass-best-effort.service b/test/exec-ioschedulingclass-best-effort.service new file mode 100644 index 0000000000..56e2718505 --- /dev/null +++ b/test/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/exec-ioschedulingclass-idle.service b/test/exec-ioschedulingclass-idle.service new file mode 100644 index 0000000000..b45795cab7 --- /dev/null +++ b/test/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/exec-ioschedulingclass-none.service b/test/exec-ioschedulingclass-none.service new file mode 100644 index 0000000000..36b546ca01 --- /dev/null +++ b/test/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/exec-ioschedulingclass-realtime.service b/test/exec-ioschedulingclass-realtime.service new file mode 100644 index 0000000000..74936d8079 --- /dev/null +++ b/test/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 -- cgit v1.2.3-54-g00ecf 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 (limited to 'src/test') 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 From aa8e00da547b50ea20e3691133bb3ae1d9644a2b Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Fri, 30 Oct 2015 18:12:31 +0100 Subject: test-path: move all related test files to a specific directory To avoid polluting test/ --- Makefile.am | 34 ++++++++++++++------------- src/test/test-path.c | 2 +- test/path-changed.path | 8 ------- test/path-changed.service | 1 - test/path-directorynotempty.path | 8 ------- test/path-directorynotempty.service | 1 - test/path-exists.path | 8 ------- test/path-exists.service | 1 - test/path-existsglob.path | 8 ------- test/path-existsglob.service | 1 - test/path-makedirectory.path | 10 -------- test/path-makedirectory.service | 1 - test/path-modified.path | 8 ------- test/path-modified.service | 1 - test/path-mycustomunit.service | 6 ----- test/path-service.service | 6 ----- test/path-unit.path | 9 ------- test/paths.target | 1 - test/test-path/basic.target | 1 + test/test-path/path-changed.path | 8 +++++++ test/test-path/path-changed.service | 1 + test/test-path/path-directorynotempty.path | 8 +++++++ test/test-path/path-directorynotempty.service | 1 + test/test-path/path-exists.path | 8 +++++++ test/test-path/path-exists.service | 1 + test/test-path/path-existsglob.path | 8 +++++++ test/test-path/path-existsglob.service | 1 + test/test-path/path-makedirectory.path | 10 ++++++++ test/test-path/path-makedirectory.service | 1 + test/test-path/path-modified.path | 8 +++++++ test/test-path/path-modified.service | 1 + test/test-path/path-mycustomunit.service | 6 +++++ test/test-path/path-service.service | 6 +++++ test/test-path/path-unit.path | 9 +++++++ test/test-path/paths.target | 1 + test/test-path/sysinit.target | 1 + 36 files changed, 99 insertions(+), 95 deletions(-) delete mode 100644 test/path-changed.path delete mode 120000 test/path-changed.service delete mode 100644 test/path-directorynotempty.path delete mode 120000 test/path-directorynotempty.service delete mode 100644 test/path-exists.path delete mode 120000 test/path-exists.service delete mode 100644 test/path-existsglob.path delete mode 120000 test/path-existsglob.service delete mode 100644 test/path-makedirectory.path delete mode 120000 test/path-makedirectory.service delete mode 100644 test/path-modified.path delete mode 120000 test/path-modified.service delete mode 100644 test/path-mycustomunit.service delete mode 100644 test/path-service.service delete mode 100644 test/path-unit.path delete mode 120000 test/paths.target create mode 120000 test/test-path/basic.target create mode 100644 test/test-path/path-changed.path create mode 120000 test/test-path/path-changed.service create mode 100644 test/test-path/path-directorynotempty.path create mode 120000 test/test-path/path-directorynotempty.service create mode 100644 test/test-path/path-exists.path create mode 120000 test/test-path/path-exists.service create mode 100644 test/test-path/path-existsglob.path create mode 120000 test/test-path/path-existsglob.service create mode 100644 test/test-path/path-makedirectory.path create mode 120000 test/test-path/path-makedirectory.service create mode 100644 test/test-path/path-modified.path create mode 120000 test/test-path/path-modified.service create mode 100644 test/test-path/path-mycustomunit.service create mode 100644 test/test-path/path-service.service create mode 100644 test/test-path/path-unit.path create mode 120000 test/test-path/paths.target create mode 120000 test/test-path/sysinit.target (limited to 'src/test') diff --git a/Makefile.am b/Makefile.am index 4319c2fdb7..be001bd09e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1515,7 +1515,6 @@ EXTRA_DIST += \ test/h.service \ test/parent-deep.slice \ test/parent.slice \ - test/paths.target \ test/sched_idle_bad.service \ test/sched_idle_ok.service \ test/sched_rr_bad.service \ @@ -1529,21 +1528,24 @@ EXTRA_DIST += \ test/testsuite.target \ test/timers.target \ test/unstoppable.service \ - test/path-changed.service \ - test/path-directorynotempty.service \ - test/path-existsglob.service \ - test/path-exists.service \ - test/path-makedirectory.service \ - test/path-modified.service \ - test/path-mycustomunit.service \ - test/path-service.service \ - test/path-changed.path \ - test/path-directorynotempty.path \ - test/path-existsglob.path \ - test/path-exists.path \ - test/path-makedirectory.path \ - test/path-modified.path \ - test/path-unit.path \ + test/test-path/paths.target \ + test/test-path/basic.target \ + test/test-path/sysinit.target \ + test/test-path/path-changed.service \ + test/test-path/path-directorynotempty.service \ + test/test-path/path-existsglob.service \ + test/test-path/path-exists.service \ + test/test-path/path-makedirectory.service \ + test/test-path/path-modified.service \ + test/test-path/path-mycustomunit.service \ + test/test-path/path-service.service \ + test/test-path/path-changed.path \ + test/test-path/path-directorynotempty.path \ + test/test-path/path-existsglob.path \ + test/test-path/path-exists.path \ + test/test-path/path-makedirectory.path \ + test/test-path/path-modified.path \ + test/test-path/path-unit.path \ test/test-execute/exec-environment-empty.service \ test/test-execute/exec-environment-multiple.service \ test/test-execute/exec-environment.service \ diff --git a/src/test/test-path.c b/src/test/test-path.c index ff0f044958..8302bdd283 100644 --- a/src/test/test-path.c +++ b/src/test/test-path.c @@ -258,7 +258,7 @@ int main(int argc, char *argv[]) { log_parse_environment(); log_open(); - assert_se(set_unit_path(TEST_DIR) >= 0); + assert_se(set_unit_path(TEST_DIR "/test-path/") >= 0); for (test = tests; test && *test; test++) { int r; diff --git a/test/path-changed.path b/test/path-changed.path deleted file mode 100644 index e58bdd925f..0000000000 --- a/test/path-changed.path +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Test PathChanged - -[Path] -PathChanged=/tmp/test-path_changed - -[Install] -WantedBy=multi-user.target diff --git a/test/path-changed.service b/test/path-changed.service deleted file mode 120000 index 8bdf178830..0000000000 --- a/test/path-changed.service +++ /dev/null @@ -1 +0,0 @@ -path-service.service \ No newline at end of file diff --git a/test/path-directorynotempty.path b/test/path-directorynotempty.path deleted file mode 100644 index 17e599fc0e..0000000000 --- a/test/path-directorynotempty.path +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Test DirectoryNotEmpty - -[Path] -DirectoryNotEmpty=/tmp/test-path_directorynotempty/ - -[Install] -WantedBy=multi-user.target diff --git a/test/path-directorynotempty.service b/test/path-directorynotempty.service deleted file mode 120000 index 8bdf178830..0000000000 --- a/test/path-directorynotempty.service +++ /dev/null @@ -1 +0,0 @@ -path-service.service \ No newline at end of file diff --git a/test/path-exists.path b/test/path-exists.path deleted file mode 100644 index c4c9105af4..0000000000 --- a/test/path-exists.path +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Test PathExists - -[Path] -PathExists=/tmp/test-path_exists - -[Install] -WantedBy=multi-user.target diff --git a/test/path-exists.service b/test/path-exists.service deleted file mode 120000 index 8bdf178830..0000000000 --- a/test/path-exists.service +++ /dev/null @@ -1 +0,0 @@ -path-service.service \ No newline at end of file diff --git a/test/path-existsglob.path b/test/path-existsglob.path deleted file mode 100644 index a058599605..0000000000 --- a/test/path-existsglob.path +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Test PathExistsGlob - -[Path] -PathExistsGlob=/tmp/test-path_existsglob* - -[Install] -WantedBy=multi-user.target diff --git a/test/path-existsglob.service b/test/path-existsglob.service deleted file mode 120000 index 8bdf178830..0000000000 --- a/test/path-existsglob.service +++ /dev/null @@ -1 +0,0 @@ -path-service.service \ No newline at end of file diff --git a/test/path-makedirectory.path b/test/path-makedirectory.path deleted file mode 100644 index 9408479c0f..0000000000 --- a/test/path-makedirectory.path +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Test MakeDirectory & DirectoryMode - -[Path] -DirectoryNotEmpty=/tmp/test-path_makedirectory/ -MakeDirectory=yes -DirectoryMode=0744 - -[Install] -WantedBy=multi-user.target diff --git a/test/path-makedirectory.service b/test/path-makedirectory.service deleted file mode 120000 index 8bdf178830..0000000000 --- a/test/path-makedirectory.service +++ /dev/null @@ -1 +0,0 @@ -path-service.service \ No newline at end of file diff --git a/test/path-modified.path b/test/path-modified.path deleted file mode 100644 index 18363227ba..0000000000 --- a/test/path-modified.path +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Test PathModified - -[Path] -PathModified=/tmp/test-path_modified - -[Install] -WantedBy=multi-user.target diff --git a/test/path-modified.service b/test/path-modified.service deleted file mode 120000 index 8bdf178830..0000000000 --- a/test/path-modified.service +++ /dev/null @@ -1 +0,0 @@ -path-service.service \ No newline at end of file diff --git a/test/path-mycustomunit.service b/test/path-mycustomunit.service deleted file mode 100644 index 172ac0d0d5..0000000000 --- a/test/path-mycustomunit.service +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=Service Test Path Unit= - -[Service] -ExecStart=/bin/true -Type=oneshot diff --git a/test/path-service.service b/test/path-service.service deleted file mode 100644 index f8499ec619..0000000000 --- a/test/path-service.service +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=Service Test for Path units - -[Service] -ExecStart=/bin/true -Type=oneshot diff --git a/test/path-unit.path b/test/path-unit.path deleted file mode 100644 index 95e572d6d5..0000000000 --- a/test/path-unit.path +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Test Path Unit= - -[Path] -PathExists=/tmp/test-path_unit -Unit=path-mycustomunit.service - -[Install] -WantedBy=multi-user.target diff --git a/test/paths.target b/test/paths.target deleted file mode 120000 index e9939c9801..0000000000 --- a/test/paths.target +++ /dev/null @@ -1 +0,0 @@ -../units/paths.target \ No newline at end of file diff --git a/test/test-path/basic.target b/test/test-path/basic.target new file mode 120000 index 0000000000..a882b72cc9 --- /dev/null +++ b/test/test-path/basic.target @@ -0,0 +1 @@ +../../units/basic.target \ No newline at end of file diff --git a/test/test-path/path-changed.path b/test/test-path/path-changed.path new file mode 100644 index 0000000000..e58bdd925f --- /dev/null +++ b/test/test-path/path-changed.path @@ -0,0 +1,8 @@ +[Unit] +Description=Test PathChanged + +[Path] +PathChanged=/tmp/test-path_changed + +[Install] +WantedBy=multi-user.target diff --git a/test/test-path/path-changed.service b/test/test-path/path-changed.service new file mode 120000 index 0000000000..8bdf178830 --- /dev/null +++ b/test/test-path/path-changed.service @@ -0,0 +1 @@ +path-service.service \ No newline at end of file diff --git a/test/test-path/path-directorynotempty.path b/test/test-path/path-directorynotempty.path new file mode 100644 index 0000000000..17e599fc0e --- /dev/null +++ b/test/test-path/path-directorynotempty.path @@ -0,0 +1,8 @@ +[Unit] +Description=Test DirectoryNotEmpty + +[Path] +DirectoryNotEmpty=/tmp/test-path_directorynotempty/ + +[Install] +WantedBy=multi-user.target diff --git a/test/test-path/path-directorynotempty.service b/test/test-path/path-directorynotempty.service new file mode 120000 index 0000000000..8bdf178830 --- /dev/null +++ b/test/test-path/path-directorynotempty.service @@ -0,0 +1 @@ +path-service.service \ No newline at end of file diff --git a/test/test-path/path-exists.path b/test/test-path/path-exists.path new file mode 100644 index 0000000000..c4c9105af4 --- /dev/null +++ b/test/test-path/path-exists.path @@ -0,0 +1,8 @@ +[Unit] +Description=Test PathExists + +[Path] +PathExists=/tmp/test-path_exists + +[Install] +WantedBy=multi-user.target diff --git a/test/test-path/path-exists.service b/test/test-path/path-exists.service new file mode 120000 index 0000000000..8bdf178830 --- /dev/null +++ b/test/test-path/path-exists.service @@ -0,0 +1 @@ +path-service.service \ No newline at end of file diff --git a/test/test-path/path-existsglob.path b/test/test-path/path-existsglob.path new file mode 100644 index 0000000000..a058599605 --- /dev/null +++ b/test/test-path/path-existsglob.path @@ -0,0 +1,8 @@ +[Unit] +Description=Test PathExistsGlob + +[Path] +PathExistsGlob=/tmp/test-path_existsglob* + +[Install] +WantedBy=multi-user.target diff --git a/test/test-path/path-existsglob.service b/test/test-path/path-existsglob.service new file mode 120000 index 0000000000..8bdf178830 --- /dev/null +++ b/test/test-path/path-existsglob.service @@ -0,0 +1 @@ +path-service.service \ No newline at end of file diff --git a/test/test-path/path-makedirectory.path b/test/test-path/path-makedirectory.path new file mode 100644 index 0000000000..9408479c0f --- /dev/null +++ b/test/test-path/path-makedirectory.path @@ -0,0 +1,10 @@ +[Unit] +Description=Test MakeDirectory & DirectoryMode + +[Path] +DirectoryNotEmpty=/tmp/test-path_makedirectory/ +MakeDirectory=yes +DirectoryMode=0744 + +[Install] +WantedBy=multi-user.target diff --git a/test/test-path/path-makedirectory.service b/test/test-path/path-makedirectory.service new file mode 120000 index 0000000000..8bdf178830 --- /dev/null +++ b/test/test-path/path-makedirectory.service @@ -0,0 +1 @@ +path-service.service \ No newline at end of file diff --git a/test/test-path/path-modified.path b/test/test-path/path-modified.path new file mode 100644 index 0000000000..18363227ba --- /dev/null +++ b/test/test-path/path-modified.path @@ -0,0 +1,8 @@ +[Unit] +Description=Test PathModified + +[Path] +PathModified=/tmp/test-path_modified + +[Install] +WantedBy=multi-user.target diff --git a/test/test-path/path-modified.service b/test/test-path/path-modified.service new file mode 120000 index 0000000000..8bdf178830 --- /dev/null +++ b/test/test-path/path-modified.service @@ -0,0 +1 @@ +path-service.service \ No newline at end of file diff --git a/test/test-path/path-mycustomunit.service b/test/test-path/path-mycustomunit.service new file mode 100644 index 0000000000..172ac0d0d5 --- /dev/null +++ b/test/test-path/path-mycustomunit.service @@ -0,0 +1,6 @@ +[Unit] +Description=Service Test Path Unit= + +[Service] +ExecStart=/bin/true +Type=oneshot diff --git a/test/test-path/path-service.service b/test/test-path/path-service.service new file mode 100644 index 0000000000..f8499ec619 --- /dev/null +++ b/test/test-path/path-service.service @@ -0,0 +1,6 @@ +[Unit] +Description=Service Test for Path units + +[Service] +ExecStart=/bin/true +Type=oneshot diff --git a/test/test-path/path-unit.path b/test/test-path/path-unit.path new file mode 100644 index 0000000000..95e572d6d5 --- /dev/null +++ b/test/test-path/path-unit.path @@ -0,0 +1,9 @@ +[Unit] +Description=Test Path Unit= + +[Path] +PathExists=/tmp/test-path_unit +Unit=path-mycustomunit.service + +[Install] +WantedBy=multi-user.target diff --git a/test/test-path/paths.target b/test/test-path/paths.target new file mode 120000 index 0000000000..b402796cb9 --- /dev/null +++ b/test/test-path/paths.target @@ -0,0 +1 @@ +../../units/paths.target \ No newline at end of file diff --git a/test/test-path/sysinit.target b/test/test-path/sysinit.target new file mode 120000 index 0000000000..9d10e5b2e2 --- /dev/null +++ b/test/test-path/sysinit.target @@ -0,0 +1 @@ +../../units/sysinit.target \ No newline at end of file -- cgit v1.2.3-54-g00ecf