xref: /spdk/test/bdev/bdevperf/test_config.sh (revision fecffda6ecf8853b82edccde429b68252f0a62c5)
1#!/usr/bin/env bash
2#  SPDX-License-Identifier: BSD-3-Clause
3#  Copyright (C) 2020 Intel Corporation
4#  All rights reserved.
5#
6
7testdir=$(readlink -f $(dirname $0))
8rootdir=$(readlink -f $testdir/../../..)
9source $rootdir/test/common/autotest_common.sh
10source $testdir/common.sh
11
12jsonconf=$testdir/conf.json
13testconf=$testdir/test.conf
14
15trap 'cleanup; exit 1' SIGINT SIGTERM EXIT
16#Test inheriting filename and rw_mode parameters from global section.
17create_job "global" "read" "Malloc0"
18create_job "job0"
19create_job "job1"
20create_job "job2"
21create_job "job3"
22bdevperf_output=$($bdevperf -t 2 --json $jsonconf -j $testconf 2>&1)
23[[ $(get_num_jobs "$bdevperf_output") == "4" ]]
24
25bdevperf_output=$($bdevperf -C -t 2 --json $jsonconf -j $testconf)
26
27cleanup
28#Test missing global section.
29create_job "job0" "write" "Malloc0"
30create_job "job1" "write" "Malloc0"
31create_job "job2" "write" "Malloc0"
32bdevperf_output=$($bdevperf -t 2 --json $jsonconf -j $testconf 2>&1)
33[[ $(get_num_jobs "$bdevperf_output") == "3" ]]
34
35cleanup
36#Test inheriting multiple filenames and rw_mode parameters from global section.
37create_job "global" "rw" "Malloc0:Malloc1"
38create_job "job0"
39create_job "job1"
40create_job "job2"
41create_job "job3"
42bdevperf_output=$($bdevperf -t 2 --json $jsonconf -j $testconf 2>&1)
43[[ $(get_num_jobs "$bdevperf_output") == "4" ]]
44cleanup
45trap - SIGINT SIGTERM EXIT
46