test/vhost: Fix arithmetic check against $max_disks

The size of the nvmes[] was being compared against a plain string
(which in arithmetic context always evaluates to 0) due to improper
var referencing.

Fix this by using (( )) to be more flexible and not depend on the
parameter expansion syntax.

Change-Id: I56fd3b98940961475638099dc66aec5544c832c7
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2000
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Michal Berger 2020-04-23 10:35:31 +02:00 committed by Tomasz Zawadzki
parent 36e573fc6b
commit 417b77941a

View File

@ -106,7 +106,7 @@ if [[ -z $max_disks ]]; then
max_disks=${#nvmes[@]}
fi
if [[ ${#nvmes[@]} -lt max_disks ]]; then
if (( ${#nvmes[@]} < max_disks )); then
fail "Number of NVMe drives (${#nvmes[@]}) is lower than number of requested disks for test ($max_disks)"
fi