diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/spdk/test/spdkcli/common.sh | |
parent | Initial commit. (diff) | |
download | ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/spdk/test/spdkcli/common.sh')
-rw-r--r-- | src/spdk/test/spdkcli/common.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/spdk/test/spdkcli/common.sh b/src/spdk/test/spdkcli/common.sh new file mode 100644 index 00000000..80ea6ab1 --- /dev/null +++ b/src/spdk/test/spdkcli/common.sh @@ -0,0 +1,26 @@ +set -xe + +testdir=$(readlink -f $(dirname $0)) +SPDKCLI_BUILD_DIR=$(readlink -f $testdir/../..) +spdkcli_job="$SPDKCLI_BUILD_DIR/test/spdkcli/spdkcli_job.py" +. $SPDKCLI_BUILD_DIR/test/common/autotest_common.sh + +function on_error_exit() { + set +e + killprocess $spdk_tgt_pid + rm -f $testdir/${MATCH_FILE} $testdir/match_files/spdkcli_details_vhost.test /tmp/sample_aio /tmp/sample_pmem + print_backtrace + exit 1 +} + +function run_spdk_tgt() { + $SPDKCLI_BUILD_DIR/app/spdk_tgt/spdk_tgt -m 0x3 -p 0 -s 4096 & + spdk_tgt_pid=$! + waitforlisten $spdk_tgt_pid +} + +function check_match() { + $SPDKCLI_BUILD_DIR/scripts/spdkcli.py ll $SPDKCLI_BRANCH > $testdir/match_files/${MATCH_FILE} + $SPDKCLI_BUILD_DIR/test/app/match/match -v $testdir/match_files/${MATCH_FILE}.match + rm -f $testdir/match_files/${MATCH_FILE} +} |