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
|
2018-11-27 18:58:25 +00:00
|
|
|
if [ ! -z $spdk_tgt_pid ]; then
|
|
|
|
killprocess $spdk_tgt_pid
|
|
|
|
fi
|
|
|
|
if [ ! -z $nvmf_tgt_pid ]; then
|
|
|
|
killprocess $nvmf_tgt_pid
|
|
|
|
fi
|
|
|
|
if [ ! -z $iscsi_tgt_pid ]; then
|
|
|
|
killprocess $iscsi_tgt_pid
|
|
|
|
fi
|
|
|
|
if [ ! -z $vhost_tgt_pid ]; then
|
|
|
|
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() {
|
2019-06-16 05:52:43 +00:00
|
|
|
$rootdir/app/spdk_tgt/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() {
|
2019-06-16 05:52:43 +00:00
|
|
|
$rootdir/app/nvmf_tgt/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_iscsi_tgt() {
|
2019-06-16 05:52:43 +00:00
|
|
|
$rootdir/app/iscsi_tgt/iscsi_tgt -m 0x3 -p 0 -s 4096 &
|
2018-11-27 18:58:25 +00:00
|
|
|
iscsi_tgt_pid=$!
|
|
|
|
waitforlisten $iscsi_tgt_pid
|
|
|
|
}
|
|
|
|
|
|
|
|
function run_vhost_tgt() {
|
2019-06-16 05:52:43 +00:00
|
|
|
$rootdir/app/vhost/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}
|
|
|
|
$rootdir/test/app/match/match -v $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
|
|
|
}
|