From 2d5c460058072401b1860c3a410f6ca30d95c79c Mon Sep 17 00:00:00 2001 From: Vincent Fu Date: Wed, 5 Oct 2022 12:14:25 -0700 Subject: [PATCH] test: add basic tests for trimwrite workloads We have some tests for randtrimwrite; it's easy enough to reuse the code to test trimwrite workloads. Signed-off-by: Vincent Fu --- t/jobs/t0024.fio | 36 ++++++++++++++++++++++++++++++++++++ t/run-fio-tests.py | 29 +++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 t/jobs/t0024.fio diff --git a/t/jobs/t0024.fio b/t/jobs/t0024.fio new file mode 100644 index 00000000..393a2b70 --- /dev/null +++ b/t/jobs/t0024.fio @@ -0,0 +1,36 @@ +# trimwrite data direction tests +[global] +filesize=1M +ioengine=null +rw=trimwrite +log_offset=1 +per_job_logs=0 +randrepeat=0 +write_bw_log + +# Expected result: trim issued to sequential offsets followed by write to same offset +# all offsets touched +# block sizes match +# Buggy result: something else +[basic] + +# Expected result: trim issued to sequential offsets followed by write to same offset +# all offsets trimmed +# block sizes 8k for both write and trim +# Buggy result: something else +[bs] +bs=8k,8k,8k + +# Expected result: trim issued to sequential offsets followed by write to same offset +# all offsets trimmed +# block sizes match +# Buggy result: something else +[bsrange] +bsrange=512-4k + +# Expected result: trim issued to sequential offsets followed by write to same offset +# all offsets trimmed +# block sizes match +# Buggy result: something else +[bssplit] +bsrange=512/25:1k:25:2k:25:4k/25 diff --git a/t/run-fio-tests.py b/t/run-fio-tests.py index 6833cea6..a285a25c 100755 --- a/t/run-fio-tests.py +++ b/t/run-fio-tests.py @@ -755,6 +755,26 @@ class FioJobTest_t0023(FioJobTest): self.check_all_offsets("bssplit_bw.log", 512, filesize) +class FioJobTest_t0024(FioJobTest_t0023): + """Test consists of fio test job t0024 trimwrite test.""" + + def check_result(self): + # call FioJobTest_t0023's parent to skip checks done by t0023 + super(FioJobTest_t0023, self).check_result() + + filesize = 1024*1024 + + self.check_trimwrite("basic_bw.log") + self.check_trimwrite("bs_bw.log") + self.check_trimwrite("bsrange_bw.log") + self.check_trimwrite("bssplit_bw.log") + + self.check_all_offsets("basic_bw.log", 4096, filesize) + self.check_all_offsets("bs_bw.log", 8192, filesize) + self.check_all_offsets("bsrange_bw.log", 512, filesize) + self.check_all_offsets("bssplit_bw.log", 512, filesize) + + class FioJobTest_iops_rate(FioJobTest): """Test consists of fio test job t0009 Confirm that job0 iops == 1000 @@ -1141,6 +1161,15 @@ TEST_LIST = [ 'pre_success': None, 'requirements': [], }, + { + 'test_id': 24, + 'test_class': FioJobTest_t0024, + 'job': 't0024.fio', + 'success': SUCCESS_DEFAULT, + 'pre_job': None, + 'pre_success': None, + 'requirements': [], + }, { 'test_id': 1000, 'test_class': FioExeTest, -- 2.25.1