test: always parse common script args
Good suggestion from Darek - let's just always parse common script args from autotest_common.sh. These arguments follow common arg naming conventions (i.e. --iso) so there's no harm just doing this for any test that sources autotest_common.sh. This has the nice effect of not requiring scripts to explicitly call this function. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: Id89b68c22557a5a771be407873d0e57843f0d05a Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455552 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Seth Howell <seth.howell5141@gmail.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
parent
4227aeb7fc
commit
6a8a1b6bef
@ -189,6 +189,21 @@ if [ -z "$output_dir" ]; then
|
|||||||
export output_dir
|
export output_dir
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
TEST_MODE=
|
||||||
|
for i in "$@"; do
|
||||||
|
case "$i" in
|
||||||
|
--iso)
|
||||||
|
TEST_MODE=iso
|
||||||
|
;;
|
||||||
|
--transport=*)
|
||||||
|
TEST_TRANSPORT="${i#*=}"
|
||||||
|
;;
|
||||||
|
--sock=*)
|
||||||
|
TEST_SOCK="${i#*=}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
function timing() {
|
function timing() {
|
||||||
direction="$1"
|
direction="$1"
|
||||||
testname="$2"
|
testname="$2"
|
||||||
@ -236,23 +251,6 @@ function timing_finish() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function parse_common_script_args() {
|
|
||||||
TEST_MODE=
|
|
||||||
for i in "$@"; do
|
|
||||||
case "$i" in
|
|
||||||
--iso)
|
|
||||||
TEST_MODE=iso
|
|
||||||
;;
|
|
||||||
--transport=*)
|
|
||||||
TEST_TRANSPORT="${i#*=}"
|
|
||||||
;;
|
|
||||||
--sock=*)
|
|
||||||
TEST_SOCK="${i#*=}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
function create_test_list() {
|
function create_test_list() {
|
||||||
grep -rshI --exclude="autotest_common.sh" --exclude="$rootdir/test/common/autotest_common.sh" -e "report_test_completion" $rootdir | sed 's/report_test_completion//g; s/[[:blank:]]//g; s/"//g;' > $output_dir/all_tests.txt || true
|
grep -rshI --exclude="autotest_common.sh" --exclude="$rootdir/test/common/autotest_common.sh" -e "report_test_completion" $rootdir | sed 's/report_test_completion//g; s/[[:blank:]]//g; s/"//g;' > $output_dir/all_tests.txt || true
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/iscsi_tgt/common.sh
|
source $rootdir/test/iscsi_tgt/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
iscsitestinit $1 $2
|
iscsitestinit $1 $2
|
||||||
|
|
||||||
timing_enter bdev_io_wait
|
timing_enter bdev_io_wait
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
rpc_py="$rootdir/scripts/rpc.py"
|
rpc_py="$rootdir/scripts/rpc.py"
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
MALLOC_BDEV_SIZE=64
|
MALLOC_BDEV_SIZE=64
|
||||||
MALLOC_BLOCK_SIZE=512
|
MALLOC_BLOCK_SIZE=512
|
||||||
|
|
||||||
|
@ -6,8 +6,6 @@ source $rootdir/test/common/autotest_common.sh
|
|||||||
source $rootdir/scripts/common.sh
|
source $rootdir/scripts/common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
rpc_py="$rootdir/scripts/rpc.py"
|
rpc_py="$rootdir/scripts/rpc.py"
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
MALLOC_BDEV_SIZE=64
|
MALLOC_BDEV_SIZE=64
|
||||||
MALLOC_BLOCK_SIZE=512
|
MALLOC_BLOCK_SIZE=512
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
nvmftestinit
|
nvmftestinit
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
MALLOC_BDEV_SIZE=64
|
MALLOC_BDEV_SIZE=64
|
||||||
MALLOC_BLOCK_SIZE=512
|
MALLOC_BLOCK_SIZE=512
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
MALLOC_BDEV_SIZE=64
|
MALLOC_BDEV_SIZE=64
|
||||||
MALLOC_BLOCK_SIZE=512
|
MALLOC_BLOCK_SIZE=512
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
MALLOC_BDEV_SIZE=64
|
MALLOC_BDEV_SIZE=64
|
||||||
MALLOC_BLOCK_SIZE=512
|
MALLOC_BLOCK_SIZE=512
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
MALLOC_BDEV_SIZE=64
|
MALLOC_BDEV_SIZE=64
|
||||||
MALLOC_BLOCK_SIZE=512
|
MALLOC_BLOCK_SIZE=512
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
NULL_BDEV_SIZE=102400
|
NULL_BDEV_SIZE=102400
|
||||||
NULL_BLOCK_SIZE=512
|
NULL_BLOCK_SIZE=512
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
NULL_BDEV_SIZE=102400
|
NULL_BDEV_SIZE=102400
|
||||||
NULL_BLOCK_SIZE=512
|
NULL_BLOCK_SIZE=512
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
MALLOC_BDEV_SIZE=64
|
MALLOC_BDEV_SIZE=64
|
||||||
MALLOC_BLOCK_SIZE=512
|
MALLOC_BLOCK_SIZE=512
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
MALLOC_BDEV_SIZE=64
|
MALLOC_BDEV_SIZE=64
|
||||||
MALLOC_BLOCK_SIZE=512
|
MALLOC_BLOCK_SIZE=512
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
MALLOC_BDEV_SIZE=64
|
MALLOC_BDEV_SIZE=64
|
||||||
MALLOC_BLOCK_SIZE=512
|
MALLOC_BLOCK_SIZE=512
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
MALLOC_BDEV_SIZE=64
|
MALLOC_BDEV_SIZE=64
|
||||||
MALLOC_BLOCK_SIZE=512
|
MALLOC_BLOCK_SIZE=512
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
if [ -z "${DEPENDENCY_DIR}" ]; then
|
if [ -z "${DEPENDENCY_DIR}" ]; then
|
||||||
echo DEPENDENCY_DIR not defined!
|
echo DEPENDENCY_DIR not defined!
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
MALLOC_BDEV_SIZE=64
|
MALLOC_BDEV_SIZE=64
|
||||||
MALLOC_BLOCK_SIZE=512
|
MALLOC_BLOCK_SIZE=512
|
||||||
LVOL_BDEV_INIT_SIZE=20
|
LVOL_BDEV_INIT_SIZE=20
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
rpc_py="$rootdir/scripts/rpc.py"
|
rpc_py="$rootdir/scripts/rpc.py"
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
MALLOC_BDEV_SIZE=64
|
MALLOC_BDEV_SIZE=64
|
||||||
MALLOC_BLOCK_SIZE=512
|
MALLOC_BLOCK_SIZE=512
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
|
||||||
parse_common_script_args $@
|
|
||||||
|
|
||||||
MALLOC_BDEV_SIZE=64
|
MALLOC_BDEV_SIZE=64
|
||||||
MALLOC_BLOCK_SIZE=512
|
MALLOC_BLOCK_SIZE=512
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user