From 0169a18fc2e5aeb444886bad2feebfeca019593f Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Wed, 14 Feb 2018 14:52:23 -0700 Subject: [PATCH] test/vhost: add VM_BASE_DIR to vm_shutdown_all checks New vm_list_all function returns just vm numbers - with no path. vm_shutdown_all was not modified to add back the path, so it would immediately think all VMs were shutdown when actually they were not. While here, fix a few other typos and nops. Fixes db0c3174 (test/vhost: avoid setting nullglob's where possible) Signed-off-by: Jim Harris Change-Id: I43c58eac4dba3422cda34a2b8a02d174d4737f61 Reviewed-on: https://review.gerrithub.io/399951 Reviewed-by: Daniel Verkamp Tested-by: SPDK Automated Test System Reviewed-by: Pawel Wodkowski --- test/vhost/common/common.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/vhost/common/common.sh b/test/vhost/common/common.sh index addc0bbc2..1f3751947 100644 --- a/test/vhost/common/common.sh +++ b/test/vhost/common/common.sh @@ -393,7 +393,7 @@ function vm_shutdown_all() local vm for vm in $vms; do - vm_shutdown $(basename $vm) + vm_shutdown $vm done notice "Waiting for VMs to shutdown..." @@ -401,7 +401,7 @@ function vm_shutdown_all() while [[ $timeo -gt 0 ]]; do all_vms_down=1 for vm in $vms; do - if [[ -r $vm/qemu.pid ]] && pkill -0 -F "$vm/qemu.pid"; then + if [[ -r $VM_BASE_DIR/$vm/qemu.pid ]] && pkill -0 -F "$VM_BASE_DIR/$vm/qemu.pid"; then all_vms_down=0 break fi @@ -418,7 +418,7 @@ function vm_shutdown_all() done $shell_restore_x - error "Timout waiting for some VMs to shutdown" + error "Timeout waiting for some VMs to shutdown" return 1 } @@ -735,7 +735,7 @@ function vm_run() continue fi - notice "running $VM_BASE_DIR$vm/run.sh" + notice "running $VM_BASE_DIR/$vm/run.sh" if ! $VM_BASE_DIR/$vm/run.sh; then error "FAILED to run vm $vm" return 1