1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 13:10:33 +00:00

nixos/test: If qemu monitor returns 0, simply return (like perl script does)

This commit is contained in:
Jacek Galowicz 2019-11-19 17:08:30 +01:00 committed by Florian Klink
parent 67e2042861
commit 72dd1c6a74

View file

@ -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()