Commit 713333fd authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

test/nvmf: add some delays in discovery.sh



The test script does sequences like the following:

1) Add a host to an existing subsystem on target A
2) Check application B to see if it has received a
   discovery AEN and attached to that subsystem

But we have to account for some delay between 1 and 2.
Application B has to receive the discovery AEN, get
the discovery log page, parse the new log page entry
and then connect to the NVM subsystem.

Fixes issue #2420.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I160ed117ccd92bfb848f0075494a0d516b341191
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11934


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 9d0bd899
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@ get_notification_count
# Discovery hostnqn is added, so now the host should see the subsystem, with a single path for the
# port of the single listener on the target.
$rpc_py nvmf_subsystem_add_host ${NQN}0 $HOST_NQN
sleep 1 # Wait a bit to make sure the discovery service has a chance to detect the changes
[[ "$(get_subsystem_names)" == "nvme0" ]]
[[ "$(get_bdev_list)" == "nvme0n1" ]]
[[ "$(get_subsystem_paths nvme0)" == "$NVMF_PORT" ]]
@@ -100,6 +101,7 @@ get_notification_count

# Adding a namespace isn't a discovery function, but do it here anyways just to confirm we see a new bdev.
$rpc_py nvmf_subsystem_add_ns ${NQN}0 null1
sleep 1 # Wait a bit to make sure the discovery service has a chance to detect the changes
[[ "$(get_bdev_list)" == "nvme0n1 nvme0n2" ]]
get_notification_count
[[ $notification_count == 1 ]]
@@ -107,6 +109,7 @@ get_notification_count
# Add a second path to the same subsystem.  This shouldn't change the list of subsystems or bdevs, but
# we should see a second path on the nvme0 subsystem now.
$rpc_py nvmf_subsystem_add_listener ${NQN}0 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_SECOND_PORT
sleep 1 # Wait a bit to make sure the discovery service has a chance to detect the changes
[[ "$(get_subsystem_names)" == "nvme0" ]]
[[ "$(get_bdev_list)" == "nvme0n1 nvme0n2" ]]
[[ "$(get_subsystem_paths nvme0)" == "$NVMF_PORT $NVMF_SECOND_PORT" ]]
@@ -116,6 +119,7 @@ get_notification_count
# Remove the listener for the first port.  The subsystem and bdevs should stay, but we should see
# the path to that first port disappear.
$rpc_py nvmf_subsystem_remove_listener ${NQN}0 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
sleep 1 # Wait a bit to make sure the discovery service has a chance to detect the changes
[[ "$(get_subsystem_names)" == "nvme0" ]]
[[ "$(get_bdev_list)" == "nvme0n1 nvme0n2" ]]
[[ "$(get_subsystem_paths nvme0)" == "$NVMF_SECOND_PORT" ]]
@@ -123,6 +127,7 @@ get_notification_count
[[ $notification_count == 0 ]]

$rpc_py -s $HOST_SOCK bdev_nvme_stop_discovery -b nvme
sleep 1 # Wait a bit to make sure the discovery service has a chance to detect the changes
[[ "$(get_subsystem_names)" == "" ]]
[[ "$(get_bdev_list)" == "" ]]
get_notification_count