]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
machine: Duplicate pexpect serial output to stdout
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 6 Apr 2022 10:44:01 +0000 (12:44 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 14 Apr 2022 20:35:40 +0000 (22:35 +0200)
Helps with debugging failing tests.

mkosi/machine.py

index a300af8ab3b7bebcf1a9c88cd48df45fbaed8085..09fbab0f22d9f6e29647922e51b54d4b35fbfa1b 100644 (file)
@@ -6,6 +6,7 @@ import contextlib
 import os
 import signal
 import subprocess
+import sys
 import unittest
 from textwrap import dedent
 from typing import Any, Iterator, Optional, Sequence
@@ -135,7 +136,7 @@ class Machine:
             # Then we tell the process to look for the # sign, which indicates the CLI for that image is active.
             # Once we've build/boot an image the CLI will prompt "root@image ~]# ".
             # Then, when pexpects finds the '#' it means we're ready to interact with the process.
-            self._serial = pexpect.spawnu(cmd, logfile=None, timeout=240)
+            self._serial = pexpect.spawnu(cmd, logfile=sys.stdout, timeout=240)
             self._serial.expect("#")
             self.stack = stack.pop_all()