Add a test case to confirm that with mix sequential and random workload i.e. with fio option percentage_random set to 0 < percentage_random < 100 we are actually writing the specified size. The test includes pre and post job files, where the former lays out 3 I/O files each of size 4MiB to be used by latter to do random write with 1MiB size per job. This is intended to cover such cases where fio generates offset just at the end of I/O region resulting in the next sequential I/O to be outside the region, when the size is less than actual filesize. This covers #1486 Signed-off-by: Ankit Kumar <ankit.kumar@xxxxxxxxxxx> --- t/jobs/t0028-post.fio | 27 +++++++++++++++++++++++++++ t/jobs/t0028-pre.fio | 21 +++++++++++++++++++++ t/run-fio-tests.py | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 t/jobs/t0028-post.fio create mode 100644 t/jobs/t0028-pre.fio diff --git a/t/jobs/t0028-post.fio b/t/jobs/t0028-post.fio new file mode 100644 index 00000000..d5ad88ca --- /dev/null +++ b/t/jobs/t0028-post.fio @@ -0,0 +1,27 @@ +# specify mixture of sequential and random workloads +[global] +ioengine=libaio +size=1M +rw=randwrite + +# Expected result: 1M data written +# Buggy result: Less than 1M data written +[basic] +bs=4K +percentage_random=50 + +# Expected result: 1M data written +# Buggy result: Less than 1M data written +[rand_skewed] +bs=4K +randseed=47827 +percentage_random=90 +iodepth=32 + +# Expected result: 1M data written +# Buggy result: Less than 1M data written +[bsrange] +bsrange=512-4K +randseed=7847 +percentage_random=50 +iodepth=32 diff --git a/t/jobs/t0028-pre.fio b/t/jobs/t0028-pre.fio new file mode 100644 index 00000000..dafc4b06 --- /dev/null +++ b/t/jobs/t0028-pre.fio @@ -0,0 +1,21 @@ +# specify mixture of sequential and random workloads +[global] +ioengine=libaio +size=4M +rw=randwrite + +[basic] +bs=4K +percentage_random=50 + +[rand_skewed] +bs=4K +randseed=47827 +percentage_random=90 +iodepth=32 + +[bsrange] +bsrange=512-4K +randseed=7847 +percentage_random=50 +iodepth=32 diff --git a/t/run-fio-tests.py b/t/run-fio-tests.py index e5b307ac..500ca841 100755 --- a/t/run-fio-tests.py +++ b/t/run-fio-tests.py @@ -800,6 +800,30 @@ class FioJobTest_t0025(FioJobTest): self.passed = False +class FioJobTest_t0028(FioJobTest): + """Test consists for test job t0028-post.fio + Confirm for all jobs that write['io_kbytes'] == 1024""" + + def check_result(self): + super(FioJobTest_t0028, self).check_result() + + if not self.passed: + return + + if self.json_data['jobs'][0]['write']['io_kbytes'] != 1024: + self.passed = False + self.failure_reason = "{basic} data written != 1024KiB,".format(self.failure_reason) + + if self.json_data['jobs'][1]['write']['io_kbytes'] != 1024: + self.passed = False + self.failure_reason = "{rand_skewed} data written != 1024KiB,".format(self.failure_reason) + + kbytes = self.json_data['jobs'][2]['write']['io_kbytes'] + if kbytes < 1021 or kbytes > 1027: + self.passed = False + self.failure_reason = "{bsrange} data written != 1024KiB,".format(self.failure_reason) + + class FioJobTest_iops_rate(FioJobTest): """Test consists of fio test job t0009 Confirm that job0 iops == 1000 @@ -1214,6 +1238,16 @@ TEST_LIST = [ 'pre_success': None, 'requirements': [Requirements.not_windows], }, + { + 'test_id': 28, + 'test_class': FioJobTest_t0028, + 'job': 't0028-post.fio', + 'success': SUCCESS_DEFAULT, + 'pre_job': 't0028-pre.fio', + 'pre_success': None, + 'output_format': 'json', + 'requirements': [Requirements.linux, Requirements.libaio], + }, { 'test_id': 1000, 'test_class': FioExeTest, -- 2.17.1