]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
blktests: add fio data verification routine
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Mon, 11 Jun 2018 09:15:46 +0000 (05:15 -0400)
committerOmar Sandoval <osandov@fb.com>
Mon, 11 Jun 2018 21:56:05 +0000 (14:56 -0700)
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
common/fio

index e83258db81f8b298d105617a2b410dc5439265d8..0f93632c0382732e8be211e4d9e2c023afb3f421 100644 (file)
@@ -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
@@ -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