From d98c37495a624921a25737010f5e961a36af6858 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Thu, 10 Feb 2022 11:09:12 +0000 Subject: [PATCH] test: add explicit listener for discovery subsystem Ensures compliance now that we've deprecated being able to connect to any listener without adding it to the discovery subsystem first. This patch was tested with a temporary change that removes the default discovery listener. It is possible that future test changes could again depend on this deprecated behavior, but at least now all existing tests will explicitly create the discovery listener, making it more likely that new tests will copy the correct behavior. Signed-off-by: Jim Harris Change-Id: I936d3d124e22a56548ea43c73ca8197c22ec0f66 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11541 Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Aleksey Marchuk Reviewed-by: Shuhei Matsumoto --- test/nvmf/host/fio.sh | 1 + test/nvmf/host/identify.sh | 1 + test/nvmf/host/perf.sh | 1 + test/nvmf/host/target_disconnect.sh | 1 + test/nvmf/target/abort.sh | 1 + test/nvmf/target/create_transport.sh | 1 + test/nvmf/target/discovery.sh | 1 + test/nvmf/target/ns_hotplug_stress.sh | 1 + test/nvmf/target/nvme_cli.sh | 1 + test/nvmf/target/nvmf_lvol.sh | 1 + test/nvmf/target/zcopy.sh | 2 ++ 11 files changed, 12 insertions(+) diff --git a/test/nvmf/host/fio.sh b/test/nvmf/host/fio.sh index 47c56a3924..2a255b4298 100755 --- a/test/nvmf/host/fio.sh +++ b/test/nvmf/host/fio.sh @@ -30,6 +30,7 @@ $rpc_py bdev_malloc_create 64 512 -b Malloc1 $rpc_py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001 $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc1 $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT +$rpc_py nvmf_subsystem_add_listener discovery -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT PLUGIN_DIR=$rootdir/examples/nvme/fio_plugin diff --git a/test/nvmf/host/identify.sh b/test/nvmf/host/identify.sh index 4126263880..410fbb8ae0 100755 --- a/test/nvmf/host/identify.sh +++ b/test/nvmf/host/identify.sh @@ -31,6 +31,7 @@ $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc0 \ --nguid "ABCDEF0123456789ABCDEF0123456789" \ --eui64 "ABCDEF0123456789" $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT +$rpc_py nvmf_subsystem_add_listener discovery -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT $rpc_py nvmf_get_subsystems diff --git a/test/nvmf/host/perf.sh b/test/nvmf/host/perf.sh index 9efa63ba06..075670a458 100755 --- a/test/nvmf/host/perf.sh +++ b/test/nvmf/host/perf.sh @@ -42,6 +42,7 @@ for bdev in $bdevs; do $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 $bdev done $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT +$rpc_py nvmf_subsystem_add_listener discovery -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT # Test multi-process access to local NVMe device if [ -n "$local_nvme_trid" ]; then diff --git a/test/nvmf/host/target_disconnect.sh b/test/nvmf/host/target_disconnect.sh index 27bb2a3bcd..2f0faae299 100755 --- a/test/nvmf/host/target_disconnect.sh +++ b/test/nvmf/host/target_disconnect.sh @@ -22,6 +22,7 @@ function disconnect_init() { $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc0 $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $1 -s $NVMF_PORT + $rpc_py nvmf_subsystem_add_listener discovery -t $TEST_TRANSPORT -a $1 -s $NVMF_PORT } # Test to make sure we don't segfault or access null pointers when we try to connect to diff --git a/test/nvmf/target/abort.sh b/test/nvmf/target/abort.sh index 55d3a55ccb..e4ffd1c733 100755 --- a/test/nvmf/target/abort.sh +++ b/test/nvmf/target/abort.sh @@ -23,6 +23,7 @@ $rpc_py bdev_delay_create -b Malloc0 -d Delay0 -r 1000000 -t 1000000 -w 1000000 $rpc_py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode0 -a -s SPDK0 $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode0 Delay0 $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode0 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT +$rpc_py nvmf_subsystem_add_listener discovery -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT # Run abort application $SPDK_EXAMPLE_DIR/abort -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT" \ diff --git a/test/nvmf/target/create_transport.sh b/test/nvmf/target/create_transport.sh index e2766467b6..633b81562f 100755 --- a/test/nvmf/target/create_transport.sh +++ b/test/nvmf/target/create_transport.sh @@ -29,6 +29,7 @@ for null_bdev in $null_bdevs; do $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 $null_bdev done $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT +$rpc_py nvmf_subsystem_add_listener discovery -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT nvme discover -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT diff --git a/test/nvmf/target/discovery.sh b/test/nvmf/target/discovery.sh index ad5a6ce967..f41d291575 100755 --- a/test/nvmf/target/discovery.sh +++ b/test/nvmf/target/discovery.sh @@ -27,6 +27,7 @@ for i in $(seq 1 4); do $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode$i Null$i $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode$i -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT done +$rpc_py nvmf_subsystem_add_listener discovery -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT nvme discover -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT diff --git a/test/nvmf/target/ns_hotplug_stress.sh b/test/nvmf/target/ns_hotplug_stress.sh index d4e02e8d7d..607fe0e126 100755 --- a/test/nvmf/target/ns_hotplug_stress.sh +++ b/test/nvmf/target/ns_hotplug_stress.sh @@ -16,6 +16,7 @@ $rpc_py nvmf_create_transport $NVMF_TRANSPORT_OPTS -u 8192 $rpc_py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001 -m 10 $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT +$rpc_py nvmf_subsystem_add_listener discovery -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT $rpc_py bdev_malloc_create 32 512 -b Malloc0 $rpc_py bdev_delay_create -b Malloc0 -d Delay0 -r 1000000 -t 1000000 -w 1000000 -n 1000000 $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Delay0 diff --git a/test/nvmf/target/nvme_cli.sh b/test/nvmf/target/nvme_cli.sh index 9c6559e127..6c71d75fc4 100755 --- a/test/nvmf/target/nvme_cli.sh +++ b/test/nvmf/target/nvme_cli.sh @@ -28,6 +28,7 @@ $rpc_py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a -s $NVMF_SERIAL -d S $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc0 $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc1 $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT +$rpc_py nvmf_subsystem_add_listener discovery -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT nvme discover -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s "$NVMF_PORT" devs=($(get_nvme_devs)) nvme_num_before_connection=${#devs[@]} diff --git a/test/nvmf/target/nvmf_lvol.sh b/test/nvmf/target/nvmf_lvol.sh index d44bc93327..935fdb2fdd 100755 --- a/test/nvmf/target/nvmf_lvol.sh +++ b/test/nvmf/target/nvmf_lvol.sh @@ -32,6 +32,7 @@ lvol=$($rpc_py bdev_lvol_create -u $lvs lvol $LVOL_BDEV_INIT_SIZE) $rpc_py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode0 -a -s SPDK0 $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode0 $lvol $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode0 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT +$rpc_py nvmf_subsystem_add_listener discovery -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT # Start random writes in the background $SPDK_EXAMPLE_DIR/perf -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT" -o 4096 -q 128 -s 512 -w randwrite -t 10 -c 0x18 & diff --git a/test/nvmf/target/zcopy.sh b/test/nvmf/target/zcopy.sh index 60454bfc98..70bd9c9c46 100755 --- a/test/nvmf/target/zcopy.sh +++ b/test/nvmf/target/zcopy.sh @@ -23,6 +23,8 @@ $rpc_py nvmf_create_transport $NVMF_TRANSPORT_OPTS -c 0 --zcopy $rpc_py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001 -m 10 $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT \ -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT +$rpc_py nvmf_subsystem_add_listener discovery -t $TEST_TRANSPORT \ + -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT $rpc_py bdev_malloc_create 32 4096 -b malloc0 $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 malloc0 -n 1