diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py index f2e7bf3c1d5..3ee8b3227c6 100755 --- a/nixos/lib/test-driver/test-driver.py +++ b/nixos/lib/test-driver/test-driver.py @@ -405,14 +405,14 @@ class Machine: keep_vm_state: bool allow_reboot: bool - process: Optional[subprocess.Popen] = None - pid: Optional[int] = None - monitor: Optional[socket.socket] = None - shell: Optional[socket.socket] = None + process: Optional[subprocess.Popen] + pid: Optional[int] + monitor: Optional[socket.socket] + shell: Optional[socket.socket] serial_thread: Optional[threading.Thread] - booted: bool = False - connected: bool = False + booted: bool + connected: bool # Store last serial console lines for use # of wait_for_console_text last_lines: Queue = Queue() @@ -445,8 +445,15 @@ class Machine: self.cleanup_statedir() self.state_dir.mkdir(mode=0o700, exist_ok=True) + self.process = None + self.pid = None + self.monitor = None + self.shell = None self.serial_thread = None + self.booted = False + self.connected = False + @staticmethod def create_startcommand(args: Dict[str, str]) -> StartCommand: rootlog.warning(