From 1efd574527c3aed317ec5e9f23a1881b69e83954 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Tue, 20 Dec 2022 17:32:54 +0100 Subject: [PATCH] test/vhost: Don't remove QEMU's pidfile when terminating the process QEMU is fully capable of unlinking its own pidfile so it may happen that after sending a signal to terminate it, the file is already gone when we attempt to rm it - in such a case, rm fails leading to overall test failure. Avoid that by allowing QEMU to do its job. For cases where QEMU might have potentially failed (e.g. due to a crash) we leave the rm in with an extra -f on its cmdline. Signed-off-by: Michal Berger Change-Id: Ia8d5c73dd76225583a63c1f622835e22ce32e66c Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16040 Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Tomasz Zawadzki --- test/vhost/common.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/test/vhost/common.sh b/test/vhost/common.sh index 43ea64237..4a0d5025b 100644 --- a/test/vhost/common.sh +++ b/test/vhost/common.sh @@ -218,7 +218,6 @@ function vhost_kill() { if kill -0 $vhost_pid; then error "ERROR: vhost was NOT killed - sending SIGABRT" kill -ABRT $vhost_pid - rm $vhost_pid_file rc=1 else while kill -0 $vhost_pid; do @@ -233,9 +232,6 @@ function vhost_kill() { fi timing_exit vhost_kill - if [[ $rc == 0 ]]; then - rm $vhost_pid_file - fi rm -rf "$vhost_dir" @@ -366,7 +362,7 @@ function vm_is_running() { fi # not running - remove pid file - rm $vm_dir/qemu.pid + rm -f $vm_dir/qemu.pid return 1 fi } @@ -434,7 +430,6 @@ function vm_kill() { # First kill should fail, second one must fail if /bin/kill $vm_pid; then notice "process $vm_pid killed" - rm $vm_dir/qemu.pid rm -rf $vm_dir elif vm_is_running $1; then error "Process $vm_pid NOT killed"