test/ftl: Drop .ini config in favor of json

Change-Id: I962ce508a03aee35b44da512492ef0a483cceb59
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1358
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
Michal Berger 2020-03-18 11:23:51 +01:00 committed by Tomasz Zawadzki
parent 9f815a839d
commit b8805882fc
7 changed files with 25 additions and 32 deletions

View File

@ -10,12 +10,9 @@ device=$1
use_append=$2
rpc_py=$rootdir/scripts/rpc.py
ftl_bdev_conf=$testdir/config/ftl.conf
gen_ftl_nvme_conf > $ftl_bdev_conf
for (( i=0; i<${#tests[@]}; i++ )) do
timing_enter "${tests[$i]}"
$rootdir/test/bdev/bdevperf/bdevperf -z -T ftl0 ${tests[$i]} -c $ftl_bdev_conf &
"$rootdir/test/bdev/bdevperf/bdevperf" -z -T ftl0 ${tests[$i]} --json <(gen_ftl_nvme_conf) &
bdevperf_pid=$!
trap 'killprocess $bdevperf_pid; exit 1' SIGINT SIGTERM EXIT
@ -32,5 +29,3 @@ for (( i=0; i<${#tests[@]}; i++ )) do
trap - SIGINT SIGTERM EXIT
timing_exit "${tests[$i]}"
done
rm -f $ftl_bdev_conf

View File

@ -48,6 +48,21 @@ function create_nv_cache_bdev() {
}
function gen_ftl_nvme_conf() {
echo "[Nvme]"
echo " AdminPollRate 100"
jq . <<-JSON
{
"subsystems": [
{
"subsystem": "bdev",
"config": [
{
"params": {
"nvme_adminq_poll_period_us": 100
},
"method": "bdev_nvme_set_options"
}
]
}
]
}
JSON
}

View File

@ -17,14 +17,11 @@ done
shift $((OPTIND -1))
device=$1
ftl_bdev_conf=$testdir/config/ftl.conf
gen_ftl_nvme_conf > $ftl_bdev_conf
restore_kill() {
rm -f $testdir/config/ftl.json
rm -f $testdir/testfile.md5
rm -f $testdir/testfile2.md5
rm -f $ftl_bdev_conf
killprocess $svcpid || true
rmmod nbd || true
@ -40,7 +37,7 @@ pu_count=$((num_group * num_pu))
# Write one band worth of data + one extra chunk
data_size=$((chunk_size * (pu_count + 1)))
$rootdir/app/spdk_tgt/spdk_tgt -c $ftl_bdev_conf & svcpid=$!
"$rootdir/app/spdk_tgt/spdk_tgt" --json <(gen_ftl_nvme_conf) & svcpid=$!
waitforlisten $svcpid
if [ -n "$nv_cache" ]; then
@ -72,7 +69,7 @@ $rpc_py nbd_stop_disk /dev/nbd0
kill -9 $svcpid
rm -f /dev/shm/spdk_tgt_trace.pid$svcpid
$rootdir/app/spdk_tgt/spdk_tgt -c $ftl_bdev_conf -L ftl_init & svcpid=$!
"$rootdir/app/spdk_tgt/spdk_tgt" --json <(gen_ftl_nvme_conf) -L ftl_init & svcpid=$!
waitforlisten $svcpid
$rpc_py load_config < $testdir/config/ftl.json

View File

@ -10,12 +10,9 @@ suite['basic']='randw-verify randw-verify-j2 randw-verify-depth128'
suite['extended']='drive-prep randw-verify-qd128-ext randw randr randrw'
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
rm -f $FTL_JSON_CONF
}
@ -38,7 +35,7 @@ export FTL_JSON_CONF=$testdir/config/ftl.json
trap "fio_kill; exit 1" SIGINT SIGTERM EXIT
$rootdir/app/spdk_tgt/spdk_tgt -c $ftl_bdev_conf & svcpid=$!
"$rootdir/app/spdk_tgt/spdk_tgt" --json <(gen_ftl_nvme_conf) & svcpid=$!
waitforlisten $svcpid
$rpc_py bdev_nvme_attach_controller -b nvme0 -a $device -t pcie
@ -67,5 +64,4 @@ for test in ${tests}; do
timing_exit $test
done
rm -f $ftl_bdev_conf
rm -f $FTL_JSON_CONF

View File

@ -62,9 +62,7 @@ run_test "ftl_json" $testdir/json.sh $device
if [ $SPDK_TEST_FTL_EXTENDED -eq 1 ]; then
run_test "ftl_fio_basic" $testdir/fio.sh $device basic
ftl_bdev_conf=$testdir/config/ftl.conf
gen_ftl_nvme_conf > $ftl_bdev_conf
$rootdir/app/spdk_tgt/spdk_tgt -c $ftl_bdev_conf & svcpid=$!
"$rootdir/app/spdk_tgt/spdk_tgt" --json <(gen_ftl_nvme_conf) & svcpid=$!
trap 'killprocess $svcpid; exit 1' SIGINT SIGTERM EXIT
@ -74,7 +72,6 @@ if [ $SPDK_TEST_FTL_EXTENDED -eq 1 ]; then
$rpc_py bdev_ocssd_create -c nvme0 -b nvme0n1 -n 1
uuid=$($rpc_py bdev_ftl_create -b ftl0 -d nvme0n1 | jq -r '.uuid')
killprocess $svcpid
rm -f $ftl_bdev_conf
trap - SIGINT SIGTERM EXIT

View File

@ -8,17 +8,14 @@ source $testdir/common.sh
rpc_py=$rootdir/scripts/rpc.py
device=$1
ftl_bdev_conf=$testdir/config/ftl.conf
gen_ftl_nvme_conf > $ftl_bdev_conf
json_kill() {
killprocess $svcpid
rm -f $ftl_bdev_conf
}
trap "json_kill; exit 1" SIGINT SIGTERM EXIT
$rootdir/app/spdk_tgt/spdk_tgt -c $ftl_bdev_conf & svcpid=$!
"$rootdir/app/spdk_tgt/spdk_tgt" --json <(gen_ftl_nvme_conf) & svcpid=$!
waitforlisten $svcpid
# Create new bdev from json configuration

View File

@ -22,9 +22,6 @@ num_group=$(get_num_group $device)
num_pu=$(get_num_pu $device)
pu_count=$((num_group * num_pu))
ftl_bdev_conf=$testdir/config/ftl.conf
gen_ftl_nvme_conf > $ftl_bdev_conf
restore_kill() {
if mount | grep $mount_dir; then
umount $mount_dir
@ -33,7 +30,6 @@ restore_kill() {
rm -f $testdir/testfile.md5
rm -f $testdir/testfile2.md5
rm -f $testdir/config/ftl.json
rm -f $ftl_bdev_conf
killprocess $svcpid
rmmod nbd || true
@ -41,7 +37,7 @@ restore_kill() {
trap "restore_kill; exit 1" SIGINT SIGTERM EXIT
$rootdir/app/spdk_tgt/spdk_tgt -c $ftl_bdev_conf & svcpid=$!
"$rootdir/app/spdk_tgt/spdk_tgt" --json <(gen_ftl_nvme_conf) & svcpid=$!
# Wait until spdk_tgt starts
waitforlisten $svcpid
@ -77,7 +73,7 @@ md5sum $mount_dir/testfile > $testdir/testfile.md5
umount $mount_dir
killprocess $svcpid
$rootdir/app/spdk_tgt/spdk_tgt -c $ftl_bdev_conf -L ftl_init & svcpid=$!
"$rootdir/app/spdk_tgt/spdk_tgt" --json <(gen_ftl_nvme_conf) -L ftl_init & svcpid=$!
# Wait until spdk_tgt starts
waitforlisten $svcpid