From f04277f0bffce0df4f32e87d1b3e37ac586b02e1 Mon Sep 17 00:00:00 2001 From: John Meneghini Date: Fri, 22 Jun 2018 02:16:10 -0700 Subject: [PATCH] test: remove more sys_sgsw dependencies from test scripts - To override the default /home/sys_sgsw dependency add DEPENDENCY_DIR to ~/autorun-spdk.conf E.g.: DEPENDENCY_DIR=/home/vagrant - To override the default HUGEPAGES use add HUGEMEM to ~/autorun-spdk.conf E.g.: HUGEMEM=1024 Change-Id: Ib8db9d7d053ae319fe4c725159742875468d47f0 Signed-off-by: John Meneghini Signed-off-by: Ed Rodriguez Reviewed-on: https://review.gerrithub.io/415907 Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp Reviewed-by: Jim Harris --- test/common/autotest_common.sh | 14 ++++++++++++-- test/nvme/hotplug.sh | 11 ++++++++--- test/nvme/spdk_nvme_cli.sh | 8 +++++++- test/nvmf/nvme_cli/nvme_cli.sh | 8 +++++++- 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index ab5d97898..12cca86ce 100755 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -56,6 +56,16 @@ fi : ${SPDK_RUN_ASAN=1}; export SPDK_RUN_ASAN : ${SPDK_RUN_UBSAN=1}; export SPDK_RUN_UBSAN +if [ -z "$DEPENDENCY_DIR" ]; then + export DEPENDENCY_DIR=/home/sys_sgsw +else + export DEPENDENCY_DIR +fi + +if [ ! -z "$HUGEMEM" ]; then + export HUGEMEM +fi + # pass our valgrind desire on to unittest.sh if [ $SPDK_RUN_VALGRIND -eq 0 ]; then export valgrind='' @@ -132,8 +142,8 @@ if [ -d /usr/src/fio ]; then config_params+=' --with-fio=/usr/src/fio' fi -if [ -d /home/sys_sgsw/vtune_codes ]; then - config_params+=' --with-vtune=/home/sys_sgsw/vtune_codes' +if [ -d ${DEPENDENCY_DIR}/vtune_codes ]; then + config_params+=' --with-vtune='${DEPENDENCY_DIR}'/vtune_codes' fi if [ -d /usr/include/rbd ] && [ -d /usr/include/rados ]; then diff --git a/test/nvme/hotplug.sh b/test/nvme/hotplug.sh index b6e8f250d..ca661b6f8 100755 --- a/test/nvme/hotplug.sh +++ b/test/nvme/hotplug.sh @@ -6,6 +6,11 @@ testdir=$(readlink -f $(dirname $0)) rootdir=$(readlink -f $testdir/../..) source $rootdir/test/common/autotest_common.sh +if [ -z "${DEPENDENCY_DIR}" ]; then + echo DEPENDENCY_DIR not defined! + exit 1 +fi + function ssh_vm() { sshpass -p "$password" ssh -o PubkeyAuthentication=no -o StrictHostKeyChecking=no -p 10022 root@localhost "$@" } @@ -72,9 +77,9 @@ function devices_delete() { } password=$1 -base_img=/home/sys_sgsw/fedora24.img -test_img=/home/sys_sgsw/fedora24_test.img -qemu_pidfile=/home/sys_sgsw/qemupid +base_img=${DEPENDENCY_DIR}/fedora24.img +test_img=${DEPENDENCY_DIR}/fedora24_test.img +qemu_pidfile=${DEPENDENCY_DIR}/qemupid if [ ! -e "$base_img" ]; then echo "Hotplug VM image not found; skipping test" diff --git a/test/nvme/spdk_nvme_cli.sh b/test/nvme/spdk_nvme_cli.sh index a3cff6d7d..9984f8c4a 100755 --- a/test/nvme/spdk_nvme_cli.sh +++ b/test/nvme/spdk_nvme_cli.sh @@ -6,7 +6,13 @@ testdir=$(readlink -f $(dirname $0)) rootdir=$(readlink -f $testdir/../..) source $rootdir/scripts/common.sh source $rootdir/test/common/autotest_common.sh -spdk_nvme_cli="/home/sys_sgsw/nvme-cli" + +if [ -z "${DEPENDENCY_DIR}" ]; then + echo DEPENDENCY_DIR not defined! + exit 1 +fi + +spdk_nvme_cli="${DEPENDENCY_DIR}/nvme-cli" if [ ! -d $spdk_nvme_cli ]; then echo "nvme-cli repository not found at $spdk_nvme_cli; skipping tests." diff --git a/test/nvmf/nvme_cli/nvme_cli.sh b/test/nvmf/nvme_cli/nvme_cli.sh index 8028897c0..c2171def2 100755 --- a/test/nvmf/nvme_cli/nvme_cli.sh +++ b/test/nvmf/nvme_cli/nvme_cli.sh @@ -4,7 +4,13 @@ testdir=$(readlink -f $(dirname $0)) rootdir=$(readlink -f $testdir/../../..) source $rootdir/test/common/autotest_common.sh source $rootdir/test/nvmf/common.sh -spdk_nvme_cli="/home/sys_sgsw/nvme-cli" + +if [ -z "${DEPENDENCY_DIR}" ]; then + echo DEPENDENCY_DIR not defined! + exit 1 +fi + +spdk_nvme_cli="${DEPENDENCY_DIR}/nvme-cli" MALLOC_BDEV_SIZE=64 MALLOC_BLOCK_SIZE=512