test: add basic tests for trimwrite workloads
authorVincent Fu <vincent.fu@samsung.com>
Wed, 5 Oct 2022 19:14:25 +0000 (12:14 -0700)
committerVincent Fu <vincent.fu@samsung.com>
Wed, 5 Oct 2022 22:15:40 +0000 (18:15 -0400)
We have some tests for randtrimwrite; it's easy enough to reuse the code
to test trimwrite workloads.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
t/jobs/t0024.fio [new file with mode: 0644]
t/run-fio-tests.py

diff --git a/t/jobs/t0024.fio b/t/jobs/t0024.fio
new file mode 100644 (file)
index 0000000..393a2b7
--- /dev/null
@@ -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
index 6833cea6e2cc288685908c183341f1fc7bd3cb34..a285a25cd0c68caebf628db8104061e9f1cb88cc 100755 (executable)
@@ -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,