]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: save the console log to a file
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 11 Aug 2023 14:36:45 +0000 (16:36 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 11 Aug 2023 14:57:06 +0000 (16:57 +0200)
So we can refer to it later if needed.

test/test-functions

index 477755e4618e9e117836d73c9b560c17cb08fe4f..7092276b8e2da90e9aa10623d8ca789f56c67483 100644 (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"