]> git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/test/spdkcli/common.sh
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / spdk / test / spdkcli / common.sh
1 set -xe
2
3 testdir=$(readlink -f $(dirname $0))
4 SPDKCLI_BUILD_DIR=$(readlink -f $testdir/../..)
5 spdkcli_job="$SPDKCLI_BUILD_DIR/test/spdkcli/spdkcli_job.py"
6 . $SPDKCLI_BUILD_DIR/test/common/autotest_common.sh
7
8 function on_error_exit() {
9 set +e
10 killprocess $spdk_tgt_pid
11 rm -f $testdir/${MATCH_FILE} $testdir/match_files/spdkcli_details_vhost.test /tmp/sample_aio /tmp/sample_pmem
12 print_backtrace
13 exit 1
14 }
15
16 function run_spdk_tgt() {
17 $SPDKCLI_BUILD_DIR/app/spdk_tgt/spdk_tgt -m 0x3 -p 0 -s 4096 &
18 spdk_tgt_pid=$!
19 waitforlisten $spdk_tgt_pid
20 }
21
22 function check_match() {
23 $SPDKCLI_BUILD_DIR/scripts/spdkcli.py ll $SPDKCLI_BRANCH > $testdir/match_files/${MATCH_FILE}
24 $SPDKCLI_BUILD_DIR/test/app/match/match -v $testdir/match_files/${MATCH_FILE}.match
25 rm -f $testdir/match_files/${MATCH_FILE}
26 }