test/nvmf: convert filesystem to use run_test
This test specifically gets a little more complicated looking when we do the test this way, but the goal is to enable deterministic reporting of test completions on a per build basis. Change-Id: Ica36986f821337c22654fb4cc25f9a72a3d73517 Signed-off-by: Seth Howell <seth.howell@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476825 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:
parent
67645f4dea
commit
b9ca149ee7
@ -12,33 +12,9 @@ rpc_py="$rootdir/scripts/rpc.py"
|
|||||||
|
|
||||||
nvmftestinit
|
nvmftestinit
|
||||||
|
|
||||||
for incapsule in 0 4096; do
|
function nvmf_filesystem_create {
|
||||||
nvmfappstart "-m 0xF"
|
fstype=$1
|
||||||
|
|
||||||
$rpc_py nvmf_create_transport $NVMF_TRANSPORT_OPTS -u 8192 -c $incapsule
|
|
||||||
|
|
||||||
$rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE -b Malloc1
|
|
||||||
$rpc_py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001
|
|
||||||
$rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc1
|
|
||||||
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
timing_enter parted
|
|
||||||
parted -s /dev/nvme0n1 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
|
if [ $fstype = ext4 ]; then
|
||||||
force=-F
|
force=-F
|
||||||
else
|
else
|
||||||
@ -53,8 +29,41 @@ for incapsule in 0 4096; do
|
|||||||
rm /mnt/device/aaa
|
rm /mnt/device/aaa
|
||||||
sync
|
sync
|
||||||
umount /mnt/device
|
umount /mnt/device
|
||||||
timing_exit $fstype
|
}
|
||||||
done
|
|
||||||
|
function nvmf_filesystem_part {
|
||||||
|
incapsule=$1
|
||||||
|
|
||||||
|
nvmfappstart "-m 0xF"
|
||||||
|
|
||||||
|
$rpc_py nvmf_create_transport $NVMF_TRANSPORT_OPTS -u 8192 -c $incapsule
|
||||||
|
$rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE -b Malloc1
|
||||||
|
$rpc_py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001
|
||||||
|
$rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc1
|
||||||
|
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
parted -s /dev/nvme0n1 mklabel msdos mkpart primary '0%' '100%'
|
||||||
|
partprobe
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
if [ $incapsule -eq 0 ]; then
|
||||||
|
run_test "case" "filesystem_ext4" nvmf_filesystem_create "ext4"
|
||||||
|
run_test "case" "filesystem_btrfs" nvmf_filesystem_create "btrfs"
|
||||||
|
run_test "case" "filesystem_xfs" nvmf_filesystem_create "xfs"
|
||||||
|
else
|
||||||
|
run_test "case" "filesystem_incapsule_ext4" nvmf_filesystem_create "ext4"
|
||||||
|
run_test "case" "filesystem_incapsule_btrfs" nvmf_filesystem_create "btrfs"
|
||||||
|
run_test "case" "filesystem_incapsule_xfs" nvmf_filesystem_create "xfs"
|
||||||
|
fi
|
||||||
|
|
||||||
parted -s /dev/nvme0n1 rm 1
|
parted -s /dev/nvme0n1 rm 1
|
||||||
|
|
||||||
@ -66,6 +75,9 @@ for incapsule in 0 4096; do
|
|||||||
trap - SIGINT SIGTERM EXIT
|
trap - SIGINT SIGTERM EXIT
|
||||||
|
|
||||||
killprocess $nvmfpid
|
killprocess $nvmfpid
|
||||||
done
|
}
|
||||||
|
|
||||||
|
run_test "suite" "nvmf_filesystem_no_incapsule" nvmf_filesystem_part 0
|
||||||
|
run_test "suite" "nvmf_filesystem_incapsule" nvmf_filesystem_part 4096
|
||||||
|
|
||||||
nvmftestfini
|
nvmftestfini
|
||||||
|
Loading…
Reference in New Issue
Block a user