From f1b3df73b6c841b41f317013d2d7a31be92f7ee3 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Wed, 26 Sep 2018 08:23:44 -0700 Subject: [PATCH] test/common: Configure repo locations inline in vm_setup This allows a userto run the script without specifying a configuration file. Removing this dependency opens us up to things like calling vm_setup directly from a vagrantfile without having to first copy the spdk source over. Change-Id: I72074a445f8befc714c03cab57a2da539350c092 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/426944 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker Chandler-Test-Pool: SPDK Automated Test System --- test/common/config/vm_setup.conf | 1 + test/common/config/vm_setup.sh | 23 ++++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/test/common/config/vm_setup.conf b/test/common/config/vm_setup.conf index 5ccba87ca2..40acea662d 100644 --- a/test/common/config/vm_setup.conf +++ b/test/common/config/vm_setup.conf @@ -1,3 +1,4 @@ +# This configuration file is provided for reference purposes. GIT_REPO_SPDK=https://review.gerrithub.io/spdk/spdk GIT_REPO_DPDK=https://github.com/spdk/dpdk.git GIT_REPO_LIBRXE=https://github.com/SoftRoCE/librxe-dev.git diff --git a/test/common/config/vm_setup.sh b/test/common/config/vm_setup.sh index 3e1eefcd40..eeff9a37a2 100755 --- a/test/common/config/vm_setup.sh +++ b/test/common/config/vm_setup.sh @@ -25,7 +25,6 @@ VM_SETUP_PATH=$(readlink -f ${BASH_SOURCE%/*}) UPGRADE=false INSTALL=false CONF="librxe,iscsi,rocksdb,fio,flamegraph,tsocks,qemu,vpp,libiscsi,nvmecli" -CONF_PATH="${VM_SETUP_PATH}/vm_setup.conf" function install_rxe_cfg() { @@ -288,14 +287,28 @@ while getopts 'iuht:c:-:' optchar; do esac done -if [ ! -f "$CONF_PATH" ]; then - echo Configuration file does not exist: "$CONF_PATH" - exit 1 +if [ ! -z "$CONF_PATH" ]; then + if [ ! -f "$CONF_PATH" ]; then + echo Configuration file does not exist: "$CONF_PATH" + exit 1 + else + source "$CONF_PATH" + fi fi cd ~ -source "$CONF_PATH" +: ${GIT_REPO_SPDK=https://review.gerrithub.io/spdk/spdk}; export GIT_REPO_SPDK +: ${GIT_REPO_DPDK=https://github.com/spdk/dpdk.git}; export GIT_REPO_DPDK +: ${GIT_REPO_LIBRXE=https://github.com/SoftRoCE/librxe-dev.git}; export GIT_REPO_LIBRXE +: ${GIT_REPO_OPEN_ISCSI=https://github.com/open-iscsi/open-iscsi}; export GIT_REPO_OPEN_ISCSI +: ${GIT_REPO_ROCKSDB=https://review.gerrithub.io/spdk/rocksdb}; export GIT_REPO_ROCKSDB +: ${GIT_REPO_FIO=http://git.kernel.dk/fio.git}; export GIT_REPO_FIO +: ${GIT_REPO_FLAMEGRAPH=https://github.com/brendangregg/FlameGraph.git}; export GIT_REPO_FLAMEGRAPH +: ${GIT_REPO_QEMU=https://github.com/spdk/qemu}; export GIT_REPO_QEMU +: ${GIT_REPO_VPP=https://gerrit.fd.io/r/vpp}; export GIT_REPO_VPP +: ${GIT_REPO_LIBISCSI=https://github.com/sahlberg/libiscsi}; export GIT_REPO_LIBISCSI +: ${GIT_REPO_SPDK_NVME_CLI=https://github.com/spdk/nvme-cli}; export GIT_REPO_SPDK_NVME_CLI jobs=$(($(nproc)*2))