From 417b77941a870aeebfc3a4362fa8241781dd6e77 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Thu, 23 Apr 2020 10:35:31 +0200 Subject: [PATCH] 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 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2000 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker Reviewed-by: Karol Latecki Reviewed-by: Darek Stojaczyk Reviewed-by: Tomasz Zawadzki --- test/vhost/lvol/lvol_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/vhost/lvol/lvol_test.sh b/test/vhost/lvol/lvol_test.sh index 060fdef03..6d0bc5bf9 100755 --- a/test/vhost/lvol/lvol_test.sh +++ b/test/vhost/lvol/lvol_test.sh @@ -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