Spdk/test/bdev/bdevperf/common.sh
Michal Berger 588dfe314b Add SPDX header to various files
They were missed by the initial set of patches which introduced this
header as a mandatory one across different types of files.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I3f9b37d41298c843e1648e72fe8593768ccd37e0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15423
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-11-29 08:27:51 +00:00

38 lines
690 B
Bash

# SPDX-License-Identifier: BSD-3-Clause
# Copyright (C) 2020 Intel Corporation.
# All rights reserved.
bdevperf=$rootdir/build/examples/bdevperf
function create_job() {
local job_section=$1
local rw=$2
local filename=$3
if [[ $job_section == "global" ]]; then
cat <<- EOF >> "$testdir"/test.conf
[global]
filename=${filename}
EOF
fi
job="[${job_section}]"
echo $global
cat <<- EOF >> "$testdir"/test.conf
${job}
filename=${filename}
bs=1024
rwmixread=70
rw=${rw}
iodepth=256
cpumask=0xff
EOF
}
function get_num_jobs() {
echo "$1" | grep -oE "Using job config with [0-9]+ jobs" | grep -oE "[0-9]+"
}
function cleanup() {
rm -f $testdir/test.conf
}