test/bdev: Cleanup old ini pieces

Change-Id: Id3aae79de36f4be415d77a2641bc1bf6050c0753
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1023
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
Michal Berger 2020-02-26 12:49:40 +01:00 committed by Tomasz Zawadzki
parent 6b8f9a0f81
commit b3b45f1659

View File

@ -6,7 +6,7 @@ source $rootdir/test/common/autotest_common.sh
source $testdir/nbd_common.sh source $testdir/nbd_common.sh
rpc_py="$rootdir/scripts/rpc.py" rpc_py="$rootdir/scripts/rpc.py"
conf_file="$testdir/bdev.conf" conf_file="$testdir/bdev.json"
# Make sure the configuration is clean # Make sure the configuration is clean
:>"$conf_file" :>"$conf_file"
@ -19,17 +19,7 @@ function cleanup() {
} }
function start_spdk_tgt() { function start_spdk_tgt() {
local spdk_cmd "$rootdir/app/spdk_tgt/spdk_tgt" &
if [[ -n $spdk_tgt_pid ]] && kill -0 "$spdk_tgt_pid" &>/dev/null; then
return 0
fi
if [[ -s $conf_file ]]; then
spdk_cmd+=(--config "$conf_file")
fi
"$rootdir/app/spdk_tgt/spdk_tgt" "${spdk_cmd[@]}" &
spdk_tgt_pid=$! spdk_tgt_pid=$!
trap 'killprocess "$spdk_tgt_pid"; exit 1' SIGINT SIGTERM EXIT trap 'killprocess "$spdk_tgt_pid"; exit 1' SIGINT SIGTERM EXIT
waitforlisten "$spdk_tgt_pid" waitforlisten "$spdk_tgt_pid"
@ -201,11 +191,11 @@ function fio_test_suite() {
done done
if [ $RUN_NIGHTLY_FAILING -eq 0 ]; then if [ $RUN_NIGHTLY_FAILING -eq 0 ]; then
local fio_params="--ioengine=spdk_bdev --iodepth=8 --bs=4k --runtime=10 $testdir/bdev.fio --spdk_json_conf=./test/bdev/bdev.conf" local fio_params="--ioengine=spdk_bdev --iodepth=8 --bs=4k --runtime=10 $testdir/bdev.fio --spdk_json_conf=$conf_file"
else else
# Use size 192KB which both exceeds typical 128KB max NVMe I/O # Use size 192KB which both exceeds typical 128KB max NVMe I/O
# size and will cross 128KB Intel DC P3700 stripe boundaries. # size and will cross 128KB Intel DC P3700 stripe boundaries.
local fio_params="--ioengine=spdk_bdev --iodepth=128 --bs=192k --runtime=100 $testdir/bdev.fio --spdk_json_conf=./test/bdev/bdev.conf" local fio_params="--ioengine=spdk_bdev --iodepth=128 --bs=192k --runtime=100 $testdir/bdev.fio --spdk_json_conf=$conf_file"
fi fi
run_test "bdev_fio_rw_verify" fio_bdev $fio_params --spdk_mem=$PRE_RESERVED_MEM \ run_test "bdev_fio_rw_verify" fio_bdev $fio_params --spdk_mem=$PRE_RESERVED_MEM \
@ -337,30 +327,29 @@ else
fi fi
test_type=${1:-bdev} test_type=${1:-bdev}
start_spdk_tgt
case "$test_type" in case "$test_type" in
bdev ) bdev )
start_spdk_tgt; setup_bdev_conf;; setup_bdev_conf;;
nvme ) nvme )
start_spdk_tgt; setup_nvme_conf;; setup_nvme_conf;;
gpt ) gpt )
start_spdk_tgt; setup_gpt_conf;; setup_gpt_conf;;
crypto_aesni ) crypto_aesni )
start_spdk_tgt; setup_crypto_aesni_conf;; setup_crypto_aesni_conf;;
crypto_qat ) crypto_qat )
start_spdk_tgt; setup_crypto_qat_conf;; setup_crypto_qat_conf;;
pmem ) pmem )
start_spdk_tgt; setup_pmem_conf;; setup_pmem_conf;;
rbd ) rbd )
start_spdk_tgt; setup_rbd_conf;; setup_rbd_conf;;
* ) * )
echo "invalid test name" echo "invalid test name"
exit 1 exit 1
;; ;;
esac esac
start_spdk_tgt # Generate json config and use it throughout all the tests
# Overwrite ini config with json and use it as such throughout all the tests
cat <<-CONF >"$conf_file" cat <<-CONF >"$conf_file"
{"subsystems":[ {"subsystems":[
$("$rpc_py" save_subsystem_config -n bdev) $("$rpc_py" save_subsystem_config -n bdev)