test: send stdout/stderr of testsuite units to journal & console
to make debugging in CIs slightly easier.
This commit is contained in:
committed by
Yu Watanabe
parent
75176c7914
commit
ba7abf79a5
@@ -2941,6 +2941,18 @@ test_setup() {
|
|||||||
mask_supporting_services
|
mask_supporting_services
|
||||||
fi
|
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
|
if get_bool "$hook_defined"; then
|
||||||
test_append_files "${initdir:?}"
|
test_append_files "${initdir:?}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -9,5 +9,3 @@ Wants=getty-pre.target
|
|||||||
ExecStartPre=rm -f /failed /testok
|
ExecStartPre=rm -f /failed /testok
|
||||||
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
StandardOutput=tty
|
|
||||||
StandardError=tty
|
|
||||||
|
|||||||
@@ -5,6 +5,4 @@ Description=TEST-35-LOGIN
|
|||||||
[Service]
|
[Service]
|
||||||
ExecStartPre=rm -f /failed /testok
|
ExecStartPre=rm -f /failed /testok
|
||||||
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
||||||
StandardOutput=journal+console
|
|
||||||
StandardError=journal+console
|
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
|||||||
@@ -5,6 +5,4 @@ Description=TEST-45-TIMEDATE
|
|||||||
[Service]
|
[Service]
|
||||||
ExecStartPre=rm -f /failed /testok
|
ExecStartPre=rm -f /failed /testok
|
||||||
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
||||||
StandardOutput=journal+console
|
|
||||||
StandardError=journal+console
|
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
|||||||
@@ -6,5 +6,3 @@ Description=TEST-64-UDEV
|
|||||||
ExecStartPre=rm -f /failed /testok
|
ExecStartPre=rm -f /failed /testok
|
||||||
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
StandardOutput=journal+console
|
|
||||||
StandardError=journal+console
|
|
||||||
|
|||||||
@@ -5,6 +5,4 @@ Description=TEST-71-HOSTNAME
|
|||||||
[Service]
|
[Service]
|
||||||
ExecStartPre=rm -f /failed /testok
|
ExecStartPre=rm -f /failed /testok
|
||||||
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
||||||
StandardOutput=journal+console
|
|
||||||
StandardError=journal+console
|
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
|||||||
@@ -5,6 +5,4 @@ Description=TEST-73-LOCALE
|
|||||||
[Service]
|
[Service]
|
||||||
ExecStartPre=rm -f /failed /testok
|
ExecStartPre=rm -f /failed /testok
|
||||||
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
||||||
StandardOutput=journal+console
|
|
||||||
StandardError=journal+console
|
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
|||||||
Reference in New Issue
Block a user