Maciej Wawryk 394bb22b63 test/ftl: Fix bug with assiciative array
Patch fdc82d3bc8c45a90f297e713dd48d3cb4e159824 fixing shellcheck's rule SC2068
caused `ftl/fio.sh` to take the whole array as single element during loop iteration.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Id31e8b32c54e9c8ae114b360779fce0579af8ccf
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476145
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-12-02 11:01:13 +00:00

41 lines
882 B
Bash
Executable File

#!/usr/bin/env bash
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh
declare -A suite
suite['basic']='randw-verify randw-verify-j2 randw-verify-depth128'
suite['extended']='drive-prep randw-verify-qd128-ext randw randr randrw'
device=$1
tests=${suite[$2]}
uuid=$3
if [ ! -d /usr/src/fio ]; then
echo "FIO not available"
exit 1
fi
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
for test in ${tests}; do
timing_enter $test
fio_bdev $testdir/config/fio/$test.fio
timing_exit $test
done
report_test_completion ftl_fio