overlay: run unionmount testsuite test cases
[xfstests-dev.git] / tests / perf / 001
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3
4 #
5 # perf/001 Test
6 #
7 # Buffered random write performance test.
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 fio_config=$tmp.fio
16 fio_results=$tmp.json
17 status=1        # failure is the default!
18 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
19
20 # get standard environment, filters and checks
21 . ./common/rc
22 . ./common/filter
23 . ./common/perf
24
25 # real QA test starts here
26 _supported_fs generic
27 _supported_os Linux
28 _require_scratch
29 _require_block_device $SCRATCH_DEV
30 _require_fio_results
31
32 rm -f $seqres.full
33
34 _size=$((16 * $LOAD_FACTOR))
35 cat >$fio_config <<EOF
36 [t1]
37 directory=${SCRATCH_MNT}
38 allrandrepeat=1
39 readwrite=randwrite
40 size=${_size}G
41 ioengine=psync
42 end_fsync=1
43 fallocate=none
44 EOF
45
46 _require_fio $fio_config
47
48 _fio_results_init
49
50 # We are going to write at least 16gib, make sure our scratch fs is large enough
51 # to fit and not deal with any enospc overhead.
52 _size=$(($_size * 4 * 1024 * 1024))
53 _scratch_mkfs >> $seqres.full 2>&1
54 _scratch_mount
55 _require_fs_space $SCRATCH_MNT $_size
56
57 cat $fio_config >> $seqres.full
58 $FIO_PROG --output-format=json --output=$fio_results $fio_config
59
60 _scratch_unmount
61 cat $fio_results >> $seqres.full
62 _fio_results_compare $seq $fio_results
63 echo "Silence is golden"
64 status=0; exit