test/vhost: common.sh fixes for listing VMs

Add nullglob options where appropriate

Change-Id: If55b0b2e19a7834eaf2efc86b2c23fcc71d8b05f
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/389292
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Karol Latecki 2017-11-28 12:45:16 +01:00 committed by Daniel Verkamp
parent d12ba75bd1
commit d07df58419

View File

@ -329,15 +329,18 @@ function vm_kill()
#
function vm_kill_all()
{
shopt -s nullglob
for vm in $VM_BASE_DIR/[0-9]*; do
vm_kill $(basename $vm)
done
shopt -u nullglob
}
# Shutdown all VM in $VM_BASE_DIR
#
function vm_shutdown_all()
{
shopt -s nullglob
for vm in $VM_BASE_DIR/[0-9]*; do
vm_shutdown $(basename $vm)
done
@ -355,12 +358,14 @@ function vm_shutdown_all()
if [[ $all_vms_down == 1 ]]; then
echo "INFO: All VMs successfully shut down"
shopt -u nullglob
return 0
fi
((timeo-=1))
sleep 1
done
shopt -u nullglob
return 1
}