test/nvme: only run setup.sh test on Linux
For now, our scripts don't support detecting mounted filesystems on NVMe devices on FreeBSD, so only run those tests on Linux. Change-Id: I558715bf4e95eaad2dd2d8a546626269c0837edb Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/393420 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
71db3a0870
commit
581107c77a
@ -31,19 +31,20 @@ function get_nvme_name_from_bdf {
|
|||||||
|
|
||||||
timing_enter nvme
|
timing_enter nvme
|
||||||
|
|
||||||
# check that our setup.sh script does not bind NVMe devices to uio/vfio if they
|
if [ `uname` = Linux ]; then
|
||||||
# have an active mountpoint
|
# check that our setup.sh script does not bind NVMe devices to uio/vfio if they
|
||||||
$rootdir/scripts/setup.sh reset
|
# have an active mountpoint
|
||||||
# give kernel nvme driver some time to create the block devices before we start looking for them
|
$rootdir/scripts/setup.sh reset
|
||||||
sleep 1
|
# give kernel nvme driver some time to create the block devices before we start looking for them
|
||||||
blkname=''
|
sleep 1
|
||||||
# first, find an NVMe device that does not have an active mountpoint already;
|
blkname=''
|
||||||
# this covers rare case where someone is running this test script on a system
|
# first, find an NVMe device that does not have an active mountpoint already;
|
||||||
# that has a mounted NVMe filesystem
|
# this covers rare case where someone is running this test script on a system
|
||||||
#
|
# that has a mounted NVMe filesystem
|
||||||
# note: more work probably needs to be done to properly handle devices with multiple
|
#
|
||||||
# namespaces
|
# note: more work probably needs to be done to properly handle devices with multiple
|
||||||
for bdf in $(linux_iter_pci 0108); do
|
# namespaces
|
||||||
|
for bdf in $(linux_iter_pci 0108); do
|
||||||
get_nvme_name_from_bdf "$bdf" blkname
|
get_nvme_name_from_bdf "$bdf" blkname
|
||||||
if [ "$blkname" != "" ]; then
|
if [ "$blkname" != "" ]; then
|
||||||
mountpoints=$(lsblk /dev/$blkname --output MOUNTPOINT -n | wc -w)
|
mountpoints=$(lsblk /dev/$blkname --output MOUNTPOINT -n | wc -w)
|
||||||
@ -53,11 +54,11 @@ for bdf in $(linux_iter_pci 0108); do
|
|||||||
blkname=''
|
blkname=''
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# if we found an NVMe block device without an active mountpoint, create and mount
|
# if we found an NVMe block device without an active mountpoint, create and mount
|
||||||
# a filesystem on it for purposes of testing the setup.sh script
|
# a filesystem on it for purposes of testing the setup.sh script
|
||||||
if [ "$blkname" != "" ]; then
|
if [ "$blkname" != "" ]; then
|
||||||
parted -s /dev/$blkname mklabel gpt
|
parted -s /dev/$blkname mklabel gpt
|
||||||
# just create a 100MB partition - this tests our ability to detect mountpoints
|
# just create a 100MB partition - this tests our ability to detect mountpoints
|
||||||
# on partitions of the device, not just the device itself; it also is faster
|
# on partitions of the device, not just the device itself; it also is faster
|
||||||
@ -83,8 +84,9 @@ if [ "$blkname" != "" ]; then
|
|||||||
if [ "$driver" = "nvme" ]; then
|
if [ "$driver" = "nvme" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
$rootdir/scripts/setup.sh
|
$rootdir/scripts/setup.sh
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ `uname` = Linux ]; then
|
if [ `uname` = Linux ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user