test/nvmf: Extend ANA state change timeout to 20 seconds

If a connection is lost, Linux NVMe host tries reconnecting after
10 seconds delay by default. To cover this case, extend the timeout
to 20 seconds. Usually Linux NVMe host recognizes the new ANA state
within 2 seconds.

This patch is for the github issue #2081

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I61fba2febcea81951c8b29f940d93863bc31b332
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9393
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Shuhei Matsumoto 2021-09-05 16:01:17 +09:00 committed by Tomasz Zawadzki
parent c4f086b6ed
commit 5466d5d4dc

View File

@ -14,7 +14,10 @@ function check_ana_state() {
local subsys_id=$1 local subsys_id=$1
local ctrl_id=$2 local ctrl_id=$2
local ana_state=$3 local ana_state=$3
local timeout=3 # Very rarely a connection is lost and Linux NVMe host tries reconnecting
# after 10 seconds delay. For this case, set a sufficienntly long timeout.
# Linux NVMe host usually recognizes the new ANA state within 2 seconds.
local timeout=20
while [ $(cat /sys/block/nvme"$subsys_id"c"$ctrl_id"n1/ana_state) != "$ana_state" ]; do while [ $(cat /sys/block/nvme"$subsys_id"c"$ctrl_id"n1/ana_state) != "$ana_state" ]; do
sleep 1 sleep 1