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
|
|
|
|
|
|
|
function on_error_exit() {
|
|
|
|
set +e
|
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
|
2018-07-04 15:30:59 +00:00
|
|
|
rm -f $testdir/${MATCH_FILE} $testdir/match_files/spdkcli_details_vhost.test /tmp/sample_aio /tmp/sample_pmem
|
2018-06-22 19:27:31 +00:00
|
|
|
print_backtrace
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
function run_spdk_tgt() {
|
2020-05-11 21:15:03 +00:00
|
|
|
$SPDK_BIN_DIR/spdk_tgt -m 0x3 -p 0 -s 4096 &
|
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() {
|
2020-05-11 21:15:03 +00:00
|
|
|
$SPDK_BIN_DIR/nvmf_tgt -m 0x3 -p 0 -s 4096 &
|
2018-11-27 18:58:25 +00:00
|
|
|
nvmf_tgt_pid=$!
|
|
|
|
waitforlisten $nvmf_tgt_pid
|
|
|
|
}
|
|
|
|
|
|
|
|
function run_vhost_tgt() {
|
2020-05-11 21:15:03 +00:00
|
|
|
$SPDK_BIN_DIR/vhost -m 0x3 -p 0 -s 4096 &
|
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
|
|
|
}
|