generic: fsx IO_URING soak tests
authorZorro Lang <zlang@redhat.com>
Sun, 8 Nov 2020 12:26:22 +0000 (20:26 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 15 Nov 2020 08:40:01 +0000 (16:40 +0800)
After fsx supports IO_URING read/write, add a test to do IO_URING
soak test of fsx.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc
tests/generic/616 [new file with mode: 0755]
tests/generic/616.out [new file with mode: 0644]
tests/generic/group

index 65ebfe201139ae7452370cfce66558faf65a44eb..e6a5b07b82be34843f5489c731e10f1c3c505f9e 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1956,6 +1956,22 @@ _require_aiodio()
     _require_odirect
 }
 
     _require_odirect
 }
 
+# this test requires that the kernel supports IO_URING
+_require_io_uring()
+{
+       $here/src/feature -R
+       case $? in
+       0)
+               ;;
+       1)
+               _notrun "kernel does not support IO_URING"
+               ;;
+       *)
+               _fail "unexpected error testing for IO_URING support"
+               ;;
+       esac
+}
+
 # this test requires that a test program exists under src/
 # $1 - command (require)
 #
 # this test requires that a test program exists under src/
 # $1 - command (require)
 #
diff --git a/tests/generic/616 b/tests/generic/616
new file mode 100755 (executable)
index 0000000..e2792b4
--- /dev/null
@@ -0,0 +1,58 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2020 Red Hat Inc.  All Rights Reserved.
+#
+# FS QA Test No. 616
+#
+# IO_URING soak buffered fsx test, copy from generic/522 but reduce the number
+# fsx ops to limit the testing time to be an auto group test.
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1       # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       cd /
+       rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs generic
+_require_test
+_require_io_uring
+
+# Run fsx for 100 thousand ops or more
+nr_ops=$((100000 * TIME_FACTOR))
+op_sz=$((128000 * LOAD_FACTOR))
+file_sz=$((600000 * LOAD_FACTOR))
+fsx_file=$TEST_DIR/fsx.$seq
+
+fsx_args=(-S 0)
+fsx_args+=(-U)
+fsx_args+=(-q)
+fsx_args+=(-N $nr_ops)
+fsx_args+=(-p $((nr_ops / 100)))
+fsx_args+=(-o $op_sz)
+fsx_args+=(-l $file_sz)
+
+run_fsx "${fsx_args[@]}" | sed -e '/^fsx.*/d'
+
+# success, all done
+echo "Silence is golden"
+status=0
+exit
diff --git a/tests/generic/616.out b/tests/generic/616.out
new file mode 100644 (file)
index 0000000..499116c
--- /dev/null
@@ -0,0 +1,2 @@
+QA output created by 616
+Silence is golden
index fb3c638cdc1cb354f069ad179e5a07279796d497..e6098156f00642e3e319ed0d46e77681f155e2e3 100644 (file)
 613 auto quick encrypt
 614 auto quick rw
 615 auto rw
 613 auto quick encrypt
 614 auto quick rw
 615 auto rw
+616 auto rw io_uring stress