From 63447f1153093c883b2488e53f46ff581d904e6a Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Fri, 30 Oct 2015 13:51:51 +0100 Subject: [PATCH 1/7] test-execute: add test for PrivateNetwork --- Makefile.am | 1 + src/test/test-execute.c | 13 +++++++++++++ test/exec-privatenetwork-yes.service | 6 ++++++ 3 files changed, 20 insertions(+) create mode 100644 test/exec-privatenetwork-yes.service diff --git a/Makefile.am b/Makefile.am index 00b9e86346f..cd5ea6f32c1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1566,6 +1566,7 @@ EXTRA_DIST += \ test/exec-workingdirectory.service \ test/exec-umask-0177.service \ test/exec-umask-default.service \ + test/exec-privatenetwork-yes.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 afbaa12e94d..fb0cb3fdc41 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, diff --git a/test/exec-privatenetwork-yes.service b/test/exec-privatenetwork-yes.service new file mode 100644 index 00000000000..494712e6a74 --- /dev/null +++ b/test/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 From 03bd70dd01c61c7a4b1e17d4b7235bab68c1ebd1 Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Fri, 30 Oct 2015 16:55:44 +0100 Subject: [PATCH 2/7] 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 diff --git a/Makefile.am b/Makefile.am index cd5ea6f32c1..64c0ca64f27 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 fb0cb3fdc41..5898b3fb710 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 00000000000..848f2a120cd --- /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 From c388dfea5a9de5771283fbf0f5ebc5a45c895b79 Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Fri, 30 Oct 2015 17:09:22 +0100 Subject: [PATCH 3/7] 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 diff --git a/Makefile.am b/Makefile.am index 64c0ca64f27..e2e3bca3406 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 5898b3fb710..d708878a4d8 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 00000000000..63ab501c63f --- /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 00000000000..e47a4f13929 --- /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 From a622675862ca59cae4662bff21a0c795e0108c65 Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Fri, 30 Oct 2015 17:46:32 +0100 Subject: [PATCH 4/7] 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 diff --git a/Makefile.am b/Makefile.am index e2e3bca3406..3d211deefc7 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 d708878a4d8..158626f7157 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 00000000000..56e27185057 --- /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 00000000000..b45795cab7b --- /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 00000000000..36b546ca013 --- /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 00000000000..74936d80798 --- /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 From 7d0f09a932182316aff4ea806c3993497b5bd859 Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Sat, 31 Oct 2015 14:46:45 +0100 Subject: [PATCH 5/7] build-sys: add missing test files to EXTRA_DIST --- Makefile.am | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile.am b/Makefile.am index 3d211deefc7..2f8bfd4d34c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1574,6 +1574,10 @@ EXTRA_DIST += \ 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/bus-policy/hello.conf \ test/bus-policy/methods.conf \ test/bus-policy/ownerships.conf \ From ac40081621ec299a55246519726a18dd2b08678c Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Fri, 30 Oct 2015 18:03:18 +0100 Subject: [PATCH 6/7] test-execute: move all files related to a specific directory To avoid polluting test/ --- Makefile.am | 68 +++++++++---------- src/test/test-execute.c | 2 +- .../exec-capabilityboundingset-invert.service | 0 .../exec-capabilityboundingset-merge.service | 0 .../exec-capabilityboundingset-reset.service | 0 .../exec-capabilityboundingset-simple.service | 0 .../exec-environment-empty.service | 0 .../exec-environment-multiple.service | 0 .../exec-environment.service | 0 .../exec-environmentfile.service | 0 test/{ => test-execute}/exec-group.service | 0 .../exec-ignoresigpipe-no.service | 0 .../exec-ignoresigpipe-yes.service | 0 ...exec-ioschedulingclass-best-effort.service | 0 .../exec-ioschedulingclass-idle.service | 0 .../exec-ioschedulingclass-none.service | 0 .../exec-ioschedulingclass-realtime.service | 0 .../exec-oomscoreadjust-negative.service | 0 .../exec-oomscoreadjust-positive.service | 0 .../exec-personality-s390.service | 0 .../exec-personality-x86-64.service | 0 .../exec-personality-x86.service | 0 .../exec-privatedevices-no.service | 0 .../exec-privatedevices-yes.service | 0 .../exec-privatenetwork-yes.service | 0 .../exec-privatetmp-no.service | 0 .../exec-privatetmp-yes.service | 0 .../exec-runtimedirectory-mode.service | 0 .../exec-runtimedirectory-owner.service | 0 .../exec-runtimedirectory.service | 0 .../exec-systemcallerrornumber.service | 0 .../exec-systemcallfilter-failing.service | 0 .../exec-systemcallfilter-failing2.service | 0 .../exec-systemcallfilter-not-failing.service | 0 ...exec-systemcallfilter-not-failing2.service | 0 .../exec-umask-0177.service | 0 .../exec-umask-default.service | 0 test/{ => test-execute}/exec-user.service | 0 .../exec-workingdirectory.service | 0 39 files changed, 35 insertions(+), 35 deletions(-) rename test/{ => test-execute}/exec-capabilityboundingset-invert.service (100%) rename test/{ => test-execute}/exec-capabilityboundingset-merge.service (100%) rename test/{ => test-execute}/exec-capabilityboundingset-reset.service (100%) rename test/{ => test-execute}/exec-capabilityboundingset-simple.service (100%) rename test/{ => test-execute}/exec-environment-empty.service (100%) rename test/{ => test-execute}/exec-environment-multiple.service (100%) rename test/{ => test-execute}/exec-environment.service (100%) rename test/{ => test-execute}/exec-environmentfile.service (100%) rename test/{ => test-execute}/exec-group.service (100%) rename test/{ => test-execute}/exec-ignoresigpipe-no.service (100%) rename test/{ => test-execute}/exec-ignoresigpipe-yes.service (100%) rename test/{ => test-execute}/exec-ioschedulingclass-best-effort.service (100%) rename test/{ => test-execute}/exec-ioschedulingclass-idle.service (100%) rename test/{ => test-execute}/exec-ioschedulingclass-none.service (100%) rename test/{ => test-execute}/exec-ioschedulingclass-realtime.service (100%) rename test/{ => test-execute}/exec-oomscoreadjust-negative.service (100%) rename test/{ => test-execute}/exec-oomscoreadjust-positive.service (100%) rename test/{ => test-execute}/exec-personality-s390.service (100%) rename test/{ => test-execute}/exec-personality-x86-64.service (100%) rename test/{ => test-execute}/exec-personality-x86.service (100%) rename test/{ => test-execute}/exec-privatedevices-no.service (100%) rename test/{ => test-execute}/exec-privatedevices-yes.service (100%) rename test/{ => test-execute}/exec-privatenetwork-yes.service (100%) rename test/{ => test-execute}/exec-privatetmp-no.service (100%) rename test/{ => test-execute}/exec-privatetmp-yes.service (100%) rename test/{ => test-execute}/exec-runtimedirectory-mode.service (100%) rename test/{ => test-execute}/exec-runtimedirectory-owner.service (100%) rename test/{ => test-execute}/exec-runtimedirectory.service (100%) rename test/{ => test-execute}/exec-systemcallerrornumber.service (100%) rename test/{ => test-execute}/exec-systemcallfilter-failing.service (100%) rename test/{ => test-execute}/exec-systemcallfilter-failing2.service (100%) rename test/{ => test-execute}/exec-systemcallfilter-not-failing.service (100%) rename test/{ => test-execute}/exec-systemcallfilter-not-failing2.service (100%) rename test/{ => test-execute}/exec-umask-0177.service (100%) rename test/{ => test-execute}/exec-umask-default.service (100%) rename test/{ => test-execute}/exec-user.service (100%) rename test/{ => test-execute}/exec-workingdirectory.service (100%) diff --git a/Makefile.am b/Makefile.am index 2f8bfd4d34c..4319c2fdb7a 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 158626f7157..e2ec53ee51d 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/test-execute/exec-capabilityboundingset-invert.service similarity index 100% rename from test/exec-capabilityboundingset-invert.service rename to test/test-execute/exec-capabilityboundingset-invert.service diff --git a/test/exec-capabilityboundingset-merge.service b/test/test-execute/exec-capabilityboundingset-merge.service similarity index 100% rename from test/exec-capabilityboundingset-merge.service rename to test/test-execute/exec-capabilityboundingset-merge.service diff --git a/test/exec-capabilityboundingset-reset.service b/test/test-execute/exec-capabilityboundingset-reset.service similarity index 100% rename from test/exec-capabilityboundingset-reset.service rename to test/test-execute/exec-capabilityboundingset-reset.service diff --git a/test/exec-capabilityboundingset-simple.service b/test/test-execute/exec-capabilityboundingset-simple.service similarity index 100% rename from test/exec-capabilityboundingset-simple.service rename to test/test-execute/exec-capabilityboundingset-simple.service diff --git a/test/exec-environment-empty.service b/test/test-execute/exec-environment-empty.service similarity index 100% rename from test/exec-environment-empty.service rename to test/test-execute/exec-environment-empty.service diff --git a/test/exec-environment-multiple.service b/test/test-execute/exec-environment-multiple.service similarity index 100% rename from test/exec-environment-multiple.service rename to test/test-execute/exec-environment-multiple.service diff --git a/test/exec-environment.service b/test/test-execute/exec-environment.service similarity index 100% rename from test/exec-environment.service rename to test/test-execute/exec-environment.service diff --git a/test/exec-environmentfile.service b/test/test-execute/exec-environmentfile.service similarity index 100% rename from test/exec-environmentfile.service rename to test/test-execute/exec-environmentfile.service diff --git a/test/exec-group.service b/test/test-execute/exec-group.service similarity index 100% rename from test/exec-group.service rename to test/test-execute/exec-group.service diff --git a/test/exec-ignoresigpipe-no.service b/test/test-execute/exec-ignoresigpipe-no.service similarity index 100% rename from test/exec-ignoresigpipe-no.service rename to test/test-execute/exec-ignoresigpipe-no.service diff --git a/test/exec-ignoresigpipe-yes.service b/test/test-execute/exec-ignoresigpipe-yes.service similarity index 100% rename from test/exec-ignoresigpipe-yes.service rename to test/test-execute/exec-ignoresigpipe-yes.service diff --git a/test/exec-ioschedulingclass-best-effort.service b/test/test-execute/exec-ioschedulingclass-best-effort.service similarity index 100% rename from test/exec-ioschedulingclass-best-effort.service rename to test/test-execute/exec-ioschedulingclass-best-effort.service diff --git a/test/exec-ioschedulingclass-idle.service b/test/test-execute/exec-ioschedulingclass-idle.service similarity index 100% rename from test/exec-ioschedulingclass-idle.service rename to test/test-execute/exec-ioschedulingclass-idle.service diff --git a/test/exec-ioschedulingclass-none.service b/test/test-execute/exec-ioschedulingclass-none.service similarity index 100% rename from test/exec-ioschedulingclass-none.service rename to test/test-execute/exec-ioschedulingclass-none.service diff --git a/test/exec-ioschedulingclass-realtime.service b/test/test-execute/exec-ioschedulingclass-realtime.service similarity index 100% rename from test/exec-ioschedulingclass-realtime.service rename to test/test-execute/exec-ioschedulingclass-realtime.service diff --git a/test/exec-oomscoreadjust-negative.service b/test/test-execute/exec-oomscoreadjust-negative.service similarity index 100% rename from test/exec-oomscoreadjust-negative.service rename to test/test-execute/exec-oomscoreadjust-negative.service diff --git a/test/exec-oomscoreadjust-positive.service b/test/test-execute/exec-oomscoreadjust-positive.service similarity index 100% rename from test/exec-oomscoreadjust-positive.service rename to test/test-execute/exec-oomscoreadjust-positive.service diff --git a/test/exec-personality-s390.service b/test/test-execute/exec-personality-s390.service similarity index 100% rename from test/exec-personality-s390.service rename to test/test-execute/exec-personality-s390.service diff --git a/test/exec-personality-x86-64.service b/test/test-execute/exec-personality-x86-64.service similarity index 100% rename from test/exec-personality-x86-64.service rename to test/test-execute/exec-personality-x86-64.service diff --git a/test/exec-personality-x86.service b/test/test-execute/exec-personality-x86.service similarity index 100% rename from test/exec-personality-x86.service rename to test/test-execute/exec-personality-x86.service diff --git a/test/exec-privatedevices-no.service b/test/test-execute/exec-privatedevices-no.service similarity index 100% rename from test/exec-privatedevices-no.service rename to test/test-execute/exec-privatedevices-no.service diff --git a/test/exec-privatedevices-yes.service b/test/test-execute/exec-privatedevices-yes.service similarity index 100% rename from test/exec-privatedevices-yes.service rename to test/test-execute/exec-privatedevices-yes.service diff --git a/test/exec-privatenetwork-yes.service b/test/test-execute/exec-privatenetwork-yes.service similarity index 100% rename from test/exec-privatenetwork-yes.service rename to test/test-execute/exec-privatenetwork-yes.service diff --git a/test/exec-privatetmp-no.service b/test/test-execute/exec-privatetmp-no.service similarity index 100% rename from test/exec-privatetmp-no.service rename to test/test-execute/exec-privatetmp-no.service diff --git a/test/exec-privatetmp-yes.service b/test/test-execute/exec-privatetmp-yes.service similarity index 100% rename from test/exec-privatetmp-yes.service rename to test/test-execute/exec-privatetmp-yes.service diff --git a/test/exec-runtimedirectory-mode.service b/test/test-execute/exec-runtimedirectory-mode.service similarity index 100% rename from test/exec-runtimedirectory-mode.service rename to test/test-execute/exec-runtimedirectory-mode.service diff --git a/test/exec-runtimedirectory-owner.service b/test/test-execute/exec-runtimedirectory-owner.service similarity index 100% rename from test/exec-runtimedirectory-owner.service rename to test/test-execute/exec-runtimedirectory-owner.service diff --git a/test/exec-runtimedirectory.service b/test/test-execute/exec-runtimedirectory.service similarity index 100% rename from test/exec-runtimedirectory.service rename to test/test-execute/exec-runtimedirectory.service diff --git a/test/exec-systemcallerrornumber.service b/test/test-execute/exec-systemcallerrornumber.service similarity index 100% rename from test/exec-systemcallerrornumber.service rename to test/test-execute/exec-systemcallerrornumber.service diff --git a/test/exec-systemcallfilter-failing.service b/test/test-execute/exec-systemcallfilter-failing.service similarity index 100% rename from test/exec-systemcallfilter-failing.service rename to test/test-execute/exec-systemcallfilter-failing.service diff --git a/test/exec-systemcallfilter-failing2.service b/test/test-execute/exec-systemcallfilter-failing2.service similarity index 100% rename from test/exec-systemcallfilter-failing2.service rename to test/test-execute/exec-systemcallfilter-failing2.service diff --git a/test/exec-systemcallfilter-not-failing.service b/test/test-execute/exec-systemcallfilter-not-failing.service similarity index 100% rename from test/exec-systemcallfilter-not-failing.service rename to test/test-execute/exec-systemcallfilter-not-failing.service diff --git a/test/exec-systemcallfilter-not-failing2.service b/test/test-execute/exec-systemcallfilter-not-failing2.service similarity index 100% rename from test/exec-systemcallfilter-not-failing2.service rename to test/test-execute/exec-systemcallfilter-not-failing2.service diff --git a/test/exec-umask-0177.service b/test/test-execute/exec-umask-0177.service similarity index 100% rename from test/exec-umask-0177.service rename to test/test-execute/exec-umask-0177.service diff --git a/test/exec-umask-default.service b/test/test-execute/exec-umask-default.service similarity index 100% rename from test/exec-umask-default.service rename to test/test-execute/exec-umask-default.service diff --git a/test/exec-user.service b/test/test-execute/exec-user.service similarity index 100% rename from test/exec-user.service rename to test/test-execute/exec-user.service diff --git a/test/exec-workingdirectory.service b/test/test-execute/exec-workingdirectory.service similarity index 100% rename from test/exec-workingdirectory.service rename to test/test-execute/exec-workingdirectory.service From aa8e00da547b50ea20e3691133bb3ae1d9644a2b Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Fri, 30 Oct 2015 18:12:31 +0100 Subject: [PATCH 7/7] 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/paths.target | 1 - test/test-path/basic.target | 1 + test/{ => test-path}/path-changed.path | 0 test/{ => test-path}/path-changed.service | 0 .../path-directorynotempty.path | 0 .../path-directorynotempty.service | 0 test/{ => test-path}/path-exists.path | 0 test/{ => test-path}/path-exists.service | 0 test/{ => test-path}/path-existsglob.path | 0 test/{ => test-path}/path-existsglob.service | 0 test/{ => test-path}/path-makedirectory.path | 0 .../path-makedirectory.service | 0 test/{ => test-path}/path-modified.path | 0 test/{ => test-path}/path-modified.service | 0 .../{ => test-path}/path-mycustomunit.service | 0 test/{ => test-path}/path-service.service | 0 test/{ => test-path}/path-unit.path | 0 test/test-path/paths.target | 1 + test/test-path/sysinit.target | 1 + 21 files changed, 22 insertions(+), 18 deletions(-) delete mode 120000 test/paths.target create mode 120000 test/test-path/basic.target rename test/{ => test-path}/path-changed.path (100%) rename test/{ => test-path}/path-changed.service (100%) rename test/{ => test-path}/path-directorynotempty.path (100%) rename test/{ => test-path}/path-directorynotempty.service (100%) rename test/{ => test-path}/path-exists.path (100%) rename test/{ => test-path}/path-exists.service (100%) rename test/{ => test-path}/path-existsglob.path (100%) rename test/{ => test-path}/path-existsglob.service (100%) rename test/{ => test-path}/path-makedirectory.path (100%) rename test/{ => test-path}/path-makedirectory.service (100%) rename test/{ => test-path}/path-modified.path (100%) rename test/{ => test-path}/path-modified.service (100%) rename test/{ => test-path}/path-mycustomunit.service (100%) rename test/{ => test-path}/path-service.service (100%) rename test/{ => test-path}/path-unit.path (100%) create mode 120000 test/test-path/paths.target create mode 120000 test/test-path/sysinit.target diff --git a/Makefile.am b/Makefile.am index 4319c2fdb7a..be001bd09ec 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 ff0f044958b..8302bdd2830 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/paths.target b/test/paths.target deleted file mode 120000 index e9939c9801c..00000000000 --- 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 00000000000..a882b72cc9b --- /dev/null +++ b/test/test-path/basic.target @@ -0,0 +1 @@ +../../units/basic.target \ No newline at end of file diff --git a/test/path-changed.path b/test/test-path/path-changed.path similarity index 100% rename from test/path-changed.path rename to test/test-path/path-changed.path diff --git a/test/path-changed.service b/test/test-path/path-changed.service similarity index 100% rename from test/path-changed.service rename to test/test-path/path-changed.service diff --git a/test/path-directorynotempty.path b/test/test-path/path-directorynotempty.path similarity index 100% rename from test/path-directorynotempty.path rename to test/test-path/path-directorynotempty.path diff --git a/test/path-directorynotempty.service b/test/test-path/path-directorynotempty.service similarity index 100% rename from test/path-directorynotempty.service rename to test/test-path/path-directorynotempty.service diff --git a/test/path-exists.path b/test/test-path/path-exists.path similarity index 100% rename from test/path-exists.path rename to test/test-path/path-exists.path diff --git a/test/path-exists.service b/test/test-path/path-exists.service similarity index 100% rename from test/path-exists.service rename to test/test-path/path-exists.service diff --git a/test/path-existsglob.path b/test/test-path/path-existsglob.path similarity index 100% rename from test/path-existsglob.path rename to test/test-path/path-existsglob.path diff --git a/test/path-existsglob.service b/test/test-path/path-existsglob.service similarity index 100% rename from test/path-existsglob.service rename to test/test-path/path-existsglob.service diff --git a/test/path-makedirectory.path b/test/test-path/path-makedirectory.path similarity index 100% rename from test/path-makedirectory.path rename to test/test-path/path-makedirectory.path diff --git a/test/path-makedirectory.service b/test/test-path/path-makedirectory.service similarity index 100% rename from test/path-makedirectory.service rename to test/test-path/path-makedirectory.service diff --git a/test/path-modified.path b/test/test-path/path-modified.path similarity index 100% rename from test/path-modified.path rename to test/test-path/path-modified.path diff --git a/test/path-modified.service b/test/test-path/path-modified.service similarity index 100% rename from test/path-modified.service rename to test/test-path/path-modified.service diff --git a/test/path-mycustomunit.service b/test/test-path/path-mycustomunit.service similarity index 100% rename from test/path-mycustomunit.service rename to test/test-path/path-mycustomunit.service diff --git a/test/path-service.service b/test/test-path/path-service.service similarity index 100% rename from test/path-service.service rename to test/test-path/path-service.service diff --git a/test/path-unit.path b/test/test-path/path-unit.path similarity index 100% rename from test/path-unit.path rename to test/test-path/path-unit.path diff --git a/test/test-path/paths.target b/test/test-path/paths.target new file mode 120000 index 00000000000..b402796cb91 --- /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 00000000000..9d10e5b2e21 --- /dev/null +++ b/test/test-path/sysinit.target @@ -0,0 +1 @@ +../../units/sysinit.target \ No newline at end of file