2022-11-02 15:49:40 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright (C) 2018 Intel Corporation
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
|
2019-06-16 05:52:43 +00:00
|
|
|
spdkcli_job="$rootdir/test/spdkcli/spdkcli_job.py"
|
|
|
|
spdk_clear_config_py="$rootdir/test/json_config/clear_config.py"
|
2018-06-22 19:27:31 +00:00
|
|
|
|
2023-02-07 16:26:58 +00:00
|
|
|
function cleanup() {
|
2019-07-25 13:01:09 +00:00
|
|
|
if [ -n "$spdk_tgt_pid" ]; then
|
2018-11-27 18:58:25 +00:00
|
|
|
killprocess $spdk_tgt_pid
|
|
|
|
fi
|
2019-07-25 13:01:09 +00:00
|
|
|
if [ -n "$nvmf_tgt_pid" ]; then
|
2018-11-27 18:58:25 +00:00
|
|
|
killprocess $nvmf_tgt_pid
|
|
|
|
fi
|
2019-07-25 13:01:09 +00:00
|
|
|
if [ -n "$iscsi_tgt_pid" ]; then
|
2018-11-27 18:58:25 +00:00
|
|
|
killprocess $iscsi_tgt_pid
|
|
|
|
fi
|
2019-07-25 13:01:09 +00:00
|
|
|
if [ -n "$vhost_tgt_pid" ]; then
|
2018-11-27 18:58:25 +00:00
|
|
|
killprocess $vhost_tgt_pid
|
|
|
|
fi
|
2023-03-03 13:45:16 +00:00
|
|
|
rm -f $testdir/${MATCH_FILE} $testdir/match_files/spdkcli_details_vhost.test /tmp/sample_aio
|
2018-06-22 19:27:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function run_spdk_tgt() {
|
2022-09-14 10:21:42 +00:00
|
|
|
$SPDK_BIN_DIR/spdk_tgt -m 0x3 -p 0 &
|
2018-06-22 19:27:31 +00:00
|
|
|
spdk_tgt_pid=$!
|
|
|
|
waitforlisten $spdk_tgt_pid
|
|
|
|
}
|
|
|
|
|
2018-11-27 18:58:25 +00:00
|
|
|
function run_nvmf_tgt() {
|
2022-09-14 10:21:42 +00:00
|
|
|
$SPDK_BIN_DIR/nvmf_tgt -m 0x3 -p 0 &
|
2018-11-27 18:58:25 +00:00
|
|
|
nvmf_tgt_pid=$!
|
|
|
|
waitforlisten $nvmf_tgt_pid
|
|
|
|
}
|
|
|
|
|
|
|
|
function run_vhost_tgt() {
|
2022-09-14 10:21:42 +00:00
|
|
|
$SPDK_BIN_DIR/vhost -m 0x3 -p 0 &
|
2018-11-27 18:58:25 +00:00
|
|
|
vhost_tgt_pid=$!
|
|
|
|
waitforlisten $vhost_tgt_pid
|
|
|
|
}
|
|
|
|
|
2018-06-22 19:27:31 +00:00
|
|
|
function check_match() {
|
2019-06-16 05:52:43 +00:00
|
|
|
$rootdir/scripts/spdkcli.py ll $SPDKCLI_BRANCH > $testdir/match_files/${MATCH_FILE}
|
2019-07-15 16:45:35 +00:00
|
|
|
$rootdir/test/app/match/match $testdir/match_files/${MATCH_FILE}.match
|
2018-07-26 14:59:39 +00:00
|
|
|
rm -f $testdir/match_files/${MATCH_FILE}
|
2018-06-22 19:27:31 +00:00
|
|
|
}
|
2023-04-12 13:33:10 +00:00
|
|
|
|
|
|
|
function wait_for_all_nvme_ctrls_to_detach() {
|
|
|
|
while (($(rpc_cmd bdev_nvme_get_controllers | jq '.|length') != 0)); do :; done
|
|
|
|
}
|