Re: [kvm-unit-tests PATCH 1/3] s390x: Fix unreliable panic-loop tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 24 Jul 2025 15:30:49 +0200
Thomas Huth <thuth@xxxxxxxxxx> wrote:

> From: Thomas Huth <thuth@xxxxxxxxxx>
> 
> In our CI, the s390x panic-loop-extint and panic-loop-pgm tests
> are sometimes failing. Having a closer look, this seems to be caused
> by ncat sometimes complaining about "Connection reset by peer" on stderr,
> likely because QEMU terminated (due to the panic) before ncat could
> properly tear down the connection. But having some output on stderr is
> interpreted as test failure in qemu_fixup_return_code(), so the test is
> marked as failed, even though the panic event occurred as expected.
> 
> To fix it, drop the usage of ncat here and simply handle the QMP
> input and output via normal fifos instead. This has also the advantage
> that we do not need an additional program for these tests anymore
> that might not be available in the installation.
> 
> Signed-off-by: Thomas Huth <thuth@xxxxxxxxxx>

Acked-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>

> ---
>  scripts/arch-run.bash | 21 +++++----------------
>  1 file changed, 5 insertions(+), 16 deletions(-)
> 
> diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
> index c440f216..58e4f93f 100644
> --- a/scripts/arch-run.bash
> +++ b/scripts/arch-run.bash
> @@ -63,14 +63,6 @@ qmp ()
>  	echo '{ "execute": "qmp_capabilities" }{ "execute":' "$2" '}' | ncat -U $1
>  }
>  
> -qmp_events ()
> -{
> -	while ! test -S "$1"; do sleep 0.1; done
> -	echo '{ "execute": "qmp_capabilities" }{ "execute": "cont" }' |
> -		ncat --no-shutdown -U $1 |
> -		jq -c 'select(has("event"))'
> -}
> -
>  filter_quiet_msgs ()
>  {
>  	grep -v "Now migrate the VM (quiet)" |
> @@ -295,26 +287,23 @@ do_migration ()
>  
>  run_panic ()
>  {
> -	if ! command -v ncat >/dev/null 2>&1; then
> -		echo "${FUNCNAME[0]} needs ncat (netcat)" >&2
> -		return 77
> -	fi
> -
>  	if ! command -v jq >/dev/null 2>&1; then
>  		echo "${FUNCNAME[0]} needs jq" >&2
>  		return 77
>  	fi
>  
>  	trap 'trap - TERM ; kill 0 ; exit 2' INT TERM
> -	trap 'rm -f ${qmp}' RETURN EXIT
> +	trap 'rm -f ${qmp}.in ${qmp}.out' RETURN EXIT
>  
>  	qmp=$(mktemp -u -t panic-qmp.XXXXXXXXXX)
> +	mkfifo ${qmp}.in ${qmp}.out
>  
>  	# start VM stopped so we don't miss any events
> -	"$@" -chardev socket,id=mon,path=${qmp},server=on,wait=off \
> +	"$@" -chardev pipe,id=mon,path=${qmp} \
>  		-mon chardev=mon,mode=control -S &
> +	echo '{ "execute": "qmp_capabilities" }{ "execute": "cont" }' > ${qmp}.in
>  
> -	panic_event_count=$(qmp_events ${qmp} | jq -c 'select(.event == "GUEST_PANICKED")' | wc -l)
> +	panic_event_count=$(jq -c 'select(.event == "GUEST_PANICKED")' < ${qmp}.out | wc -l)
>  	if [ "$panic_event_count" -lt 1 ]; then
>  		echo "FAIL: guest did not panic"
>  		ret=3





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux