mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-08 21:17:47 +03:00
test: reorganize the TEST-52 a bit
This commit is contained in:
parent
6695c41c31
commit
9abef4b1b4
@ -1,14 +0,0 @@
|
||||
all setup run clean clean-again:
|
||||
@TEST_BASE_DIR=../ ./test.sh --$@
|
||||
|
||||
# finish option is used to run checks that can only be run outside of
|
||||
# the test execution. Example case, honor first shutdown, proof is obtained
|
||||
# from the console output as the image shuts down. This does not show up in
|
||||
# the journal so the output from the do_test is captured in a file in /tmp.
|
||||
# Without the use of finish the test will still pass because if it fails
|
||||
# the test will loop and will be terminated via a command timeout.
|
||||
# This just provides concrete confirmation.
|
||||
finish:
|
||||
@TEST_BASE_DIR=../ ./fini.sh --$@
|
||||
|
||||
.PHONY: all setup run clean clean-again finish
|
1
test/TEST-52-HONORFIRSTSHUTDOWN/Makefile
Symbolic link
1
test/TEST-52-HONORFIRSTSHUTDOWN/Makefile
Symbolic link
@ -0,0 +1 @@
|
||||
../TEST-01-BASIC/Makefile
|
@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
TEST_DESCRIPTION="test honor first shutdown"
|
||||
|
||||
if grep -q "Shutdown is already active. Skipping emergency action request" /tmp/honorfirstshutdown.log; then
|
||||
echo "$TEST_DESCRIPTION [pass]"
|
||||
exit 0
|
||||
else
|
||||
echo "$TEST_DESCRIPTION [fail]"
|
||||
exit 1
|
||||
fi
|
@ -18,4 +18,10 @@ NSPAWN_TIMEOUT=20
|
||||
# only found from the console during the poweroff.
|
||||
rm -f /tmp/honorfirstshutdown.log >/dev/null
|
||||
|
||||
do_test "$@" 52 >/tmp/honorfirstshutdown.log
|
||||
check_result_nspawn_hook() {
|
||||
grep -q "Shutdown is already active. Skipping emergency action request" /tmp/honorfirstshutdown.log
|
||||
}
|
||||
|
||||
# Note: don't use a pipe in the following expression, as it breaks the trap
|
||||
# handlers we have defined in test/test-functions.
|
||||
do_test "$@" > >(tee /tmp/honorfirstshutdown.log)
|
||||
|
@ -3,7 +3,7 @@ Description=Honor First Shutdown feature
|
||||
After=multi-user.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/testsuite-52.units/%N.sh
|
||||
ExecStop=sh -c 'kill -KILL $MAINPID'
|
||||
FailureAction=reboot
|
||||
|
@ -2,5 +2,5 @@
|
||||
Description=Testsuite service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/%N.units/%N.sh
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
||||
Type=oneshot
|
@ -2,11 +2,6 @@
|
||||
set -ex
|
||||
set -o pipefail
|
||||
|
||||
if ! test -x /usr/lib/systemd/tests/testdata/units/test-honor-first-shutdown.sh ; then
|
||||
echo "honor-first-shutdown script not found - FAIL" >/testok
|
||||
exit 0
|
||||
fi
|
||||
|
||||
systemd-analyze log-level debug
|
||||
systemd-analyze log-target console
|
||||
|
Loading…
Reference in New Issue
Block a user