test/vhost: fix variable error in vm_setup

apparently getopt used $i when iterating over variables because when
weuse --force and don't set i ourselves, bash throws errors that look
like "line 594: [[: --test-cases=1,2: attempted assignment to
non-variable (error token is "=1,2")".

Change-Id: I89937f1cdd3d3c0557c931a11707df17c7b8d87e
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478079
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Seth Howell 2019-12-16 08:25:06 -07:00 committed by Tomasz Zawadzki
parent 34ae11720d
commit 6b9e48df95

View File

@ -586,7 +586,7 @@ function vm_setup()
vm_num=$i
fi
if [[ $i -eq 256 ]]; then
if [[ $vm_num -eq 256 ]]; then
error "no free VM found. do some cleanup (256 VMs created, are you insane?)"
return 1
fi