Commit 1a88f528 authored by Jim Harris's avatar Jim Harris
Browse files

test/nvmf: dump `nvme list-subsys` when ns_masking.sh connect fails



This was useful to help debug issue #3337. It helps determine if the
filter turned up empty because the connect failed or we filtered the JSON
incorrectly.

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


Reviewed-by: default avatarBen Walker <ben@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
parent 5d8af4ee
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -20,6 +20,14 @@ function connect() {
	waitforserial "$NVMF_SERIAL" $1
	ctrl_id=$(nvme list-subsys -o json \
		| jq -r '.[].Subsystems[] | select(.NQN=='\"$SUBSYSNQN\"') | .Paths[0].Name')
	if [[ -z "$ctrl_id" ]]; then
		# The filter returned empty, so dump the raw JSON contents so we
		# can try to debug why - whether the connect actually failed
		# or we just aren't filtering the JSON correctly.
		# We ran into this with issue #3337, which is now resolved, but
		# leave this here just in case this pops up again in the future.
		nvme list-subsys -o json
	fi
}

function disconnect() {