Commit 25503b96 authored by Kozlowski Mateusz's avatar Kozlowski Mateusz Committed by Tomasz Zawadzki
Browse files

FTL: Add write tests

parent e8c5ccf0
Loading
Loading
Loading
Loading

test/ftl/common.sh

0 → 100644
+48 −0
Original line number Diff line number Diff line
# Common utility functions to be sourced by the libftl test scripts

function clear_lvols() {
	stores=$("$rootdir/scripts/rpc.py" bdev_lvol_get_lvstores | jq -r ".[] | .uuid")
	for lvs in $stores; do
		"$rootdir/scripts/rpc.py" bdev_lvol_delete_lvstore -u $lvs
	done
}

function create_nv_cache_bdev() {
	local name=$1
	local cache_bdf=$2
	local base_bdev=$3

	# use 5% space of base bdev
	local size=$(($(get_bdev_size $base_bdev) * 5 / 100))

	# Create NVMe bdev on specified device and split it so that it has the desired size
	local nvc_bdev
	nvc_bdev=$($rootdir/scripts/rpc.py bdev_nvme_attach_controller -b $name -t PCIe -a $cache_bdf)

	local nvc_size
	nvc_size=$(get_bdev_size $nvc_bdev)
	if [[ $size -gt $nvc_size ]]; then
		size=nvc_size
	fi
	$rootdir/scripts/rpc.py bdev_split_create $nvc_bdev -s $size 1
}

function create_base_bdev() {
	local name=$1
	local base_bdf=$2
	local size=$3

	# Create NVMe bdev on specified device and split it so that it has the desired size
	local base_bdev
	base_bdev=$($rootdir/scripts/rpc.py bdev_nvme_attach_controller -b $name -t PCIe -a $base_bdf)

	local base_size
	base_size=$(get_bdev_size $base_bdev)
	if [[ $size -le $base_size ]]; then
		$rootdir/scripts/rpc.py bdev_split_create $base_bdev -s $size 1
	else
		clear_lvols
		lvs=$($rootdir/scripts/rpc.py bdev_lvol_create_lvstore $base_bdev lvs)
		$rootdir/scripts/rpc.py bdev_lvol_create ${base_bdev}p0 $size -t -u $lvs
	fi
}
+20 −0
Original line number Diff line number Diff line
[global]
ioengine=spdk_bdev
spdk_json_conf=${FTL_JSON_CONF}
filename=${FTL_BDEV_NAME}
thread=1
direct=1
iodepth=128
rw=randwrite
verify=crc32c
do_verify=0
verify_dump=0
verify_state_save=0
verify_fatal=1
bs=4k
random_distribution=normal
serialize_overlap=1
io_size=256M

[test]
numjobs=1
+25 −0
Original line number Diff line number Diff line
[global]
ioengine=spdk_bdev
spdk_json_conf=${FTL_JSON_CONF}
filename=${FTL_BDEV_NAME}
thread=1
direct=1
iodepth=128
rw=randwrite
verify=crc32c
do_verify=0
verify_dump=0
verify_state_save=0
verify_backlog=5000
verify_fatal=1
bs=4k
random_distribution=normal
serialize_overlap=1
io_size=256M

[first_half]
offset=0%
size=50%

[second_half]
offset=50%
+24 −0
Original line number Diff line number Diff line
[global]
ioengine=spdk_bdev
spdk_json_conf=${FTL_JSON_CONF}
filename=${FTL_BDEV_NAME}
thread=1
direct=1
iodepth=2048
size=100%

[write]
numjobs=1
rw=randwrite
verify=crc32c
do_verify=0
verify_dump=0
verify_state_save=0
verify_fatal=1
bs=512k
serialize_overlap=1
norandommap

[read]
rw=randread
bs=512k
+20 −0
Original line number Diff line number Diff line
[global]
ioengine=spdk_bdev
spdk_json_conf=${FTL_JSON_CONF}
filename=${FTL_BDEV_NAME}
thread=1
direct=1
iodepth=1
rw=randwrite
size=256M
verify=crc32c
do_verify=0
verify_dump=0
verify_state_save=0
verify_backlog=16
verify_fatal=1
bs=68k
random_distribution=normal

[test]
numjobs=1
Loading