-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from katlapinka/ocf-di-test
[experimental]Add data integrity test for OCF+SPDK
- Loading branch information
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[global] | ||
thread=1 | ||
group_reporting=1 | ||
direct=1 | ||
rw=write | ||
iodepth=16 | ||
bs=4K | ||
size=100M | ||
|
||
[job] | ||
filename=cas_dev |