1#!/usr/bin/env bash 2 3testdir=$(readlink -f $(dirname $0)) 4rootdir=$(readlink -f $testdir/../..) 5source $rootdir/test/common/autotest_common.sh 6source $testdir/common.sh 7 8tests=(randw randw-verify randw-verify-j2 randw-verify-depth128) 9 10rpc_py=$rootdir/scripts/rpc.py 11 12fio_kill() { 13 killprocess $svcpid 14 rm -f $FTL_JSON_CONF 15} 16 17device=$1 18 19if [[ $CONFIG_FIO_PLUGIN != y ]]; then 20 echo "FIO not available" 21 exit 1 22fi 23 24export FTL_BDEV_NAME=ftl0 25export FTL_JSON_CONF=$testdir/config/ftl.json 26 27trap "fio_kill; exit 1" SIGINT SIGTERM EXIT 28 29"$SPDK_BIN_DIR/spdk_tgt" --json <(gen_ftl_nvme_conf) & 30svcpid=$! 31waitforlisten $svcpid 32 33$rpc_py bdev_nvme_attach_controller -b nvme0 -a $device -t pcie 34bdev_create_zone nvme0n1 35$rpc_py bdev_ftl_create -b ftl0 -d "$ZONE_DEV" 36 37waitforbdev ftl0 38 39( 40 echo '{"subsystems": [' 41 $rpc_py save_subsystem_config -n bdev 42 echo ']}' 43) > $FTL_JSON_CONF 44 45killprocess $svcpid 46trap - SIGINT SIGTERM EXIT 47 48for test in "${tests[@]}"; do 49 timing_enter $test 50 fio_bdev $testdir/config/fio/$test.fio 51 timing_exit $test 52done 53 54rm -f $FTL_JSON_CONF 55