From 09c033a2763fe7f0e625901f199e646b3f132e84 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 10 May 2023 12:38:57 +0200 Subject: test: rename TEST-07-ISSUE-1981 to TEST-07-PID1 --- test/TEST-07-ISSUE-1981/Makefile | 1 - test/TEST-07-ISSUE-1981/test.sh | 13 ---------- test/TEST-07-PID1/Makefile | 1 + test/TEST-07-PID1/test.sh | 10 ++++++++ test/units/testsuite-07.issue-1981.sh | 47 +++++++++++++++++++++++++++++++++++ test/units/testsuite-07.sh | 33 +++--------------------- 6 files changed, 62 insertions(+), 43 deletions(-) delete mode 120000 test/TEST-07-ISSUE-1981/Makefile delete mode 100755 test/TEST-07-ISSUE-1981/test.sh create mode 120000 test/TEST-07-PID1/Makefile create mode 100755 test/TEST-07-PID1/test.sh create mode 100755 test/units/testsuite-07.issue-1981.sh (limited to 'test') diff --git a/test/TEST-07-ISSUE-1981/Makefile b/test/TEST-07-ISSUE-1981/Makefile deleted file mode 120000 index e9f93b1104..0000000000 --- a/test/TEST-07-ISSUE-1981/Makefile +++ /dev/null @@ -1 +0,0 @@ -../TEST-01-BASIC/Makefile \ No newline at end of file diff --git a/test/TEST-07-ISSUE-1981/test.sh b/test/TEST-07-ISSUE-1981/test.sh deleted file mode 100755 index 5bc41386b5..0000000000 --- a/test/TEST-07-ISSUE-1981/test.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later -set -e - -TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/1981" -TEST_NO_QEMU=1 - -# shellcheck source=test/test-functions -. "${TEST_BASE_DIR:?}/test-functions" - -NSPAWN_TIMEOUT=30 - -do_test "$@" diff --git a/test/TEST-07-PID1/Makefile b/test/TEST-07-PID1/Makefile new file mode 120000 index 0000000000..e9f93b1104 --- /dev/null +++ b/test/TEST-07-PID1/Makefile @@ -0,0 +1 @@ +../TEST-01-BASIC/Makefile \ No newline at end of file diff --git a/test/TEST-07-PID1/test.sh b/test/TEST-07-PID1/test.sh new file mode 100755 index 0000000000..2b9dd418b8 --- /dev/null +++ b/test/TEST-07-PID1/test.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later +set -e + +TEST_DESCRIPTION="Tests for core PID1 functionality" + +# shellcheck source=test/test-functions +. "${TEST_BASE_DIR:?}/test-functions" + +do_test "$@" diff --git a/test/units/testsuite-07.issue-1981.sh b/test/units/testsuite-07.issue-1981.sh new file mode 100755 index 0000000000..6eb802c93f --- /dev/null +++ b/test/units/testsuite-07.issue-1981.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later +set -eux +set -o pipefail + +# Segmentation fault in timer_enter_waiting while masking a unit +# Issue: https://github.com/systemd/systemd/issues/1981 + +at_exit() { + set +e + + systemctl stop my.timer my.service + rm -f /run/systemd/system/my.{service,timer} + systemctl daemon-reload +} + +trap at_exit EXIT + +mkdir -p /run/systemd/system + +cat >/run/systemd/system/my.service <<\EOF +[Service] +Type=oneshot +ExecStartPre=sh -c 'test "$TRIGGER_UNIT" = my.timer' +ExecStartPre=sh -c 'test -n "$TRIGGER_TIMER_REALTIME_USEC"' +ExecStartPre=sh -c 'test -n "$TRIGGER_TIMER_MONOTONIC_USEC"' +ExecStart=/bin/echo Timer runs me +EOF + +cat >/run/systemd/system/my.timer </run/systemd/system/my.timer.d/override.conf </failed -cat >/lib/systemd/system/my.service </lib/systemd/system/my.timer </etc/systemd/system/my.timer.d/override.conf < Date: Wed, 10 May 2023 13:07:26 +0200 Subject: test: merge TEST-08-ISSUE-2730 into TEST-07-PID1 --- test/TEST-07-PID1/test.sh | 19 +++++++++++++++++++ test/TEST-08-ISSUE-2730/Makefile | 1 - test/TEST-08-ISSUE-2730/test.sh | 14 -------------- test/meson.build | 12 ------------ test/testsuite-08.units/-.mount | 12 ------------ test/testsuite-08.units/local-fs.target.wants/-.mount | 1 - test/testsuite-08.units/root.mount | 1 - test/testsuite-08.units/systemd-remount-fs.service | 12 ------------ test/units/testsuite-07.sh | 4 ++++ test/units/testsuite-08.service | 8 -------- 10 files changed, 23 insertions(+), 61 deletions(-) delete mode 120000 test/TEST-08-ISSUE-2730/Makefile delete mode 100755 test/TEST-08-ISSUE-2730/test.sh delete mode 100644 test/testsuite-08.units/-.mount delete mode 120000 test/testsuite-08.units/local-fs.target.wants/-.mount delete mode 120000 test/testsuite-08.units/root.mount delete mode 100644 test/testsuite-08.units/systemd-remount-fs.service delete mode 100644 test/units/testsuite-08.service (limited to 'test') diff --git a/test/TEST-07-PID1/test.sh b/test/TEST-07-PID1/test.sh index 2b9dd418b8..c241840327 100755 --- a/test/TEST-07-PID1/test.sh +++ b/test/TEST-07-PID1/test.sh @@ -7,4 +7,23 @@ TEST_DESCRIPTION="Tests for core PID1 functionality" # shellcheck source=test/test-functions . "${TEST_BASE_DIR:?}/test-functions" +test_append_files() { + local workspace="${1:?}" + + # Issue: https://github.com/systemd/systemd/issues/2730 + mkdir -p "$workspace/etc/systemd/system/" + cat >"$workspace/etc/systemd/system/issue2730.mount" </failed +# Issue: https://github.com/systemd/systemd/issues/2730 +# See TEST-07-PID1/test.sh for the first "half" of the test +mountpoint /issue2730 + for script in "${0%.sh}".*.sh; do echo "Running $script" "./$script" diff --git a/test/units/testsuite-08.service b/test/units/testsuite-08.service deleted file mode 100644 index d6937663e2..0000000000 --- a/test/units/testsuite-08.service +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-08-ISSUE-2730 - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=sh -x -c 'mount -o remount,rw /dev/sda1 && echo OK >/testok; systemctl poweroff' -Type=oneshot -- cgit v1.2.1 From 4966a31ba3ef1eae37733a81bf318f4b18d11a96 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 10 May 2023 13:13:12 +0200 Subject: test: merge TEST-09-ISSUE-2691 into TEST-07-PID1 --- test/TEST-09-ISSUE-2691/Makefile | 1 - test/TEST-09-ISSUE-2691/test.sh | 11 ----------- test/units/testsuite-07.service | 6 +++++- test/units/testsuite-09.service | 11 ----------- 4 files changed, 5 insertions(+), 24 deletions(-) delete mode 120000 test/TEST-09-ISSUE-2691/Makefile delete mode 100755 test/TEST-09-ISSUE-2691/test.sh delete mode 100644 test/units/testsuite-09.service (limited to 'test') diff --git a/test/TEST-09-ISSUE-2691/Makefile b/test/TEST-09-ISSUE-2691/Makefile deleted file mode 120000 index e9f93b1104..0000000000 --- a/test/TEST-09-ISSUE-2691/Makefile +++ /dev/null @@ -1 +0,0 @@ -../TEST-01-BASIC/Makefile \ No newline at end of file diff --git a/test/TEST-09-ISSUE-2691/test.sh b/test/TEST-09-ISSUE-2691/test.sh deleted file mode 100755 index 3fc243cc55..0000000000 --- a/test/TEST-09-ISSUE-2691/test.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later -set -e - -TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/2691" -TEST_NO_NSPAWN=1 - -# shellcheck source=test/test-functions -. "${TEST_BASE_DIR:?}/test-functions" - -do_test "$@" diff --git a/test/units/testsuite-07.service b/test/units/testsuite-07.service index c478e12360..f45b9c7c5b 100644 --- a/test/units/testsuite-07.service +++ b/test/units/testsuite-07.service @@ -3,6 +3,10 @@ Description=TEST-07-ISSUE-1981 [Service] +Type=oneshot ExecStartPre=rm -f /failed /testok ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot +# Issue: https://github.com/systemd/systemd/issues/2691 +ExecStop=sh -c 'kill -SEGV $$$$' +RemainAfterExit=yes +TimeoutStopSec=270s diff --git a/test/units/testsuite-09.service b/test/units/testsuite-09.service deleted file mode 100644 index 6f6cd9c522..0000000000 --- a/test/units/testsuite-09.service +++ /dev/null @@ -1,11 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-09-ISSUE-2691 - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=sh -c '>/testok' -ExecStop=sh -c 'kill -SEGV $$$$' -Type=oneshot -RemainAfterExit=yes -TimeoutStopSec=270s -- cgit v1.2.1 From a8faac7dae6f54e88aad08d2d8c34e165ce6e922 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 10 May 2023 13:41:03 +0200 Subject: test: merge TEST-10-ISSUE-2467 with TEST-07-PID1 --- test/TEST-07-PID1/test.sh | 8 ++++++++ test/TEST-10-ISSUE-2467/Makefile | 1 - test/TEST-10-ISSUE-2467/test.sh | 22 ---------------------- test/meson.build | 1 + test/testsuite-07.units/issue2467.service | 10 ++++++++++ test/testsuite-07.units/issue2467.socket | 3 +++ test/testsuite-10.units/test10.service | 10 ---------- test/testsuite-10.units/test10.socket | 3 --- test/units/testsuite-07.issue-2467.sh | 17 +++++++++++++++++ test/units/testsuite-10.service | 16 ---------------- 10 files changed, 39 insertions(+), 52 deletions(-) delete mode 120000 test/TEST-10-ISSUE-2467/Makefile delete mode 100755 test/TEST-10-ISSUE-2467/test.sh create mode 100644 test/testsuite-07.units/issue2467.service create mode 100644 test/testsuite-07.units/issue2467.socket delete mode 100644 test/testsuite-10.units/test10.service delete mode 100644 test/testsuite-10.units/test10.socket create mode 100755 test/units/testsuite-07.issue-2467.sh delete mode 100644 test/units/testsuite-10.service (limited to 'test') diff --git a/test/TEST-07-PID1/test.sh b/test/TEST-07-PID1/test.sh index c241840327..1c3d7137fe 100755 --- a/test/TEST-07-PID1/test.sh +++ b/test/TEST-07-PID1/test.sh @@ -10,6 +10,14 @@ TEST_DESCRIPTION="Tests for core PID1 functionality" test_append_files() { local workspace="${1:?}" + # Collecting coverage slows this particular test quite a bit, causing + # it to fail with the default settings (20 triggers per 2 secs). + # Let's help it a bit in such case. + if get_bool "$IS_BUILT_WITH_COVERAGE"; then + mkdir -p "$workspace/etc/systemd/system/issue2467.socket.d" + printf "[Socket]\nTriggerLimitIntervalSec=10\n" >"$workspace/etc/systemd/system/issue2467.socket.d/coverage-override.conf" + fi + # Issue: https://github.com/systemd/systemd/issues/2730 mkdir -p "$workspace/etc/systemd/system/" cat >"$workspace/etc/systemd/system/issue2730.mount" <"${initdir:?}/etc/systemd/system/test10.socket.d/coverage-override.conf" - fi - ) -} - -do_test "$@" diff --git a/test/meson.build b/test/meson.build index 61b47e199f..dc3b78be1f 100644 --- a/test/meson.build +++ b/test/meson.build @@ -15,6 +15,7 @@ if install_tests 'testsuite-03.units', 'testsuite-04.units', 'testsuite-06.units', + 'testsuite-07.units', 'testsuite-10.units', 'testsuite-11.units', 'testsuite-16.units', diff --git a/test/testsuite-07.units/issue2467.service b/test/testsuite-07.units/issue2467.service new file mode 100644 index 0000000000..99d886f025 --- /dev/null +++ b/test/testsuite-07.units/issue2467.service @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Requires=issue2467.socket +ConditionPathExistsGlob=/tmp/nonexistent +# Make sure we hit the socket trigger limit in the test and not the service start limit. +StartLimitInterval=1000 +StartLimitBurst=1000 + +[Service] +ExecStart=true diff --git a/test/testsuite-07.units/issue2467.socket b/test/testsuite-07.units/issue2467.socket new file mode 100644 index 0000000000..af1317b409 --- /dev/null +++ b/test/testsuite-07.units/issue2467.socket @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Socket] +ListenStream=/run/test.ctl diff --git a/test/testsuite-10.units/test10.service b/test/testsuite-10.units/test10.service deleted file mode 100644 index fc8fad9327..0000000000 --- a/test/testsuite-10.units/test10.service +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Requires=test10.socket -ConditionPathExistsGlob=/tmp/nonexistent -# Make sure we hit the socket trigger limit in the test and not the service start limit. -StartLimitInterval=1000 -StartLimitBurst=1000 - -[Service] -ExecStart=true diff --git a/test/testsuite-10.units/test10.socket b/test/testsuite-10.units/test10.socket deleted file mode 100644 index af1317b409..0000000000 --- a/test/testsuite-10.units/test10.socket +++ /dev/null @@ -1,3 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Socket] -ListenStream=/run/test.ctl diff --git a/test/units/testsuite-07.issue-2467.sh b/test/units/testsuite-07.issue-2467.sh new file mode 100755 index 0000000000..a5dcfd55dd --- /dev/null +++ b/test/units/testsuite-07.issue-2467.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later +set -eux +set -o pipefail + +# Don't start services every few ms if condition fails +# Issue: https://github.com/systemd/systemd/issues/2467 + +rm -f /tmp/nonexistent +systemctl start issue2467.socket +nc -w20 -U /run/test.ctl || : + +# TriggerLimitIntervalSec= by default is set to 2s. A "sleep 10" should give +# systemd enough time even on slower machines, to reach the trigger limit. +# shellcheck disable=SC2016 +timeout 10 bash -c 'while ! [[ "$(systemctl show issue2467.socket -P ActiveState)" == failed ]]; do sleep .5; done' +[[ "$(systemctl show issue2467.socket -P Result)" == trigger-limit-hit ]] diff --git a/test/units/testsuite-10.service b/test/units/testsuite-10.service deleted file mode 100644 index 9fcfd673c6..0000000000 --- a/test/units/testsuite-10.service +++ /dev/null @@ -1,16 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-10-ISSUE-2467 - -[Service] -ExecStartPre=rm -f /failed /testok -Type=oneshot -ExecStart=rm -f /tmp/nonexistent -ExecStart=systemctl start test10.socket -ExecStart=-nc -w20 -U /run/test.ctl -# TriggerLimitIntervalSec= by default is set to 2s. A "sleep 10" should give -# systemd enough time even on slower machines, to reach the trigger limit. -ExecStart=sleep 10 -ExecStart=sh -x -c 'test "$(systemctl show test10.socket -P ActiveState)" = failed' -ExecStart=sh -x -c 'test "$(systemctl show test10.socket -P Result)" = trigger-limit-hit' -ExecStart=sh -x -c 'echo OK >/testok' -- cgit v1.2.1 From 33dff897b9ad1e24b2c737de1e41b21c4543c8e1 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 10 May 2023 13:49:34 +0200 Subject: test: merge TEST-11-ISSUE-3166 into TEST-07-PID1 --- test/TEST-11-ISSUE-3166/Makefile | 1 - test/TEST-11-ISSUE-3166/test.sh | 11 ----------- .../testsuite-07.units/issue3166-fail-on-restart.service | 10 ++++++++++ test/testsuite-11.units/fail-on-restart.service | 10 ---------- test/units/testsuite-07.issue-3166.sh | 16 ++++++++++++++++ test/units/testsuite-11.service | 8 -------- test/units/testsuite-11.sh | 14 -------------- 7 files changed, 26 insertions(+), 44 deletions(-) delete mode 120000 test/TEST-11-ISSUE-3166/Makefile delete mode 100755 test/TEST-11-ISSUE-3166/test.sh create mode 100644 test/testsuite-07.units/issue3166-fail-on-restart.service delete mode 100644 test/testsuite-11.units/fail-on-restart.service create mode 100755 test/units/testsuite-07.issue-3166.sh delete mode 100644 test/units/testsuite-11.service delete mode 100755 test/units/testsuite-11.sh (limited to 'test') diff --git a/test/TEST-11-ISSUE-3166/Makefile b/test/TEST-11-ISSUE-3166/Makefile deleted file mode 120000 index e9f93b1104..0000000000 --- a/test/TEST-11-ISSUE-3166/Makefile +++ /dev/null @@ -1 +0,0 @@ -../TEST-01-BASIC/Makefile \ No newline at end of file diff --git a/test/TEST-11-ISSUE-3166/test.sh b/test/TEST-11-ISSUE-3166/test.sh deleted file mode 100755 index 12dabd704d..0000000000 --- a/test/TEST-11-ISSUE-3166/test.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later -set -e - -TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/3166" -TEST_NO_NSPAWN=1 - -# shellcheck source=test/test-functions -. "${TEST_BASE_DIR:?}/test-functions" - -do_test "$@" diff --git a/test/testsuite-07.units/issue3166-fail-on-restart.service b/test/testsuite-07.units/issue3166-fail-on-restart.service new file mode 100644 index 0000000000..b8695d8446 --- /dev/null +++ b/test/testsuite-07.units/issue3166-fail-on-restart.service @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Fail on restart +StartLimitIntervalSec=1m +StartLimitBurst=3 + +[Service] +Type=exec +ExecStart=false +Restart=always diff --git a/test/testsuite-11.units/fail-on-restart.service b/test/testsuite-11.units/fail-on-restart.service deleted file mode 100644 index b8695d8446..0000000000 --- a/test/testsuite-11.units/fail-on-restart.service +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=Fail on restart -StartLimitIntervalSec=1m -StartLimitBurst=3 - -[Service] -Type=exec -ExecStart=false -Restart=always diff --git a/test/units/testsuite-07.issue-3166.sh b/test/units/testsuite-07.issue-3166.sh new file mode 100755 index 0000000000..6677901358 --- /dev/null +++ b/test/units/testsuite-07.issue-3166.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later +set -eux +set -o pipefail + +# Service doesn't enter the "failed" state +# Issue: https://github.com/systemd/systemd/issues/3166 + +systemctl --no-block start issue3166-fail-on-restart.service +active_state="$(systemctl show --value --property ActiveState issue3166-fail-on-restart.service)" +while [[ "$active_state" == "activating" || "$active_state" =~ ^(in)?active$ ]]; do + sleep .5 + active_state="$(systemctl show --value --property ActiveState issue3166-fail-on-restart.service)" +done +systemctl is-failed issue3166-fail-on-restart.service || exit 1 +[[ "$(systemctl show --value --property NRestarts issue3166-fail-on-restart.service)" -le 3 ]] || exit 1 diff --git a/test/units/testsuite-11.service b/test/units/testsuite-11.service deleted file mode 100644 index 5dfcf50e3f..0000000000 --- a/test/units/testsuite-11.service +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-11-ISSUE-3166 - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-11.sh b/test/units/testsuite-11.sh deleted file mode 100755 index 7e1391d8ea..0000000000 --- a/test/units/testsuite-11.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later -set -eux -set -o pipefail - -systemctl --no-block start fail-on-restart.service -active_state=$(systemctl show --value --property ActiveState fail-on-restart.service) -while [[ "$active_state" == "activating" || "$active_state" =~ ^(in)?active$ ]]; do - sleep .5 - active_state=$(systemctl show --value --property ActiveState fail-on-restart.service) -done -systemctl is-failed fail-on-restart.service || exit 1 -[[ "$(systemctl show --value --property NRestarts fail-on-restart.service)" -le 3 ]] || exit 1 -touch /testok -- cgit v1.2.1 From 51b6dbf75ad48a816e6a1503fd5d7c4b9ba2b1d6 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 10 May 2023 13:58:13 +0200 Subject: test: merge TEST-12-ISSUE-3171 into TEST-07-PID1 --- test/TEST-12-ISSUE-3171/Makefile | 1 - test/TEST-12-ISSUE-3171/test.sh | 11 -------- test/units/testsuite-07.issue-3171.sh | 50 +++++++++++++++++++++++++++++++++++ test/units/testsuite-12.service | 9 ------- test/units/testsuite-12.sh | 49 ---------------------------------- 5 files changed, 50 insertions(+), 70 deletions(-) delete mode 120000 test/TEST-12-ISSUE-3171/Makefile delete mode 100755 test/TEST-12-ISSUE-3171/test.sh create mode 100755 test/units/testsuite-07.issue-3171.sh delete mode 100644 test/units/testsuite-12.service delete mode 100755 test/units/testsuite-12.sh (limited to 'test') diff --git a/test/TEST-12-ISSUE-3171/Makefile b/test/TEST-12-ISSUE-3171/Makefile deleted file mode 120000 index e9f93b1104..0000000000 --- a/test/TEST-12-ISSUE-3171/Makefile +++ /dev/null @@ -1 +0,0 @@ -../TEST-01-BASIC/Makefile \ No newline at end of file diff --git a/test/TEST-12-ISSUE-3171/test.sh b/test/TEST-12-ISSUE-3171/test.sh deleted file mode 100755 index 977e04ee3f..0000000000 --- a/test/TEST-12-ISSUE-3171/test.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later -set -e - -TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/3171" -TEST_NO_QEMU=1 - -# shellcheck source=test/test-functions -. "${TEST_BASE_DIR:?}/test-functions" - -do_test "$@" diff --git a/test/units/testsuite-07.issue-3171.sh b/test/units/testsuite-07.issue-3171.sh new file mode 100755 index 0000000000..db17c25f90 --- /dev/null +++ b/test/units/testsuite-07.issue-3171.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later +set -eux +set -o pipefail + +# SocketGroup lost on daemon-reload with unit moving away temporarily +# Issue: https://github.com/systemd/systemd/issues/3171 + +echo "g adm - - -" | systemd-sysusers - + +U=/run/systemd/system/issue-3171.socket +cat >$U </run/systemd/system/issue-3171@.service <$U </run/systemd/system/test12@.service < Date: Wed, 10 May 2023 14:02:54 +0200 Subject: test: move TEST-23's units into a dedicated subfolder To remain consistent with other tests. --- test/meson.build | 1 + test/testsuite-23.units/testsuite-23-binds-to.service | 10 ++++++++++ test/testsuite-23.units/testsuite-23-bound-by.service | 6 ++++++ test/testsuite-23.units/testsuite-23-fail.service | 7 +++++++ test/testsuite-23.units/testsuite-23-prop-stop-one.service | 10 ++++++++++ test/testsuite-23.units/testsuite-23-prop-stop-two.service | 6 ++++++ test/testsuite-23.units/testsuite-23-retry-fail.service | 9 +++++++++ test/testsuite-23.units/testsuite-23-retry-upheld.service | 10 ++++++++++ test/testsuite-23.units/testsuite-23-retry-uphold.service | 7 +++++++ test/testsuite-23.units/testsuite-23-short-lived.service | 11 +++++++++++ test/testsuite-23.units/testsuite-23-success.service | 7 +++++++ test/testsuite-23.units/testsuite-23-uphold.service | 7 +++++++ test/units/testsuite-23-binds-to.service | 10 ---------- test/units/testsuite-23-bound-by.service | 6 ------ test/units/testsuite-23-fail.service | 7 ------- test/units/testsuite-23-prop-stop-one.service | 10 ---------- test/units/testsuite-23-prop-stop-two.service | 6 ------ test/units/testsuite-23-retry-fail.service | 9 --------- test/units/testsuite-23-retry-upheld.service | 10 ---------- test/units/testsuite-23-retry-uphold.service | 7 ------- test/units/testsuite-23-short-lived.service | 11 ----------- test/units/testsuite-23-success.service | 7 ------- test/units/testsuite-23-uphold.service | 7 ------- 23 files changed, 91 insertions(+), 90 deletions(-) create mode 100644 test/testsuite-23.units/testsuite-23-binds-to.service create mode 100644 test/testsuite-23.units/testsuite-23-bound-by.service create mode 100644 test/testsuite-23.units/testsuite-23-fail.service create mode 100644 test/testsuite-23.units/testsuite-23-prop-stop-one.service create mode 100644 test/testsuite-23.units/testsuite-23-prop-stop-two.service create mode 100644 test/testsuite-23.units/testsuite-23-retry-fail.service create mode 100644 test/testsuite-23.units/testsuite-23-retry-upheld.service create mode 100644 test/testsuite-23.units/testsuite-23-retry-uphold.service create mode 100644 test/testsuite-23.units/testsuite-23-short-lived.service create mode 100644 test/testsuite-23.units/testsuite-23-success.service create mode 100644 test/testsuite-23.units/testsuite-23-uphold.service delete mode 100644 test/units/testsuite-23-binds-to.service delete mode 100644 test/units/testsuite-23-bound-by.service delete mode 100644 test/units/testsuite-23-fail.service delete mode 100644 test/units/testsuite-23-prop-stop-one.service delete mode 100644 test/units/testsuite-23-prop-stop-two.service delete mode 100644 test/units/testsuite-23-retry-fail.service delete mode 100644 test/units/testsuite-23-retry-upheld.service delete mode 100644 test/units/testsuite-23-retry-uphold.service delete mode 100644 test/units/testsuite-23-short-lived.service delete mode 100644 test/units/testsuite-23-success.service delete mode 100644 test/units/testsuite-23-uphold.service (limited to 'test') diff --git a/test/meson.build b/test/meson.build index dc3b78be1f..48f837cee5 100644 --- a/test/meson.build +++ b/test/meson.build @@ -19,6 +19,7 @@ if install_tests 'testsuite-10.units', 'testsuite-11.units', 'testsuite-16.units', + 'testsuite-23.units', 'testsuite-28.units', 'testsuite-30.units', 'testsuite-52.units', diff --git a/test/testsuite-23.units/testsuite-23-binds-to.service b/test/testsuite-23.units/testsuite-23-binds-to.service new file mode 100644 index 0000000000..d81676a8c3 --- /dev/null +++ b/test/testsuite-23.units/testsuite-23-binds-to.service @@ -0,0 +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 + +[Service] +ExecStart=/bin/sleep infinity +# --kill-who= (no 'm') to check that the short form is accepted +ExecStopPost=systemctl kill --kill-who=main -sRTMIN+1 testsuite-23.service diff --git a/test/testsuite-23.units/testsuite-23-bound-by.service b/test/testsuite-23.units/testsuite-23-bound-by.service new file mode 100644 index 0000000000..a2df5a1954 --- /dev/null +++ b/test/testsuite-23.units/testsuite-23-bound-by.service @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Unit with BoundBy= + +[Service] +ExecStart=/bin/sleep 0.7 diff --git a/test/testsuite-23.units/testsuite-23-fail.service b/test/testsuite-23.units/testsuite-23-fail.service new file mode 100644 index 0000000000..36f8baa6ba --- /dev/null +++ b/test/testsuite-23.units/testsuite-23-fail.service @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Failing unit +OnFailure=testsuite-23-uphold.service + +[Service] +ExecStart=/bin/false diff --git a/test/testsuite-23.units/testsuite-23-prop-stop-one.service b/test/testsuite-23.units/testsuite-23-prop-stop-one.service new file mode 100644 index 0000000000..f068daf2b3 --- /dev/null +++ b/test/testsuite-23.units/testsuite-23-prop-stop-one.service @@ -0,0 +1,10 @@ +# 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=/bin/sleep infinity +ExecStopPost=systemctl kill --kill-whom=main -sUSR2 testsuite-23.service diff --git a/test/testsuite-23.units/testsuite-23-prop-stop-two.service b/test/testsuite-23.units/testsuite-23-prop-stop-two.service new file mode 100644 index 0000000000..2bcd209e16 --- /dev/null +++ b/test/testsuite-23.units/testsuite-23-prop-stop-two.service @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Stop Propagation Sender + +[Service] +ExecStart=/bin/sleep 1.5 diff --git a/test/testsuite-23.units/testsuite-23-retry-fail.service b/test/testsuite-23.units/testsuite-23-retry-fail.service new file mode 100644 index 0000000000..0fc27c41fe --- /dev/null +++ b/test/testsuite-23.units/testsuite-23-retry-fail.service @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Failed Dependency Unit + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/bin/sh -c "if [ -f /tmp/testsuite-23-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/testsuite-23.units/testsuite-23-retry-upheld.service new file mode 100644 index 0000000000..0426d76a54 --- /dev/null +++ b/test/testsuite-23.units/testsuite-23-retry-upheld.service @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Upheld Unit +Requires=testsuite-23-retry-fail.service +After=testsuite-23-retry-fail.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/bin/echo ok diff --git a/test/testsuite-23.units/testsuite-23-retry-uphold.service b/test/testsuite-23.units/testsuite-23-retry-uphold.service new file mode 100644 index 0000000000..f35e8424de --- /dev/null +++ b/test/testsuite-23.units/testsuite-23-retry-uphold.service @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Upholding Unit +Upholds=testsuite-23-retry-upheld.service + +[Service] +ExecStart=/bin/sleep infinity diff --git a/test/testsuite-23.units/testsuite-23-short-lived.service b/test/testsuite-23.units/testsuite-23-short-lived.service new file mode 100644 index 0000000000..2dcb2ae228 --- /dev/null +++ b/test/testsuite-23.units/testsuite-23-short-lived.service @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Shortlived Unit +StopWhenUnneeded=yes + +# Bump up the start limit logic, so that we can be restarted frequently enough +StartLimitBurst=15 +StartLimitIntervalSec=1h + +[Service] +ExecStart=/usr/lib/systemd/tests/testdata/units/testsuite-23-short-lived.sh diff --git a/test/testsuite-23.units/testsuite-23-success.service b/test/testsuite-23.units/testsuite-23-success.service new file mode 100644 index 0000000000..410d4f83c3 --- /dev/null +++ b/test/testsuite-23.units/testsuite-23-success.service @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Succeeding unit +OnSuccess=testsuite-23-fail.service + +[Service] +ExecStart=/bin/true diff --git a/test/testsuite-23.units/testsuite-23-uphold.service b/test/testsuite-23.units/testsuite-23-uphold.service new file mode 100644 index 0000000000..3549d6a8f5 --- /dev/null +++ b/test/testsuite-23.units/testsuite-23-uphold.service @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Upholding Unit +Upholds=testsuite-23-short-lived.service + +[Service] +ExecStart=/bin/sleep infinity diff --git a/test/units/testsuite-23-binds-to.service b/test/units/testsuite-23-binds-to.service deleted file mode 100644 index d81676a8c3..0000000000 --- a/test/units/testsuite-23-binds-to.service +++ /dev/null @@ -1,10 +0,0 @@ -# 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 - -[Service] -ExecStart=/bin/sleep infinity -# --kill-who= (no 'm') to check that the short form is accepted -ExecStopPost=systemctl kill --kill-who=main -sRTMIN+1 testsuite-23.service diff --git a/test/units/testsuite-23-bound-by.service b/test/units/testsuite-23-bound-by.service deleted file mode 100644 index a2df5a1954..0000000000 --- a/test/units/testsuite-23-bound-by.service +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=Unit with BoundBy= - -[Service] -ExecStart=/bin/sleep 0.7 diff --git a/test/units/testsuite-23-fail.service b/test/units/testsuite-23-fail.service deleted file mode 100644 index 36f8baa6ba..0000000000 --- a/test/units/testsuite-23-fail.service +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=Failing unit -OnFailure=testsuite-23-uphold.service - -[Service] -ExecStart=/bin/false diff --git a/test/units/testsuite-23-prop-stop-one.service b/test/units/testsuite-23-prop-stop-one.service deleted file mode 100644 index f068daf2b3..0000000000 --- a/test/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=/bin/sleep infinity -ExecStopPost=systemctl kill --kill-whom=main -sUSR2 testsuite-23.service diff --git a/test/units/testsuite-23-prop-stop-two.service b/test/units/testsuite-23-prop-stop-two.service deleted file mode 100644 index 2bcd209e16..0000000000 --- a/test/units/testsuite-23-prop-stop-two.service +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=Stop Propagation Sender - -[Service] -ExecStart=/bin/sleep 1.5 diff --git a/test/units/testsuite-23-retry-fail.service b/test/units/testsuite-23-retry-fail.service deleted file mode 100644 index 0fc27c41fe..0000000000 --- a/test/units/testsuite-23-retry-fail.service +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=Failed Dependency Unit - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/bin/sh -c "if [ -f /tmp/testsuite-23-retry-fail ]; then exit 0; else exit 1; fi" -Restart=no diff --git a/test/units/testsuite-23-retry-upheld.service b/test/units/testsuite-23-retry-upheld.service deleted file mode 100644 index 0426d76a54..0000000000 --- a/test/units/testsuite-23-retry-upheld.service +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=Upheld Unit -Requires=testsuite-23-retry-fail.service -After=testsuite-23-retry-fail.service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/bin/echo ok diff --git a/test/units/testsuite-23-retry-uphold.service b/test/units/testsuite-23-retry-uphold.service deleted file mode 100644 index f35e8424de..0000000000 --- a/test/units/testsuite-23-retry-uphold.service +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=Upholding Unit -Upholds=testsuite-23-retry-upheld.service - -[Service] -ExecStart=/bin/sleep infinity diff --git a/test/units/testsuite-23-short-lived.service b/test/units/testsuite-23-short-lived.service deleted file mode 100644 index 2dcb2ae228..0000000000 --- a/test/units/testsuite-23-short-lived.service +++ /dev/null @@ -1,11 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=Shortlived Unit -StopWhenUnneeded=yes - -# Bump up the start limit logic, so that we can be restarted frequently enough -StartLimitBurst=15 -StartLimitIntervalSec=1h - -[Service] -ExecStart=/usr/lib/systemd/tests/testdata/units/testsuite-23-short-lived.sh diff --git a/test/units/testsuite-23-success.service b/test/units/testsuite-23-success.service deleted file mode 100644 index 410d4f83c3..0000000000 --- a/test/units/testsuite-23-success.service +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=Succeeding unit -OnSuccess=testsuite-23-fail.service - -[Service] -ExecStart=/bin/true diff --git a/test/units/testsuite-23-uphold.service b/test/units/testsuite-23-uphold.service deleted file mode 100644 index 3549d6a8f5..0000000000 --- a/test/units/testsuite-23-uphold.service +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=Upholding Unit -Upholds=testsuite-23-short-lived.service - -[Service] -ExecStart=/bin/sleep infinity -- cgit v1.2.1 From 11562ee585d5f2e42cb583f06aa01c7383d85f55 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 10 May 2023 14:19:40 +0200 Subject: test: merge TEST-47-ISSUE-14566 into TEST-07-PID1 --- test/TEST-47-ISSUE-14566/Makefile | 1 - test/TEST-47-ISSUE-14566/test.sh | 10 -------- test/testsuite-07.units/issue14566-repro.service | 8 ++++++ test/testsuite-07.units/issue14566-repro.sh | 6 +++++ test/units/testsuite-07.issue-14566.sh | 31 ++++++++++++++++++++++++ test/units/testsuite-47-repro.service | 8 ------ test/units/testsuite-47-repro.sh | 6 ----- test/units/testsuite-47.service | 8 ------ test/units/testsuite-47.sh | 25 ------------------- 9 files changed, 45 insertions(+), 58 deletions(-) delete mode 120000 test/TEST-47-ISSUE-14566/Makefile delete mode 100755 test/TEST-47-ISSUE-14566/test.sh create mode 100644 test/testsuite-07.units/issue14566-repro.service create mode 100755 test/testsuite-07.units/issue14566-repro.sh create mode 100755 test/units/testsuite-07.issue-14566.sh delete mode 100644 test/units/testsuite-47-repro.service delete mode 100755 test/units/testsuite-47-repro.sh delete mode 100644 test/units/testsuite-47.service delete mode 100755 test/units/testsuite-47.sh (limited to 'test') diff --git a/test/TEST-47-ISSUE-14566/Makefile b/test/TEST-47-ISSUE-14566/Makefile deleted file mode 120000 index e9f93b1104..0000000000 --- a/test/TEST-47-ISSUE-14566/Makefile +++ /dev/null @@ -1 +0,0 @@ -../TEST-01-BASIC/Makefile \ No newline at end of file diff --git a/test/TEST-47-ISSUE-14566/test.sh b/test/TEST-47-ISSUE-14566/test.sh deleted file mode 100755 index 8bdbe14b97..0000000000 --- a/test/TEST-47-ISSUE-14566/test.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later -set -e - -TEST_DESCRIPTION="Test that KillMode=mixed does not leave left over processes with ExecStopPost=" - -# shellcheck source=test/test-functions -. "${TEST_BASE_DIR:?}/test-functions" - -do_test "$@" diff --git a/test/testsuite-07.units/issue14566-repro.service b/test/testsuite-07.units/issue14566-repro.service new file mode 100644 index 0000000000..56805963b4 --- /dev/null +++ b/test/testsuite-07.units/issue14566-repro.service @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Issue 14566 Repro + +[Service] +ExecStart=/usr/lib/systemd/tests/testdata/testsuite-07.units/%N.sh +ExecStopPost=/bin/true +KillMode=mixed diff --git a/test/testsuite-07.units/issue14566-repro.sh b/test/testsuite-07.units/issue14566-repro.sh new file mode 100755 index 0000000000..74fa7605e7 --- /dev/null +++ b/test/testsuite-07.units/issue14566-repro.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later + +sleep infinity & +echo $! >/leakedtestpid +wait $! diff --git a/test/units/testsuite-07.issue-14566.sh b/test/units/testsuite-07.issue-14566.sh new file mode 100755 index 0000000000..e17c3934c1 --- /dev/null +++ b/test/units/testsuite-07.issue-14566.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later +set -eux +set -o pipefail + +# Test that KillMode=mixed does not leave left over processes with ExecStopPost= +# Issue: https://github.com/systemd/systemd/issues/14566 + +if [[ -n "${ASAN_OPTIONS:-}" ]]; then + # Temporarily skip this test when running with sanitizers due to a deadlock + # See: https://bugzilla.redhat.com/show_bug.cgi?id=2098125 + echo "Sanitizers detected, skipping the test..." + exit 0 +fi + +systemd-analyze log-level debug + +systemctl start issue14566-repro +sleep 4 +systemctl status issue14566-repro + +leaked_pid=$(cat /leakedtestpid) + +systemctl stop issue14566-repro +sleep 4 + +# Leaked PID will still be around if we're buggy. +# I personally prefer to see 42. +ps -p "$leaked_pid" && exit 42 + +systemd-analyze log-level info diff --git a/test/units/testsuite-47-repro.service b/test/units/testsuite-47-repro.service deleted file mode 100644 index 1508ac6242..0000000000 --- a/test/units/testsuite-47-repro.service +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=Issue 14566 Repro - -[Service] -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -ExecStopPost=/bin/true -KillMode=mixed diff --git a/test/units/testsuite-47-repro.sh b/test/units/testsuite-47-repro.sh deleted file mode 100755 index 74fa7605e7..0000000000 --- a/test/units/testsuite-47-repro.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later - -sleep infinity & -echo $! >/leakedtestpid -wait $! diff --git a/test/units/testsuite-47.service b/test/units/testsuite-47.service deleted file mode 100644 index d5ad480108..0000000000 --- a/test/units/testsuite-47.service +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-47-ISSUE-14566 - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-47.sh b/test/units/testsuite-47.sh deleted file mode 100755 index 529e9617a5..0000000000 --- a/test/units/testsuite-47.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later -set -eux -set -o pipefail - -systemd-analyze log-level debug - -systemctl start testsuite-47-repro -sleep 4 -systemctl status testsuite-47-repro - -leaked_pid=$(cat /leakedtestpid) - -systemctl stop testsuite-47-repro -sleep 4 - -# Leaked PID will still be around if we're buggy. -# I personally prefer to see 42. -ps -p "$leaked_pid" && exit 42 - -systemd-analyze log-level info - -echo OK >/testok - -exit 0 -- cgit v1.2.1 From d8d8380a35c494b6cb7ec5ee12dbe93002bd2f2f Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 10 May 2023 14:26:08 +0200 Subject: test: merge TEST-51-ISSUE-16115 into TEST-07-PID1 --- test/TEST-51-ISSUE-16115/Makefile | 1 - test/TEST-51-ISSUE-16115/test.sh | 10 ---------- test/testsuite-07.units/issue16115-repro-1.service | 10 ++++++++++ test/testsuite-07.units/issue16115-repro-2.service | 10 ++++++++++ test/testsuite-07.units/issue16115-repro-3.service | 10 ++++++++++ test/units/testsuite-07.issue-16115.sh | 16 ++++++++++++++++ test/units/testsuite-51-repro-1.service | 10 ---------- test/units/testsuite-51-repro-2.service | 10 ---------- test/units/testsuite-51-repro-3.service | 10 ---------- test/units/testsuite-51.service | 8 -------- test/units/testsuite-51.sh | 15 --------------- 11 files changed, 46 insertions(+), 64 deletions(-) delete mode 120000 test/TEST-51-ISSUE-16115/Makefile delete mode 100755 test/TEST-51-ISSUE-16115/test.sh create mode 100644 test/testsuite-07.units/issue16115-repro-1.service create mode 100644 test/testsuite-07.units/issue16115-repro-2.service create mode 100644 test/testsuite-07.units/issue16115-repro-3.service create mode 100755 test/units/testsuite-07.issue-16115.sh delete mode 100644 test/units/testsuite-51-repro-1.service delete mode 100644 test/units/testsuite-51-repro-2.service delete mode 100644 test/units/testsuite-51-repro-3.service delete mode 100644 test/units/testsuite-51.service delete mode 100755 test/units/testsuite-51.sh (limited to 'test') diff --git a/test/TEST-51-ISSUE-16115/Makefile b/test/TEST-51-ISSUE-16115/Makefile deleted file mode 120000 index e9f93b1104..0000000000 --- a/test/TEST-51-ISSUE-16115/Makefile +++ /dev/null @@ -1 +0,0 @@ -../TEST-01-BASIC/Makefile \ No newline at end of file diff --git a/test/TEST-51-ISSUE-16115/test.sh b/test/TEST-51-ISSUE-16115/test.sh deleted file mode 100755 index 7b306fa57b..0000000000 --- a/test/TEST-51-ISSUE-16115/test.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later -set -e - -TEST_DESCRIPTION="Test ExecCondition= does not restart on abnormal or failure" - -# shellcheck source=test/test-functions -. "${TEST_BASE_DIR:?}/test-functions" - -do_test "$@" diff --git a/test/testsuite-07.units/issue16115-repro-1.service b/test/testsuite-07.units/issue16115-repro-1.service new file mode 100644 index 0000000000..90252b388a --- /dev/null +++ b/test/testsuite-07.units/issue16115-repro-1.service @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Issue 16115 Repro with on-abnormal + +[Service] +Type=simple +Restart=on-abnormal +ExecCondition=/bin/false +ExecStart=sleep 100 +RestartSec=1 diff --git a/test/testsuite-07.units/issue16115-repro-2.service b/test/testsuite-07.units/issue16115-repro-2.service new file mode 100644 index 0000000000..7c65691029 --- /dev/null +++ b/test/testsuite-07.units/issue16115-repro-2.service @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Issue 16115 Repro with on-failure + +[Service] +Type=simple +Restart=on-failure +ExecCondition=/bin/false +ExecStart=sleep 100 +RestartSec=1 diff --git a/test/testsuite-07.units/issue16115-repro-3.service b/test/testsuite-07.units/issue16115-repro-3.service new file mode 100644 index 0000000000..c68f93d11d --- /dev/null +++ b/test/testsuite-07.units/issue16115-repro-3.service @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Issue 22257 Repro with Restart=always + +[Service] +Type=simple +Restart=always +ExecCondition=/bin/false +ExecStart=sleep 100 +RestartSec=1 diff --git a/test/units/testsuite-07.issue-16115.sh b/test/units/testsuite-07.issue-16115.sh new file mode 100755 index 0000000000..8f638269cd --- /dev/null +++ b/test/units/testsuite-07.issue-16115.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later +set -eux +set -o pipefail + +# Test ExecCondition= does not restart on abnormal or failure +# Issue: https://github.com/systemd/systemd/issues/16115 + +systemctl start issue16115-repro-1 +systemctl start issue16115-repro-2 +systemctl start issue16115-repro-3 +sleep 5 # wait a bit in case there are restarts so we can count them below + +[[ "$(systemctl show issue16115-repro-1 -P NRestarts)" == "0" ]] +[[ "$(systemctl show issue16115-repro-2 -P NRestarts)" == "0" ]] +[[ "$(systemctl show issue16115-repro-3 -P NRestarts)" == "0" ]] diff --git a/test/units/testsuite-51-repro-1.service b/test/units/testsuite-51-repro-1.service deleted file mode 100644 index 90252b388a..0000000000 --- a/test/units/testsuite-51-repro-1.service +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=Issue 16115 Repro with on-abnormal - -[Service] -Type=simple -Restart=on-abnormal -ExecCondition=/bin/false -ExecStart=sleep 100 -RestartSec=1 diff --git a/test/units/testsuite-51-repro-2.service b/test/units/testsuite-51-repro-2.service deleted file mode 100644 index 7c65691029..0000000000 --- a/test/units/testsuite-51-repro-2.service +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=Issue 16115 Repro with on-failure - -[Service] -Type=simple -Restart=on-failure -ExecCondition=/bin/false -ExecStart=sleep 100 -RestartSec=1 diff --git a/test/units/testsuite-51-repro-3.service b/test/units/testsuite-51-repro-3.service deleted file mode 100644 index c68f93d11d..0000000000 --- a/test/units/testsuite-51-repro-3.service +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=Issue 22257 Repro with Restart=always - -[Service] -Type=simple -Restart=always -ExecCondition=/bin/false -ExecStart=sleep 100 -RestartSec=1 diff --git a/test/units/testsuite-51.service b/test/units/testsuite-51.service deleted file mode 100644 index c241262c27..0000000000 --- a/test/units/testsuite-51.service +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-51-ISSUE-16115 - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-51.sh b/test/units/testsuite-51.sh deleted file mode 100755 index e603d953a4..0000000000 --- a/test/units/testsuite-51.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later -set -eux -set -o pipefail - -systemctl start testsuite-51-repro-1 -systemctl start testsuite-51-repro-2 -systemctl start testsuite-51-repro-3 -sleep 5 # wait a bit in case there are restarts so we can count them below - -[[ "$(systemctl show testsuite-51-repro-1 -P NRestarts)" == "0" ]] -[[ "$(systemctl show testsuite-51-repro-2 -P NRestarts)" == "0" ]] -[[ "$(systemctl show testsuite-51-repro-3 -P NRestarts)" == "0" ]] - -touch /testok -- cgit v1.2.1 From 3a4b86264eef6bd51e880386388e8b3f95cbaa33 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 10 May 2023 20:17:19 +0200 Subject: test: merge TEST-20-MAINPIDGAMES into TEST-07-PID1 --- test/TEST-20-MAINPIDGAMES/Makefile | 1 - test/TEST-20-MAINPIDGAMES/test.sh | 10 -- test/units/testsuite-07.main-PID-change.sh | 179 +++++++++++++++++++++++++++++ test/units/testsuite-07.service | 1 + test/units/testsuite-20.service | 11 -- test/units/testsuite-20.sh | 165 -------------------------- 6 files changed, 180 insertions(+), 187 deletions(-) delete mode 120000 test/TEST-20-MAINPIDGAMES/Makefile delete mode 100755 test/TEST-20-MAINPIDGAMES/test.sh create mode 100755 test/units/testsuite-07.main-PID-change.sh delete mode 100644 test/units/testsuite-20.service delete mode 100755 test/units/testsuite-20.sh (limited to 'test') diff --git a/test/TEST-20-MAINPIDGAMES/Makefile b/test/TEST-20-MAINPIDGAMES/Makefile deleted file mode 120000 index e9f93b1104..0000000000 --- a/test/TEST-20-MAINPIDGAMES/Makefile +++ /dev/null @@ -1 +0,0 @@ -../TEST-01-BASIC/Makefile \ No newline at end of file diff --git a/test/TEST-20-MAINPIDGAMES/test.sh b/test/TEST-20-MAINPIDGAMES/test.sh deleted file mode 100755 index b663201efb..0000000000 --- a/test/TEST-20-MAINPIDGAMES/test.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later -set -e - -TEST_DESCRIPTION="test changing main PID" - -# shellcheck source=test/test-functions -. "${TEST_BASE_DIR:?}/test-functions" - -do_test "$@" diff --git a/test/units/testsuite-07.main-PID-change.sh b/test/units/testsuite-07.main-PID-change.sh new file mode 100755 index 0000000000..da23032d1e --- /dev/null +++ b/test/units/testsuite-07.main-PID-change.sh @@ -0,0 +1,179 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later +set -eux +set -o pipefail + +# Test changing the main PID + +systemd-analyze log-level debug + +# The main service PID should be the parent bash process +MAINPID="${PPID:?}" +test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$MAINPID" + +# Start a test process inside of our own cgroup +sleep infinity & +INTERNALPID=$! +disown + +# Start a test process outside of our own cgroup +systemd-run -p DynamicUser=1 --unit=test-sleep.service /bin/sleep infinity +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" + +# 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" + +# 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" + +# 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" + +# 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" + +# 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" + +# 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" + +# 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" + +# 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" + +cat >/tmp/test-mainpid.sh <<\EOF +#!/usr/bin/env bash + +set -eux +set -o pipefail + +# Create a number of children, and make one the main one +sleep infinity & +disown + +sleep infinity & +MAINPID=$! +disown + +sleep infinity & +disown + +echo $MAINPID >/run/mainpidsh/pid +EOF +chmod +x /tmp/test-mainpid.sh + +systemd-run --unit=test-mainpidsh.service \ + -p StandardOutput=tty \ + -p StandardError=tty \ + -p Type=forking \ + -p RuntimeDirectory=mainpidsh \ + -p PIDFile=/run/mainpidsh/pid \ + /tmp/test-mainpid.sh +test "$(systemctl show -P MainPID test-mainpidsh.service)" -eq "$(cat /run/mainpidsh/pid)" + +cat >/tmp/test-mainpid2.sh <<\EOF +#!/usr/bin/env bash + +set -eux +set -o pipefail + +# Create a number of children, and make one the main one +sleep infinity & +disown + +sleep infinity & +MAINPID=$! +disown + +sleep infinity & +disown + +echo $MAINPID >/run/mainpidsh2/pid +chown 1001:1001 /run/mainpidsh2/pid +EOF +chmod +x /tmp/test-mainpid2.sh + +systemd-run --unit=test-mainpidsh2.service \ + -p StandardOutput=tty \ + -p StandardError=tty \ + -p Type=forking \ + -p RuntimeDirectory=mainpidsh2 \ + -p PIDFile=/run/mainpidsh2/pid \ + /tmp/test-mainpid2.sh +test "$(systemctl show -P MainPID test-mainpidsh2.service)" -eq "$(cat /run/mainpidsh2/pid)" + +cat >/dev/shm/test-mainpid3.sh </tmp/test-mainpid.sh </run/mainpidsh/pid -EOF -chmod +x /tmp/test-mainpid.sh - -systemd-run --unit=test-mainpidsh.service -p StandardOutput=tty -p StandardError=tty -p Type=forking -p RuntimeDirectory=mainpidsh -p PIDFile=/run/mainpidsh/pid /tmp/test-mainpid.sh -test "$(systemctl show -P MainPID test-mainpidsh.service)" -eq "$(cat /run/mainpidsh/pid)" - -cat >/tmp/test-mainpid2.sh </run/mainpidsh2/pid -chown 1001:1001 /run/mainpidsh2/pid -EOF -chmod +x /tmp/test-mainpid2.sh - -systemd-run --unit=test-mainpidsh2.service -p StandardOutput=tty -p StandardError=tty -p Type=forking -p RuntimeDirectory=mainpidsh2 -p PIDFile=/run/mainpidsh2/pid /tmp/test-mainpid2.sh -test "$(systemctl show -P MainPID test-mainpidsh2.service)" -eq "$(cat /run/mainpidsh2/pid)" - -cat >/dev/shm/test-mainpid3.sh </testok - -exit 0 -- cgit v1.2.1 From 15bbc0c1071c439d83e711ef7786d401b6c0a0d4 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 10 May 2023 21:12:01 +0200 Subject: test: abstract the common test parts into a utility script Also, instead of bailing out on the first failed subtest, always run all subtests and print a summary at the end (with an appropriate exit code). --- test/units/test-control.sh | 126 +++++++++++++++++++++++++++++++++++++++++++++ test/units/testsuite-07.sh | 8 +-- test/units/testsuite-17.sh | 7 +-- test/units/testsuite-22.sh | 7 +-- test/units/testsuite-23.sh | 59 ++------------------- test/units/testsuite-74.sh | 8 +-- test/units/testsuite-81.sh | 8 +-- 7 files changed, 150 insertions(+), 73 deletions(-) create mode 100644 test/units/test-control.sh (limited to 'test') diff --git a/test/units/test-control.sh b/test/units/test-control.sh new file mode 100644 index 0000000000..dd28939cbf --- /dev/null +++ b/test/units/test-control.sh @@ -0,0 +1,126 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# shellcheck shell=bash + +if [[ "${BASH_SOURCE[0]}" -ef "$0" ]]; then + echo >&2 "This file should not be executed directly" + exit 1 +fi + +declare -i CHILD_PID=0 +PASSED_TESTS=() +FAILED_TESTS=() + +# Like trap, but passes the signal name as the first argument +trap_with_sig() { + local fun="${1:?}" + local sig + shift + + for sig in "$@"; do + # shellcheck disable=SC2064 + trap "$fun $sig" "$sig" + done +} + +# Propagate the caught signal to the current child process +handle_signal() { + local sig="${1:?}" + + if [[ $CHILD_PID -gt 0 ]]; then + echo "Propagating signal $sig to child process $CHILD_PID" + kill -s "$sig" "$CHILD_PID" + fi +} + +# In order to make the handle_signal() stuff above work, we have to execute +# each script asynchronously, since bash won't execute traps until the currently +# executed command finishes. This, however, introduces another issue regarding +# how bash's wait works. Quoting: +# +# When bash is waiting for an asynchronous command via the wait builtin, +# the reception of a signal for which a trap has been set will cause the wait +# builtin to return immediately with an exit status greater than 128, +# immediately after which the trap is executed. +# +# In other words - every time we propagate a signal, wait returns with +# 128+signal, so we have to wait again - repeat until the process dies. +wait_harder() { + local pid="${1:?}" + + while kill -0 "$pid" &>/dev/null; do + wait "$pid" || : + done + + wait "$pid" +} + +# Like run_subtests, but propagate specified signals to the subtest script +run_subtests_with_signals() { + local subtests=("${0%.sh}".*.sh) + local subtest + + if [[ "${#subtests[@]}" -eq 0 ]]; then + echo >&2 "No subtests found for file $0" + exit 1 + fi + + if [[ "$#" -eq 0 ]]; then + echo >&2 "No signals to propagate were specified" + exit 1 + fi + + trap_with_sig handle_signal "$@" + + for subtest in "${subtests[@]}"; do + : "--- $subtest BEGIN ---" + "./$subtest" & + CHILD_PID=$! + wait_harder "$CHILD_PID" && PASSED_TESTS+=("$subtest") || FAILED_TESTS+=("$subtest") + : "--- $subtest END ---" + done + + show_summary +} + +run_subtests() { + local subtests=("${0%.sh}".*.sh) + local subtest + + if [[ "${#subtests[@]}" -eq 0 ]]; then + echo >&2 "No subtests found for file $0" + exit 1 + fi + + for subtest in "${subtests[@]}"; do + : "--- $subtest BEGIN ---" + "./$subtest" && PASSED_TESTS+=("$subtest") || FAILED_TESTS+=("$subtest") + : "--- $subtest END ---" + done + + show_summary +} + +show_summary() {( + set +x + + if [[ ${#PASSED_TESTS[@]} -eq 0 && ${#FAILED_TESTS[@]} -eq 0 ]]; then + echo >&2 "No tests were executed, this is most likely an error" + exit 1 + fi + + printf "PASSED TESTS: %3d:\n" "${#PASSED_TESTS[@]}" + echo "------------------" + for t in "${PASSED_TESTS[@]}"; do + echo "$t" + done + + if [[ "${#FAILED_TESTS[@]}" -ne 0 ]]; then + printf "FAILED TESTS: %3d:\n" "${#FAILED_TESTS[@]}" + echo "------------------" + for t in "${FAILED_TESTS[@]}"; do + echo "$t" + done + fi + + [[ "${#FAILED_TESTS[@]}" -eq 0 ]] +)} diff --git a/test/units/testsuite-07.sh b/test/units/testsuite-07.sh index 8c004a72e5..58d278e1f1 100755 --- a/test/units/testsuite-07.sh +++ b/test/units/testsuite-07.sh @@ -3,16 +3,16 @@ set -eux set -o pipefail +# shellcheck source=test/units/test-control.sh +. "$(dirname "$0")"/test-control.sh + : >/failed # Issue: https://github.com/systemd/systemd/issues/2730 # See TEST-07-PID1/test.sh for the first "half" of the test mountpoint /issue2730 -for script in "${0%.sh}".*.sh; do - echo "Running $script" - "./$script" -done +run_subtests touch /testok rm /failed diff --git a/test/units/testsuite-17.sh b/test/units/testsuite-17.sh index b389875ef1..72040f69d8 100755 --- a/test/units/testsuite-17.sh +++ b/test/units/testsuite-17.sh @@ -3,13 +3,14 @@ set -eux set -o pipefail +# shellcheck source=test/units/test-control.sh +. "$(dirname "$0")"/test-control.sh + : >/failed udevadm settle -for t in "${0%.sh}".*.sh; do - echo "Running $t"; ./"$t" -done +run_subtests touch /testok rm /failed diff --git a/test/units/testsuite-22.sh b/test/units/testsuite-22.sh index 43823f1d46..5a07e7b78c 100755 --- a/test/units/testsuite-22.sh +++ b/test/units/testsuite-22.sh @@ -3,11 +3,12 @@ set -eux set -o pipefail +# shellcheck source=test/units/test-control.sh +. "$(dirname "$0")"/test-control.sh + : >/failed -for t in "${0%.sh}".*.sh; do - echo "Running $t"; ./"$t" -done +run_subtests touch /testok rm /failed diff --git a/test/units/testsuite-23.sh b/test/units/testsuite-23.sh index 34899070f1..3be645e20a 100755 --- a/test/units/testsuite-23.sh +++ b/test/units/testsuite-23.sh @@ -5,62 +5,11 @@ set -o pipefail : >/failed -declare -i CHILD_PID=0 +# shellcheck source=test/units/test-control.sh +. "$(dirname "$0")"/test-control.sh -# Note: all the signal shenanigans are necessary for the Upholds= tests - -# Like trap, but passes the signal name as the first argument -trap_with_sig() { - local fun="${1:?}" - local sig - shift - - for sig in "$@"; do - # shellcheck disable=SC2064 - trap "$fun $sig" "$sig" - done -} - -# Propagate the caught signal to the current child process -handle_signal() { - local sig="${1:?}" - - if [[ $CHILD_PID -gt 0 ]]; then - echo "Propagating signal $sig to child process $CHILD_PID" - kill -s "$sig" "$CHILD_PID" - fi -} - -# In order to make the handle_signal() stuff above work, we have to execute -# each script asynchronously, since bash won't execute traps until the currently -# executed command finishes. This, however, introduces another issue regarding -# how bash's wait works. Quoting: -# -# When bash is waiting for an asynchronous command via the wait builtin, -# the reception of a signal for which a trap has been set will cause the wait -# builtin to return immediately with an exit status greater than 128, -# immediately after which the trap is executed. -# -# In other words - every time we propagate a signal, wait returns with -# 128+signal, so we have to wait again - repeat until the process dies. -wait_harder() { - local pid="${1:?}" - - while kill -0 "$pid" &>/dev/null; do - wait "$pid" || : - done - - wait "$pid" -} - -trap_with_sig handle_signal SIGUSR1 SIGUSR2 SIGRTMIN+1 - -for script in "${0%.sh}".*.sh; do - echo "Running $script" - "./$script" & - CHILD_PID=$! - wait_harder "$CHILD_PID" -done +# Note: the signal shenanigans are necessary for the Upholds= tests +run_subtests_with_signals SIGUSR1 SIGUSR2 SIGRTMIN+1 touch /testok rm /failed diff --git a/test/units/testsuite-74.sh b/test/units/testsuite-74.sh index 13c767e490..5a07e7b78c 100755 --- a/test/units/testsuite-74.sh +++ b/test/units/testsuite-74.sh @@ -3,12 +3,12 @@ set -eux set -o pipefail +# shellcheck source=test/units/test-control.sh +. "$(dirname "$0")"/test-control.sh + : >/failed -for script in "${0%.sh}".*.sh; do - echo "Running $script" - "./$script" -done +run_subtests touch /testok rm /failed diff --git a/test/units/testsuite-81.sh b/test/units/testsuite-81.sh index 13c767e490..5a07e7b78c 100755 --- a/test/units/testsuite-81.sh +++ b/test/units/testsuite-81.sh @@ -3,12 +3,12 @@ set -eux set -o pipefail +# shellcheck source=test/units/test-control.sh +. "$(dirname "$0")"/test-control.sh + : >/failed -for script in "${0%.sh}".*.sh; do - echo "Running $script" - "./$script" -done +run_subtests touch /testok rm /failed -- cgit v1.2.1