Commit 67645f4d authored by Seth Howell's avatar Seth Howell Committed by Tomasz Zawadzki
Browse files

test/nvmf/filesystem: explicitly use nvme0n1



This test has always relied on /dev/nvme0n1 being the location of our
test drive which means that it is the only one in the system at the time
the test is run.

So instead of trying to loop multiple non-existant nvme drives, just
call it out directly.

Also, add a todo to remove the dependence on NVMe0n1 since we could run
this test on a machine where the main filesystem is on an NVMe drive
which would break this test.

Change-Id: Ibb2448d9367a5c80d85a1c91b0c6e44e58237751
Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476952


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent d29169bd
Loading
Loading
Loading
Loading
+28 −29
Original line number Diff line number Diff line
@@ -24,15 +24,15 @@ for incapsule in 0 4096; do

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

	# TODO: fix this to wait for the proper NVMe device.
	# if we are hosting the local filesystem on an NVMe drive, this test will fail
	# because it relies on the no other NVMe drives being present in the system.
	waitforblk "nvme0n1"

	mkdir -p /mnt/device

	devs=$(lsblk -l -o NAME | grep nvme)

	for dev in $devs; do
	timing_enter parted
		parted -s /dev/$dev mklabel msdos  mkpart primary '0%' '100%'
	parted -s /dev/nvme0n1 mklabel msdos  mkpart primary '0%' '100%'
	partprobe
	timing_exit parted
	sleep 1
@@ -45,9 +45,9 @@ for incapsule in 0 4096; do
			force=-f
		fi

			mkfs.${fstype} $force /dev/${dev}p1
		mkfs.${fstype} $force /dev/nvme0n1p1

			mount /dev/${dev}p1 /mnt/device
		mount /dev/nvme0n1p1 /mnt/device
		touch /mnt/device/aaa
		sync
		rm /mnt/device/aaa
@@ -56,8 +56,7 @@ for incapsule in 0 4096; do
		timing_exit $fstype
	done

		parted -s /dev/$dev rm 1
	done
	parted -s /dev/nvme0n1 rm 1

	sync
	nvme disconnect -n "nqn.2016-06.io.spdk:cnode1" || true