nixos/test-driver: actually use the backdoor message to wait for backdoor
New EDK2 sets up the backdoor port as a serial console, which feeds the test driver a bunch of boot logs it can safely ignore. Do so by waiting for the message the backdoor shell prints before doing anything else.
This commit is contained in:
parent
1abde93ec3
commit
008f9f0cd4
1 changed files with 7 additions and 1 deletions
|
@ -752,7 +752,13 @@ class Machine:
|
||||||
while not shell_ready(timeout_secs=30):
|
while not shell_ready(timeout_secs=30):
|
||||||
self.log("Guest root shell did not produce any data yet...")
|
self.log("Guest root shell did not produce any data yet...")
|
||||||
|
|
||||||
self.log(self.shell.recv(1024).decode())
|
while True:
|
||||||
|
chunk = self.shell.recv(1024)
|
||||||
|
self.log(f"Guest shell says: {chunk!r}")
|
||||||
|
# NOTE: for this to work, nothing must be printed after this line!
|
||||||
|
if b"Spawning backdoor root shell..." in chunk:
|
||||||
|
break
|
||||||
|
|
||||||
toc = time.time()
|
toc = time.time()
|
||||||
|
|
||||||
self.log("connected to guest root shell")
|
self.log("connected to guest root shell")
|
||||||
|
|
Loading…
Reference in a new issue