2018-06-22 21:27:31 +02:00
|
|
|
set -xe
|
|
|
|
|
|
|
|
testdir=$(readlink -f $(dirname $0))
|
|
|
|
SPDKCLI_BUILD_DIR=$(readlink -f $testdir/../..)
|
2018-09-11 15:26:14 +02:00
|
|
|
spdkcli_job="$SPDKCLI_BUILD_DIR/test/spdkcli/spdkcli_job.py"
|
2018-11-07 14:57:38 +01:00
|
|
|
spdk_clear_config_py="$SPDKCLI_BUILD_DIR/test/json_config/clear_config.py"
|
2018-06-22 21:27:31 +02:00
|
|
|
. $SPDKCLI_BUILD_DIR/test/common/autotest_common.sh
|
|
|
|
|
|
|
|
function on_error_exit() {
|
|
|
|
set +e
|
2018-11-27 13:58:25 -05: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 11:30:59 -04:00
|
|
|
rm -f $testdir/${MATCH_FILE} $testdir/match_files/spdkcli_details_vhost.test /tmp/sample_aio /tmp/sample_pmem
|
2018-06-22 21:27:31 +02:00
|
|
|
print_backtrace
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
function run_spdk_tgt() {
|
2018-10-22 17:00:33 -07:00
|
|
|
$SPDKCLI_BUILD_DIR/app/spdk_tgt/spdk_tgt -m 0x3 -p 0 -s 4096 &
|
2018-06-22 21:27:31 +02:00
|
|
|
spdk_tgt_pid=$!
|
|
|
|
waitforlisten $spdk_tgt_pid
|
|
|
|
}
|
|
|
|
|
2018-11-27 13:58:25 -05:00
|
|
|
function run_nvmf_tgt() {
|
|
|
|
$SPDKCLI_BUILD_DIR/app/nvmf_tgt/nvmf_tgt -m 0x3 -p 0 -s 4096 &
|
|
|
|
nvmf_tgt_pid=$!
|
|
|
|
waitforlisten $nvmf_tgt_pid
|
|
|
|
}
|
|
|
|
|
|
|
|
function run_iscsi_tgt() {
|
|
|
|
$SPDKCLI_BUILD_DIR/app/iscsi_tgt/iscsi_tgt -m 0x3 -p 0 -s 4096 &
|
|
|
|
iscsi_tgt_pid=$!
|
|
|
|
waitforlisten $iscsi_tgt_pid
|
|
|
|
}
|
|
|
|
|
|
|
|
function run_vhost_tgt() {
|
|
|
|
$SPDKCLI_BUILD_DIR/app/vhost/vhost -m 0x3 -p 0 -s 4096 &
|
|
|
|
vhost_tgt_pid=$!
|
|
|
|
waitforlisten $vhost_tgt_pid
|
|
|
|
}
|
|
|
|
|
2018-06-22 21:27:31 +02:00
|
|
|
function check_match() {
|
2018-09-11 15:26:14 +02:00
|
|
|
$SPDKCLI_BUILD_DIR/scripts/spdkcli.py ll $SPDKCLI_BRANCH > $testdir/match_files/${MATCH_FILE}
|
2018-07-26 16:59:39 +02:00
|
|
|
$SPDKCLI_BUILD_DIR/test/app/match/match -v $testdir/match_files/${MATCH_FILE}.match
|
|
|
|
rm -f $testdir/match_files/${MATCH_FILE}
|
2018-06-22 21:27:31 +02:00
|
|
|
}
|