test: send stdout/stderr of testsuite units to journal & console

to make debugging in CIs slightly easier.
This commit is contained in:
Frantisek Sumsal 2022-06-16 22:16:53 +02:00 committed by Yu Watanabe
parent 75176c7914
commit ba7abf79a5
7 changed files with 12 additions and 12 deletions

View File

@ -2941,6 +2941,18 @@ test_setup() {
mask_supporting_services
fi
# Send stdout/stderr of testsuite-*.service units to both journal and
# console to make debugging in CIs easier
# Note: we can't use a dropin for `testsuite-.service`, since that also
# overrides 'sub-units' of some tests that already use a specific
# value for Standard(Output|Error)=
# (e.g. test/units/testsuite-66-deviceisolation.service)
if ! get_bool "$INTERACTIVE_DEBUG"; then
local dropin_dir="${initdir:?}/etc/systemd/system/testsuite-${TESTID:?}.service.d"
mkdir -p "$dropin_dir"
printf '[Service]\nStandardOutput=journal+console\nStandardError=journal+console' >"$dropin_dir/99-stdout.conf"
fi
if get_bool "$hook_defined"; then
test_append_files "${initdir:?}"
fi

View File

@ -9,5 +9,3 @@ Wants=getty-pre.target
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot
StandardOutput=tty
StandardError=tty

View File

@ -5,6 +5,4 @@ Description=TEST-35-LOGIN
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
StandardOutput=journal+console
StandardError=journal+console
Type=oneshot

View File

@ -5,6 +5,4 @@ Description=TEST-45-TIMEDATE
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
StandardOutput=journal+console
StandardError=journal+console
Type=oneshot

View File

@ -6,5 +6,3 @@ Description=TEST-64-UDEV
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console

View File

@ -5,6 +5,4 @@ Description=TEST-71-HOSTNAME
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
StandardOutput=journal+console
StandardError=journal+console
Type=oneshot

View File

@ -5,6 +5,4 @@ Description=TEST-73-LOCALE
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
StandardOutput=journal+console
StandardError=journal+console
Type=oneshot