test: save the console log to a file

So we can refer to it later if needed.
This commit is contained in:
Frantisek Sumsal 2023-08-11 16:36:45 +02:00
parent c82cc3709e
commit 701e0c2660

View file

@ -626,7 +626,7 @@ run_qemu() {
qemu_cmd=(timeout --foreground "$QEMU_TIMEOUT" "$QEMU_BIN")
fi
(set -x; "${qemu_cmd[@]}" "${qemu_options[@]}" -append "${kernel_params[*]}")
(set -x; "${qemu_cmd[@]}" "${qemu_options[@]}" -append "${kernel_params[*]}" |& tee "${TESTDIR:?}/console.log")
rc=$?
if [ "$rc" -eq 124 ] && [ "$QEMU_TIMEOUT" != "infinity" ]; then
derror "Test timed out after ${QEMU_TIMEOUT}s"
@ -693,7 +693,7 @@ run_nspawn() {
nspawn_cmd+=("$SYSTEMD_NSPAWN")
fi
(set -x; "${nspawn_cmd[@]}" "${nspawn_options[@]}" "${kernel_params[@]}")
(set -x; "${nspawn_cmd[@]}" "${nspawn_options[@]}" "${kernel_params[@]}" |& tee "${TESTDIR:?}/console.log")
rc=$?
if [ "$rc" -eq 124 ] && [ "$NSPAWN_TIMEOUT" != "infinity" ]; then
derror "Test timed out after ${NSPAWN_TIMEOUT}s"