2018-10-29 14:40:34 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
testdir=$(readlink -f $(dirname $0))
|
|
|
|
rootdir=$(readlink -f $testdir/../..)
|
|
|
|
source $rootdir/test/common/autotest_common.sh
|
2019-09-25 12:09:51 +00:00
|
|
|
source $testdir/common.sh
|
2018-10-29 14:40:34 +00:00
|
|
|
|
2019-01-29 09:54:46 +00:00
|
|
|
declare -A suite
|
|
|
|
suite['basic']='randw-verify randw-verify-j2 randw-verify-depth128'
|
|
|
|
suite['extended']='drive-prep randw-verify-qd128-ext randw randr randrw'
|
|
|
|
|
2019-09-25 12:09:51 +00:00
|
|
|
rpc_py=$rootdir/scripts/rpc.py
|
|
|
|
ftl_bdev_conf=$testdir/config/ftl.conf
|
|
|
|
gen_ftl_nvme_conf > $ftl_bdev_conf
|
|
|
|
|
|
|
|
fio_kill() {
|
|
|
|
killprocess $svcpid
|
|
|
|
rm -f $ftl_bdev_conf
|
2020-02-19 14:48:07 +00:00
|
|
|
rm -f $FTL_JSON_CONF
|
2019-09-25 12:09:51 +00:00
|
|
|
}
|
|
|
|
|
2018-10-29 14:40:34 +00:00
|
|
|
device=$1
|
2019-01-29 09:54:46 +00:00
|
|
|
tests=${suite[$2]}
|
|
|
|
uuid=$3
|
2018-10-29 14:40:34 +00:00
|
|
|
|
2020-03-02 19:55:44 +00:00
|
|
|
if [[ $CONFIG_FIO_PLUGIN != y ]]; then
|
2018-10-29 14:40:34 +00:00
|
|
|
echo "FIO not available"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-01-29 09:54:46 +00:00
|
|
|
if [ -z "$tests" ]; then
|
|
|
|
echo "Invalid test suite '$2'"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-02-19 14:48:07 +00:00
|
|
|
export FTL_BDEV_NAME=ftl0
|
|
|
|
export FTL_JSON_CONF=$testdir/config/ftl.json
|
2019-09-25 12:09:51 +00:00
|
|
|
|
|
|
|
trap "fio_kill; exit 1" SIGINT SIGTERM EXIT
|
|
|
|
|
|
|
|
$rootdir/app/spdk_tgt/spdk_tgt -c $ftl_bdev_conf & svcpid=$!
|
|
|
|
waitforlisten $svcpid
|
|
|
|
|
|
|
|
$rpc_py bdev_nvme_attach_controller -b nvme0 -a $device -t pcie
|
|
|
|
$rpc_py bdev_ocssd_create -c nvme0 -b nvme0n1
|
2019-01-29 09:54:46 +00:00
|
|
|
|
|
|
|
if [ -z "$uuid" ]; then
|
2020-01-16 13:30:17 +00:00
|
|
|
$rpc_py bdev_ftl_create -b ftl0 -d nvme0n1
|
2019-01-29 09:54:46 +00:00
|
|
|
else
|
2020-01-16 13:30:17 +00:00
|
|
|
$rpc_py bdev_ftl_create -b ftl0 -d nvme0n1 -u $uuid
|
2019-01-29 09:54:46 +00:00
|
|
|
fi
|
2018-10-29 14:40:34 +00:00
|
|
|
|
2020-02-19 14:48:07 +00:00
|
|
|
waitforbdev ftl0
|
|
|
|
|
|
|
|
(
|
|
|
|
echo '{"subsystems": [';
|
|
|
|
$rpc_py save_subsystem_config -n bdev
|
|
|
|
echo ']}'
|
|
|
|
) > $FTL_JSON_CONF
|
|
|
|
|
|
|
|
killprocess $svcpid
|
2020-03-06 13:50:04 +00:00
|
|
|
trap - SIGINT SIGTERM EXIT
|
2019-09-25 12:09:51 +00:00
|
|
|
|
2019-11-29 10:49:39 +00:00
|
|
|
for test in ${tests}; do
|
2018-10-29 14:40:34 +00:00
|
|
|
timing_enter $test
|
2019-05-30 06:59:51 +00:00
|
|
|
fio_bdev $testdir/config/fio/$test.fio
|
2018-10-29 14:40:34 +00:00
|
|
|
timing_exit $test
|
|
|
|
done
|
2019-09-25 12:09:51 +00:00
|
|
|
|
2020-03-06 13:50:04 +00:00
|
|
|
rm -f $ftl_bdev_conf
|
|
|
|
rm -f $FTL_JSON_CONF
|