common/rc: add _scratch_{u}mount_idmapped() helpers
[xfstests-dev.git] / tests / generic / 113
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2005 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 113
6 #
7 # aio-stress
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=0        # success is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20     cd /
21     rm -f $TEST_DIR/aio-stress.$$.*
22 }
23
24 # get standard environment, filters and checks
25 . ./common/rc
26 . ./common/filter
27
28 _do_test()
29 {
30     _n="$1"
31     _param="$2"
32     _count="$3"
33     _nproc="$4"
34
35     _files="$TEST_DIR/aiostress.$$.$_n"
36     __proc=$_nproc
37     [ $__proc -gt 1 ] && _param="-t $__proc $_param"
38     while [ $__proc -gt 1 ]; do
39         _files="$_files $TEST_DIR/aiostress.$$.$_n.$__proc"
40         let __proc=$__proc-1
41     done
42     rm -f $_files
43  
44     echo ""
45     echo "-----------------------------------------------"
46     echo "aio-stress.$_n : $_param"
47     echo "-----------------------------------------------"
48     if ! $here/ltp/aio-stress $_param $AIOSTRESS_AVOID -I $_count $_files >>$tmp.out 2>&1
49     then
50         echo "    aio-stress (count=$_count) returned $?"
51         cat $tmp.out
52         status=1
53         exit
54     fi
55
56     _check_test_fs
57     rm -f $_files
58 }
59
60 # real QA test starts here
61 _supported_fs generic
62 _require_test
63 _require_aio
64 _require_odirect
65
66 [ -x $here/ltp/aio-stress ] || _notrun "aio-stress not built for this platform"
67
68 echo "brevity is wit..."
69
70 count=1000
71 procs=20
72
73 _check_test_fs
74
75 # the default
76 _do_test 1 "-s 120m" $count 1
77
78 # and the default with multiprocess
79 _do_test 2 "-s 10m" $count $procs
80
81 # as above, but now using direct IO
82 _do_test 3 "-s 10m -O" $count $procs
83
84 # dio with O_SYNC and unwritten extent conversion
85 _do_test 4 "-s 10m -O -S" $count $procs
86
87 # random dio writes with O_SYNC and unwritten extent conversion
88 _do_test 5 "-s 10m -O -S -o 2" $count $procs
89
90 exit