xref: /spdk/test/bdev/bdevperf/common.sh (revision 88e3ffd7b6c5ec1ea1a660354d25f02c766092e1)
1bdevperf=$rootdir/test/bdev/bdevperf/bdevperf
2
3function create_job() {
4	local job_section=$1
5	local rw=$2
6	local filename=$3
7
8	if [[ $job_section == "global" ]]; then
9		cat <<- EOF >> "$testdir"/test.conf
10			[global]
11			filename=${filename}
12		EOF
13	fi
14	job="[${job_section}]"
15	echo $global
16	cat <<- EOF >> "$testdir"/test.conf
17		${job}
18		filename=${filename}
19		bs=1024
20		rwmixread=70
21		rw=${rw}
22		iodepth=256
23		cpumask=0xff
24	EOF
25}
26
27function get_num_jobs() {
28	echo "$1" | grep -oE "Using job config with [0-9]+ jobs" | grep -oE "[0-9]+"
29}
30
31function cleanup() {
32	rm -f $testdir/test.conf
33}
34