1#!/usr/bin/env bash 2# SPDX-License-Identifier: BSD-3-Clause 3# Copyright (C) 2019 Intel Corporation 4# All rights reserved. 5# 6testdir=$(readlink -f $(dirname $0)) 7rootdir=$(readlink -f $testdir/../..) 8source $rootdir/test/common/autotest_common.sh 9source $testdir/common.sh 10 11tests=('-q 1 -w randwrite -t 4 -o 69632' '-q 128 -w randwrite -t 4 -o 4096' '-q 128 -w verify -t 4 -o 4096') 12device=$1 13cache_device=$2 14use_append=$3 15rpc_py=$rootdir/scripts/rpc.py 16timeout=240 17 18for ((i = 0; i < ${#tests[@]}; i++)); do 19 timing_enter "${tests[$i]}" 20 "$rootdir/build/examples/bdevperf" -z -T ftl0 ${tests[$i]} & 21 bdevperf_pid=$! 22 23 trap 'killprocess $bdevperf_pid; exit 1' SIGINT SIGTERM EXIT 24 waitforlisten $bdevperf_pid 25 split_bdev=$(create_base_bdev nvme0 $device $((1024 * 101))) 26 nv_cache=$(create_nv_cache_bdev nvc0 $cache_device $split_bdev) 27 28 l2p_dram_size_mb=$(($(get_bdev_size $split_bdev) * 20 / 100 / 1024)) 29 $rpc_py -t $timeout bdev_ftl_create -b ftl0 -d $split_bdev $use_append -c $nv_cache --l2p_dram_limit $l2p_dram_size_mb 30 31 $rootdir/examples/bdev/bdevperf/bdevperf.py perform_tests 32 $rpc_py bdev_ftl_delete -b ftl0 33 34 killprocess $bdevperf_pid 35 trap - SIGINT SIGTERM EXIT 36 timing_exit "${tests[$i]}" 37done 38 39remove_shm 40