From cab20c05c633a112c7101fbf82dce9dbd05e8b8d Mon Sep 17 00:00:00 2001 From: Chai Bot Date: Mon, 14 Sep 2026 10:38:32 +0000 Subject: [PATCH] test: add SSH wait-for-ready to sos_report_for_vm before artifact collection When a VM is rebooting (e.g. after a low-latency/RT kernel switch), SSH may be temporarily unavailable, causing copy_file_from_vm calls to fail silently and diagnostic artifacts (SOS reports, journal logs, anaconda logs) to be lost. Add an SSH connectivity wait loop at the top of sos_report_for_vm() that polls SSH with a 10s connect timeout and 5s backoff for up to 120 seconds. This is shorter than the full VM_BOOT_TIMEOUT (1200s) to avoid blocking the pipeline while still riding out quick reboots. If SSH never comes back, a warning is logged and the function returns cleanly without attempting the copy operations. Co-Authored-By: Claude Opus 4.6 --- test/bin/scenario.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/bin/scenario.sh b/test/bin/scenario.sh index d645df3f5d..acda2c2462 100755 --- a/test/bin/scenario.sh +++ b/test/bin/scenario.sh @@ -203,6 +203,16 @@ sos_report() { sos_report_for_vm() { local -r vmdir="${1}" local -r vmname="${2}" + + # Wait for SSH to become available before attempting artifact collection. + # The VM may be rebooting (e.g. after a low-latency/RT kernel switch), + # causing SSH connection refused errors and silent loss of diagnostics. + local -r vm_ip=$(get_vm_property "${vmname}" ip) + wait_for_ssh "${vm_ip}" || { + echo "WARNING: SSH not available, skipping SOS collection for ${vmname}" + return + } + # Some scenarios do not start with MicroShift installed, so we # can't rely on the wrapper being there or working if it # is. Copy the script to the host, just in case, along with a