From: Ankit Kumar <ankit.kumar@samsung.com>
To: axboe@kernel.dk
Cc: fio@vger.kernel.org, vincentfu@gmail.com,
Ankit Kumar <ankit.kumar@samsung.com>
Subject: [PATCH 2/2] test: add test for mix random and sequential workload
Date: Fri, 18 Nov 2022 10:44:54 +0530 [thread overview]
Message-ID: <20221118051454.31288-3-ankit.kumar@samsung.com> (raw)
In-Reply-To: <20221118051454.31288-1-ankit.kumar@samsung.com>
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@samsung.com>
---
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
prev parent reply other threads:[~2022-11-18 5:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20221118052632epcas5p48ffea1e5c9b88f99b2bc90147e93321d@epcas5p4.samsung.com>
2022-11-18 5:14 ` [PATCH 0/2] Fix percentage random workload and add test case Ankit Kumar
2022-11-18 5:14 ` [PATCH 1/2] io_u: fix offset generation for mix of random and sequential workload Ankit Kumar
2022-11-28 21:57 ` Vincent Fu
2022-11-30 10:50 ` Ankit Kumar
2022-11-30 19:10 ` Vincent Fu
2022-11-18 5:14 ` Ankit Kumar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221118051454.31288-3-ankit.kumar@samsung.com \
--to=ankit.kumar@samsung.com \
--cc=axboe@kernel.dk \
--cc=fio@vger.kernel.org \
--cc=vincentfu@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.