diff mbox series

[kvm-unit-tests,1/3] migration: Fix test harness hang on fifo

Message ID 20230725033937.277156-2-npiggin@gmail.com (mailing list archive)
State New, archived
Headers show
Series migration: fixes and multiple migration | expand

Commit Message

Nicholas Piggin July 25, 2023, 3:39 a.m. UTC
If the test fails before migration is complete, the input fifo for the
destination machine is not written to and that can leave cat waiting
for input.

Clear that condition in the error handler so the harness doesn't hang
in this case.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 scripts/arch-run.bash | 1 +
 1 file changed, 1 insertion(+)

Comments

Nico Boehr July 28, 2023, 7:20 a.m. UTC | #1
Quoting Nicholas Piggin (2023-07-25 05:39:35)
> If the test fails before migration is complete, the input fifo for the
> destination machine is not written to and that can leave cat waiting
> for input.
> 
> Clear that condition in the error handler so the harness doesn't hang
> in this case.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>

Reviewed-by: Nico Boehr <nrb@linux.ibm.com>
diff mbox series

Patch

diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
index 5e7e4201..518607f4 100644
--- a/scripts/arch-run.bash
+++ b/scripts/arch-run.bash
@@ -165,6 +165,7 @@  run_migration ()
 		migstatus=`qmp ${qmp1} '"query-migrate"' | grep return`
 		if grep -q '"failed"' <<<"$migstatus" ; then
 			echo "ERROR: Migration failed." >&2
+			echo > ${fifo}
 			qmp ${qmp1} '"quit"'> ${qmpout1} 2>/dev/null
 			qmp ${qmp2} '"quit"'> ${qmpout2} 2>/dev/null
 			return 2