Commit 5d8af4ee authored by Jim Harris's avatar Jim Harris
Browse files

test/nvmf: relax subsystem filter in ns_masking.sh



`nvme list-subsys` returns an array of objects, one for each HostNQN. In some
cases, the first entry might be the OS's hostnqn, with an SSD subsystem. Then
the ns_masking.sh subsystem ends up in the second entry.

But the filter was explicitly only looking at the first entry. So relax
this to look at all entries.

Note that we could filter on the hostnqn, but that just adds more code to
the test script, filtering on subsystem NQN will always be sufficient.

Fixes issue #3337.

Signed-off-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: Idf7adfe6326d0468e576c190e7086a80213fe7eb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22747


Reviewed-by: default avatarBen Walker <ben@nvidia.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 62f5c528
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ function connect() {
		-a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT" -i 4
	waitforserial "$NVMF_SERIAL" $1
	ctrl_id=$(nvme list-subsys -o json \
		| jq -r '.[0].Subsystems[] | select(.NQN=='\"$SUBSYSNQN\"') | .Paths[0].Name')
		| jq -r '.[].Subsystems[] | select(.NQN=='\"$SUBSYSNQN\"') | .Paths[0].Name')
}

function disconnect() {