To get rid of some boilerplate.
TEST_DESCRIPTION="shutdown testing"
IMAGE_NAME="shutdown"
-TEST_NO_QEMU=1
+TEST_NO_QEMU=yes
+# Prevent shutdown in test suite, the expect script does that manually.
+TEST_SKIP_SHUTDOWN=yes
# shellcheck source=test/test-functions
. "${TEST_BASE_DIR:?}/test-functions"
test_append_files() {
local workspace="${1:?}"
- # prevent shutdown in test suite, the expect script does that manually.
- mkdir -p "${workspace:?}/etc/systemd/system/end.service.d"
- cat >"$workspace/etc/systemd/system/end.service.d/99-override.conf" <<EOF
-[Service]
-ExecStart=
-ExecStart=/bin/true
-EOF
+
inst /usr/bin/screen
echo "PS1='screen\$WINDOW # '" >>"$workspace/root/.bashrc"
echo 'startup_message off' >"$workspace/etc/screenrc"
TEST_DESCRIPTION="Test Soft-Rebooting"
# We temporarily remount rootfs read-only, so ignore any missing coverage
IGNORE_MISSING_COVERAGE=yes
+# Prevent shutdown in test suite, the expect script does that manually.
+TEST_SKIP_SHUTDOWN=yes
# shellcheck source=test/test-functions
. "$TEST_BASE_DIR/test-functions"
-test_append_files() {
- local workspace="${1:?}"
- # prevent shutdown in test suite, the expect script does that manually.
- mkdir -p "${workspace:?}/etc/systemd/system/end.service.d"
- cat >"$workspace/etc/systemd/system/end.service.d/99-override.conf" <<EOF
-[Service]
-ExecStart=
-ExecStart=/bin/true
-EOF
-}
-
do_test "$@"
"systemd.unit=testsuite.target"
"systemd.wants=testsuite-$1.service"
"noresume"
+ "oops=panic"
${TEST_MATCH_SUBTEST:+"systemd.setenv=TEST_MATCH_SUBTEST=$TEST_MATCH_SUBTEST"}
${TEST_MATCH_TESTCASE:+"systemd.setenv=TEST_MATCH_TESTCASE=$TEST_MATCH_TESTCASE"}
)
- if ! get_bool "$INTERACTIVE_DEBUG"; then
+ if ! get_bool "$INTERACTIVE_DEBUG" && ! get_bool "$TEST_SKIP_SHUTDOWN"; then
kernel_params+=(
- "oops=panic"
"panic=1"
"systemd.wants=end.service"
)
if get_bool "$INTERACTIVE_DEBUG"; then
nspawn_options+=("--console=interactive")
- else
+ elif ! get_bool "$TEST_SKIP_SHUTDOWN"; then
kernel_params+=("systemd.wants=end.service")
fi