2 # SPDX-License-Identifier: LGPL-2.1-or-later
5 TEST_REQUIRE_INSTALL_TESTS
=0
6 TEST_DESCRIPTION
="testing honor first shutdown"
9 # shellcheck source=test/test-functions
10 .
"${TEST_BASE_DIR:?}/test-functions"
12 # Using timeout because if the test fails it can loop.
13 # The reason is because the poweroff executed by end.service
14 # could turn into a reboot if the test fails.
17 # Remove this file if it exists. This is used along with
18 # the make target "finish". Since concrete confirmation is
19 # only found from the console during the poweroff.
20 rm -f /tmp
/honorfirstshutdown.log
>/dev
/null
22 check_result_nspawn_hook
() {
23 grep -q "Shutdown is already active. Skipping emergency action request" /tmp
/honorfirstshutdown.log
26 # Note: don't use a pipe in the following expression, as it breaks the trap
27 # handlers we have defined in test/test-functions.
28 do_test
"$@" > >(tee /tmp
/honorfirstshutdown.log
)