diff --git a/test/ocf/integrity/di_12h.fio b/test/ocf/integrity/di_12h.fio new file mode 100644 index 00000000000..7a8ade4df63 --- /dev/null +++ b/test/ocf/integrity/di_12h.fio @@ -0,0 +1,15 @@ +[global] +thread=1 +group_reporting=1 +direct=1 +time_based=1 +do_verify=1 +verify=meta +verify_backlog=1024 +iodepth=128 +bs=4K +runtime=43200 + +[job] +rw=randrw +filename=cas_dev diff --git a/test/ocf/integrity/di_12h.sh b/test/ocf/integrity/di_12h.sh new file mode 100755 index 00000000000..d9d6b8ef637 --- /dev/null +++ b/test/ocf/integrity/di_12h.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +if [ $# -ne 1 ] +then + echo >&2 "There should be cache mode passed as the script's argument." + exit 1 +fi + + +curdir=$(dirname $(readlink -f "${BASH_SOURCE[0]}")) +rootdir=$(readlink -f $curdir/../../..) +source $rootdir/test/ocf/common.sh +source $rootdir/scripts/common.sh +source $rootdir/test/common/autotest_common.sh +rpc_py=$rootdir/scripts/rpc.py + +# Setup NVMe devices +$rootdir/scripts/setup.sh +prepare_nvme_config + +# Start SPDK app +start_spdk "$curdir/config" + +# Create partitions for cache and core device +create_partitions Nvme0n1 1 100 +create_partitions Nvme1n1 1 150 + +# Create CAS device +$rpc_py bdev_ocf_create cas_dev $1 Nvme0n1p0 Nvme1n1p0 --create --force + +# Save current config and stop SPDK app +save_and_clean_bdev_config +stop_spdk + +# Run fio to fill cache space +fio_bdev $curdir/fill.fio --aux-path=/tmp/ --ioengine=spdk_bdev --spdk_json_conf="$curdir/config" + +# Check if cache is filled properly +start_spdk "$curdir/config" + +occupancy=$(get_stat cas_dev usage occupancy percentage) +if (( $(echo "100-$occupancy > 5" |bc -l) )) +then + echo >&2 "Cache is not filled properly. Occupancy=$occupancy" + exit 1 +fi + +stop_spdk + +# Run fio with data integrity verify option for 12h +fio_bdev $curdir/di_12h.fio --aux-path=/tmp/ --ioengine=spdk_bdev --spdk_json_conf="$curdir/config" + diff --git a/test/ocf/integrity/fill.fio b/test/ocf/integrity/fill.fio new file mode 100644 index 00000000000..66b8e7f5d31 --- /dev/null +++ b/test/ocf/integrity/fill.fio @@ -0,0 +1,11 @@ +[global] +thread=1 +group_reporting=1 +direct=1 +rw=write +iodepth=16 +bs=4K +size=100M + +[job] +filename=cas_dev