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: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476952
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Seth Howell 2019-12-05 14:05:18 -07:00 committed by Tomasz Zawadzki
parent d29169bd77
commit 67645f4dea

View File

@ -24,41 +24,40 @@ 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)
timing_enter parted
parted -s /dev/nvme0n1 mklabel msdos mkpart primary '0%' '100%'
partprobe
timing_exit parted
sleep 1
for dev in $devs; do
timing_enter parted
parted -s /dev/$dev mklabel msdos mkpart primary '0%' '100%'
partprobe
timing_exit parted
sleep 1
for fstype in "ext4" "btrfs" "xfs"; do
timing_enter $fstype
if [ $fstype = ext4 ]; then
force=-F
else
force=-f
fi
for fstype in "ext4" "btrfs" "xfs"; do
timing_enter $fstype
if [ $fstype = ext4 ]; then
force=-F
else
force=-f
fi
mkfs.${fstype} $force /dev/nvme0n1p1
mkfs.${fstype} $force /dev/${dev}p1
mount /dev/${dev}p1 /mnt/device
touch /mnt/device/aaa
sync
rm /mnt/device/aaa
sync
umount /mnt/device
timing_exit $fstype
done
parted -s /dev/$dev rm 1
mount /dev/nvme0n1p1 /mnt/device
touch /mnt/device/aaa
sync
rm /mnt/device/aaa
sync
umount /mnt/device
timing_exit $fstype
done
parted -s /dev/nvme0n1 rm 1
sync
nvme disconnect -n "nqn.2016-06.io.spdk:cnode1" || true