test/spdkcli: cleanup includes

autotest_common.sh used to be sourced from
test/spdkcli/common.sh (and it still is - we'll clean
it up in a separate patch). Let's source that file in
each spdkcli test script, just like we do in every
other test script.

Change-Id: I2e021bcda7402ee0c5a4a5f45f921bb0142b6783
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458176
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Darek Stojaczyk 2019-06-16 07:47:10 +02:00
parent 012804ebcf
commit d77b0a6720
7 changed files with 41 additions and 26 deletions

View File

@ -1,11 +1,13 @@
#!/usr/bin/env bash
set -xe
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/spdkcli/common.sh
source $rootdir/test/iscsi_tgt/common.sh
MATCH_FILE="spdkcli_iscsi.test"
SPDKCLI_BRANCH="/iscsi"
testdir=$(readlink -f $(dirname $0))
. $testdir/common.sh
. $testdir/../iscsi_tgt/common.sh
timing_enter spdkcli_iscsi
trap 'on_error_exit;' ERR

View File

@ -1,11 +1,13 @@
#!/usr/bin/env bash
set -xe
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/spdkcli/common.sh
source $rootdir/test/nvmf/common.sh
MATCH_FILE="spdkcli_nvmf.test"
SPDKCLI_BRANCH="/nvmf"
testdir=$(readlink -f $(dirname $0))
. $testdir/common.sh
. $testdir/../nvmf/common.sh
timing_enter spdkcli_nvmf
trap 'on_error_exit; revert_soft_roce' ERR

View File

@ -1,10 +1,12 @@
#!/usr/bin/env bash
set -xe
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/spdkcli/common.sh
MATCH_FILE="spdkcli_pmem.test"
SPDKCLI_BRANCH="/bdevs/pmemblk"
testdir=$(readlink -f $(dirname $0))
. $testdir/common.sh
timing_enter spdkcli_pmem
trap 'on_error_exit;' ERR

View File

@ -1,5 +1,10 @@
#!/usr/bin/env bash
set -xe
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/spdkcli/common.sh
source $rootdir/test/iscsi_tgt/common.sh
MATCH_FILE="spdkcli_raid.test"
SPDKCLI_BRANCH="/bdevs"

View File

@ -1,10 +1,12 @@
#!/usr/bin/env bash
set -xe
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/spdkcli/common.sh
MATCH_FILE="spdkcli_rbd.test"
SPDKCLI_BRANCH="/bdevs/rbd"
testdir=$(readlink -f $(dirname $0))
. $testdir/common.sh
timing_enter spdk_cli_rbd
trap 'on_error_exit' ERR
@ -14,7 +16,6 @@ timing_exit run_spdk_tgt
timing_enter spdkcli_create_rbd_config
trap 'rbd_cleanup; on_error_exit' ERR
rootdir=$(readlink -f $SPDKCLI_BUILD_DIR)
rbd_cleanup
rbd_setup 127.0.0.1
$spdkcli_job "'/bdevs/rbd create rbd foo 512' 'Ceph0' True

View File

@ -1,10 +1,12 @@
#!/usr/bin/env bash
set -xe
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/spdkcli/common.sh
MATCH_FILE="spdkcli_vhost.test"
SPDKCLI_BRANCH="/"
testdir=$(readlink -f $(dirname $0))
. $testdir/common.sh
timing_enter spdk_cli_vhost
trap 'on_error_exit' ERR
@ -29,8 +31,8 @@ dd if=/dev/zero of=/tmp/sample_aio2 bs=2048 count=5000
$spdkcli_job "'/bdevs/aio create sample0 /tmp/sample_aio 512' 'sample0' True
'/bdevs/aio create sample1 /tmp/sample_aio2 512' 'sample1' True
"
trtype=$($SPDKCLI_BUILD_DIR/scripts/gen_nvme.sh --json | jq -r '.config[].params | select(.name=="Nvme0").trtype')
traddr=$($SPDKCLI_BUILD_DIR/scripts/gen_nvme.sh --json | jq -r '.config[].params | select(.name=="Nvme0").traddr')
trtype=$($rootdir/scripts/gen_nvme.sh --json | jq -r '.config[].params | select(.name=="Nvme0").trtype')
traddr=$($rootdir/scripts/gen_nvme.sh --json | jq -r '.config[].params | select(.name=="Nvme0").traddr')
$spdkcli_job "'/bdevs/nvme create Nvme0 $trtype $traddr' 'Nvme0' True
'/bdevs/split_disk split_bdev Nvme0n1 4' 'Nvme0n1p0' True
"
@ -68,8 +70,8 @@ $spdkcli_job "'save_config $testdir/config.json'
timing_exit spdkcli_save_config
timing_enter spdkcli_check_match_details
$SPDKCLI_BUILD_DIR/scripts/spdkcli.py bdevs/split_disk/Nvme0n1p0 show_details | jq -r -S '.' > $testdir/match_files/spdkcli_details_vhost.test
$SPDKCLI_BUILD_DIR/test/app/match/match -v $testdir/match_files/spdkcli_details_vhost.test.match
$rootdir/scripts/spdkcli.py bdevs/split_disk/Nvme0n1p0 show_details | jq -r -S '.' > $testdir/match_files/spdkcli_details_vhost.test
$rootdir/test/app/match/match -v $testdir/match_files/spdkcli_details_vhost.test.match
rm -f $testdir/match_files/spdkcli_details_vhost.test
timing_exit spdkcli_check_match_details

View File

@ -1,8 +1,9 @@
#!/usr/bin/env bash
set -xe
testdir=$(readlink -f $(dirname $0))
. $testdir/common.sh
rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/spdkcli/common.sh
trap 'killprocess $virtio_pid; on_error_exit' ERR
timing_enter spdk_cli_vhost_init
@ -12,7 +13,7 @@ run_spdk_tgt
timing_exit run_spdk_tgt
timing_enter run_spdk_virtio
$SPDKCLI_BUILD_DIR/app/spdk_tgt/spdk_tgt -m 0x4 -p 0 -g -u -s 1024 -r /var/tmp/virtio.sock &
$rootdir/app/spdk_tgt/spdk_tgt -m 0x4 -p 0 -g -u -s 1024 -r /var/tmp/virtio.sock &
virtio_pid=$!
waitforlisten $virtio_pid /var/tmp/virtio.sock
timing_exit run_spdk_virtio