Skip to content

Commit

Permalink
test/nvmf: test InCapsuleDataSize 0 in filesystem.sh
Browse files Browse the repository at this point in the history
Change-Id: I939aef31473b6a7acae879fb5b03a62154390cac
Signed-off-by: Daniel Verkamp <[email protected]>
Reviewed-on: https://review.gerrithub.io/418729
Tested-by: SPDK Automated Test System <[email protected]>
Reviewed-by: Jim Harris <[email protected]>
Reviewed-by: Ben Walker <[email protected]>
  • Loading branch information
danielverkamp committed Jul 9, 2018
1 parent 6138d3b commit 1fcfc42
Showing 1 changed file with 50 additions and 44 deletions.
94 changes: 50 additions & 44 deletions test/nvmf/filesystem/filesystem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,67 +20,73 @@ if [ -z $NVMF_FIRST_TARGET_IP ]; then
fi

timing_enter fs_test
timing_enter start_nvmf_tgt
# Start up the NVMf target in another process
$NVMF_APP -c $testdir/../nvmf.conf &
nvmfpid=$!

trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
for incapsule in 0 4096; do
# Start up the NVMf target in another process
cp $testdir/../nvmf.conf /tmp/nvmf.conf
echo "InCapsuleDataSize $incapsule" >> /tmp/nvmf.conf
$NVMF_APP -c /tmp/nvmf.conf &
nvmfpid=$!

waitforlisten $nvmfpid
timing_exit start_nvmf_tgt
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT

bdevs="$bdevs $($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
bdevs="$bdevs $($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
waitforlisten $nvmfpid

modprobe -v nvme-rdma
bdevs="$bdevs $($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
bdevs="$bdevs $($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"

$rpc_py construct_nvmf_subsystem nqn.2016-06.io.spdk:cnode1 "trtype:RDMA traddr:$NVMF_FIRST_TARGET_IP trsvcid:4420" "" -a -s SPDK00000000000001 -n "$bdevs"
modprobe -v nvme-rdma

nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode1" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
$rpc_py construct_nvmf_subsystem nqn.2016-06.io.spdk:cnode1 "trtype:RDMA traddr:$NVMF_FIRST_TARGET_IP trsvcid:4420" "" -a -s SPDK00000000000001 -n "$bdevs"

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

mkdir -p /mnt/device
waitforblk "nvme0n1"
waitforblk "nvme0n2"

devs=`lsblk -l -o NAME | grep nvme`
mkdir -p /mnt/device

for dev in $devs; do
timing_enter parted
parted -s /dev/$dev mklabel msdos mkpart primary '0%' '100%'
timing_exit parted
sleep 1
devs=`lsblk -l -o NAME | grep nvme`

for fstype in "ext4" "btrfs" "xfs"; do
timing_enter $fstype
if [ $fstype = ext4 ]; then
force=-F
else
force=-f
fi
for dev in $devs; do
timing_enter parted
parted -s /dev/$dev mklabel msdos mkpart primary '0%' '100%'
timing_exit parted
sleep 1

mkfs.${fstype} $force /dev/${dev}p1
for fstype in "ext4" "btrfs" "xfs"; do
timing_enter $fstype
if [ $fstype = ext4 ]; then
force=-F
else
force=-f
fi

mount /dev/${dev}p1 /mnt/device
touch /mnt/device/aaa
sync
rm /mnt/device/aaa
sync
umount /mnt/device
timing_exit $fstype
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
done

parted -s /dev/$dev rm 1
done
sync
nvme disconnect -n "nqn.2016-06.io.spdk:cnode1" || true

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

$rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode1
trap - SIGINT SIGTERM EXIT

nvmfcleanup
killprocess $nvmfpid
done

trap - SIGINT SIGTERM EXIT
rm -f /tmp/nvmf.conf

nvmfcleanup
killprocess $nvmfpid
timing_exit fs_test

0 comments on commit 1fcfc42

Please sign in to comment.