Waits until SSH to the guest becomes available.
(
command: &str,
auth: &PasswordAuth,
ip: &str,
timeout: Duration,
)
| 1009 | |
| 1010 | /// Waits until SSH to the guest becomes available. |
| 1011 | pub 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 | |
| 1028 | pub fn exec_host_command_with_retries(command: &str, retries: u32, interval: Duration) -> bool { |
| 1029 | for _ in 0..retries { |