blktests: add a test for wbt
PATCH 1/1 blktests: add a test for wbt
There's currently no tests to verify wbt is working properly, this patch fixes that. Simply run a varied workload and measure the read latencies with wbt off, and then turn it on and verify that the read latencies go down.
Signed-off-by Josef Bacik <[email protected]>
--- common/fio | 8 +++++ common/rc | 8 +++++ tests/block/022 | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/block/022.out | 2 ++ tests/block/026 | 12 ++----- 5 files changed, 114 insertions(+), 10 deletions(-) create mode 100755 tests/block/022 create mode 100644 tests/block/022.out
common/fio +8 -0
@@ -192,3 +192,11 @@ _fio_perf_report() { TEST_RUN["$FIO_PERF_PREFIX$name"]="$value" done } + +_fio_results_key() { + local job=$1 + local key=$2 + local resultfile=$3 + + jq '.jobs[] | select(.jobname == "'"$job"'") | .'"$key" "$resultfile" +}
common/rc +8 -0
@@ -183,6 +183,14 @@ _test_dev_is_pci() { return 0 } +_test_dev_supports_wbt() { + if [[ ! -e "${TEST_DEV_SYSFS}/queue/wbt_lat_usec" ]]; then + SKIP_REASON="$TEST_DEV does not support wbt" + return 1 + fi + return 0 +} + _get_pci_dev_from_blkdev() { readlink -f "$TEST_DEV_SYSFS/device" | \ grep -Eo '[0-9a-f]{4,5}:[0-9a-f]{2}:[0-9a-f]{2}\.[0-9a-f]' | \
tests/block/022 new file +94 -0
94 lines not on this page · raw message
tests/block/022.out new file +2 -0
@@ -0,0 +1,2 @@ +Running block/022 +Test complete
tests/block/026 +2 -10
@@ -14,21 +14,13 @@ requires() { _have_program jq } -fio_results_key() { - local job=$1 - local key=$2 - local resultfile=$3 - - jq '.jobs[] | select(.jobname == "'"$job"'") | .'"$key" "$resultfile" -} - sum_read_write_bytes() { local job=$1 local resultfile=$2 local readbytes writebytes - readbytes=$(fio_results_key "$job" read.io_bytes "$resultfile") - writebytes=$(fio_results_key "$job" write.io_bytes "$resultfile") + readbytes=$(_fio_results_key "$job" read.io_bytes "$resultfile") + writebytes=$(_fio_results_key "$job" write.io_bytes "$resultfile") echo $((readbytes + writebytes)) }
Signature · 1 line
2.14.3
Quoted 6 lines · Josef Bacik
There's currently no tests to verify wbt is working properly, this patch fixes that. Simply run a varied workload and measure the read latencies with wbt off, and then turn it on and verify that the read latencies go down.
Signed-off-by Josef Bacik <[email protected]>
Similar to the io.latency test. Test itself looks fine, but sometimes fails with "Read latency too high, wbt not working?". Maybe these tests just aren't well suited for running in QEMU?