summaryrefslogtreecommitdiff
path: root/tests/perf/001
blob: 5e622b69dd19ee09a1c6b882341ca7785f6c48a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0

#
# perf/001 Test
#
# Buffered random write performance test.
#
. ./common/preamble
_begin_fstest auto

fio_config=$tmp.fio
fio_results=$tmp.json

# Import common functions.
. ./common/filter
. ./common/perf

# real QA test starts here
_supported_fs generic
_require_scratch
_require_block_device $SCRATCH_DEV
_require_fio_results

_size=$((16 * $LOAD_FACTOR))
cat >$fio_config <<EOF
[t1]
directory=${SCRATCH_MNT}
allrandrepeat=1
readwrite=randwrite
size=${_size}G
ioengine=psync
end_fsync=1
fallocate=none
EOF

_require_fio $fio_config

_fio_results_init

# We are going to write at least 16gib, make sure our scratch fs is large enough
# to fit and not deal with any enospc overhead.
_size=$(($_size * 4 * 1024 * 1024))
_scratch_mkfs >> $seqres.full 2>&1
_scratch_mount
_require_fs_space $SCRATCH_MNT $_size

cat $fio_config >> $seqres.full
$FIO_PROG --output-format=json --output=$fio_results $fio_config

_scratch_unmount
cat $fio_results >> $seqres.full
_fio_results_compare $seq $fio_results
echo "Silence is golden"
status=0; exit