Commit e3263286 authored by Seth Howell's avatar Seth Howell Committed by Daniel Verkamp
Browse files

test/nvmf: confirm kernel finds NVMe-oF namespaces



In Fedora 27 the nvme program returns before the kernel has loaded the
namespces associated with the subsystem. This patch ensures that those
namespaces can be enumerated by the kernel before we run any tests on
them.

Change-Id: I77505ed5cd5b1118a841650851fa5ecaf76f5619
Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/407829


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent b332897a
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -468,6 +468,22 @@ function discover_bdevs()
	rm -f /var/run/spdk_bdev0
}

function waitforblk()
{
	local i=0
	while ! lsblk -l -o NAME | grep -q -w $1; do
		[ $i -lt 15 ] || break
		i=$[$i+1]
		sleep 1
	done

	if ! lsblk -l -o NAME | grep -q -w $1; then
		return 1
	fi

	return 0
}

function fio_config_gen()
{
	local config_file=$1
+3 −0
Original line number Diff line number Diff line
@@ -39,6 +39,9 @@ $rpc_py construct_nvmf_subsystem nqn.2016-06.io.spdk:cnode1 "trtype:RDMA traddr:

nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode1" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"

waitforblk "nvme0n1"
waitforblk "nvme0n2"

mkdir -p /mnt/device

devs=`lsblk -l -o NAME | grep nvme`
+3 −0
Original line number Diff line number Diff line
@@ -43,6 +43,9 @@ done

nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode1" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"

waitforblk "nvme0n1"
waitforblk "nvme0n2"

$testdir/nvmf_fio.py 4096 1 write 1 verify
$testdir/nvmf_fio.py 4096 1 randwrite 1 verify
$testdir/nvmf_fio.py 4096 128 write 1 verify
+5 −0
Original line number Diff line number Diff line
@@ -71,7 +71,12 @@ for i in `seq 1 $SUBSYS_NR`; do
done

for i in `seq 1 $SUBSYS_NR`; do
	k=$[$i-1]
	nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode${i}" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"

	for j in `seq 1 10`; do
		waitforblk "nvme${k}n${j}"
	done
done

$testdir/../fio/nvmf_fio.py 262144 64 randwrite 10 verify
+5 −0
Original line number Diff line number Diff line
@@ -48,7 +48,12 @@ do
done

for i in `seq 1 $NVMF_SUBSYS`; do
	k=$[$i-1]
	nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode${i}" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"

	for j in `seq 1 10`; do
		waitforblk "nvme${k}n${j}"
	done
done

$testdir/../fio/nvmf_fio.py 262144 64 read 10
Loading