test/vhost: use vm_is_running in vm_shutdown_all

Fix test timeout. QEMU pid is leaking from one test run into another
test run. This make test see random process with the same PID and skip
running VM.

Change-Id: I56940c55793535ab149c79775f5de284882ebd97
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/404476
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Pawel Wodkowski 2018-03-20 14:27:51 +01:00 committed by Jim Harris
parent bbe53581bd
commit dd9d121da5

View File

@ -464,7 +464,7 @@ function vm_shutdown_all()
while [[ $timeo -gt 0 ]]; do
local all_vms_down=1
for vm in $vms; do
if [[ -r $VM_BASE_DIR/$vm/qemu.pid ]] && pkill -0 -F "$VM_BASE_DIR/$vm/qemu.pid"; then
if vm_is_running $vm; then
all_vms_down=0
break
fi