test_append_files() {
local workspace="${1:?}"
+ local dropin_dir
mkdir -p "$workspace/test-journals/"
cp -av "${TEST_BASE_DIR:?}/test-journals/"* "$workspace/test-journals/"
# Necessary for RH-based systems, otherwise MHD fails with:
# microhttpd: Failed to initialise TLS session.
image_install -o /etc/crypto-policies/back-ends/gnutls.config
+
+ # Since we nuke the journal repeatedly during this test, let's redirect
+ # stdout/stderr to the console as well to make the test a bit more debug-able.
+ if ! get_bool "${INTERACTIVE_DEBUG:-}"; then
+ dropin_dir="${workspace:?}/etc/systemd/system/testsuite-04.service.d/"
+ mkdir -p "$dropin_dir"
+ printf '[Service]\nStandardOutput=journal+console\nStandardError=journal+console' >"$dropin_dir/99-stdout.conf"
+ fi
}
do_test "$@"
journalctl --flush
fi
- rm -f /run/systemd/journald.conf.d/99-forward-to-console.conf
- systemctl restart systemd-journald
-
return 0
}
# current boot, let's temporarily overmount /var/log/journal with a tmpfs,
# as we're going to wipe it multiple times, but we need to keep the original
# journal intact for the other tests to work correctly.
-#
-# Also, since we'll eventually lose the journal from this test, let's temporarily
-# forward everything to console, to make potential fails debug-able.
trap at_exit EXIT
-mkdir -p /run/systemd/journald.conf.d/
-echo -ne '[Journal]\nForwardToConsole=yes' >/run/systemd/journald.conf.d/99-forward-to-console.conf
mount -t tmpfs tmpfs /var/log/journal
systemctl restart systemd-journald
set -eux
set -o pipefail
-# Limit the maximum journal size
-trap "journalctl --rotate --vacuum-size=20M" EXIT
-
# shellcheck source=test/units/test-control.sh
. "$(dirname "$0")"/test-control.sh