test: merge unit file related tests into TEST-23-UNIT-FILE

Rename TEST-23-TYPE-EXEC to TEST-23-UNIT-FILE and merge it with
following tests:
  - TEST-37-RUNTIMEDIRECTORYPRESERV
  - TEST-40-EXEC-COMMAND-EX
  - TEST-41-ONESHOT-RESTART
  - TEST-42-EXECSTOPPOST
  - TEST-57-ONSUCCESS-UPHOLD
This commit is contained in:
Frantisek Sumsal
2023-05-08 22:38:34 +02:00
committed by Yu Watanabe
parent 97211510b0
commit 539af5c441
44 changed files with 262 additions and 325 deletions

View File

@@ -2,7 +2,7 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
TEST_DESCRIPTION="test Type=exec"
TEST_DESCRIPTION="Tests for various unit file settings"
# shellcheck source=test/test-functions
. "${TEST_BASE_DIR:?}/test-functions"

View File

@@ -1 +0,0 @@
../TEST-01-BASIC/Makefile

View File

@@ -1,12 +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 -e
TEST_DESCRIPTION="test RuntimeDirectoryPreserve=yes"
# shellcheck source=test/test-functions
. "${TEST_BASE_DIR:?}/test-functions"
do_test "$@"

View File

@@ -1 +0,0 @@
../TEST-01-BASIC/Makefile

View File

@@ -1,10 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
TEST_DESCRIPTION="Test ExecReload= (PR #13098)"
# shellcheck source=test/test-functions
. "${TEST_BASE_DIR:?}/test-functions"
do_test "$@"

View File

@@ -1 +0,0 @@
../TEST-01-BASIC/Makefile

View File

@@ -1,10 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
TEST_DESCRIPTION="test ExecXYZEx= service unit dbus hookups"
# shellcheck source=test/test-functions
. "${TEST_BASE_DIR:?}/test-functions"
do_test "$@"

View File

@@ -1 +0,0 @@
../TEST-01-BASIC/Makefile

View File

@@ -1,10 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
TEST_DESCRIPTION="Test oneshot unit restart on failure"
# shellcheck source=test/test-functions
. "${TEST_BASE_DIR:?}/test-functions"
do_test "$@"

View File

@@ -1 +0,0 @@
../TEST-01-BASIC/Makefile

View File

@@ -1,10 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
TEST_DESCRIPTION="test that ExecStopPost= is always run"
# shellcheck source=test/test-functions
. "${TEST_BASE_DIR:?}/test-functions"
do_test "$@"

View File

@@ -1 +0,0 @@
../TEST-01-BASIC/Makefile

View File

@@ -1,9 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
TEST_DESCRIPTION="test OnSuccess= + Uphold= + PropagatesStopTo= + BindsTo="
# shellcheck source=test/test-functions
. "$TEST_BASE_DIR/test-functions"
do_test "$@" 57

View File

@@ -1,10 +1,10 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Unit]
Description=Unit with BindsTo=
BindsTo=testsuite-57-bound-by.service
After=testsuite-57-bound-by.service
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-57.service
ExecStopPost=systemctl kill --kill-who=main -sRTMIN+1 testsuite-23.service

View File

@@ -1,7 +1,7 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Unit]
Description=Failing unit
OnFailure=testsuite-57-uphold.service
OnFailure=testsuite-23-uphold.service
[Service]
ExecStart=/bin/false

View File

@@ -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

Some files were not shown because too many files have changed in this diff Show More