diff --git a/test/common/config/vm_setup.conf b/test/common/config/vm_setup.conf new file mode 100644 index 000000000..9b810cff8 --- /dev/null +++ b/test/common/config/vm_setup.conf @@ -0,0 +1,10 @@ +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 +GIT_REPO_OPEN_ISCSI=https://github.com/open-iscsi/open-iscsi +GIT_REPO_ROCKSDB=https://review.gerrithub.io/spdk/rocksdb +GIT_REPO_FIO=http://git.kernel.dk/fio.git +GIT_REPO_FLAMEGRAPH=https://github.com/brendangregg/FlameGraph.git +GIT_REPO_QEMU=https://github.com/spdk/qemu +GIT_REPO_VPP=https://gerrit.fd.io/r/vpp +GIT_REPO_LIBISCSI=https://github.com/sahlberg/libiscsi diff --git a/test/common/config/vm_setup.sh b/test/common/config/vm_setup.sh index 0087dc204..2d0fe1baf 100755 --- a/test/common/config/vm_setup.sh +++ b/test/common/config/vm_setup.sh @@ -20,9 +20,12 @@ set -e +VM_SETUP_PATH=$(readlink -f ${BASH_SOURCE%/*}) + UPGRADE=false INSTALL=false CONF="librxe,iscsi,rocksdb,fio,flamegraph,tsocks,qemu,vpp,libiscsi" +CONF_PATH="${VM_SETUP_PATH}/vm_setup.conf" function usage() { @@ -34,10 +37,11 @@ function usage() echo " -u --upgrade Run dnf upgrade" echo " -i --install-deps Install dnf based dependencies" echo " -t --test-conf List of test configurations to enable (${CONF})" + echo " -c --conf-path Path to configuration file" exit 0 } -while getopts 'iuht:-:' optchar; do +while getopts 'iuht:c:-:' optchar; do case "$optchar" in -) case "$OPTARG" in @@ -45,6 +49,7 @@ while getopts 'iuht:-:' optchar; do upgrade) UPGRADE=true;; install-deps) INSTALL=true;; test-conf=*) CONF="${OPTARG#*=}";; + conf-path=*) CONF_PATH="${OPTARG#*=}";; *) echo "Invalid argument '$OPTARG'" usage;; esac @@ -53,11 +58,19 @@ while getopts 'iuht:-:' optchar; do u) UPGRADE=true;; i) INSTALL=true;; t) CONF="$OPTARG";; + c) CONF_PATH="$OPTARG";; *) echo "Invalid argument '$OPTARG'" usage;; esac done +if [ ! -f "$CONF_PATH" ]; then + echo Configuration file does not exist: "$CONF_PATH" + exit 1 +fi + +source "$CONF_PATH" + jobs=$(($(nproc)*2)) if $UPGRADE; then @@ -76,9 +89,10 @@ mkdir -p output if [ -d spdk ]; then echo "spdk source already present, not cloning" else - git clone https://review.gerrithub.io/spdk/spdk + git clone "${GIT_REPO_SPDK}" fi cd spdk +git config submodule.dpdk.url "${GIT_REPO_DPDK}" git submodule update --init --recursive if $INSTALL; then @@ -132,7 +146,7 @@ if echo $CONF | grep -q librxe; then if [ -d librxe-dev ]; then echo "librxe-dev source already present, not cloning" else - git clone https://github.com/SoftRoCE/librxe-dev.git + git clone "${GIT_REPO_LIBRXE}" fi cd librxe-dev @@ -158,7 +172,7 @@ if echo $CONF | grep -q iscsi; then rpm2cpio $(ls) | cpio -idmv mkdir -p patches mv 00* patches/ - git clone https://github.com/open-iscsi/open-iscsi + git clone "${GIT_REPO_OPEN_ISCSI}" cd open-iscsi @@ -186,7 +200,7 @@ if echo $CONF | grep -q rocksdb; then # Rocksdb is installed for use with the blobfs tests. if [ ! -d /usr/src/rocksdb ]; then - git clone https://review.gerrithub.io/spdk/rocksdb + git clone "${GIT_REPO_ROCKSDB}" git -C ./rocksdb checkout spdk-v5.6.1 sudo mv rocksdb /usr/src/ else @@ -200,7 +214,7 @@ if echo $CONF | grep -q fio; then # building the spdk fio plugin. if [ ! -d /usr/src/fio ]; then if [ ! -d fio ]; then - git clone http://git.kernel.dk/fio.git + git clone "${GIT_REPO_FIO}" sudo mv fio /usr/src/ else sudo mv fio /usr/src/ @@ -223,7 +237,7 @@ cd ~ if echo $CONF | grep -q flamegraph; then # Flamegraph is used when printing out timing graphs for the tests. if [ ! -d /usr/local/FlameGraph ]; then - git clone https://github.com/brendangregg/FlameGraph.git + git clone "${GIT_REPO_FLAMEGRAPH}" mkdir -p /usr/local sudo mv FlameGraph /usr/local/FlameGraph else @@ -237,7 +251,7 @@ if echo $CONF | grep -q qemu; then mkdir -p qemu cd qemu if [ ! -d "$SPDK_QEMU_BRANCH" ]; then - git clone https://github.com/spdk/qemu -b "$SPDK_QEMU_BRANCH" "$SPDK_QEMU_BRANCH" + git clone "${GIT_REPO_QEMU}" -b "$SPDK_QEMU_BRANCH" "$SPDK_QEMU_BRANCH" else echo "qemu already checked out. Skipping" fi @@ -272,7 +286,7 @@ if echo $CONF | grep -q vpp; then exit 1 fi else - git clone https://gerrit.fd.io/r/vpp + git clone "${GIT_REPO_VPP}" cd vpp git checkout v18.01.1 # VPP 18.01.1 does not support OpenSSL 1.1. @@ -303,7 +317,7 @@ if echo $CONF | grep -q libiscsi; then # We currently don't make any changes to the libiscsi repository for our tests, but it is possible that we will need # to later. Cloning from git is just future proofing the machines. if [ ! -d libiscsi ]; then - git clone https://github.com/sahlberg/libiscsi + git clone "${GIT_REPO_LIBISCSI}" else echo "libiscsi already checked out. Skipping" fi