Skip to content

Commit

Permalink
blktests: add fio data verification routine
Browse files Browse the repository at this point in the history
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
  • Loading branch information
ChaitanayaKulkarni authored and osandov committed Jun 11, 2018
1 parent 1e7b866 commit 3891768
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion common/fio
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,15 @@ _fio_perf() {
# tests that should run for a specific amount of time.
_run_fio() {
local args=("--output=$TMPDIR/fio_perf" "--output-format=terse" "--terse-version=4" "--group_reporting=1")

if [[ -v TIMEOUT ]]; then
args+=("--runtime=$TIMEOUT")
fi
fio "${args[@]}" "$@"

if ! fio "${args[@]}" "$@"; then
echo "fio exited with status $?"
cat "$TMPDIR"/fio_perf
fi
}

# Wrapper around _run_fio used if you need some I/O but don't really care much
Expand All @@ -175,6 +180,11 @@ _run_fio_rand_io() {
--name=reads --direct=1 "$@"
}

_run_fio_verify_io() {
_run_fio --name=verify --rw=randwrite --direct=1 --ioengine=libaio --bs=4k \
--norandommap --iodepth=16 --verify=crc32c "$@"
}

_fio_perf_report() {
# If there is more than one group, we don't know what to report.
if [[ $(wc -l < "$TMPDIR/fio_perf") -gt 1 ]]; then
Expand Down

0 comments on commit 3891768

Please sign in to comment.