selftests/vsock: do not unconditionally die if qemu fails

If QEMU fails to boot, then set the returncode (via timeout) instead of
unconditionally dying. This is in preparation for tests that expect QEMU
to fail to boot. In that case, we just want to know if the boot failed
or not so we can test the pass/fail criteria, and continue executing the
next test.

Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Bobby Eshleman <bobbyeshleman@meta.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://patch.msgid.link/20251108-vsock-selftests-fixes-and-improvements-v4-5-d5e8d6c87289@meta.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Bobby Eshleman
2025-11-08 08:00:56 -08:00
committed by Jakub Kicinski
parent ac8997e943
commit c7df4adc06
+2 -4
View File
@@ -236,10 +236,8 @@ vm_start() {
--append "${KERNEL_CMDLINE}" \
--rw &> ${logfile} &
if ! timeout ${WAIT_TOTAL} \
bash -c 'while [[ ! -s '"${pidfile}"' ]]; do sleep 1; done; exit 0'; then
die "failed to boot VM"
fi
timeout "${WAIT_TOTAL}" \
bash -c 'while [[ ! -s '"${pidfile}"' ]]; do sleep 1; done; exit 0'
}
vm_wait_for_ssh() {