Commit b8805882 authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

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



Change-Id: I962ce508a03aee35b44da512492ef0a483cceb59
Signed-off-by: default avatarMichal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1358


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
parent 9f815a83
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -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
+17 −2
Original line number Diff line number Diff line
@@ -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
}
+2 −5
Original line number Diff line number Diff line
@@ -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
+1 −5
Original line number Diff line number Diff line
@@ -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
+1 −4
Original line number Diff line number Diff line
@@ -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

Loading