Skip to main content

wait_for_ssh

Function wait_for_ssh 

Source
pub async fn wait_for_ssh(
    host: &str,
    port: u16,
    timeout_: Duration,
) -> Result<()>
Expand description

Poll host:port until a real SSH server answers. A bare TCP connect is NOT enough: QEMU’s user-mode NAT completes the host-side handshake while the guest is still in UEFI/Setup, so connect() succeeds minutes before any sshd exists (false “ready” + hung ssh client). We require the SSH-2.0-... banner, which only a live sshd sends.

Default budget is caller-chosen; poll interval crate::timeouts::SSH_POLL_INTERVAL. On timeout the caller should screendump before failing (see canary test).