]> git.proxmox.com Git - systemd.git/blame - test/TEST-52-HONORFIRSTSHUTDOWN/test.sh
New upstream version 249~rc1
[systemd.git] / test / TEST-52-HONORFIRSTSHUTDOWN / test.sh
CommitLineData
a10f5d05
MB
1#!/bin/bash
2set -e
8b3d4ff0 3
a10f5d05
MB
4TEST_REQUIRE_INSTALL_TESTS=0
5TEST_DESCRIPTION="testing honor first shutdown"
a10f5d05
MB
6TEST_NO_QEMU=1
7
8b3d4ff0
MB
8# shellcheck source=test/test-functions
9. "${TEST_BASE_DIR:?}/test-functions"
10
11# Using timeout because if the test fails it can loop.
a10f5d05
MB
12# The reason is because the poweroff executed by end.service
13# could turn into a reboot if the test fails.
14NSPAWN_TIMEOUT=20
15
8b3d4ff0
MB
16# Remove this file if it exists. This is used along with
17# the make target "finish". Since concrete confirmation is
a10f5d05
MB
18# only found from the console during the poweroff.
19rm -f /tmp/honorfirstshutdown.log >/dev/null
20
8b3d4ff0
MB
21check_result_nspawn_hook() {
22 grep -q "Shutdown is already active. Skipping emergency action request" /tmp/honorfirstshutdown.log
23}
24
25# Note: don't use a pipe in the following expression, as it breaks the trap
26# handlers we have defined in test/test-functions.
27do_test "$@" > >(tee /tmp/honorfirstshutdown.log)