diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py index 872e96327e8..5402b937734 100644 --- a/nixos/lib/test-driver/test-driver.py +++ b/nixos/lib/test-driver/test-driver.py @@ -290,10 +290,15 @@ class Machine: def wait_for_monitor_prompt(self) -> str: assert self.monitor is not None + answer = "" while True: - answer = self.monitor.recv(1024).decode() + undecoded_answer = self.monitor.recv(1024) + if not undecoded_answer: + break + answer += undecoded_answer.decode() if answer.endswith("(qemu) "): - return answer + break + return answer def send_monitor_command(self, command: str) -> str: message = ("{}\n".format(command)).encode()