about summary refs log tree commit diff
path: root/nixos/lib
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2023-07-08 20:21:50 +0300
committerK900 <me@0upti.me>2023-07-08 20:21:50 +0300
commit008f9f0cd419bd66e922239e2319fd2b1f347ad8 (patch)
tree7a854ef740b01330a75fdee33d31ce27bee6a3d8 /nixos/lib
parent1abde93ec32aa4011f49168269cb03f32232d50d (diff)
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.
Diffstat (limited to 'nixos/lib')
-rw-r--r--nixos/lib/test-driver/test_driver/machine.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/nixos/lib/test-driver/test_driver/machine.py b/nixos/lib/test-driver/test_driver/machine.py
index 7ef0ae89910b0..c315f9b2f57f3 100644
--- a/nixos/lib/test-driver/test_driver/machine.py
+++ b/nixos/lib/test-driver/test_driver/machine.py
@@ -752,7 +752,13 @@ class Machine:
             while not shell_ready(timeout_secs=30):
                 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()
 
             self.log("connected to guest root shell")