diff --git a/mkosi.images/system/mkosi.conf b/mkosi.images/system/mkosi.conf index f7f32a07e6e..7f1c5f571ee 100644 --- a/mkosi.images/system/mkosi.conf +++ b/mkosi.images/system/mkosi.conf @@ -20,7 +20,7 @@ ExtraTrees= %O/minimal-1.root-%a.raw:/usr/share/minimal_1.raw %O/minimal-1.root-%a-verity.raw:/usr/share/minimal_1.verity %O/minimal-1.root-%a-verity-sig.raw:/usr/share/minimal_1.verity.sig - %O/minimal-base:/usr/share/testsuite-13-container-template + %O/minimal-base:/usr/share/TEST-13-NSPAWN-container-template Packages= acl diff --git a/test/testsuite-03.units/always-activating.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.service similarity index 100% rename from test/testsuite-03.units/always-activating.service rename to test/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.service diff --git a/test/testsuite-03.units/always-activating.socket b/test/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.socket similarity index 100% rename from test/testsuite-03.units/always-activating.socket rename to test/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.socket diff --git a/test/testsuite-03.units/fails-on-restart-restartdirect.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.service similarity index 100% rename from test/testsuite-03.units/fails-on-restart-restartdirect.service rename to test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.service diff --git a/test/testsuite-03.units/fails-on-restart-restartdirect.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.target similarity index 100% rename from test/testsuite-03.units/fails-on-restart-restartdirect.target rename to test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.target diff --git a/test/testsuite-03.units/fails-on-restart.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.service similarity index 100% rename from test/testsuite-03.units/fails-on-restart.service rename to test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.service diff --git a/test/testsuite-03.units/fails-on-restart.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.target similarity index 100% rename from test/testsuite-03.units/fails-on-restart.target rename to test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.target diff --git a/test/testsuite-03.units/hello-after-sleep.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/hello-after-sleep.target similarity index 100% rename from test/testsuite-03.units/hello-after-sleep.target rename to test/TEST-03-JOBS/TEST-03-JOBS.units/hello-after-sleep.target diff --git a/test/testsuite-03.units/hello.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/hello.service similarity index 100% rename from test/testsuite-03.units/hello.service rename to test/TEST-03-JOBS/TEST-03-JOBS.units/hello.service diff --git a/test/testsuite-03.units/propagatestopto-and-pullin.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-and-pullin.target similarity index 100% rename from test/testsuite-03.units/propagatestopto-and-pullin.target rename to test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-and-pullin.target diff --git a/test/testsuite-03.units/propagatestopto-indirect.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-indirect.target similarity index 100% rename from test/testsuite-03.units/propagatestopto-indirect.target rename to test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-indirect.target diff --git a/test/testsuite-03.units/propagatestopto-only.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-only.target similarity index 100% rename from test/testsuite-03.units/propagatestopto-only.target rename to test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-only.target diff --git a/test/testsuite-03.units/sleep-infinity-simple.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/sleep-infinity-simple.service similarity index 100% rename from test/testsuite-03.units/sleep-infinity-simple.service rename to test/TEST-03-JOBS/TEST-03-JOBS.units/sleep-infinity-simple.service diff --git a/test/testsuite-03.units/sleep.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/sleep.service similarity index 100% rename from test/testsuite-03.units/sleep.service rename to test/TEST-03-JOBS/TEST-03-JOBS.units/sleep.service diff --git a/test/testsuite-03.units/succeeds-on-restart-restartdirect.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.service similarity index 66% rename from test/testsuite-03.units/succeeds-on-restart-restartdirect.service rename to test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.service index b05f2f8dcf7..a2b9c339ad2 100644 --- a/test/testsuite-03.units/succeeds-on-restart-restartdirect.service +++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Service] Type=oneshot -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-03.units/succeeds-on-restart.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-03-JOBS.units/succeeds-on-restart.sh Restart=on-failure RestartMode=direct diff --git a/test/testsuite-03.units/succeeds-on-restart-restartdirect.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.target similarity index 100% rename from test/testsuite-03.units/succeeds-on-restart-restartdirect.target rename to test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.target diff --git a/test/testsuite-03.units/succeeds-on-restart.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.service similarity index 66% rename from test/testsuite-03.units/succeeds-on-restart.service rename to test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.service index d7b3c7a210b..d0e9c2bc845 100644 --- a/test/testsuite-03.units/succeeds-on-restart.service +++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Service] Type=oneshot -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-03.units/succeeds-on-restart.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-03-JOBS.units/succeeds-on-restart.sh Restart=on-failure RestartMode=normal diff --git a/test/testsuite-03.units/succeeds-on-restart.sh b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.sh similarity index 100% rename from test/testsuite-03.units/succeeds-on-restart.sh rename to test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.sh diff --git a/test/testsuite-03.units/succeeds-on-restart.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.target similarity index 100% rename from test/testsuite-03.units/succeeds-on-restart.target rename to test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.target diff --git a/test/testsuite-03.units/unstoppable.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/unstoppable.service similarity index 100% rename from test/testsuite-03.units/unstoppable.service rename to test/TEST-03-JOBS/TEST-03-JOBS.units/unstoppable.service diff --git a/test/TEST-03-JOBS/meson.build b/test/TEST-03-JOBS/meson.build index 8dec5f37e73..3484d21ba2f 100644 --- a/test/TEST-03-JOBS/meson.build +++ b/test/TEST-03-JOBS/meson.build @@ -5,3 +5,5 @@ integration_tests += [ 'name' : fs.name(meson.current_source_dir()), }, ] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-03-JOBS.units'] diff --git a/test/testsuite-04.units/delegated-cgroup-filtering.service b/test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/delegated-cgroup-filtering.service similarity index 100% rename from test/testsuite-04.units/delegated-cgroup-filtering.service rename to test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/delegated-cgroup-filtering.service diff --git a/test/testsuite-04.units/forever-print-hola.service b/test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/forever-print-hola.service similarity index 100% rename from test/testsuite-04.units/forever-print-hola.service rename to test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/forever-print-hola.service diff --git a/test/testsuite-04.units/logs-filtering.service b/test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/logs-filtering.service similarity index 100% rename from test/testsuite-04.units/logs-filtering.service rename to test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/logs-filtering.service diff --git a/test/testsuite-04.units/silent-success.service b/test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/silent-success.service similarity index 100% rename from test/testsuite-04.units/silent-success.service rename to test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/silent-success.service diff --git a/test/testsuite-04.units/verbose-success.service b/test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/verbose-success.service similarity index 100% rename from test/testsuite-04.units/verbose-success.service rename to test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/verbose-success.service diff --git a/test/TEST-04-JOURNAL/meson.build b/test/TEST-04-JOURNAL/meson.build index 184f70ab720..5a0b073c02b 100644 --- a/test/TEST-04-JOURNAL/meson.build +++ b/test/TEST-04-JOURNAL/meson.build @@ -8,3 +8,5 @@ integration_tests += [ 'storage' : 'persistent', }, ] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-04-JOURNAL.units'] diff --git a/test/TEST-04-JOURNAL/test.sh b/test/TEST-04-JOURNAL/test.sh index f8f3a4b3e32..a7aa71fce32 100755 --- a/test/TEST-04-JOURNAL/test.sh +++ b/test/TEST-04-JOURNAL/test.sh @@ -20,7 +20,7 @@ test_append_files() { # Since we nuke the journal repeatedly during this test, let's redirect # stdout/stderr to the console as well to make the test a bit more debug-able. if ! get_bool "${INTERACTIVE_DEBUG:-}"; then - dropin_dir="${workspace:?}/etc/systemd/system/testsuite-04.service.d/" + dropin_dir="${workspace:?}/etc/systemd/system/TEST-04-JOURNAL.service.d/" mkdir -p "$dropin_dir" printf '[Service]\nStandardOutput=journal+console\nStandardError=journal+console' >"$dropin_dir/99-stdout.conf" fi diff --git a/test/testsuite-06.units/hola.service b/test/TEST-06-SELINUX/TEST-06-SELINUX.units/hola.service similarity index 100% rename from test/testsuite-06.units/hola.service rename to test/TEST-06-SELINUX/TEST-06-SELINUX.units/hola.service diff --git a/test/TEST-06-SELINUX/meson.build b/test/TEST-06-SELINUX/meson.build index 408e41ff287..e3cf0030c50 100644 --- a/test/TEST-06-SELINUX/meson.build +++ b/test/TEST-06-SELINUX/meson.build @@ -10,3 +10,5 @@ integration_tests += [ 'firmware' : 'uefi', }, ] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-06-SELINUX.units'] diff --git a/test/testsuite-07.units/issue14566-repro.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.service similarity index 67% rename from test/testsuite-07.units/issue14566-repro.service rename to test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.service index 56805963b41..757f978101e 100644 --- a/test/testsuite-07.units/issue14566-repro.service +++ b/test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.service @@ -3,6 +3,6 @@ Description=Issue 14566 Repro [Service] -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-07.units/%N.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-07-PID1.units/%N.sh ExecStopPost=/bin/true KillMode=mixed diff --git a/test/testsuite-07.units/issue14566-repro.sh b/test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.sh similarity index 100% rename from test/testsuite-07.units/issue14566-repro.sh rename to test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.sh diff --git a/test/testsuite-07.units/issue16115-repro-1.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-1.service similarity index 100% rename from test/testsuite-07.units/issue16115-repro-1.service rename to test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-1.service diff --git a/test/testsuite-07.units/issue16115-repro-2.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-2.service similarity index 100% rename from test/testsuite-07.units/issue16115-repro-2.service rename to test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-2.service diff --git a/test/testsuite-07.units/issue16115-repro-3.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-3.service similarity index 100% rename from test/testsuite-07.units/issue16115-repro-3.service rename to test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-3.service diff --git a/test/testsuite-07.units/issue2467.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue2467.service similarity index 100% rename from test/testsuite-07.units/issue2467.service rename to test/TEST-07-PID1/TEST-07-PID1.units/issue2467.service diff --git a/test/testsuite-07.units/issue2467.socket b/test/TEST-07-PID1/TEST-07-PID1.units/issue2467.socket similarity index 100% rename from test/testsuite-07.units/issue2467.socket rename to test/TEST-07-PID1/TEST-07-PID1.units/issue2467.socket diff --git a/test/testsuite-07.units/issue2730-alias.mount b/test/TEST-07-PID1/TEST-07-PID1.units/issue2730-alias.mount similarity index 100% rename from test/testsuite-07.units/issue2730-alias.mount rename to test/TEST-07-PID1/TEST-07-PID1.units/issue2730-alias.mount diff --git a/test/testsuite-07.units/issue2730.mount b/test/TEST-07-PID1/TEST-07-PID1.units/issue2730.mount similarity index 100% rename from test/testsuite-07.units/issue2730.mount rename to test/TEST-07-PID1/TEST-07-PID1.units/issue2730.mount diff --git a/test/testsuite-07.units/issue27953.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue27953.service similarity index 100% rename from test/testsuite-07.units/issue27953.service rename to test/TEST-07-PID1/TEST-07-PID1.units/issue27953.service diff --git a/test/testsuite-07.units/issue3166-fail-on-restart.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue3166-fail-on-restart.service similarity index 100% rename from test/testsuite-07.units/issue3166-fail-on-restart.service rename to test/TEST-07-PID1/TEST-07-PID1.units/issue3166-fail-on-restart.service diff --git a/test/testsuite-07.units/local-fs.target.wants/issue2730.mount b/test/TEST-07-PID1/TEST-07-PID1.units/local-fs.target.wants/issue2730.mount similarity index 100% rename from test/testsuite-07.units/local-fs.target.wants/issue2730.mount rename to test/TEST-07-PID1/TEST-07-PID1.units/local-fs.target.wants/issue2730.mount diff --git a/test/testsuite-07.units/pass-fds-to-exec-no.socket b/test/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-no.socket similarity index 100% rename from test/testsuite-07.units/pass-fds-to-exec-no.socket rename to test/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-no.socket diff --git a/test/testsuite-07.units/pass-fds-to-exec-yes.socket b/test/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-yes.socket similarity index 100% rename from test/testsuite-07.units/pass-fds-to-exec-yes.socket rename to test/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-yes.socket diff --git a/test/TEST-07-PID1/meson.build b/test/TEST-07-PID1/meson.build index 8dec5f37e73..76ed3e75814 100644 --- a/test/TEST-07-PID1/meson.build +++ b/test/TEST-07-PID1/meson.build @@ -5,3 +5,5 @@ integration_tests += [ 'name' : fs.name(meson.current_source_dir()), }, ] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-07-PID1.units'] diff --git a/test/TEST-08-INITRD/test.sh b/test/TEST-08-INITRD/test.sh index 3ad60f1a949..badb6cb31a1 100755 --- a/test/TEST-08-INITRD/test.sh +++ b/test/TEST-08-INITRD/test.sh @@ -80,7 +80,7 @@ check_result_qemu_hook() { # Setup a one shot service in initrd that creates a dummy bind mount under /run # to check if the mount persists though the initrd transition. The "check" part -# is in the respective testsuite-08.sh script. +# is in the respective TEST-08-INITRD.sh script. # # See: https://github.com/systemd/systemd/issues/28452 run_qemu_hook() { diff --git a/test/TEST-13-NSPAWN/test.sh b/test/TEST-13-NSPAWN/test.sh index 744e793ac2e..9a0404f4b0c 100755 --- a/test/TEST-13-NSPAWN/test.sh +++ b/test/TEST-13-NSPAWN/test.sh @@ -13,7 +13,7 @@ TEST_FORCE_NEWIMAGE=1 test_append_files() { local workspace="${1:?}" - local container="$workspace/usr/share/testsuite-13-container-template" + local container="$workspace/usr/share/TEST-13-NSPAWN-container-template" # For virtual wlan interface. instmods mac80211_hwsim diff --git a/test/testsuite-16.units/extend-timeout.sh b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh similarity index 100% rename from test/testsuite-16.units/extend-timeout.sh rename to test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh diff --git a/test/testsuite-16.units/fail-runtime.service b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-runtime.service similarity index 86% rename from test/testsuite-16.units/fail-runtime.service rename to test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-runtime.service index 1d74963a30b..7380994dbd3 100644 --- a/test/testsuite-16.units/fail-runtime.service +++ b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-runtime.service @@ -10,4 +10,4 @@ TimeoutStartSec=4 TimeoutStopSec=4 RuntimeMaxSec=10 Environment=SERVICE=fail_runtime extend_timeout_interval=5 sleep_interval=7 start_intervals=0 run_intervals=2 stop_intervals=0 -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh diff --git a/test/testsuite-16.units/fail-start.service b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-start.service similarity index 86% rename from test/testsuite-16.units/fail-start.service rename to test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-start.service index 38aebf2a8ff..984d8f98643 100644 --- a/test/testsuite-16.units/fail-start.service +++ b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-start.service @@ -11,4 +11,4 @@ TimeoutStartSec=10 TimeoutStopSec=4 RuntimeMaxSec=4 Environment=SERVICE=fail_start extend_timeout_interval=5 sleep_interval=7 start_intervals=2 run_intervals=0 stop_intervals=0 -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh diff --git a/test/testsuite-16.units/fail-stop.service b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-stop.service similarity index 90% rename from test/testsuite-16.units/fail-stop.service rename to test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-stop.service index 1910ac9ff44..4293d7e8bdc 100644 --- a/test/testsuite-16.units/fail-stop.service +++ b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-stop.service @@ -10,7 +10,7 @@ TimeoutStartSec=4 TimeoutStopSec=10 RuntimeMaxSec=4 Environment=SERVICE=fail_stop extend_timeout_interval=5 sleep_interval=7 start_intervals=0 run_intervals=0 stop_intervals=2 -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh # Due to 6041a7ee2c1bbff6301082f192fc1b0882400d42 SIGTERM isn't sent as the service shuts down with STOPPING=1 # This file makes the test assess.sh quicker by notifing it that this test has finished. ExecStopPost=/bin/bash -c '[[ $SERVICE_RESULT == timeout && $EXIT_CODE == killed ]] && touch /fail_runtime.terminated' diff --git a/test/testsuite-16.units/success-all.service b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-all.service similarity index 87% rename from test/testsuite-16.units/success-all.service rename to test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-all.service index 1fdc363f696..7f26084c7a3 100644 --- a/test/testsuite-16.units/success-all.service +++ b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-all.service @@ -12,4 +12,4 @@ TimeoutStartSec=4 TimeoutStopSec=4 RuntimeMaxSec=4 Environment=SERVICE=success_all extend_timeout_interval=4 sleep_interval=2 start_intervals=3 run_intervals=3 stop_intervals=3 -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh diff --git a/test/testsuite-16.units/success-runtime.service b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-runtime.service similarity index 84% rename from test/testsuite-16.units/success-runtime.service rename to test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-runtime.service index 2f5744d15ec..33a36f3ba22 100644 --- a/test/testsuite-16.units/success-runtime.service +++ b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-runtime.service @@ -11,4 +11,4 @@ TimeoutStartSec=4 TimeoutStopSec=4 RuntimeMaxSec=8 Environment=SERVICE=success_runtime extend_timeout_interval=4 sleep_interval=6 start_intervals=0 run_intervals=1 stop_intervals=0 -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh diff --git a/test/testsuite-16.units/success-start.service b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-start.service similarity index 85% rename from test/testsuite-16.units/success-start.service rename to test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-start.service index be518e98703..0453b34ff3e 100644 --- a/test/testsuite-16.units/success-start.service +++ b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-start.service @@ -10,4 +10,4 @@ TimeoutStartSec=8 TimeoutStopSec=4 RuntimeMaxSec=4 Environment=SERVICE=success_start extend_timeout_interval=4 sleep_interval=6 start_intervals=1 run_intervals=0 stop_intervals=0 -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh diff --git a/test/testsuite-16.units/success-stop.service b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-stop.service similarity index 85% rename from test/testsuite-16.units/success-stop.service rename to test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-stop.service index 2bd3e3e3ba3..3719f54fd7b 100644 --- a/test/testsuite-16.units/success-stop.service +++ b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-stop.service @@ -10,4 +10,4 @@ TimeoutStartSec=4 TimeoutStopSec=8 RuntimeMaxSec=4 Environment=SERVICE=success_stop extend_timeout_interval=4 sleep_interval=6 start_intervals=0 run_intervals=0 stop_intervals=1 -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh diff --git a/test/TEST-16-EXTEND-TIMEOUT/meson.build b/test/TEST-16-EXTEND-TIMEOUT/meson.build index 8dec5f37e73..75cf2029f98 100644 --- a/test/TEST-16-EXTEND-TIMEOUT/meson.build +++ b/test/TEST-16-EXTEND-TIMEOUT/meson.build @@ -5,3 +5,5 @@ integration_tests += [ 'name' : fs.name(meson.current_source_dir()), }, ] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-16-EXTEND-TIMEOUT.units'] diff --git a/test/testsuite-23.units/testsuite-23-binds-to.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-binds-to.service similarity index 52% rename from test/testsuite-23.units/testsuite-23-binds-to.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-binds-to.service index 9a3e31b0804..022c37e5472 100644 --- a/test/testsuite-23.units/testsuite-23-binds-to.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-binds-to.service @@ -1,10 +1,10 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] Description=Unit with BindsTo= -BindsTo=testsuite-23-bound-by.service -After=testsuite-23-bound-by.service +BindsTo=TEST-23-UNIT-FILE-bound-by.service +After=TEST-23-UNIT-FILE-bound-by.service [Service] ExecStart=sleep infinity # --kill-who= (no 'm') to check that the short form is accepted -ExecStopPost=systemctl kill --kill-whom=main -sRTMIN+1 testsuite-23.service +ExecStopPost=systemctl kill --kill-whom=main -sRTMIN+1 TEST-23-UNIT-FILE.service diff --git a/test/testsuite-23.units/testsuite-23-bound-by.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-bound-by.service similarity index 100% rename from test/testsuite-23.units/testsuite-23-bound-by.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-bound-by.service diff --git a/test/testsuite-23.units/testsuite-23-fail.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-fail.service similarity index 70% rename from test/testsuite-23.units/testsuite-23-fail.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-fail.service index 597810797d0..b78e6b438eb 100644 --- a/test/testsuite-23.units/testsuite-23-fail.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-fail.service @@ -1,7 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] Description=Failing unit -OnFailure=testsuite-23-uphold.service +OnFailure=TEST-23-UNIT-FILE-uphold.service [Service] ExecStart=false diff --git a/test/testsuite-23.units/testsuite-23-joins-namespace-of-1.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-1.service similarity index 100% rename from test/testsuite-23.units/testsuite-23-joins-namespace-of-1.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-1.service diff --git a/test/testsuite-23.units/testsuite-23-joins-namespace-of-2.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-2.service similarity index 73% rename from test/testsuite-23.units/testsuite-23-joins-namespace-of-2.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-2.service index 36b4c272fd7..42dd44555a1 100644 --- a/test/testsuite-23.units/testsuite-23-joins-namespace-of-2.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-2.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] -JoinsNamespaceOf=testsuite-23-joins-namespace-of-1.service +JoinsNamespaceOf=TEST-23-UNIT-FILE-joins-namespace-of-1.service [Service] Type=oneshot diff --git a/test/testsuite-23.units/testsuite-23-joins-namespace-of-3.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-3.service similarity index 73% rename from test/testsuite-23.units/testsuite-23-joins-namespace-of-3.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-3.service index 90944450202..f745481f78f 100644 --- a/test/testsuite-23.units/testsuite-23-joins-namespace-of-3.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-3.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] -JoinsNamespaceOf=testsuite-23-joins-namespace-of-1.service +JoinsNamespaceOf=TEST-23-UNIT-FILE-joins-namespace-of-1.service [Service] Type=oneshot diff --git a/test/testsuite-23.units/testsuite-23-joins-namespace-of-4.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-4.service similarity index 77% rename from test/testsuite-23.units/testsuite-23-joins-namespace-of-4.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-4.service index a70f8fca998..a0ff403986f 100644 --- a/test/testsuite-23.units/testsuite-23-joins-namespace-of-4.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-4.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] -JoinsNamespaceOf=testsuite-23-joins-namespace-of-5.service +JoinsNamespaceOf=TEST-23-UNIT-FILE-joins-namespace-of-5.service [Service] Type=notify diff --git a/test/testsuite-23.units/testsuite-23-joins-namespace-of-5.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-5.service similarity index 100% rename from test/testsuite-23.units/testsuite-23-joins-namespace-of-5.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-5.service diff --git a/test/testsuite-23.units/testsuite-23-joins-namespace-of-6.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-6.service similarity index 77% rename from test/testsuite-23.units/testsuite-23-joins-namespace-of-6.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-6.service index dae533cc369..9227bdaa05f 100644 --- a/test/testsuite-23.units/testsuite-23-joins-namespace-of-6.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-6.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] -JoinsNamespaceOf=testsuite-23-joins-namespace-of-8.service +JoinsNamespaceOf=TEST-23-UNIT-FILE-joins-namespace-of-8.service [Service] Type=notify diff --git a/test/testsuite-23.units/testsuite-23-joins-namespace-of-7.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-7.service similarity index 77% rename from test/testsuite-23.units/testsuite-23-joins-namespace-of-7.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-7.service index 60c083a3f43..a5d62c651d4 100644 --- a/test/testsuite-23.units/testsuite-23-joins-namespace-of-7.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-7.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] -JoinsNamespaceOf=testsuite-23-joins-namespace-of-8.service +JoinsNamespaceOf=TEST-23-UNIT-FILE-joins-namespace-of-8.service [Service] Type=oneshot diff --git a/test/testsuite-23.units/testsuite-23-joins-namespace-of-8.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-8.service similarity index 100% rename from test/testsuite-23.units/testsuite-23-joins-namespace-of-8.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-8.service diff --git a/test/testsuite-23.units/testsuite-23-joins-namespace-of-9.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-9.service similarity index 77% rename from test/testsuite-23.units/testsuite-23-joins-namespace-of-9.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-9.service index 6c64873b241..a30f92af809 100644 --- a/test/testsuite-23.units/testsuite-23-joins-namespace-of-9.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-9.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] -JoinsNamespaceOf=testsuite-23-joins-namespace-of-8.service +JoinsNamespaceOf=TEST-23-UNIT-FILE-joins-namespace-of-8.service [Service] Type=oneshot diff --git a/test/testsuite-23.units/testsuite-23-namespaced.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-namespaced.service similarity index 88% rename from test/testsuite-23.units/testsuite-23-namespaced.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-namespaced.service index 46c27ca5d83..82eb74c0bd8 100644 --- a/test/testsuite-23.units/testsuite-23-namespaced.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-namespaced.service @@ -7,7 +7,7 @@ Type=notify RemainAfterExit=yes MountAPIVFS=yes PrivateTmp=yes -BindPaths=/run/testsuite-23-marker-fixed:/tmp/testfile-marker-fixed +BindPaths=/run/TEST-23-UNIT-FILE-marker-fixed:/tmp/testfile-marker-fixed InaccessiblePaths=/run/inaccessible ExecStartPre=grep -q -F MARKER_FIXED /tmp/testfile-marker-fixed ExecStart=sh -c 'systemd-notify --ready; until grep -q -F MARKER_RUNTIME /tmp/testfile-marker-runtime; do sleep 0.1; done; test ! -f /run/inaccessible/testfile-marker-fixed' diff --git a/test/testsuite-23.units/testsuite-23-non-namespaced.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-non-namespaced.service similarity index 100% rename from test/testsuite-23.units/testsuite-23-non-namespaced.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-non-namespaced.service diff --git a/test/testsuite-23.units/testsuite-23-oneshot-restartforce.sh b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-oneshot-restartforce.sh similarity index 100% rename from test/testsuite-23.units/testsuite-23-oneshot-restartforce.sh rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-oneshot-restartforce.sh diff --git a/test/testsuite-23.units/testsuite-23-openfile-server.socket b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-openfile-server.socket similarity index 100% rename from test/testsuite-23.units/testsuite-23-openfile-server.socket rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-openfile-server.socket diff --git a/test/testsuite-23.units/testsuite-23-openfile-server@.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-openfile-server@.service similarity index 100% rename from test/testsuite-23.units/testsuite-23-openfile-server@.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-openfile-server@.service diff --git a/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-prop-stop-one.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-prop-stop-one.service new file mode 100644 index 00000000000..0739aaf31d8 --- /dev/null +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-prop-stop-one.service @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Stop Propagation Receiver +Wants=TEST-23-UNIT-FILE-prop-stop-two.service +After=TEST-23-UNIT-FILE-prop-stop-two.service +StopPropagatedFrom=TEST-23-UNIT-FILE-prop-stop-two.service + +[Service] +ExecStart=sleep infinity +ExecStopPost=systemctl kill --kill-whom=main -sUSR2 TEST-23-UNIT-FILE.service diff --git a/test/testsuite-23.units/testsuite-23-prop-stop-two.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-prop-stop-two.service similarity index 100% rename from test/testsuite-23.units/testsuite-23-prop-stop-two.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-prop-stop-two.service diff --git a/test/testsuite-23.units/testsuite-23-retry-fail.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-fail.service similarity index 60% rename from test/testsuite-23.units/testsuite-23-retry-fail.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-fail.service index 2e0972cbf0d..319757a44d1 100644 --- a/test/testsuite-23.units/testsuite-23-retry-fail.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-fail.service @@ -5,5 +5,5 @@ Description=Failed Dependency Unit [Service] Type=oneshot RemainAfterExit=yes -ExecStart=sh -c "if [ -f /tmp/testsuite-23-retry-fail ]; then exit 0; else exit 1; fi" +ExecStart=sh -c "if [ -f /tmp/TEST-23-UNIT-FILE-retry-fail ]; then exit 0; else exit 1; fi" Restart=no diff --git a/test/testsuite-23.units/testsuite-23-retry-upheld.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-upheld.service similarity index 60% rename from test/testsuite-23.units/testsuite-23-retry-upheld.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-upheld.service index 3c20e4338c5..722a3b479bf 100644 --- a/test/testsuite-23.units/testsuite-23-retry-upheld.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-upheld.service @@ -1,8 +1,8 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] Description=Upheld Unit -Requires=testsuite-23-retry-fail.service -After=testsuite-23-retry-fail.service +Requires=TEST-23-UNIT-FILE-retry-fail.service +After=TEST-23-UNIT-FILE-retry-fail.service [Service] Type=oneshot diff --git a/test/testsuite-23.units/testsuite-23-retry-uphold.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-uphold.service similarity index 70% rename from test/testsuite-23.units/testsuite-23-retry-uphold.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-uphold.service index 7f15f068b41..829ea5c39e7 100644 --- a/test/testsuite-23.units/testsuite-23-retry-uphold.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-uphold.service @@ -1,7 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] Description=Upholding Unit -Upholds=testsuite-23-retry-upheld.service +Upholds=TEST-23-UNIT-FILE-retry-upheld.service [Service] ExecStart=sleep infinity diff --git a/test/testsuite-23.units/testsuite-23-short-lived.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-short-lived.service similarity index 74% rename from test/testsuite-23.units/testsuite-23-short-lived.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-short-lived.service index 2dcb2ae228e..ac9583f9169 100644 --- a/test/testsuite-23.units/testsuite-23-short-lived.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-short-lived.service @@ -8,4 +8,4 @@ StartLimitBurst=15 StartLimitIntervalSec=1h [Service] -ExecStart=/usr/lib/systemd/tests/testdata/units/testsuite-23-short-lived.sh +ExecStart=/usr/lib/systemd/tests/testdata/units/TEST-23-UNIT-FILE-short-lived.sh diff --git a/test/testsuite-23.units/testsuite-23-specifier-j-depends-wants.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-specifier-j-depends-wants.service similarity index 100% rename from test/testsuite-23.units/testsuite-23-specifier-j-depends-wants.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-specifier-j-depends-wants.service diff --git a/test/testsuite-23.units/testsuite-23-specifier-j-wants.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-specifier-j-wants.service similarity index 65% rename from test/testsuite-23.units/testsuite-23-specifier-j-wants.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-specifier-j-wants.service index 9abb257df47..5aeee9f8d66 100644 --- a/test/testsuite-23.units/testsuite-23-specifier-j-wants.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-specifier-j-wants.service @@ -1,8 +1,8 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] Description=Wants with percent-j specifier -Wants=testsuite-23-specifier-j-depends-%j.service -After=testsuite-23-specifier-j-depends-%j.service +Wants=TEST-23-UNIT-FILE-specifier-j-depends-%j.service +After=TEST-23-UNIT-FILE-specifier-j-depends-%j.service [Service] Type=oneshot diff --git a/test/testsuite-23.units/testsuite-23-success.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-success.service similarity index 72% rename from test/testsuite-23.units/testsuite-23-success.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-success.service index 2ace6fa370c..1ae6271fcca 100644 --- a/test/testsuite-23.units/testsuite-23-success.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-success.service @@ -1,7 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] Description=Succeeding unit -OnSuccess=testsuite-23-fail.service +OnSuccess=TEST-23-UNIT-FILE-fail.service [Service] ExecStart=true diff --git a/test/testsuite-23.units/testsuite-23-upheldby-install.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-upheldby-install.service similarity index 76% rename from test/testsuite-23.units/testsuite-23-upheldby-install.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-upheldby-install.service index bcfacd21dd4..edb8fcb2e91 100644 --- a/test/testsuite-23.units/testsuite-23-upheldby-install.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-upheldby-install.service @@ -6,4 +6,4 @@ Description=Unit that sets UpheldBy= through [Install] ExecStart=sleep infinity [Install] -UpheldBy=testsuite-23-retry-uphold.service +UpheldBy=TEST-23-UNIT-FILE-retry-uphold.service diff --git a/test/testsuite-23.units/testsuite-23-uphold.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-uphold.service similarity index 71% rename from test/testsuite-23.units/testsuite-23-uphold.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-uphold.service index 67f0ac88599..36c5dae7d30 100644 --- a/test/testsuite-23.units/testsuite-23-uphold.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-uphold.service @@ -1,7 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] Description=Upholding Unit -Upholds=testsuite-23-short-lived.service +Upholds=TEST-23-UNIT-FILE-short-lived.service [Service] ExecStart=sleep infinity diff --git a/test/TEST-23-UNIT-FILE/meson.build b/test/TEST-23-UNIT-FILE/meson.build index 8dec5f37e73..3f44662ae3a 100644 --- a/test/TEST-23-UNIT-FILE/meson.build +++ b/test/TEST-23-UNIT-FILE/meson.build @@ -5,3 +5,5 @@ integration_tests += [ 'name' : fs.name(meson.current_source_dir()), }, ] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-23-UNIT-FILE.units'] diff --git a/test/testsuite-30.units/systemd-timedated.service.d/watchdog.conf b/test/TEST-30-ONCLOCKCHANGE/TEST-30-ONCLOCKCHANGE.units/systemd-timedated.service.d/watchdog.conf similarity index 100% rename from test/testsuite-30.units/systemd-timedated.service.d/watchdog.conf rename to test/TEST-30-ONCLOCKCHANGE/TEST-30-ONCLOCKCHANGE.units/systemd-timedated.service.d/watchdog.conf diff --git a/test/TEST-30-ONCLOCKCHANGE/meson.build b/test/TEST-30-ONCLOCKCHANGE/meson.build index 8dec5f37e73..174ec42867f 100644 --- a/test/TEST-30-ONCLOCKCHANGE/meson.build +++ b/test/TEST-30-ONCLOCKCHANGE/meson.build @@ -5,3 +5,5 @@ integration_tests += [ 'name' : fs.name(meson.current_source_dir()), }, ] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-30-ONCLOCKCHANGE.units'] diff --git a/test/testsuite-52.units/test-honor-first-shutdown.service b/test/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units/test-honor-first-shutdown.service similarity index 73% rename from test/testsuite-52.units/test-honor-first-shutdown.service rename to test/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units/test-honor-first-shutdown.service index abcf578402c..bbeac3a74e6 100644 --- a/test/testsuite-52.units/test-honor-first-shutdown.service +++ b/test/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units/test-honor-first-shutdown.service @@ -4,7 +4,7 @@ Description=Honor First Shutdown feature After=multi-user.target [Service] -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-52.units/%N.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-52-HONORFIRSTSHUTDOWN.units/%N.sh ExecStop=sh -c 'kill -KILL $MAINPID' FailureAction=reboot diff --git a/test/testsuite-52.units/test-honor-first-shutdown.sh b/test/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units/test-honor-first-shutdown.sh similarity index 100% rename from test/testsuite-52.units/test-honor-first-shutdown.sh rename to test/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units/test-honor-first-shutdown.sh diff --git a/test/TEST-52-HONORFIRSTSHUTDOWN/meson.build b/test/TEST-52-HONORFIRSTSHUTDOWN/meson.build index 8dec5f37e73..08503e88221 100644 --- a/test/TEST-52-HONORFIRSTSHUTDOWN/meson.build +++ b/test/TEST-52-HONORFIRSTSHUTDOWN/meson.build @@ -5,3 +5,5 @@ integration_tests += [ 'name' : fs.name(meson.current_source_dir()), }, ] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-52-HONORFIRSTSHUTDOWN.units'] diff --git a/test/testsuite-63.units/test63-glob.path b/test/TEST-63-PATH/TEST-63-PATH.units/test63-glob.path similarity index 100% rename from test/testsuite-63.units/test63-glob.path rename to test/TEST-63-PATH/TEST-63-PATH.units/test63-glob.path diff --git a/test/testsuite-63.units/test63-glob.service b/test/TEST-63-PATH/TEST-63-PATH.units/test63-glob.service similarity index 100% rename from test/testsuite-63.units/test63-glob.service rename to test/TEST-63-PATH/TEST-63-PATH.units/test63-glob.service diff --git a/test/testsuite-63.units/test63-issue-24577-dep.service b/test/TEST-63-PATH/TEST-63-PATH.units/test63-issue-24577-dep.service similarity index 100% rename from test/testsuite-63.units/test63-issue-24577-dep.service rename to test/TEST-63-PATH/TEST-63-PATH.units/test63-issue-24577-dep.service diff --git a/test/testsuite-63.units/test63-issue-24577.path b/test/TEST-63-PATH/TEST-63-PATH.units/test63-issue-24577.path similarity index 100% rename from test/testsuite-63.units/test63-issue-24577.path rename to test/TEST-63-PATH/TEST-63-PATH.units/test63-issue-24577.path diff --git a/test/testsuite-63.units/test63-issue-24577.service b/test/TEST-63-PATH/TEST-63-PATH.units/test63-issue-24577.service similarity index 100% rename from test/testsuite-63.units/test63-issue-24577.service rename to test/TEST-63-PATH/TEST-63-PATH.units/test63-issue-24577.service diff --git a/test/testsuite-63.units/test63-pr-30768.path b/test/TEST-63-PATH/TEST-63-PATH.units/test63-pr-30768.path similarity index 100% rename from test/testsuite-63.units/test63-pr-30768.path rename to test/TEST-63-PATH/TEST-63-PATH.units/test63-pr-30768.path diff --git a/test/testsuite-63.units/test63-pr-30768.service b/test/TEST-63-PATH/TEST-63-PATH.units/test63-pr-30768.service similarity index 100% rename from test/testsuite-63.units/test63-pr-30768.service rename to test/TEST-63-PATH/TEST-63-PATH.units/test63-pr-30768.service diff --git a/test/testsuite-63.units/test63.path b/test/TEST-63-PATH/TEST-63-PATH.units/test63.path similarity index 100% rename from test/testsuite-63.units/test63.path rename to test/TEST-63-PATH/TEST-63-PATH.units/test63.path diff --git a/test/testsuite-63.units/test63.service b/test/TEST-63-PATH/TEST-63-PATH.units/test63.service similarity index 100% rename from test/testsuite-63.units/test63.service rename to test/TEST-63-PATH/TEST-63-PATH.units/test63.service diff --git a/test/TEST-63-PATH/meson.build b/test/TEST-63-PATH/meson.build index 8dec5f37e73..4aa3afdf7a3 100644 --- a/test/TEST-63-PATH/meson.build +++ b/test/TEST-63-PATH/meson.build @@ -5,3 +5,5 @@ integration_tests += [ 'name' : fs.name(meson.current_source_dir()), }, ] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-63-PATH.units'] diff --git a/test/testsuite-80.units/fdstore-nopin.service b/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-nopin.service similarity index 54% rename from test/testsuite-80.units/fdstore-nopin.service rename to test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-nopin.service index 29ffd230336..f65885345f0 100644 --- a/test/testsuite-80.units/fdstore-nopin.service +++ b/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-nopin.service @@ -3,4 +3,4 @@ Type=notify NotifyAccess=all FileDescriptorStoreMax=10 FileDescriptorStorePreserve=restart -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-80.units/fdstore-pin.sh 0 +ExecStart=/usr/lib/systemd/tests/testdata/TEST-80-NOTIFYACCESS.units/fdstore-pin.sh 0 diff --git a/test/testsuite-80.units/fdstore-pin.service b/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.service similarity index 53% rename from test/testsuite-80.units/fdstore-pin.service rename to test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.service index 913daa2725b..393b5ac6819 100644 --- a/test/testsuite-80.units/fdstore-pin.service +++ b/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.service @@ -3,4 +3,4 @@ Type=notify NotifyAccess=all FileDescriptorStoreMax=10 FileDescriptorStorePreserve=yes -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-80.units/fdstore-pin.sh 1 +ExecStart=/usr/lib/systemd/tests/testdata/TEST-80-NOTIFYACCESS.units/fdstore-pin.sh 1 diff --git a/test/testsuite-80.units/fdstore-pin.sh b/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.sh similarity index 100% rename from test/testsuite-80.units/fdstore-pin.sh rename to test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.sh diff --git a/test/testsuite-80.units/fdstore-pin.target b/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.target similarity index 100% rename from test/testsuite-80.units/fdstore-pin.target rename to test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.target diff --git a/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/notify.service b/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/notify.service new file mode 100644 index 00000000000..5693be613da --- /dev/null +++ b/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/notify.service @@ -0,0 +1,4 @@ +[Service] +Type=notify +NotifyAccess=all +ExecStart=/usr/lib/systemd/tests/testdata/TEST-80-NOTIFYACCESS.units/test.sh diff --git a/test/testsuite-80.units/test.sh b/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/test.sh similarity index 100% rename from test/testsuite-80.units/test.sh rename to test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/test.sh diff --git a/test/TEST-80-NOTIFYACCESS/meson.build b/test/TEST-80-NOTIFYACCESS/meson.build index 8dec5f37e73..f78c6fd732e 100644 --- a/test/TEST-80-NOTIFYACCESS/meson.build +++ b/test/TEST-80-NOTIFYACCESS/meson.build @@ -5,3 +5,5 @@ integration_tests += [ 'name' : fs.name(meson.current_source_dir()), }, ] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-80-NOTIFYACCESS.units'] diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py index c41ca8e55a0..6e2c0aede72 100755 --- a/test/integration-test-wrapper.py +++ b/test/integration-test-wrapper.py @@ -43,7 +43,6 @@ def main(): parser.add_argument('--meson-source-dir', required=True, type=Path) parser.add_argument('--meson-build-dir', required=True, type=Path) parser.add_argument('--test-name', required=True) - parser.add_argument('--test-number', required=True) parser.add_argument('--storage', required=True) parser.add_argument('--firmware', required=True) parser.add_argument('--slow', action=argparse.BooleanOptionalAction) @@ -59,7 +58,7 @@ def main(): exit(77) name = args.test_name + (f"-{i}" if (i := os.getenv("MESON_TEST_ITERATION")) else "") - test_unit = f"testsuite-{args.test_number}.service" + test_unit = f"{args.test_name}.service" dropin = textwrap.dedent( """\ @@ -130,7 +129,7 @@ def main(): '--kernel-command-line-extra', ' '.join([ 'systemd.hostname=H', - f"SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/testsuite-{args.test_number}.units:/usr/lib/systemd/tests/testdata/units:", + f"SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/{args.test_name}.units:/usr/lib/systemd/tests/testdata/units:", f"systemd.unit={test_unit}", 'systemd.mask=systemd-networkd-wait-online.service', *( diff --git a/test/meson.build b/test/meson.build index 37c6a671ad8..26fbd562829 100644 --- a/test/meson.build +++ b/test/meson.build @@ -1,75 +1,5 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -if install_tests - foreach subdir : [ - 'auxv', - 'journal-data', - 'knot-data', - 'test-journals', - 'units', - 'test-execute', - 'test-fstab-generator', - 'test-path', - 'test-path-util', - 'test-umount', - 'test-network', - 'test-network-generator-conversion', - 'testsuite-03.units', - 'testsuite-04.units', - 'testsuite-06.units', - 'testsuite-07.units', - 'testsuite-16.units', - 'testsuite-23.units', - 'testsuite-30.units', - 'testsuite-52.units', - 'testsuite-63.units', - 'testsuite-80.units', - ] - # install_subdir() before meson 1.3.0 does not handle symlinks correctly (it follows them - # instead of copying the symlink) so we use rsync instead. - if meson.version().version_compare('<1.3.0') - if not rsync.found() - error('rsync is required to install the integration test data') - endif - - rsync_r = rsync.full_path() + ' -rlpt --exclude .gitattributes --exclude 25-default.link -- "@0@" "${DESTDIR:-}@1@"' - meson.add_install_script(sh, '-c', - rsync_r.format(meson.current_source_dir() / subdir, testdata_dir)) - else - install_subdir(subdir, - exclude_files : ['.gitattributes', '25-default.link'], - install_dir : testdata_dir, - follow_symlinks : false) - endif - endforeach - - # test-network/conf/25-default.link is a local symlink that becomes dangling when installed, so we - # exclude it and create the correct symlink here. - meson.add_install_script(sh, '-c', ln_s.format(networkdir / '99-default.link', - testdata_dir / 'test-network/conf/25-default.link')) - - install_data(kbd_model_map, - install_dir : testdata_dir + '/test-keymap-util') - - if conf.get('HAVE_ZSTD') == 1 and efi_arch != '' - install_subdir('test-bcd', - exclude_files : '.gitattributes', - install_dir : testdata_dir) - endif - if conf.get('ENABLE_RESOLVE') == 1 - install_subdir('test-resolve', - exclude_files : '.gitattributes', - install_dir : testdata_dir) - endif - - # The unit tests implemented as shell scripts expect to find testdata/ - # in the directory where they are stored. - meson.add_install_script(sh, '-c', ln_s.format(testdata_dir, - unittestsdir / 'testdata')) -endif - -############################################################ - if conf.get('ENABLE_SYSUSERS') == 1 test_sysusers_sh = configure_file( input : 'test-sysusers.sh.in', @@ -353,6 +283,20 @@ integration_test_template = { 'firmware' : 'linux', 'slow' : false, } +testdata_subdirs = [ + 'auxv', + 'journal-data', + 'knot-data', + 'test-journals', + 'units', + 'test-execute', + 'test-fstab-generator', + 'test-path', + 'test-path-util', + 'test-umount', + 'test-network', + 'test-network-generator-conversion', +] foreach dirname : [ 'TEST-01-BASIC', @@ -423,13 +367,10 @@ foreach dirname : [ endforeach foreach integration_test : integration_tests - integration_test_number = integration_test['name'].split('-')[1] - integration_test_args = [ '--meson-source-dir', meson.project_source_root(), '--meson-build-dir', meson.project_build_root(), '--test-name', integration_test['name'], - '--test-number', integration_test_number, '--storage', integration_test['storage'], '--firmware', integration_test['firmware'], ] @@ -463,3 +404,48 @@ foreach integration_test : integration_tests suite : 'integration-tests', ) endforeach + +if install_tests + foreach subdir : testdata_subdirs + # install_subdir() before meson 1.3.0 does not handle symlinks correctly (it follows them + # instead of copying the symlink) so we use rsync instead. + if meson.version().version_compare('<1.3.0') + if not rsync.found() + error('rsync is required to install the integration test data') + endif + + rsync_r = rsync.full_path() + ' -rlpt --exclude .gitattributes --exclude 25-default.link -- "@0@" "${DESTDIR:-}@1@"' + meson.add_install_script(sh, '-c', + rsync_r.format(meson.current_source_dir() / subdir, testdata_dir)) + else + install_subdir(subdir, + exclude_files : ['.gitattributes', '25-default.link'], + install_dir : testdata_dir, + follow_symlinks : false) + endif + endforeach + + # test-network/conf/25-default.link is a local symlink that becomes dangling when installed, so we + # exclude it and create the correct symlink here. + meson.add_install_script(sh, '-c', ln_s.format(networkdir / '99-default.link', + testdata_dir / 'test-network/conf/25-default.link')) + + install_data(kbd_model_map, + install_dir : testdata_dir + '/test-keymap-util') + + if conf.get('HAVE_ZSTD') == 1 and efi_arch != '' + install_subdir('test-bcd', + exclude_files : '.gitattributes', + install_dir : testdata_dir) + endif + if conf.get('ENABLE_RESOLVE') == 1 + install_subdir('test-resolve', + exclude_files : '.gitattributes', + install_dir : testdata_dir) + endif + + # The unit tests implemented as shell scripts expect to find testdata/ + # in the directory where they are stored. + meson.add_install_script(sh, '-c', ln_s.format(testdata_dir, + unittestsdir / 'testdata')) +endif diff --git a/test/test-functions b/test/test-functions index 6e889f838b5..2168854addf 100644 --- a/test/test-functions +++ b/test/test-functions @@ -146,10 +146,9 @@ if ! [[ "$TESTNAME" =~ ^TEST\-([0-9]+)\-.+$ ]]; then echo "ERROR: Test name '$TESTNAME' is not in the expected format: TEST-[0-9]+-*" >&2 exit 1 fi -TESTID="${BASH_REMATCH[1]:?}" -if [[ ! -f "$TEST_UNITS_DIR/testsuite-$TESTID.service" ]]; then - echo "ERROR: Test '$TESTNAME' is missing its service file '$TEST_UNITS_DIR/testsuite-$TESTID.service" >&2 +if [[ ! -f "$TEST_UNITS_DIR/$TESTNAME.service" ]]; then + echo "ERROR: Test '$TESTNAME' is missing its service file '$TEST_UNITS_DIR/$TESTNAME.service" >&2 exit 1 fi @@ -566,9 +565,9 @@ run_qemu() { "loglevel=2" "init=$PATH_TO_INIT" "console=$CONSOLE" - "SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/testsuite-$1.units:/usr/lib/systemd/tests/testdata/units:" + "SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/$1.units:/usr/lib/systemd/tests/testdata/units:" "systemd.unit=testsuite.target" - "systemd.wants=testsuite-$1.service" + "systemd.wants=$1.service" "noresume" "oops=panic" ${TEST_MATCH_SUBTEST:+"systemd.setenv=TEST_MATCH_SUBTEST=$TEST_MATCH_SUBTEST"} @@ -658,13 +657,13 @@ run_nspawn() { "--register=no" "--kill-signal=SIGKILL" "--directory=${1:?}" - "--setenv=SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/testsuite-$2.units:/usr/lib/systemd/tests/testdata/units:" - "--machine=TEST-$TESTID" + "--setenv=SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/$2.units:/usr/lib/systemd/tests/testdata/units:" + "--machine=$2" ) local kernel_params=( "$PATH_TO_INIT" "systemd.unit=testsuite.target" - "systemd.wants=testsuite-$2.service" + "systemd.wants=$2.service" ${TEST_MATCH_SUBTEST:+"systemd.setenv=TEST_MATCH_SUBTEST=$TEST_MATCH_SUBTEST"} ${TEST_MATCH_TESTCASE:+"systemd.setenv=TEST_MATCH_TESTCASE=$TEST_MATCH_TESTCASE"} ) @@ -1745,10 +1744,10 @@ save_journal() { dest_name="system.journal" fi - # Show messages from the testsuite-XX.service or messages with priority "warning" and higher + # Show messages from the TEST-XX-XXX.service or messages with priority "warning" and higher echo " --- $source_dir ---" "$JOURNALCTL" --all --no-pager --no-hostname -o short-monotonic -D "$source_dir" \ - _SYSTEMD_UNIT="testsuite-${TESTID:?}.service" + SYSLOG_IDENTIFIER="testsuite-$TESTID.sh" + \ + _SYSTEMD_UNIT="${TESTNAME:?}.service" + SYSLOG_IDENTIFIER="$TESTNAME.sh" + \ PRIORITY=4 + PRIORITY=3 + PRIORITY=2 + PRIORITY=1 + PRIORITY=0 if get_bool "$save"; then @@ -3325,11 +3324,11 @@ test_setup() { } test_run() { - local test_id="${1:?}" + local test_name="${1:?}" mount_initdir if ! get_bool "${TEST_NO_QEMU:=}"; then - if run_qemu "$test_id"; then + if run_qemu "$test_name"; then check_result_qemu || { echo "qemu test failed"; return 1; } else dwarn "can't run qemu, skipping" @@ -3337,7 +3336,7 @@ test_run() { fi if ! get_bool "${TEST_NO_NSPAWN:=}"; then mount_initdir - if run_nspawn "${initdir:?}" "$test_id"; then + if run_nspawn "${initdir:?}" "$test_name"; then check_result_nspawn "$initdir" || { echo "nspawn-root test failed"; return 1; } else dwarn "can't run systemd-nspawn, skipping" @@ -3345,7 +3344,7 @@ test_run() { if get_bool "${RUN_IN_UNPRIVILEGED_CONTAINER:=}"; then dir="$TESTDIR/unprivileged-nspawn-root" - if NSPAWN_ARGUMENTS="-U --private-network ${NSPAWN_ARGUMENTS:-}" run_nspawn "$dir" "$test_id"; then + if NSPAWN_ARGUMENTS="-U --private-network ${NSPAWN_ARGUMENTS:-}" run_nspawn "$dir" "$test_name"; then check_result_nspawn "$dir" || { echo "unprivileged-nspawn-root test failed"; return 1; } else dwarn "can't run systemd-nspawn, skipping" @@ -3401,7 +3400,7 @@ do_test() { case $1 in --run) echo "${testname} RUN: $TEST_DESCRIPTION" - test_run "$TESTID" + test_run "$TESTNAME" ret=$? if [ $ret -eq 0 ]; then echo "${testname} RUN: $TEST_DESCRIPTION [OK]" @@ -3433,7 +3432,7 @@ do_test() { test_setup_cleanup >"$TESTLOG" 2>&1 || ret=$? fi if [ $ret -eq 0 ]; then - test_run "$TESTID" >"$TESTLOG" 2>&1 || ret=$? + test_run "$TESTNAME" >"$TESTLOG" 2>&1 || ret=$? fi test_cleanup if [ $ret -eq 0 ]; then diff --git a/test/testsuite-23.units/testsuite-23-prop-stop-one.service b/test/testsuite-23.units/testsuite-23-prop-stop-one.service deleted file mode 100644 index 03189550a7f..00000000000 --- a/test/testsuite-23.units/testsuite-23-prop-stop-one.service +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=Stop Propagation Receiver -Wants=testsuite-23-prop-stop-two.service -After=testsuite-23-prop-stop-two.service -StopPropagatedFrom=testsuite-23-prop-stop-two.service - -[Service] -ExecStart=sleep infinity -ExecStopPost=systemctl kill --kill-whom=main -sUSR2 testsuite-23.service diff --git a/test/testsuite-80.units/notify.service b/test/testsuite-80.units/notify.service deleted file mode 100644 index 196b0766720..00000000000 --- a/test/testsuite-80.units/notify.service +++ /dev/null @@ -1,4 +0,0 @@ -[Service] -Type=notify -NotifyAccess=all -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-80.units/test.sh diff --git a/test/units/testsuite-01.service b/test/units/TEST-01-BASIC.service similarity index 100% rename from test/units/testsuite-01.service rename to test/units/TEST-01-BASIC.service diff --git a/test/units/testsuite-01.sh b/test/units/TEST-01-BASIC.sh similarity index 100% rename from test/units/testsuite-01.sh rename to test/units/TEST-01-BASIC.sh diff --git a/test/units/testsuite-02.service b/test/units/TEST-02-UNITTESTS.service similarity index 100% rename from test/units/testsuite-02.service rename to test/units/TEST-02-UNITTESTS.service diff --git a/test/units/testsuite-02.sh b/test/units/TEST-02-UNITTESTS.sh similarity index 100% rename from test/units/testsuite-02.sh rename to test/units/TEST-02-UNITTESTS.sh diff --git a/test/units/testsuite-03.service b/test/units/TEST-03-JOBS.service similarity index 100% rename from test/units/testsuite-03.service rename to test/units/TEST-03-JOBS.service diff --git a/test/units/testsuite-03.sh b/test/units/TEST-03-JOBS.sh similarity index 100% rename from test/units/testsuite-03.sh rename to test/units/TEST-03-JOBS.sh diff --git a/test/units/testsuite-04.LogFilterPatterns.sh b/test/units/TEST-04-JOURNAL.LogFilterPatterns.sh similarity index 100% rename from test/units/testsuite-04.LogFilterPatterns.sh rename to test/units/TEST-04-JOURNAL.LogFilterPatterns.sh diff --git a/test/units/testsuite-04.SYSTEMD_JOURNAL_COMPRESS.sh b/test/units/TEST-04-JOURNAL.SYSTEMD_JOURNAL_COMPRESS.sh similarity index 100% rename from test/units/testsuite-04.SYSTEMD_JOURNAL_COMPRESS.sh rename to test/units/TEST-04-JOURNAL.SYSTEMD_JOURNAL_COMPRESS.sh diff --git a/test/units/testsuite-04.bsod.sh b/test/units/TEST-04-JOURNAL.bsod.sh similarity index 100% rename from test/units/testsuite-04.bsod.sh rename to test/units/TEST-04-JOURNAL.bsod.sh diff --git a/test/units/testsuite-04.cat.sh b/test/units/TEST-04-JOURNAL.cat.sh similarity index 100% rename from test/units/testsuite-04.cat.sh rename to test/units/TEST-04-JOURNAL.cat.sh diff --git a/test/units/testsuite-04.corrupted-journals.sh b/test/units/TEST-04-JOURNAL.corrupted-journals.sh similarity index 100% rename from test/units/testsuite-04.corrupted-journals.sh rename to test/units/TEST-04-JOURNAL.corrupted-journals.sh diff --git a/test/units/testsuite-04.fss.sh b/test/units/TEST-04-JOURNAL.fss.sh similarity index 100% rename from test/units/testsuite-04.fss.sh rename to test/units/TEST-04-JOURNAL.fss.sh diff --git a/test/units/testsuite-04.journal-append.sh b/test/units/TEST-04-JOURNAL.journal-append.sh similarity index 100% rename from test/units/testsuite-04.journal-append.sh rename to test/units/TEST-04-JOURNAL.journal-append.sh diff --git a/test/units/testsuite-04.journal-corrupt.sh b/test/units/TEST-04-JOURNAL.journal-corrupt.sh similarity index 100% rename from test/units/testsuite-04.journal-corrupt.sh rename to test/units/TEST-04-JOURNAL.journal-corrupt.sh diff --git a/test/units/testsuite-04.journal-gatewayd.sh b/test/units/TEST-04-JOURNAL.journal-gatewayd.sh similarity index 100% rename from test/units/testsuite-04.journal-gatewayd.sh rename to test/units/TEST-04-JOURNAL.journal-gatewayd.sh diff --git a/test/units/testsuite-04.journal-remote.sh b/test/units/TEST-04-JOURNAL.journal-remote.sh similarity index 100% rename from test/units/testsuite-04.journal-remote.sh rename to test/units/TEST-04-JOURNAL.journal-remote.sh diff --git a/test/units/testsuite-04.journal.sh b/test/units/TEST-04-JOURNAL.journal.sh similarity index 100% rename from test/units/testsuite-04.journal.sh rename to test/units/TEST-04-JOURNAL.journal.sh diff --git a/test/units/testsuite-04.service b/test/units/TEST-04-JOURNAL.service similarity index 100% rename from test/units/testsuite-04.service rename to test/units/TEST-04-JOURNAL.service diff --git a/test/units/testsuite-04.sh b/test/units/TEST-04-JOURNAL.sh similarity index 100% rename from test/units/testsuite-04.sh rename to test/units/TEST-04-JOURNAL.sh diff --git a/test/units/testsuite-05.effective-limit.sh b/test/units/TEST-05-RLIMITS.effective-limit.sh similarity index 100% rename from test/units/testsuite-05.effective-limit.sh rename to test/units/TEST-05-RLIMITS.effective-limit.sh diff --git a/test/units/testsuite-05.rlimit.sh b/test/units/TEST-05-RLIMITS.rlimit.sh similarity index 77% rename from test/units/testsuite-05.rlimit.sh rename to test/units/TEST-05-RLIMITS.rlimit.sh index bbf3adbe651..6b425d4081d 100755 --- a/test/units/testsuite-05.rlimit.sh +++ b/test/units/TEST-05-RLIMITS.rlimit.sh @@ -16,8 +16,8 @@ systemctl daemon-reload [[ "$(systemctl show -P DefaultLimitNOFILESoft)" = "10000" ]] [[ "$(systemctl show -P DefaultLimitNOFILE)" = "16384" ]] -[[ "$(systemctl show -P LimitNOFILESoft testsuite-05.service)" = "10000" ]] -[[ "$(systemctl show -P LimitNOFILE testsuite-05.service)" = "16384" ]] +[[ "$(systemctl show -P LimitNOFILESoft TEST-05-RLIMITS.service)" = "10000" ]] +[[ "$(systemctl show -P LimitNOFILE TEST-05-RLIMITS.service)" = "16384" ]] # shellcheck disable=SC2016 systemd-run --wait -t bash -c '[[ "$(ulimit -n -S)" = "10000" ]]' diff --git a/test/units/testsuite-19.service b/test/units/TEST-05-RLIMITS.service similarity index 85% rename from test/units/testsuite-19.service rename to test/units/TEST-05-RLIMITS.service index 9ee5fc97d23..ab72d8fe27a 100644 --- a/test/units/testsuite-19.service +++ b/test/units/TEST-05-RLIMITS.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] -Description=TEST-19-DELEGATE +Description=TEST-05-RLIMITS [Service] ExecStartPre=rm -f /failed /testok diff --git a/test/units/testsuite-05.sh b/test/units/TEST-05-RLIMITS.sh similarity index 100% rename from test/units/testsuite-05.sh rename to test/units/TEST-05-RLIMITS.sh diff --git a/test/units/testsuite-06.service b/test/units/TEST-06-SELINUX.service similarity index 100% rename from test/units/testsuite-06.service rename to test/units/TEST-06-SELINUX.service diff --git a/test/units/testsuite-06.sh b/test/units/TEST-06-SELINUX.sh similarity index 100% rename from test/units/testsuite-06.sh rename to test/units/TEST-06-SELINUX.sh diff --git a/test/units/testsuite-07.aux-scope.sh b/test/units/TEST-07-PID1.aux-scope.sh similarity index 100% rename from test/units/testsuite-07.aux-scope.sh rename to test/units/TEST-07-PID1.aux-scope.sh diff --git a/test/units/testsuite-07.exec-context.sh b/test/units/TEST-07-PID1.exec-context.sh similarity index 100% rename from test/units/testsuite-07.exec-context.sh rename to test/units/TEST-07-PID1.exec-context.sh diff --git a/test/units/testsuite-07.exec-deserialization.sh b/test/units/TEST-07-PID1.exec-deserialization.sh similarity index 100% rename from test/units/testsuite-07.exec-deserialization.sh rename to test/units/TEST-07-PID1.exec-deserialization.sh diff --git a/test/units/testsuite-07.exec-timestamps.sh b/test/units/TEST-07-PID1.exec-timestamps.sh similarity index 100% rename from test/units/testsuite-07.exec-timestamps.sh rename to test/units/TEST-07-PID1.exec-timestamps.sh diff --git a/test/units/testsuite-07.issue-14566.sh b/test/units/TEST-07-PID1.issue-14566.sh similarity index 100% rename from test/units/testsuite-07.issue-14566.sh rename to test/units/TEST-07-PID1.issue-14566.sh diff --git a/test/units/testsuite-07.issue-16115.sh b/test/units/TEST-07-PID1.issue-16115.sh similarity index 100% rename from test/units/testsuite-07.issue-16115.sh rename to test/units/TEST-07-PID1.issue-16115.sh diff --git a/test/units/testsuite-07.issue-1981.sh b/test/units/TEST-07-PID1.issue-1981.sh similarity index 100% rename from test/units/testsuite-07.issue-1981.sh rename to test/units/TEST-07-PID1.issue-1981.sh diff --git a/test/units/testsuite-07.issue-2467.sh b/test/units/TEST-07-PID1.issue-2467.sh similarity index 100% rename from test/units/testsuite-07.issue-2467.sh rename to test/units/TEST-07-PID1.issue-2467.sh diff --git a/test/units/testsuite-07.issue-27953.sh b/test/units/TEST-07-PID1.issue-27953.sh similarity index 100% rename from test/units/testsuite-07.issue-27953.sh rename to test/units/TEST-07-PID1.issue-27953.sh diff --git a/test/units/testsuite-07.issue-30412.sh b/test/units/TEST-07-PID1.issue-30412.sh similarity index 100% rename from test/units/testsuite-07.issue-30412.sh rename to test/units/TEST-07-PID1.issue-30412.sh diff --git a/test/units/testsuite-07.issue-3166.sh b/test/units/TEST-07-PID1.issue-3166.sh similarity index 100% rename from test/units/testsuite-07.issue-3166.sh rename to test/units/TEST-07-PID1.issue-3166.sh diff --git a/test/units/testsuite-07.issue-3171.sh b/test/units/TEST-07-PID1.issue-3171.sh similarity index 100% rename from test/units/testsuite-07.issue-3171.sh rename to test/units/TEST-07-PID1.issue-3171.sh diff --git a/test/units/testsuite-07.main-PID-change.sh b/test/units/TEST-07-PID1.main-PID-change.sh similarity index 88% rename from test/units/testsuite-07.main-PID-change.sh rename to test/units/TEST-07-PID1.main-PID-change.sh index bd1144c6f2e..16f3510e5ed 100755 --- a/test/units/testsuite-07.main-PID-change.sh +++ b/test/units/TEST-07-PID1.main-PID-change.sh @@ -10,7 +10,7 @@ set -o pipefail # The main service PID should be the parent bash process MAINPID="${PPID:?}" -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$MAINPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$MAINPID" # Start a test process inside of our own cgroup sleep infinity & @@ -23,41 +23,41 @@ EXTERNALPID="$(systemctl show -P MainPID test-sleep.service)" # Update our own main PID to the external test PID, this should work systemd-notify MAINPID="$EXTERNALPID" -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$EXTERNALPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$EXTERNALPID" # Update our own main PID to the internal test PID, this should work, too systemd-notify MAINPID=$INTERNALPID -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$INTERNALPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$INTERNALPID" # Update it back to our own PID, this should also work systemd-notify MAINPID="$MAINPID" -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$MAINPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$MAINPID" # Try to set it to PID 1, which it should ignore, because that's the manager systemd-notify MAINPID=1 -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$MAINPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$MAINPID" # Try to set it to PID 0, which is invalid and should be ignored systemd-notify MAINPID=0 -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$MAINPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$MAINPID" # Try to set it to a valid but non-existing PID, which should be ignored. (Note # that we set the PID to a value well above any known /proc/sys/kernel/pid_max, # which means we can be pretty sure it doesn't exist by coincidence) systemd-notify MAINPID=1073741824 -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$MAINPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$MAINPID" # Change it again to the external PID, without privileges this time. This should be ignored, because the PID is from outside of our cgroup and we lack privileges. systemd-notify --uid=1000 MAINPID="$EXTERNALPID" -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$MAINPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$MAINPID" # Change it again to the internal PID, without privileges this time. This should work, as the process is on our cgroup, and that's enough even if we lack privileges. systemd-notify --uid=1000 MAINPID="$INTERNALPID" -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$INTERNALPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$INTERNALPID" # Update it back to our own PID, this should also work systemd-notify --uid=1000 MAINPID="$MAINPID" -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$MAINPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$MAINPID" cat >/tmp/test-mainpid.sh <<\EOF #!/usr/bin/env bash diff --git a/test/units/testsuite-07.mount-invalid-chars.sh b/test/units/TEST-07-PID1.mount-invalid-chars.sh similarity index 100% rename from test/units/testsuite-07.mount-invalid-chars.sh rename to test/units/TEST-07-PID1.mount-invalid-chars.sh diff --git a/test/units/testsuite-07.poll-limit.sh b/test/units/TEST-07-PID1.poll-limit.sh similarity index 100% rename from test/units/testsuite-07.poll-limit.sh rename to test/units/TEST-07-PID1.poll-limit.sh diff --git a/test/units/testsuite-07.pr-31351.sh b/test/units/TEST-07-PID1.pr-31351.sh similarity index 100% rename from test/units/testsuite-07.pr-31351.sh rename to test/units/TEST-07-PID1.pr-31351.sh diff --git a/test/units/testsuite-07.private-network.sh b/test/units/TEST-07-PID1.private-network.sh similarity index 100% rename from test/units/testsuite-07.private-network.sh rename to test/units/TEST-07-PID1.private-network.sh diff --git a/test/units/testsuite-07.service b/test/units/TEST-07-PID1.service similarity index 100% rename from test/units/testsuite-07.service rename to test/units/TEST-07-PID1.service diff --git a/test/units/testsuite-07.sh b/test/units/TEST-07-PID1.sh similarity index 100% rename from test/units/testsuite-07.sh rename to test/units/TEST-07-PID1.sh diff --git a/test/units/testsuite-07.socket-pass-fds.sh b/test/units/TEST-07-PID1.socket-pass-fds.sh similarity index 100% rename from test/units/testsuite-07.socket-pass-fds.sh rename to test/units/TEST-07-PID1.socket-pass-fds.sh diff --git a/test/units/testsuite-07.type-exec-parallel.sh b/test/units/TEST-07-PID1.type-exec-parallel.sh similarity index 100% rename from test/units/testsuite-07.type-exec-parallel.sh rename to test/units/TEST-07-PID1.type-exec-parallel.sh diff --git a/test/units/testsuite-08.service b/test/units/TEST-08-INITRD.service similarity index 100% rename from test/units/testsuite-08.service rename to test/units/TEST-08-INITRD.service diff --git a/test/units/testsuite-08.sh b/test/units/TEST-08-INITRD.sh similarity index 100% rename from test/units/testsuite-08.sh rename to test/units/TEST-08-INITRD.sh diff --git a/test/units/testsuite-09.journal.sh b/test/units/TEST-09-REBOOT.journal.sh similarity index 100% rename from test/units/testsuite-09.journal.sh rename to test/units/TEST-09-REBOOT.journal.sh diff --git a/test/units/testsuite-09.service b/test/units/TEST-09-REBOOT.service similarity index 100% rename from test/units/testsuite-09.service rename to test/units/TEST-09-REBOOT.service diff --git a/test/units/testsuite-09.sh b/test/units/TEST-09-REBOOT.sh similarity index 100% rename from test/units/testsuite-09.sh rename to test/units/TEST-09-REBOOT.sh diff --git a/test/units/testsuite-13.importctl.sh b/test/units/TEST-13-NSPAWN.importctl.sh similarity index 100% rename from test/units/testsuite-13.importctl.sh rename to test/units/TEST-13-NSPAWN.importctl.sh diff --git a/test/units/testsuite-13.machinectl.sh b/test/units/TEST-13-NSPAWN.machinectl.sh similarity index 100% rename from test/units/testsuite-13.machinectl.sh rename to test/units/TEST-13-NSPAWN.machinectl.sh diff --git a/test/units/testsuite-13.nspawn-oci.sh b/test/units/TEST-13-NSPAWN.nspawn-oci.sh similarity index 99% rename from test/units/testsuite-13.nspawn-oci.sh rename to test/units/TEST-13-NSPAWN.nspawn-oci.sh index b8a76fa1722..65dcc96b594 100755 --- a/test/units/testsuite-13.nspawn-oci.sh +++ b/test/units/TEST-13-NSPAWN.nspawn-oci.sh @@ -34,7 +34,7 @@ NETNS="$(mktemp /var/tmp/netns.XXX)" mount --bind /proc/self/ns/net "$NETNS" TMPDIR="$(mktemp -d)" touch "$TMPDIR/hello" -OCI="$(mktemp -d /var/lib/machines/testsuite-13.oci-bundle.XXX)" +OCI="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.oci-bundle.XXX)" create_dummy_container "$OCI/rootfs" mkdir -p "$OCI/rootfs/opt/var" mkdir -p "$OCI/rootfs/opt/readonly" diff --git a/test/units/testsuite-13.nspawn.sh b/test/units/TEST-13-NSPAWN.nspawn.sh similarity index 96% rename from test/units/testsuite-13.nspawn.sh rename to test/units/TEST-13-NSPAWN.nspawn.sh index 026ed23fcd9..7901e9877bf 100755 --- a/test/units/testsuite-13.nspawn.sh +++ b/test/units/TEST-13-NSPAWN.nspawn.sh @@ -82,7 +82,7 @@ testcase_sanity() { template="$(mktemp -d /tmp/nspawn-template.XXX)" create_dummy_container "$template" # Create a simple image from the just created container template - image="$(mktemp /var/lib/machines/testsuite-13.image-XXX.img)" + image="$(mktemp /var/lib/machines/TEST-13-NSPAWN.image-XXX.img)" dd if=/dev/zero of="$image" bs=1M count=256 mkfs.ext4 "$image" mkdir -p /mnt @@ -94,7 +94,7 @@ testcase_sanity() { systemd-nspawn --version # --template= - root="$(mktemp -u -d /var/lib/machines/testsuite-13.sanity.XXX)" + root="$(mktemp -u -d /var/lib/machines/TEST-13-NSPAWN.sanity.XXX)" coverage_create_nspawn_dropin "$root" (! systemd-nspawn --directory="$root" bash -xec 'echo hello') # Initialize $root from $template (the $root directory must not exist, hence @@ -342,7 +342,7 @@ testcase_nspawn_settings() { local root container dev private_users wlan_names mkdir -p /run/systemd/nspawn - root="$(mktemp -d /var/lib/machines/testsuite-13.nspawn-settings.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.nspawn-settings.XXX)" container="$(basename "$root")" create_dummy_container "$root" rm -f "/etc/systemd/nspawn/$container.nspawn" @@ -505,7 +505,7 @@ bind_user_cleanup() { testcase_bind_user() { local root - root="$(mktemp -d /var/lib/machines/testsuite-13.bind-user.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.bind-user.XXX)" create_dummy_container "$root" useradd --create-home --user-group nspawn-bind-user-1 useradd --create-home --user-group nspawn-bind-user-2 @@ -554,7 +554,7 @@ testcase_bind_tmp_path() { # https://github.com/systemd/systemd/issues/4789 local root - root="$(mktemp -d /var/lib/machines/testsuite-13.bind-tmp-path.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.bind-tmp-path.XXX)" create_dummy_container "$root" : >/tmp/bind systemd-nspawn --register=no \ @@ -569,7 +569,7 @@ testcase_norbind() { # https://github.com/systemd/systemd/issues/13170 local root - root="$(mktemp -d /var/lib/machines/testsuite-13.norbind-path.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.norbind-path.XXX)" mkdir -p /tmp/binddir/subdir echo -n "outer" >/tmp/binddir/subdir/file mount -t tmpfs tmpfs /tmp/binddir/subdir @@ -596,7 +596,7 @@ testcase_rootidmap() { local root cmd permissions local owner=1000 - root="$(mktemp -d /var/lib/machines/testsuite-13.rootidmap-path.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.rootidmap-path.XXX)" # Create ext4 image, as ext4 supports idmapped-mounts. mkdir -p /tmp/rootidmap/bind dd if=/dev/zero of=/tmp/rootidmap/ext4.img bs=4k count=2048 @@ -640,7 +640,7 @@ testcase_owneridmap() { local root cmd permissions local owner=1000 - root="$(mktemp -d /var/lib/machines/testsuite-13.owneridmap-path.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.owneridmap-path.XXX)" # Create ext4 image, as ext4 supports idmapped-mounts. mkdir -p /tmp/owneridmap/bind dd if=/dev/zero of=/tmp/owneridmap/ext4.img bs=4k count=2048 @@ -704,7 +704,7 @@ testcase_notification_socket() { local root local cmd='echo a | nc -U -u -w 1 /run/host/notify' - root="$(mktemp -d /var/lib/machines/testsuite-13.check_notification_socket.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.check_notification_socket.XXX)" create_dummy_container "$root" systemd-nspawn --register=no --directory="$root" bash -x -c "$cmd" @@ -716,7 +716,7 @@ testcase_notification_socket() { testcase_os_release() { local root entrypoint os_release_source - root="$(mktemp -d /var/lib/machines/testsuite-13.os-release.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.os-release.XXX)" create_dummy_container "$root" entrypoint="$root/entrypoint.sh" cat >"$entrypoint" <<\EOF @@ -758,7 +758,7 @@ testcase_machinectl_bind() { local service_path service_name root container_name ec local cmd='for i in $(seq 1 20); do if test -f /tmp/marker; then exit 0; fi; sleep .5; done; exit 1;' - root="$(mktemp -d /var/lib/machines/testsuite-13.machinectl-bind.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.machinectl-bind.XXX)" create_dummy_container "$root" container_name="$(basename "$root")" @@ -793,7 +793,7 @@ testcase_selinux() { local root - root="$(mktemp -d /var/lib/machines/testsuite-13.selinux.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.selinux.XXX)" create_dummy_container "$root" chcon -R -t container_t "$root" @@ -810,7 +810,7 @@ testcase_ephemeral_config() { # https://github.com/systemd/systemd/issues/13297 local root container_name - root="$(mktemp -d /var/lib/machines/testsuite-13.ephemeral-config.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.ephemeral-config.XXX)" create_dummy_container "$root" container_name="$(basename "$root")" @@ -853,7 +853,7 @@ matrix_run_one() { return 0 fi - root="$(mktemp -d "/var/lib/machines/testsuite-13.unified-$1-cgns-$2-api-vfs-writable-$3.XXX")" + root="$(mktemp -d "/var/lib/machines/TEST-13-NSPAWN.unified-$1-cgns-$2-api-vfs-writable-$3.XXX")" create_dummy_container "$root" SYSTEMD_NSPAWN_UNIFIED_HIERARCHY="$cgroupsv2" SYSTEMD_NSPAWN_USE_CGNS="$use_cgns" SYSTEMD_NSPAWN_API_VFS_WRITABLE="$api_vfs_writable" \ @@ -941,8 +941,8 @@ testcase_check_os_release() { # https://github.com/systemd/systemd/issues/29185 local base common_opts root - base="$(mktemp -d /var/lib/machines/testsuite-13.check_os_release_base.XXX)" - root="$(mktemp -d /var/lib/machines/testsuite-13.check_os_release.XXX)" + base="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.check_os_release_base.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.check_os_release.XXX)" create_dummy_container "$base" cp -d "$base"/{bin,sbin,lib,lib64} "$root/" common_opts=( diff --git a/test/units/testsuite-13.nss-mymachines.sh b/test/units/TEST-13-NSPAWN.nss-mymachines.sh similarity index 100% rename from test/units/testsuite-13.nss-mymachines.sh rename to test/units/TEST-13-NSPAWN.nss-mymachines.sh diff --git a/test/units/testsuite-13.service b/test/units/TEST-13-NSPAWN.service similarity index 100% rename from test/units/testsuite-13.service rename to test/units/TEST-13-NSPAWN.service diff --git a/test/units/testsuite-13.sh b/test/units/TEST-13-NSPAWN.sh similarity index 100% rename from test/units/testsuite-13.sh rename to test/units/TEST-13-NSPAWN.sh diff --git a/test/units/testsuite-15.service b/test/units/TEST-15-DROPIN.service similarity index 100% rename from test/units/testsuite-15.service rename to test/units/TEST-15-DROPIN.service diff --git a/test/units/testsuite-15.sh b/test/units/TEST-15-DROPIN.sh similarity index 98% rename from test/units/testsuite-15.sh rename to test/units/TEST-15-DROPIN.sh index 7143a1597a3..f5bd8d8af4a 100755 --- a/test/units/testsuite-15.sh +++ b/test/units/TEST-15-DROPIN.sh @@ -694,15 +694,15 @@ testcase_symlink_dropin_directory() { echo "Testing symlink drop-in directory..." create_services test15-a rmdir /{etc,run,usr/lib}/systemd/system/test15-a.service.d - mkdir -p /tmp/testsuite-15-test15-a-dropin-directory - ln -s /tmp/testsuite-15-test15-a-dropin-directory /etc/systemd/system/test15-a.service.d - cat >/tmp/testsuite-15-test15-a-dropin-directory/override.conf </tmp/TEST-15-DROPIN-test15-a-dropin-directory/override.conf </tmp/TEST-23-UNIT-FILE.counter + +if [ "$counter" -eq 5 ] ; then + systemctl kill --kill-whom=main -sUSR1 TEST-23-UNIT-FILE.service +fi + +exec sleep 1.5 diff --git a/test/units/testsuite-23.ExecReload.sh b/test/units/TEST-23-UNIT-FILE.ExecReload.sh similarity index 100% rename from test/units/testsuite-23.ExecReload.sh rename to test/units/TEST-23-UNIT-FILE.ExecReload.sh diff --git a/test/units/testsuite-23.ExecStopPost.sh b/test/units/TEST-23-UNIT-FILE.ExecStopPost.sh similarity index 100% rename from test/units/testsuite-23.ExecStopPost.sh rename to test/units/TEST-23-UNIT-FILE.ExecStopPost.sh diff --git a/test/units/TEST-23-UNIT-FILE.JoinsNamespaceOf.sh b/test/units/TEST-23-UNIT-FILE.JoinsNamespaceOf.sh new file mode 100755 index 00000000000..4fd68d8b848 --- /dev/null +++ b/test/units/TEST-23-UNIT-FILE.JoinsNamespaceOf.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later + +set -eux +set -o pipefail + +# Test JoinsNamespaceOf= with PrivateTmp=yes + +systemd-analyze log-level debug +systemd-analyze log-target journal + +# simple case +systemctl start TEST-23-UNIT-FILE-joins-namespace-of-1.service +systemctl start TEST-23-UNIT-FILE-joins-namespace-of-2.service +systemctl start TEST-23-UNIT-FILE-joins-namespace-of-3.service +systemctl stop TEST-23-UNIT-FILE-joins-namespace-of-1.service + +# inverse dependency +systemctl start TEST-23-UNIT-FILE-joins-namespace-of-4.service +systemctl start TEST-23-UNIT-FILE-joins-namespace-of-5.service +systemctl stop TEST-23-UNIT-FILE-joins-namespace-of-4.service + +# transitive dependency +systemctl start TEST-23-UNIT-FILE-joins-namespace-of-6.service +systemctl start TEST-23-UNIT-FILE-joins-namespace-of-7.service +systemctl start TEST-23-UNIT-FILE-joins-namespace-of-8.service +systemctl start TEST-23-UNIT-FILE-joins-namespace-of-9.service +systemctl stop TEST-23-UNIT-FILE-joins-namespace-of-6.service +systemctl stop TEST-23-UNIT-FILE-joins-namespace-of-8.service + +systemd-analyze log-level info diff --git a/test/units/testsuite-23.RuntimeDirectoryPreserve.sh b/test/units/TEST-23-UNIT-FILE.RuntimeDirectoryPreserve.sh similarity index 100% rename from test/units/testsuite-23.RuntimeDirectoryPreserve.sh rename to test/units/TEST-23-UNIT-FILE.RuntimeDirectoryPreserve.sh diff --git a/test/units/testsuite-23.StandardOutput.sh b/test/units/TEST-23-UNIT-FILE.StandardOutput.sh similarity index 80% rename from test/units/testsuite-23.StandardOutput.sh rename to test/units/TEST-23-UNIT-FILE.StandardOutput.sh index 50b9ac2a2b9..a951b13b465 100755 --- a/test/units/testsuite-23.StandardOutput.sh +++ b/test/units/TEST-23-UNIT-FILE.StandardOutput.sh @@ -7,7 +7,7 @@ set -o pipefail systemd-analyze log-level debug -systemd-run --wait --unit=testsuite-23-standard-output-one \ +systemd-run --wait --unit=TEST-23-UNIT-FILE-standard-output-one \ -p StandardOutput=file:/tmp/stdout \ -p StandardError=file:/tmp/stderr \ -p Type=exec \ @@ -19,7 +19,7 @@ cmp /tmp/stderr <"/run/systemd/system/$UNIT_NAME" </run/TEST-23-UNIT-FILE-marker-fixed +mkdir /run/inaccessible + +systemctl start TEST-23-UNIT-FILE-namespaced.service + +# Ensure that inaccessible paths aren't bypassed by the runtime setup, +(! systemctl bind --mkdir TEST-23-UNIT-FILE-namespaced.service /run/TEST-23-UNIT-FILE-marker-fixed /run/inaccessible/testfile-marker-fixed) + +echo "MARKER_WRONG" >/run/TEST-23-UNIT-FILE-marker-wrong +echo "MARKER_RUNTIME" >/run/TEST-23-UNIT-FILE-marker-runtime + +# Mount twice to exercise mount-beneath (on kernel 6.5+, on older kernels it will just overmount) +systemctl bind --mkdir TEST-23-UNIT-FILE-namespaced.service /run/TEST-23-UNIT-FILE-marker-wrong /tmp/testfile-marker-runtime +test "$(systemctl show -P SubState TEST-23-UNIT-FILE-namespaced.service)" = "running" +systemctl bind --mkdir TEST-23-UNIT-FILE-namespaced.service /run/TEST-23-UNIT-FILE-marker-runtime /tmp/testfile-marker-runtime + +timeout 10 bash -xec 'while [[ "$(systemctl show -P SubState TEST-23-UNIT-FILE-namespaced.service)" == running ]]; do sleep .5; done' +systemctl is-active TEST-23-UNIT-FILE-namespaced.service + +# Now test that systemctl bind fails when attempted on a non-namespaced unit +systemctl start TEST-23-UNIT-FILE-non-namespaced.service + +(! systemctl bind --mkdir TEST-23-UNIT-FILE-non-namespaced.service /run/TEST-23-UNIT-FILE-marker-runtime /tmp/testfile-marker-runtime) + +timeout 10 bash -xec 'while [[ "$(systemctl show -P SubState TEST-23-UNIT-FILE-non-namespaced.service)" == running ]]; do sleep .5; done' +(! systemctl is-active TEST-23-UNIT-FILE-non-namespaced.service) diff --git a/test/units/testsuite-23.service b/test/units/TEST-23-UNIT-FILE.service similarity index 84% rename from test/units/testsuite-23.service rename to test/units/TEST-23-UNIT-FILE.service index 26f5226cd4d..e45435b84a5 100644 --- a/test/units/testsuite-23.service +++ b/test/units/TEST-23-UNIT-FILE.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] -Description=TEST-23-TYPE-EXEC +Description=TEST-23-UNIT-FILE [Service] ExecStartPre=rm -f /failed /testok diff --git a/test/units/testsuite-23.sh b/test/units/TEST-23-UNIT-FILE.sh similarity index 100% rename from test/units/testsuite-23.sh rename to test/units/TEST-23-UNIT-FILE.sh diff --git a/test/units/TEST-23-UNIT-FILE.start-stop-no-reload.sh b/test/units/TEST-23-UNIT-FILE.start-stop-no-reload.sh new file mode 100755 index 00000000000..61a6592cb6c --- /dev/null +++ b/test/units/TEST-23-UNIT-FILE.start-stop-no-reload.sh @@ -0,0 +1,93 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh +set -eux +set -o pipefail + +# Test start & stop operations without daemon-reload + +at_exit() { + set +e + + rm -f /run/systemd/system/TEST-23-UNIT-FILE-no-reload.{service,target} +} + +trap at_exit EXIT + +cat >/run/systemd/system/TEST-23-UNIT-FILE-no-reload.target </run/systemd/system/TEST-23-UNIT-FILE-no-reload.service </run/systemd/system/TEST-23-UNIT-FILE-no-reload.service </run/systemd/system/TEST-23-UNIT-FILE-no-reload.target </run/systemd/system/TEST-23-UNIT-FILE-no-reload.service </run/systemd/system/testsuite-55-testbloat.service.d/override.conf </run/systemd/system/TEST-55-OOMD-testbloat.service.d/override.conf </dev/null && echo thisshouldnotbehere; done" diff --git a/test/units/testsuite-66.sh b/test/units/TEST-66-DEVICE-ISOLATION.sh similarity index 64% rename from test/units/testsuite-66.sh rename to test/units/TEST-66-DEVICE-ISOLATION.sh index 147335a7af1..ccdfcb274c1 100755 --- a/test/units/testsuite-66.sh +++ b/test/units/TEST-66-DEVICE-ISOLATION.sh @@ -3,11 +3,11 @@ set -eux set -o pipefail -RESULTS_FILE=/tmp/testsuite66serviceresults +RESULTS_FILE=/tmp/TEST-66-DEVICE-ISOLATION.serviceresults systemd-analyze log-level debug -systemctl start testsuite-66-deviceisolation.service +systemctl start TEST-66-DEVICE-ISOLATION-device-isolation.service sleep 5 grep -q "Operation not permitted" "$RESULTS_FILE" @@ -15,7 +15,7 @@ grep -q "Operation not permitted" "$RESULTS_FILE" systemctl daemon-reload systemctl daemon-reexec -systemctl stop testsuite-66-deviceisolation.service +systemctl stop TEST-66-DEVICE-ISOLATION-device-isolation.service grep -q "thisshouldnotbehere" "$RESULTS_FILE" && exit 42 diff --git a/test/units/TEST-66-DEVICEISOLATION.service b/test/units/TEST-66-DEVICEISOLATION.service new file mode 100644 index 00000000000..61cd0abfb58 --- /dev/null +++ b/test/units/TEST-66-DEVICEISOLATION.service @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=TEST-66-DEVICEISOLATION + +[Service] +ExecStartPre=rm -f /failed /testok +ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh +Type=oneshot diff --git a/test/units/testsuite-67.service b/test/units/TEST-67-INTEGRITY.service similarity index 100% rename from test/units/testsuite-67.service rename to test/units/TEST-67-INTEGRITY.service diff --git a/test/units/testsuite-67.sh b/test/units/TEST-67-INTEGRITY.sh similarity index 100% rename from test/units/testsuite-67.sh rename to test/units/TEST-67-INTEGRITY.sh diff --git a/test/units/testsuite-68.service b/test/units/TEST-68-PROPAGATE-EXIT-STATUS.service similarity index 100% rename from test/units/testsuite-68.service rename to test/units/TEST-68-PROPAGATE-EXIT-STATUS.service diff --git a/test/units/testsuite-68.sh b/test/units/TEST-68-PROPAGATE-EXIT-STATUS.sh similarity index 100% rename from test/units/testsuite-68.sh rename to test/units/TEST-68-PROPAGATE-EXIT-STATUS.sh diff --git a/test/units/testsuite-69.service b/test/units/TEST-69-SHUTDOWN.service similarity index 100% rename from test/units/testsuite-69.service rename to test/units/TEST-69-SHUTDOWN.service diff --git a/test/units/testsuite-70.creds.sh b/test/units/TEST-70-TPM2.creds.sh similarity index 100% rename from test/units/testsuite-70.creds.sh rename to test/units/TEST-70-TPM2.creds.sh diff --git a/test/units/testsuite-70.cryptenroll.sh b/test/units/TEST-70-TPM2.cryptenroll.sh similarity index 100% rename from test/units/testsuite-70.cryptenroll.sh rename to test/units/TEST-70-TPM2.cryptenroll.sh diff --git a/test/units/testsuite-70.cryptsetup.sh b/test/units/TEST-70-TPM2.cryptsetup.sh similarity index 100% rename from test/units/testsuite-70.cryptsetup.sh rename to test/units/TEST-70-TPM2.cryptsetup.sh diff --git a/test/units/testsuite-70.measure.sh b/test/units/TEST-70-TPM2.measure.sh similarity index 100% rename from test/units/testsuite-70.measure.sh rename to test/units/TEST-70-TPM2.measure.sh diff --git a/test/units/testsuite-70.pcrextend.sh b/test/units/TEST-70-TPM2.pcrextend.sh similarity index 100% rename from test/units/testsuite-70.pcrextend.sh rename to test/units/TEST-70-TPM2.pcrextend.sh diff --git a/test/units/testsuite-70.pcrlock.sh b/test/units/TEST-70-TPM2.pcrlock.sh similarity index 100% rename from test/units/testsuite-70.pcrlock.sh rename to test/units/TEST-70-TPM2.pcrlock.sh diff --git a/test/units/testsuite-70.service b/test/units/TEST-70-TPM2.service similarity index 100% rename from test/units/testsuite-70.service rename to test/units/TEST-70-TPM2.service diff --git a/test/units/testsuite-70.sh b/test/units/TEST-70-TPM2.sh similarity index 100% rename from test/units/testsuite-70.sh rename to test/units/TEST-70-TPM2.sh diff --git a/test/units/testsuite-70.tpm2-setup.sh b/test/units/TEST-70-TPM2.tpm2-setup.sh similarity index 100% rename from test/units/testsuite-70.tpm2-setup.sh rename to test/units/TEST-70-TPM2.tpm2-setup.sh diff --git a/test/units/testsuite-71.service b/test/units/TEST-71-HOSTNAME.service similarity index 100% rename from test/units/testsuite-71.service rename to test/units/TEST-71-HOSTNAME.service diff --git a/test/units/testsuite-71.sh b/test/units/TEST-71-HOSTNAME.sh similarity index 100% rename from test/units/testsuite-71.sh rename to test/units/TEST-71-HOSTNAME.sh diff --git a/test/units/testsuite-72.service b/test/units/TEST-72-SYSUPDATE.service similarity index 100% rename from test/units/testsuite-72.service rename to test/units/TEST-72-SYSUPDATE.service diff --git a/test/units/testsuite-72.sh b/test/units/TEST-72-SYSUPDATE.sh similarity index 100% rename from test/units/testsuite-72.sh rename to test/units/TEST-72-SYSUPDATE.sh diff --git a/test/units/testsuite-73.service b/test/units/TEST-73-LOCALE.service similarity index 100% rename from test/units/testsuite-73.service rename to test/units/TEST-73-LOCALE.service diff --git a/test/units/testsuite-73.sh b/test/units/TEST-73-LOCALE.sh similarity index 100% rename from test/units/testsuite-73.sh rename to test/units/TEST-73-LOCALE.sh diff --git a/test/units/testsuite-74.battery-check.sh b/test/units/TEST-74-AUX-UTILS.battery-check.sh similarity index 100% rename from test/units/testsuite-74.battery-check.sh rename to test/units/TEST-74-AUX-UTILS.battery-check.sh diff --git a/test/units/testsuite-74.bootctl.sh b/test/units/TEST-74-AUX-UTILS.bootctl.sh similarity index 100% rename from test/units/testsuite-74.bootctl.sh rename to test/units/TEST-74-AUX-UTILS.bootctl.sh diff --git a/test/units/testsuite-74.busctl.sh b/test/units/TEST-74-AUX-UTILS.busctl.sh similarity index 100% rename from test/units/testsuite-74.busctl.sh rename to test/units/TEST-74-AUX-UTILS.busctl.sh diff --git a/test/units/testsuite-74.capsule.sh b/test/units/TEST-74-AUX-UTILS.capsule.sh similarity index 100% rename from test/units/testsuite-74.capsule.sh rename to test/units/TEST-74-AUX-UTILS.capsule.sh diff --git a/test/units/testsuite-74.cgls.sh b/test/units/TEST-74-AUX-UTILS.cgls.sh similarity index 100% rename from test/units/testsuite-74.cgls.sh rename to test/units/TEST-74-AUX-UTILS.cgls.sh diff --git a/test/units/testsuite-74.cgtop.sh b/test/units/TEST-74-AUX-UTILS.cgtop.sh similarity index 100% rename from test/units/testsuite-74.cgtop.sh rename to test/units/TEST-74-AUX-UTILS.cgtop.sh diff --git a/test/units/testsuite-74.coredump.sh b/test/units/TEST-74-AUX-UTILS.coredump.sh similarity index 99% rename from test/units/testsuite-74.coredump.sh rename to test/units/TEST-74-AUX-UTILS.coredump.sh index f48607c0db2..3f3571639e3 100755 --- a/test/units/testsuite-74.coredump.sh +++ b/test/units/TEST-74-AUX-UTILS.coredump.sh @@ -79,7 +79,7 @@ timeout 30 bash -c "while [[ \$(coredumpctl list -q --no-legend $CORE_TEST_BIN | if cgroupfs_supports_user_xattrs; then # Make sure we can forward crashes back to containers - CONTAINER="testsuite-74-container" + CONTAINER="TEST-74-AUX-UTILS-container" mkdir -p "/var/lib/machines/$CONTAINER" mkdir -p "/run/systemd/system/systemd-nspawn@$CONTAINER.service.d" diff --git a/test/units/testsuite-74.delta.sh b/test/units/TEST-74-AUX-UTILS.delta.sh similarity index 100% rename from test/units/testsuite-74.delta.sh rename to test/units/TEST-74-AUX-UTILS.delta.sh diff --git a/test/units/testsuite-74.escape.sh b/test/units/TEST-74-AUX-UTILS.escape.sh similarity index 100% rename from test/units/testsuite-74.escape.sh rename to test/units/TEST-74-AUX-UTILS.escape.sh diff --git a/test/units/testsuite-74.firstboot.sh b/test/units/TEST-74-AUX-UTILS.firstboot.sh similarity index 100% rename from test/units/testsuite-74.firstboot.sh rename to test/units/TEST-74-AUX-UTILS.firstboot.sh diff --git a/test/units/testsuite-74.id128.sh b/test/units/TEST-74-AUX-UTILS.id128.sh similarity index 100% rename from test/units/testsuite-74.id128.sh rename to test/units/TEST-74-AUX-UTILS.id128.sh diff --git a/test/units/testsuite-74.machine-id-setup.sh b/test/units/TEST-74-AUX-UTILS.machine-id-setup.sh similarity index 100% rename from test/units/testsuite-74.machine-id-setup.sh rename to test/units/TEST-74-AUX-UTILS.machine-id-setup.sh diff --git a/test/units/testsuite-74.modules-load.sh b/test/units/TEST-74-AUX-UTILS.modules-load.sh similarity index 100% rename from test/units/testsuite-74.modules-load.sh rename to test/units/TEST-74-AUX-UTILS.modules-load.sh diff --git a/test/units/testsuite-74.mount.sh b/test/units/TEST-74-AUX-UTILS.mount.sh similarity index 100% rename from test/units/testsuite-74.mount.sh rename to test/units/TEST-74-AUX-UTILS.mount.sh diff --git a/test/units/testsuite-74.network-generator.sh b/test/units/TEST-74-AUX-UTILS.network-generator.sh similarity index 100% rename from test/units/testsuite-74.network-generator.sh rename to test/units/TEST-74-AUX-UTILS.network-generator.sh diff --git a/test/units/testsuite-74.networkctl.sh b/test/units/TEST-74-AUX-UTILS.networkctl.sh similarity index 100% rename from test/units/testsuite-74.networkctl.sh rename to test/units/TEST-74-AUX-UTILS.networkctl.sh diff --git a/test/units/testsuite-74.path.sh b/test/units/TEST-74-AUX-UTILS.path.sh similarity index 100% rename from test/units/testsuite-74.path.sh rename to test/units/TEST-74-AUX-UTILS.path.sh diff --git a/test/units/testsuite-74.pstore.sh b/test/units/TEST-74-AUX-UTILS.pstore.sh similarity index 100% rename from test/units/testsuite-74.pstore.sh rename to test/units/TEST-74-AUX-UTILS.pstore.sh diff --git a/test/units/testsuite-74.run.sh b/test/units/TEST-74-AUX-UTILS.run.sh similarity index 100% rename from test/units/testsuite-74.run.sh rename to test/units/TEST-74-AUX-UTILS.run.sh diff --git a/test/units/testsuite-74.service b/test/units/TEST-74-AUX-UTILS.service similarity index 100% rename from test/units/testsuite-74.service rename to test/units/TEST-74-AUX-UTILS.service diff --git a/test/units/testsuite-74.sh b/test/units/TEST-74-AUX-UTILS.sh similarity index 100% rename from test/units/testsuite-74.sh rename to test/units/TEST-74-AUX-UTILS.sh diff --git a/test/units/testsuite-74.socket.sh b/test/units/TEST-74-AUX-UTILS.socket.sh similarity index 100% rename from test/units/testsuite-74.socket.sh rename to test/units/TEST-74-AUX-UTILS.socket.sh diff --git a/test/units/testsuite-74.ssh.sh b/test/units/TEST-74-AUX-UTILS.ssh.sh similarity index 100% rename from test/units/testsuite-74.ssh.sh rename to test/units/TEST-74-AUX-UTILS.ssh.sh diff --git a/test/units/testsuite-74.varlinkctl.sh b/test/units/TEST-74-AUX-UTILS.varlinkctl.sh similarity index 100% rename from test/units/testsuite-74.varlinkctl.sh rename to test/units/TEST-74-AUX-UTILS.varlinkctl.sh diff --git a/test/units/testsuite-74.vpick.sh b/test/units/TEST-74-AUX-UTILS.vpick.sh similarity index 100% rename from test/units/testsuite-74.vpick.sh rename to test/units/TEST-74-AUX-UTILS.vpick.sh diff --git a/test/units/TEST-75-RESOLVED.service b/test/units/TEST-75-RESOLVED.service new file mode 100644 index 00000000000..3368e04b99d --- /dev/null +++ b/test/units/TEST-75-RESOLVED.service @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=TEST-75-RESOLVED + +[Service] +ExecStartPre=rm -f /failed /testok +ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh +Type=oneshot diff --git a/test/units/testsuite-75.sh b/test/units/TEST-75-RESOLVED.sh similarity index 100% rename from test/units/testsuite-75.sh rename to test/units/TEST-75-RESOLVED.sh diff --git a/test/units/testsuite-76.service b/test/units/TEST-76-SYSCTL.service similarity index 100% rename from test/units/testsuite-76.service rename to test/units/TEST-76-SYSCTL.service diff --git a/test/units/testsuite-76.sh b/test/units/TEST-76-SYSCTL.sh similarity index 100% rename from test/units/testsuite-76.sh rename to test/units/TEST-76-SYSCTL.sh diff --git a/test/units/testsuite-78.service b/test/units/TEST-78-SIGQUEUE.service similarity index 100% rename from test/units/testsuite-78.service rename to test/units/TEST-78-SIGQUEUE.service diff --git a/test/units/testsuite-78.sh b/test/units/TEST-78-SIGQUEUE.sh similarity index 100% rename from test/units/testsuite-78.sh rename to test/units/TEST-78-SIGQUEUE.sh diff --git a/test/units/testsuite-79.service b/test/units/TEST-79-MEMPRESS.service similarity index 100% rename from test/units/testsuite-79.service rename to test/units/TEST-79-MEMPRESS.service diff --git a/test/units/testsuite-79.sh b/test/units/TEST-79-MEMPRESS.sh similarity index 94% rename from test/units/testsuite-79.sh rename to test/units/TEST-79-MEMPRESS.sh index 205f7f3da32..4ce73d4c299 100755 --- a/test/units/testsuite-79.sh +++ b/test/units/TEST-79-MEMPRESS.sh @@ -15,7 +15,7 @@ fi systemd-analyze log-level debug -CGROUP=/sys/fs/cgroup/"$(systemctl show testsuite-79.service -P ControlGroup)" +CGROUP=/sys/fs/cgroup/"$(systemctl show TEST-79-MEMPRESS.service -P ControlGroup)" test -d "$CGROUP" if ! test -f "$CGROUP"/memory.pressure ; then diff --git a/test/units/testsuite-80.service b/test/units/TEST-80-NOTIFYACCESS.service similarity index 100% rename from test/units/testsuite-80.service rename to test/units/TEST-80-NOTIFYACCESS.service diff --git a/test/units/testsuite-80.sh b/test/units/TEST-80-NOTIFYACCESS.sh similarity index 100% rename from test/units/testsuite-80.sh rename to test/units/TEST-80-NOTIFYACCESS.sh diff --git a/test/units/testsuite-81.debug-generator.sh b/test/units/TEST-81-GENERATORS.debug-generator.sh similarity index 100% rename from test/units/testsuite-81.debug-generator.sh rename to test/units/TEST-81-GENERATORS.debug-generator.sh diff --git a/test/units/testsuite-81.environment-d-generator.sh b/test/units/TEST-81-GENERATORS.environment-d-generator.sh similarity index 100% rename from test/units/testsuite-81.environment-d-generator.sh rename to test/units/TEST-81-GENERATORS.environment-d-generator.sh diff --git a/test/units/testsuite-81.fstab-generator.sh b/test/units/TEST-81-GENERATORS.fstab-generator.sh similarity index 100% rename from test/units/testsuite-81.fstab-generator.sh rename to test/units/TEST-81-GENERATORS.fstab-generator.sh diff --git a/test/units/testsuite-81.getty-generator.sh b/test/units/TEST-81-GENERATORS.getty-generator.sh similarity index 100% rename from test/units/testsuite-81.getty-generator.sh rename to test/units/TEST-81-GENERATORS.getty-generator.sh diff --git a/test/units/testsuite-81.run-generator.sh b/test/units/TEST-81-GENERATORS.run-generator.sh similarity index 100% rename from test/units/testsuite-81.run-generator.sh rename to test/units/TEST-81-GENERATORS.run-generator.sh diff --git a/test/units/testsuite-81.service b/test/units/TEST-81-GENERATORS.service similarity index 100% rename from test/units/testsuite-81.service rename to test/units/TEST-81-GENERATORS.service diff --git a/test/units/testsuite-81.sh b/test/units/TEST-81-GENERATORS.sh similarity index 100% rename from test/units/testsuite-81.sh rename to test/units/TEST-81-GENERATORS.sh diff --git a/test/units/testsuite-81.system-update-generator.sh b/test/units/TEST-81-GENERATORS.system-update-generator.sh similarity index 100% rename from test/units/testsuite-81.system-update-generator.sh rename to test/units/TEST-81-GENERATORS.system-update-generator.sh diff --git a/test/units/testsuite-82.service b/test/units/TEST-82-SOFTREBOOT.service similarity index 100% rename from test/units/testsuite-82.service rename to test/units/TEST-82-SOFTREBOOT.service diff --git a/test/units/testsuite-82.sh b/test/units/TEST-82-SOFTREBOOT.sh similarity index 79% rename from test/units/testsuite-82.sh rename to test/units/TEST-82-SOFTREBOOT.sh index 9747602d192..7a1d8a9221b 100755 --- a/test/units/testsuite-82.sh +++ b/test/units/TEST-82-SOFTREBOOT.sh @@ -23,13 +23,13 @@ systemd-analyze log-level debug export SYSTEMD_LOG_LEVEL=debug -if [ -f /run/testsuite82.touch3 ]; then +if [ -f /run/TEST-82-SOFTREBOOT.touch3 ]; then echo "This is the fourth boot!" systemd-notify --status="Fourth Boot" test "$(busctl -j get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager SoftRebootsCount | jq -r '.data')" -eq 3 - rm /run/testsuite82.touch3 + rm /run/TEST-82-SOFTREBOOT.touch3 mount rmdir /original-root /run/nextroot @@ -39,10 +39,10 @@ if [ -f /run/testsuite82.touch3 ]; then test "$x" = "oinkoink" # Check that the surviving services are still around - test "$(systemctl show -P ActiveState testsuite-82-survive.service)" = "active" - test "$(systemctl show -P ActiveState testsuite-82-survive-argv.service)" = "active" - test "$(systemctl show -P ActiveState testsuite-82-nosurvive-sigterm.service)" != "active" - test "$(systemctl show -P ActiveState testsuite-82-nosurvive.service)" != "active" + test "$(systemctl show -P ActiveState TEST-82-SOFTREBOOT-survive.service)" = "active" + test "$(systemctl show -P ActiveState TEST-82-SOFTREBOOT-survive-argv.service)" = "active" + test "$(systemctl show -P ActiveState TEST-82-SOFTREBOOT-nosurvive-sigterm.service)" != "active" + test "$(systemctl show -P ActiveState TEST-82-SOFTREBOOT-nosurvive.service)" != "active" # Check journals journalctl -o short-monotonic --no-hostname --grep '(will soft-reboot|KILL|corrupt)' @@ -50,13 +50,13 @@ if [ -f /run/testsuite82.touch3 ]; then # All succeeded, exit cleanly now -elif [ -f /run/testsuite82.touch2 ]; then +elif [ -f /run/TEST-82-SOFTREBOOT.touch2 ]; then echo "This is the third boot!" systemd-notify --status="Third Boot" test "$(busctl -j get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager SoftRebootsCount | jq -r '.data')" -eq 2 - rm /run/testsuite82.touch2 + rm /run/TEST-82-SOFTREBOOT.touch2 # Check that the fdstore entry still exists test "$LISTEN_FDS" -eq 2 @@ -70,10 +70,10 @@ elif [ -f /run/testsuite82.touch2 ]; then rm "$T" # Check that the surviving services are still around - test "$(systemctl show -P ActiveState testsuite-82-survive.service)" = "active" - test "$(systemctl show -P ActiveState testsuite-82-survive-argv.service)" = "active" - test "$(systemctl show -P ActiveState testsuite-82-nosurvive-sigterm.service)" != "active" - test "$(systemctl show -P ActiveState testsuite-82-nosurvive.service)" != "active" + test "$(systemctl show -P ActiveState TEST-82-SOFTREBOOT-survive.service)" = "active" + test "$(systemctl show -P ActiveState TEST-82-SOFTREBOOT-survive-argv.service)" = "active" + test "$(systemctl show -P ActiveState TEST-82-SOFTREBOOT-nosurvive-sigterm.service)" != "active" + test "$(systemctl show -P ActiveState TEST-82-SOFTREBOOT-nosurvive.service)" != "active" # Test that we really are in the new overlayfs root fs read -r x ..sh) +# Run all subtests (i.e. files named as $TESTNAME..sh) run_subtests() { local subtests=("${0%.sh}".*.sh) local subtest diff --git a/test/units/testsuite-23-short-lived.sh b/test/units/testsuite-23-short-lived.sh deleted file mode 100755 index 4a12c7f4987..00000000000 --- a/test/units/testsuite-23-short-lived.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later -set -ex - -if [ -f /tmp/testsuite-23.counter ] ; then - read -r counter < /tmp/testsuite-23.counter - counter=$((counter + 1)) -else - counter=0 -fi - -echo "$counter" >/tmp/testsuite-23.counter - -if [ "$counter" -eq 5 ] ; then - systemctl kill --kill-whom=main -sUSR1 testsuite-23.service -fi - -exec sleep 1.5 diff --git a/test/units/testsuite-23.JoinsNamespaceOf.sh b/test/units/testsuite-23.JoinsNamespaceOf.sh deleted file mode 100755 index 68ba4650722..00000000000 --- a/test/units/testsuite-23.JoinsNamespaceOf.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later - -set -eux -set -o pipefail - -# Test JoinsNamespaceOf= with PrivateTmp=yes - -systemd-analyze log-level debug -systemd-analyze log-target journal - -# simple case -systemctl start testsuite-23-joins-namespace-of-1.service -systemctl start testsuite-23-joins-namespace-of-2.service -systemctl start testsuite-23-joins-namespace-of-3.service -systemctl stop testsuite-23-joins-namespace-of-1.service - -# inverse dependency -systemctl start testsuite-23-joins-namespace-of-4.service -systemctl start testsuite-23-joins-namespace-of-5.service -systemctl stop testsuite-23-joins-namespace-of-4.service - -# transitive dependency -systemctl start testsuite-23-joins-namespace-of-6.service -systemctl start testsuite-23-joins-namespace-of-7.service -systemctl start testsuite-23-joins-namespace-of-8.service -systemctl start testsuite-23-joins-namespace-of-9.service -systemctl stop testsuite-23-joins-namespace-of-6.service -systemctl stop testsuite-23-joins-namespace-of-8.service - -systemd-analyze log-level info diff --git a/test/units/testsuite-23.Upholds.sh b/test/units/testsuite-23.Upholds.sh deleted file mode 100755 index e62f9c64dea..00000000000 --- a/test/units/testsuite-23.Upholds.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later - -set -eux -set -o pipefail - -# Test OnSuccess= + Uphold= + PropagatesStopTo= + BindsTo= - -systemd-analyze log-level debug -systemd-analyze log-target journal - -# Idea is this: -# 1. we start testsuite-23-success.service -# 2. which through OnSuccess= starts testsuite-23-fail.service, -# 3. which through OnFailure= starts testsuite-23-uphold.service, -# 4. which through Uphold= starts/keeps testsuite-23-short-lived.service running, -# 5. which will sleep 1s when invoked, and on the 5th invocation send us a SIGUSR1 -# 6. once we got that we finish cleanly - -sigusr1=0 -trap sigusr1=1 SIGUSR1 - -trap -p SIGUSR1 - -systemctl start testsuite-23-success.service - -while [ "$sigusr1" -eq 0 ] ; do - sleep .5 -done - -systemctl stop testsuite-23-uphold.service - -systemctl enable testsuite-23-upheldby-install.service - -# Idea is this: -# 1. we start testsuite-23-retry-uphold.service -# 2. which through Uphold= starts testsuite-23-retry-upheld.service -# 3. which through Requires= starts testsuite-23-retry-fail.service -# 4. which fails as /tmp/testsuite-23-retry-fail does not exist, so testsuite-23-retry-upheld.service -# is no longer restarted -# 5. we create /tmp/testsuite-23-retry-fail -# 6. now testsuite-23-retry-upheld.service will be restarted since upheld, and its dependency will -# be satisfied - -rm -f /tmp/testsuite-23-retry-fail -systemctl start testsuite-23-retry-uphold.service -systemctl is-active testsuite-23-upheldby-install.service - -until systemctl is-failed testsuite-23-retry-fail.service ; do - sleep .5 -done - -(! systemctl is-active testsuite-23-retry-upheld.service) - -touch /tmp/testsuite-23-retry-fail - -until systemctl is-active testsuite-23-retry-upheld.service ; do - sleep .5 -done - -systemctl stop testsuite-23-retry-uphold.service testsuite-23-retry-fail.service testsuite-23-retry-upheld.service - -# Idea is this: -# 1. we start testsuite-23-prop-stop-one.service -# 2. which through Wants=/After= pulls in testsuite-23-prop-stop-two.service as well -# 3. testsuite-23-prop-stop-one.service then sleeps indefinitely -# 4. testsuite-23-prop-stop-two.service sleeps a short time and exits -# 5. the StopPropagatedFrom= dependency between the two should ensure *both* will exit as result -# 6. an ExecStopPost= line on testsuite-23-prop-stop-one.service will send us a SIGUSR2 -# 7. once we got that we finish cleanly - -sigusr2=0 -trap sigusr2=1 SIGUSR2 - -systemctl start testsuite-23-prop-stop-one.service - -while [ "$sigusr2" -eq 0 ] ; do - sleep .5 -done - - -# Idea is this: -# 1. we start testsuite-23-binds-to.service -# 2. which through BindsTo=/After= pulls in testsuite-23-bound-by.service as well -# 3. testsuite-23-bound-by.service suddenly dies -# 4. testsuite-23-binds-to.service should then also be pulled down (it otherwise just hangs) -# 6. an ExecStopPost= line on testsuite-23-binds-to.service will send us a SIGRTMIN1+1 -# 7. once we got that we finish cleanly - -sigrtmin1=0 -trap sigrtmin1=1 SIGRTMIN+1 - -systemctl start testsuite-23-binds-to.service - -while [ "$sigrtmin1" -eq 0 ] ; do - sleep .5 -done - -systemd-analyze log-level info diff --git a/test/units/testsuite-23.runtime-bind-paths.sh b/test/units/testsuite-23.runtime-bind-paths.sh deleted file mode 100755 index 65c2dbf41db..00000000000 --- a/test/units/testsuite-23.runtime-bind-paths.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later -# shellcheck disable=SC2016 -set -eux -set -o pipefail - -# Test adding new BindPaths while unit is already running - -at_exit() { - set +e - - rm -f /run/testsuite-23-marker-{fixed,runtime} - rm -fr /run/inaccessible -} - -trap at_exit EXIT - -echo "MARKER_FIXED" >/run/testsuite-23-marker-fixed -mkdir /run/inaccessible - -systemctl start testsuite-23-namespaced.service - -# Ensure that inaccessible paths aren't bypassed by the runtime setup, -(! systemctl bind --mkdir testsuite-23-namespaced.service /run/testsuite-23-marker-fixed /run/inaccessible/testfile-marker-fixed) - -echo "MARKER_WRONG" >/run/testsuite-23-marker-wrong -echo "MARKER_RUNTIME" >/run/testsuite-23-marker-runtime - -# Mount twice to exercise mount-beneath (on kernel 6.5+, on older kernels it will just overmount) -systemctl bind --mkdir testsuite-23-namespaced.service /run/testsuite-23-marker-wrong /tmp/testfile-marker-runtime -test "$(systemctl show -P SubState testsuite-23-namespaced.service)" = "running" -systemctl bind --mkdir testsuite-23-namespaced.service /run/testsuite-23-marker-runtime /tmp/testfile-marker-runtime - -timeout 10 bash -xec 'while [[ "$(systemctl show -P SubState testsuite-23-namespaced.service)" == running ]]; do sleep .5; done' -systemctl is-active testsuite-23-namespaced.service - -# Now test that systemctl bind fails when attempted on a non-namespaced unit -systemctl start testsuite-23-non-namespaced.service - -(! systemctl bind --mkdir testsuite-49-non-namespaced.service /run/testsuite-23-marker-runtime /tmp/testfile-marker-runtime) - -timeout 10 bash -xec 'while [[ "$(systemctl show -P SubState testsuite-23-non-namespaced.service)" == running ]]; do sleep .5; done' -(! systemctl is-active testsuite-23-non-namespaced.service) diff --git a/test/units/testsuite-23.start-stop-no-reload.sh b/test/units/testsuite-23.start-stop-no-reload.sh deleted file mode 100755 index e40990bdbb8..00000000000 --- a/test/units/testsuite-23.start-stop-no-reload.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later -# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -# ex: ts=8 sw=4 sts=4 et filetype=sh -set -eux -set -o pipefail - -# Test start & stop operations without daemon-reload - -at_exit() { - set +e - - rm -f /run/systemd/system/testsuite-23-no-reload.{service,target} -} - -trap at_exit EXIT - -cat >/run/systemd/system/testsuite-23-no-reload.target </run/systemd/system/testsuite-23-no-reload.service </run/systemd/system/testsuite-23-no-reload.service </run/systemd/system/testsuite-23-no-reload.target </run/systemd/system/testsuite-23-no-reload.service <&2 "Missing container template, probably not running in TEST-13-NSPAWN?" exit 1 fi mkdir -p "$root" - cp -a /usr/share/testsuite-13-container-template/* "$root" + cp -a /usr/share/TEST-13-NSPAWN-container-template/* "$root" coverage_create_nspawn_dropin "$root" }