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:
parent
9f815a839d
commit
b8805882fc
@ -10,12 +10,9 @@ device=$1
|
|||||||
use_append=$2
|
use_append=$2
|
||||||
rpc_py=$rootdir/scripts/rpc.py
|
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
|
for (( i=0; i<${#tests[@]}; i++ )) do
|
||||||
timing_enter "${tests[$i]}"
|
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=$!
|
bdevperf_pid=$!
|
||||||
|
|
||||||
trap 'killprocess $bdevperf_pid; exit 1' SIGINT SIGTERM EXIT
|
trap 'killprocess $bdevperf_pid; exit 1' SIGINT SIGTERM EXIT
|
||||||
@ -32,5 +29,3 @@ for (( i=0; i<${#tests[@]}; i++ )) do
|
|||||||
trap - SIGINT SIGTERM EXIT
|
trap - SIGINT SIGTERM EXIT
|
||||||
timing_exit "${tests[$i]}"
|
timing_exit "${tests[$i]}"
|
||||||
done
|
done
|
||||||
|
|
||||||
rm -f $ftl_bdev_conf
|
|
||||||
|
@ -48,6 +48,21 @@ function create_nv_cache_bdev() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function gen_ftl_nvme_conf() {
|
function gen_ftl_nvme_conf() {
|
||||||
echo "[Nvme]"
|
jq . <<-JSON
|
||||||
echo " AdminPollRate 100"
|
{
|
||||||
|
"subsystems": [
|
||||||
|
{
|
||||||
|
"subsystem": "bdev",
|
||||||
|
"config": [
|
||||||
|
{
|
||||||
|
"params": {
|
||||||
|
"nvme_adminq_poll_period_us": 100
|
||||||
|
},
|
||||||
|
"method": "bdev_nvme_set_options"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
JSON
|
||||||
}
|
}
|
||||||
|
@ -17,14 +17,11 @@ done
|
|||||||
shift $((OPTIND -1))
|
shift $((OPTIND -1))
|
||||||
|
|
||||||
device=$1
|
device=$1
|
||||||
ftl_bdev_conf=$testdir/config/ftl.conf
|
|
||||||
gen_ftl_nvme_conf > $ftl_bdev_conf
|
|
||||||
|
|
||||||
restore_kill() {
|
restore_kill() {
|
||||||
rm -f $testdir/config/ftl.json
|
rm -f $testdir/config/ftl.json
|
||||||
rm -f $testdir/testfile.md5
|
rm -f $testdir/testfile.md5
|
||||||
rm -f $testdir/testfile2.md5
|
rm -f $testdir/testfile2.md5
|
||||||
rm -f $ftl_bdev_conf
|
|
||||||
|
|
||||||
killprocess $svcpid || true
|
killprocess $svcpid || true
|
||||||
rmmod nbd || true
|
rmmod nbd || true
|
||||||
@ -40,7 +37,7 @@ pu_count=$((num_group * num_pu))
|
|||||||
# Write one band worth of data + one extra chunk
|
# Write one band worth of data + one extra chunk
|
||||||
data_size=$((chunk_size * (pu_count + 1)))
|
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
|
waitforlisten $svcpid
|
||||||
|
|
||||||
if [ -n "$nv_cache" ]; then
|
if [ -n "$nv_cache" ]; then
|
||||||
@ -72,7 +69,7 @@ $rpc_py nbd_stop_disk /dev/nbd0
|
|||||||
kill -9 $svcpid
|
kill -9 $svcpid
|
||||||
rm -f /dev/shm/spdk_tgt_trace.pid$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
|
waitforlisten $svcpid
|
||||||
|
|
||||||
$rpc_py load_config < $testdir/config/ftl.json
|
$rpc_py load_config < $testdir/config/ftl.json
|
||||||
|
@ -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'
|
suite['extended']='drive-prep randw-verify-qd128-ext randw randr randrw'
|
||||||
|
|
||||||
rpc_py=$rootdir/scripts/rpc.py
|
rpc_py=$rootdir/scripts/rpc.py
|
||||||
ftl_bdev_conf=$testdir/config/ftl.conf
|
|
||||||
gen_ftl_nvme_conf > $ftl_bdev_conf
|
|
||||||
|
|
||||||
fio_kill() {
|
fio_kill() {
|
||||||
killprocess $svcpid
|
killprocess $svcpid
|
||||||
rm -f $ftl_bdev_conf
|
|
||||||
rm -f $FTL_JSON_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
|
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
|
waitforlisten $svcpid
|
||||||
|
|
||||||
$rpc_py bdev_nvme_attach_controller -b nvme0 -a $device -t pcie
|
$rpc_py bdev_nvme_attach_controller -b nvme0 -a $device -t pcie
|
||||||
@ -67,5 +64,4 @@ for test in ${tests}; do
|
|||||||
timing_exit $test
|
timing_exit $test
|
||||||
done
|
done
|
||||||
|
|
||||||
rm -f $ftl_bdev_conf
|
|
||||||
rm -f $FTL_JSON_CONF
|
rm -f $FTL_JSON_CONF
|
||||||
|
@ -62,9 +62,7 @@ run_test "ftl_json" $testdir/json.sh $device
|
|||||||
if [ $SPDK_TEST_FTL_EXTENDED -eq 1 ]; then
|
if [ $SPDK_TEST_FTL_EXTENDED -eq 1 ]; then
|
||||||
run_test "ftl_fio_basic" $testdir/fio.sh $device basic
|
run_test "ftl_fio_basic" $testdir/fio.sh $device basic
|
||||||
|
|
||||||
ftl_bdev_conf=$testdir/config/ftl.conf
|
"$rootdir/app/spdk_tgt/spdk_tgt" --json <(gen_ftl_nvme_conf) & svcpid=$!
|
||||||
gen_ftl_nvme_conf > $ftl_bdev_conf
|
|
||||||
$rootdir/app/spdk_tgt/spdk_tgt -c $ftl_bdev_conf & svcpid=$!
|
|
||||||
|
|
||||||
trap 'killprocess $svcpid; exit 1' SIGINT SIGTERM EXIT
|
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
|
$rpc_py bdev_ocssd_create -c nvme0 -b nvme0n1 -n 1
|
||||||
uuid=$($rpc_py bdev_ftl_create -b ftl0 -d nvme0n1 | jq -r '.uuid')
|
uuid=$($rpc_py bdev_ftl_create -b ftl0 -d nvme0n1 | jq -r '.uuid')
|
||||||
killprocess $svcpid
|
killprocess $svcpid
|
||||||
rm -f $ftl_bdev_conf
|
|
||||||
|
|
||||||
trap - SIGINT SIGTERM EXIT
|
trap - SIGINT SIGTERM EXIT
|
||||||
|
|
||||||
|
@ -8,17 +8,14 @@ source $testdir/common.sh
|
|||||||
rpc_py=$rootdir/scripts/rpc.py
|
rpc_py=$rootdir/scripts/rpc.py
|
||||||
|
|
||||||
device=$1
|
device=$1
|
||||||
ftl_bdev_conf=$testdir/config/ftl.conf
|
|
||||||
gen_ftl_nvme_conf > $ftl_bdev_conf
|
|
||||||
|
|
||||||
json_kill() {
|
json_kill() {
|
||||||
killprocess $svcpid
|
killprocess $svcpid
|
||||||
rm -f $ftl_bdev_conf
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trap "json_kill; exit 1" SIGINT SIGTERM EXIT
|
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
|
waitforlisten $svcpid
|
||||||
|
|
||||||
# Create new bdev from json configuration
|
# Create new bdev from json configuration
|
||||||
|
@ -22,9 +22,6 @@ num_group=$(get_num_group $device)
|
|||||||
num_pu=$(get_num_pu $device)
|
num_pu=$(get_num_pu $device)
|
||||||
pu_count=$((num_group * num_pu))
|
pu_count=$((num_group * num_pu))
|
||||||
|
|
||||||
ftl_bdev_conf=$testdir/config/ftl.conf
|
|
||||||
gen_ftl_nvme_conf > $ftl_bdev_conf
|
|
||||||
|
|
||||||
restore_kill() {
|
restore_kill() {
|
||||||
if mount | grep $mount_dir; then
|
if mount | grep $mount_dir; then
|
||||||
umount $mount_dir
|
umount $mount_dir
|
||||||
@ -33,7 +30,6 @@ restore_kill() {
|
|||||||
rm -f $testdir/testfile.md5
|
rm -f $testdir/testfile.md5
|
||||||
rm -f $testdir/testfile2.md5
|
rm -f $testdir/testfile2.md5
|
||||||
rm -f $testdir/config/ftl.json
|
rm -f $testdir/config/ftl.json
|
||||||
rm -f $ftl_bdev_conf
|
|
||||||
|
|
||||||
killprocess $svcpid
|
killprocess $svcpid
|
||||||
rmmod nbd || true
|
rmmod nbd || true
|
||||||
@ -41,7 +37,7 @@ restore_kill() {
|
|||||||
|
|
||||||
trap "restore_kill; exit 1" SIGINT SIGTERM EXIT
|
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
|
# Wait until spdk_tgt starts
|
||||||
waitforlisten $svcpid
|
waitforlisten $svcpid
|
||||||
|
|
||||||
@ -77,7 +73,7 @@ md5sum $mount_dir/testfile > $testdir/testfile.md5
|
|||||||
umount $mount_dir
|
umount $mount_dir
|
||||||
killprocess $svcpid
|
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
|
# Wait until spdk_tgt starts
|
||||||
waitforlisten $svcpid
|
waitforlisten $svcpid
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user