From 162336079df221454a273e1c306bcb0531407a1b Mon Sep 17 00:00:00 2001 From: Qian Yingjin Date: Tue, 9 Aug 2022 03:56:23 -0400 Subject: [PATCH] LU-15994 tests: add testing for io_uring via fio This patch adds test case for io_uring I/O engine via fio. Test-Parameters: trivial testlist=sanity Signed-off-by: Qian Yingjin Change-Id: I0f2e371f91c02dc76644f42e5d1055ec200597c6 Reviewed-on: https://review.whamcloud.com/48167 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Bobi Jam Reviewed-by: Oleg Drokin --- lustre/tests/sanity.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 214611e..58577c2 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -28679,6 +28679,33 @@ test_905() { } run_test 905 "bad or new opcode should not stuck client" +test_906() { + grep -q io_uring_setup /proc/kallsyms || + skip "Client OS does not support io_uring I/O engine" + io_uring_probe || skip "kernel does not support io_uring fully" + which fio || skip_env "no fio installed" + fio --enghelp | grep -q io_uring || + skip_env "fio does not support io_uring I/O engine" + + local file=$DIR/$tfile + local ioengine="io_uring" + local numjobs=2 + local size=50M + + fio --name=seqwrite --ioengine=$ioengine \ + --bs=$PAGE_SIZE --direct=1 --numjobs=$numjobs \ + --iodepth=64 --size=$size --filename=$file --rw=write || + error "fio seqwrite $file failed" + + fio --name=seqread --ioengine=$ioengine \ + --bs=$PAGE_SIZE --direct=1 --numjobs=$numjobs \ + --iodepth=64 --size=$size --filename=$file --rw=read || + error "fio seqread $file failed" + + rm -f $file || error "rm -f $file failed" +} +run_test 906 "Simple test for io_uring I/O engine via fio" + complete $SECONDS [ -f $EXT2_DEV ] && rm $EXT2_DEV || true check_and_cleanup_lustre -- 1.8.3.1