MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / wait_for_ssh

Function wait_for_ssh

test_infra/src/lib.rs:1011–1026  ·  view source on GitHub ↗

Waits until SSH to the guest becomes available.

(
    command: &str,
    auth: &PasswordAuth,
    ip: &str,
    timeout: Duration,
)

Source from the content-addressed store, hash-verified

1009
1010/// Waits until SSH to the guest becomes available.
1011pub fn wait_for_ssh(
1012 command: &str,
1013 auth: &PasswordAuth,
1014 ip: &str,
1015 timeout: Duration,
1016) -> Result<String, WaitForSshError> {
1017 wait_until_succeeds(timeout, || {
1018 ssh_command_ip_with_auth(command, auth, ip, Some(timeout))
1019 })
1020 .map_err(|source| WaitForSshError::Timeout {
1021 command: command.to_string(),
1022 ip: ip.to_string(),
1023 timeout,
1024 source,
1025 })
1026}
1027
1028pub fn exec_host_command_with_retries(command: &str, retries: u32, interval: Duration) -> bool {
1029 for _ in 0..retries {

Callers 4

test_vfioFunction · 0.85
wait_for_bootMethod · 0.85
wait_for_sshMethod · 0.85
wait_for_ssh_commandMethod · 0.85

Calls 2

wait_until_succeedsFunction · 0.85
ssh_command_ip_with_authFunction · 0.85

Tested by 2

test_vfioFunction · 0.68
wait_for_bootMethod · 0.68