2018-10-29 10:40:34 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
testdir=$(readlink -f $(dirname $0))
|
|
|
|
rootdir=$(readlink -f $testdir/../..)
|
2019-01-29 04:54:46 -05:00
|
|
|
plugindir=$rootdir/examples/bdev/fio_plugin
|
2018-10-29 10:40:34 -04:00
|
|
|
|
|
|
|
source $rootdir/test/common/autotest_common.sh
|
|
|
|
|
2019-01-29 04:54:46 -05: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'
|
|
|
|
|
2018-10-29 10:40:34 -04:00
|
|
|
device=$1
|
2019-01-29 04:54:46 -05:00
|
|
|
tests=${suite[$2]}
|
|
|
|
uuid=$3
|
2018-10-29 10:40:34 -04:00
|
|
|
|
|
|
|
if [ ! -d /usr/src/fio ]; then
|
|
|
|
echo "FIO not available"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-01-29 04:54:46 -05:00
|
|
|
if [ -z "$tests" ]; then
|
|
|
|
echo "Invalid test suite '$2'"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
export FTL_BDEV_CONF=$testdir/config/ftl.conf
|
|
|
|
export FTL_BDEV_NAME=nvme0
|
|
|
|
|
|
|
|
if [ -z "$uuid" ]; then
|
|
|
|
$rootdir/scripts/gen_ftl.sh -a $device -n nvme0 -l 0-3 > $FTL_BDEV_CONF
|
|
|
|
else
|
|
|
|
$rootdir/scripts/gen_ftl.sh -a $device -n nvme0 -l 0-3 -u $uuid > $FTL_BDEV_CONF
|
|
|
|
fi
|
2018-10-29 10:40:34 -04:00
|
|
|
|
|
|
|
for test in ${tests[@]}; do
|
|
|
|
timing_enter $test
|
|
|
|
LD_PRELOAD=$plugindir/fio_plugin /usr/src/fio/fio $testdir/config/fio/$test.fio
|
|
|
|
timing_exit $test
|
|
|
|
done
|
|
|
|
|
|
|
|
report_test_completion ftl_fio
|