test: vm_setup.sh localization
Change-Id: Ief3a1fbde5d8eabefa87c39feefe3d496e3a5369 Signed-off-by: Ed Rodriguez <ed.rodriguez@netapp.com> Signed-off-by: John Meneghini <johnm@netapp.com> Reviewed-on: https://review.gerrithub.io/418236 Reviewed-by: Seth Howell <seth.howell5141@gmail.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
806f43b26d
commit
2e0df7813e
10
test/common/config/vm_setup.conf
Normal file
10
test/common/config/vm_setup.conf
Normal file
@ -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
|
@ -20,9 +20,12 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
VM_SETUP_PATH=$(readlink -f ${BASH_SOURCE%/*})
|
||||||
|
|
||||||
UPGRADE=false
|
UPGRADE=false
|
||||||
INSTALL=false
|
INSTALL=false
|
||||||
CONF="librxe,iscsi,rocksdb,fio,flamegraph,tsocks,qemu,vpp,libiscsi"
|
CONF="librxe,iscsi,rocksdb,fio,flamegraph,tsocks,qemu,vpp,libiscsi"
|
||||||
|
CONF_PATH="${VM_SETUP_PATH}/vm_setup.conf"
|
||||||
|
|
||||||
function usage()
|
function usage()
|
||||||
{
|
{
|
||||||
@ -34,10 +37,11 @@ function usage()
|
|||||||
echo " -u --upgrade Run dnf upgrade"
|
echo " -u --upgrade Run dnf upgrade"
|
||||||
echo " -i --install-deps Install dnf based dependencies"
|
echo " -i --install-deps Install dnf based dependencies"
|
||||||
echo " -t --test-conf List of test configurations to enable (${CONF})"
|
echo " -t --test-conf List of test configurations to enable (${CONF})"
|
||||||
|
echo " -c --conf-path Path to configuration file"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
while getopts 'iuht:-:' optchar; do
|
while getopts 'iuht:c:-:' optchar; do
|
||||||
case "$optchar" in
|
case "$optchar" in
|
||||||
-)
|
-)
|
||||||
case "$OPTARG" in
|
case "$OPTARG" in
|
||||||
@ -45,6 +49,7 @@ while getopts 'iuht:-:' optchar; do
|
|||||||
upgrade) UPGRADE=true;;
|
upgrade) UPGRADE=true;;
|
||||||
install-deps) INSTALL=true;;
|
install-deps) INSTALL=true;;
|
||||||
test-conf=*) CONF="${OPTARG#*=}";;
|
test-conf=*) CONF="${OPTARG#*=}";;
|
||||||
|
conf-path=*) CONF_PATH="${OPTARG#*=}";;
|
||||||
*) echo "Invalid argument '$OPTARG'"
|
*) echo "Invalid argument '$OPTARG'"
|
||||||
usage;;
|
usage;;
|
||||||
esac
|
esac
|
||||||
@ -53,11 +58,19 @@ while getopts 'iuht:-:' optchar; do
|
|||||||
u) UPGRADE=true;;
|
u) UPGRADE=true;;
|
||||||
i) INSTALL=true;;
|
i) INSTALL=true;;
|
||||||
t) CONF="$OPTARG";;
|
t) CONF="$OPTARG";;
|
||||||
|
c) CONF_PATH="$OPTARG";;
|
||||||
*) echo "Invalid argument '$OPTARG'"
|
*) echo "Invalid argument '$OPTARG'"
|
||||||
usage;;
|
usage;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ ! -f "$CONF_PATH" ]; then
|
||||||
|
echo Configuration file does not exist: "$CONF_PATH"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
source "$CONF_PATH"
|
||||||
|
|
||||||
jobs=$(($(nproc)*2))
|
jobs=$(($(nproc)*2))
|
||||||
|
|
||||||
if $UPGRADE; then
|
if $UPGRADE; then
|
||||||
@ -76,9 +89,10 @@ mkdir -p output
|
|||||||
if [ -d spdk ]; then
|
if [ -d spdk ]; then
|
||||||
echo "spdk source already present, not cloning"
|
echo "spdk source already present, not cloning"
|
||||||
else
|
else
|
||||||
git clone https://review.gerrithub.io/spdk/spdk
|
git clone "${GIT_REPO_SPDK}"
|
||||||
fi
|
fi
|
||||||
cd spdk
|
cd spdk
|
||||||
|
git config submodule.dpdk.url "${GIT_REPO_DPDK}"
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
|
|
||||||
if $INSTALL; then
|
if $INSTALL; then
|
||||||
@ -132,7 +146,7 @@ if echo $CONF | grep -q librxe; then
|
|||||||
if [ -d librxe-dev ]; then
|
if [ -d librxe-dev ]; then
|
||||||
echo "librxe-dev source already present, not cloning"
|
echo "librxe-dev source already present, not cloning"
|
||||||
else
|
else
|
||||||
git clone https://github.com/SoftRoCE/librxe-dev.git
|
git clone "${GIT_REPO_LIBRXE}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd librxe-dev
|
cd librxe-dev
|
||||||
@ -158,7 +172,7 @@ if echo $CONF | grep -q iscsi; then
|
|||||||
rpm2cpio $(ls) | cpio -idmv
|
rpm2cpio $(ls) | cpio -idmv
|
||||||
mkdir -p patches
|
mkdir -p patches
|
||||||
mv 00* patches/
|
mv 00* patches/
|
||||||
git clone https://github.com/open-iscsi/open-iscsi
|
git clone "${GIT_REPO_OPEN_ISCSI}"
|
||||||
|
|
||||||
cd 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.
|
# Rocksdb is installed for use with the blobfs tests.
|
||||||
if [ ! -d /usr/src/rocksdb ]; then
|
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
|
git -C ./rocksdb checkout spdk-v5.6.1
|
||||||
sudo mv rocksdb /usr/src/
|
sudo mv rocksdb /usr/src/
|
||||||
else
|
else
|
||||||
@ -200,7 +214,7 @@ if echo $CONF | grep -q fio; then
|
|||||||
# building the spdk fio plugin.
|
# building the spdk fio plugin.
|
||||||
if [ ! -d /usr/src/fio ]; then
|
if [ ! -d /usr/src/fio ]; then
|
||||||
if [ ! -d fio ]; then
|
if [ ! -d fio ]; then
|
||||||
git clone http://git.kernel.dk/fio.git
|
git clone "${GIT_REPO_FIO}"
|
||||||
sudo mv fio /usr/src/
|
sudo mv fio /usr/src/
|
||||||
else
|
else
|
||||||
sudo mv fio /usr/src/
|
sudo mv fio /usr/src/
|
||||||
@ -223,7 +237,7 @@ cd ~
|
|||||||
if echo $CONF | grep -q flamegraph; then
|
if echo $CONF | grep -q flamegraph; then
|
||||||
# Flamegraph is used when printing out timing graphs for the tests.
|
# Flamegraph is used when printing out timing graphs for the tests.
|
||||||
if [ ! -d /usr/local/FlameGraph ]; then
|
if [ ! -d /usr/local/FlameGraph ]; then
|
||||||
git clone https://github.com/brendangregg/FlameGraph.git
|
git clone "${GIT_REPO_FLAMEGRAPH}"
|
||||||
mkdir -p /usr/local
|
mkdir -p /usr/local
|
||||||
sudo mv FlameGraph /usr/local/FlameGraph
|
sudo mv FlameGraph /usr/local/FlameGraph
|
||||||
else
|
else
|
||||||
@ -237,7 +251,7 @@ if echo $CONF | grep -q qemu; then
|
|||||||
mkdir -p qemu
|
mkdir -p qemu
|
||||||
cd qemu
|
cd qemu
|
||||||
if [ ! -d "$SPDK_QEMU_BRANCH" ]; then
|
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
|
else
|
||||||
echo "qemu already checked out. Skipping"
|
echo "qemu already checked out. Skipping"
|
||||||
fi
|
fi
|
||||||
@ -272,7 +286,7 @@ if echo $CONF | grep -q vpp; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
git clone https://gerrit.fd.io/r/vpp
|
git clone "${GIT_REPO_VPP}"
|
||||||
cd vpp
|
cd vpp
|
||||||
git checkout v18.01.1
|
git checkout v18.01.1
|
||||||
# VPP 18.01.1 does not support OpenSSL 1.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
|
# 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.
|
# to later. Cloning from git is just future proofing the machines.
|
||||||
if [ ! -d libiscsi ]; then
|
if [ ! -d libiscsi ]; then
|
||||||
git clone https://github.com/sahlberg/libiscsi
|
git clone "${GIT_REPO_LIBISCSI}"
|
||||||
else
|
else
|
||||||
echo "libiscsi already checked out. Skipping"
|
echo "libiscsi already checked out. Skipping"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user