aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2018-04-19 14:52:50 +0200
committerJan Gelety <jgelety@cisco.com>2018-06-19 13:16:57 +0000
commit47b807e7268231b35982dc3b5a0c3108537d6432 (patch)
tree1ca34e1dd24b8b7cd5b9834033826459ab1434fb
parent67c6fbcb8c531d1013ee4cc866e6743589a90ba2 (diff)
Use pkg download script in bootstrap files
Download specific version of VPP/DKMS via download script. Change-Id: I6585790224d746a9edea7fa6624e810f389218e6 Signed-off-by: Peter Mikus <pmikus@cisco.com>
-rw-r--r--VPP_STABLE_VER_CENTOS2
-rw-r--r--VPP_STABLE_VER_UBUNTU2
-rw-r--r--bootstrap-verify-perf-ligato.sh37
-rwxr-xr-xbootstrap-verify-perf.sh39
-rw-r--r--bootstrap-vpp-verify-semiweekly.sh68
-rw-r--r--bootstrap-vpp-verify-weekly.sh89
-rwxr-xr-xbootstrap.sh92
7 files changed, 122 insertions, 207 deletions
diff --git a/VPP_STABLE_VER_CENTOS b/VPP_STABLE_VER_CENTOS
index 10b08f846a..ffebaae295 100644
--- a/VPP_STABLE_VER_CENTOS
+++ b/VPP_STABLE_VER_CENTOS
@@ -1 +1 @@
-18.07-rc0~278_gb2371c2~b4311.x86_64 \ No newline at end of file
+18.07-rc0~278_gb2371c2~b4311
diff --git a/VPP_STABLE_VER_UBUNTU b/VPP_STABLE_VER_UBUNTU
index d831ae3187..b29375bbf3 100644
--- a/VPP_STABLE_VER_UBUNTU
+++ b/VPP_STABLE_VER_UBUNTU
@@ -1 +1 @@
-18.07-rc0~278-gb2371c2~b4361_amd64 \ No newline at end of file
+18.07-rc0~278-gb2371c2~b4361
diff --git a/bootstrap-verify-perf-ligato.sh b/bootstrap-verify-perf-ligato.sh
index e3b130d3c2..0ede5901da 100644
--- a/bootstrap-verify-perf-ligato.sh
+++ b/bootstrap-verify-perf-ligato.sh
@@ -20,6 +20,8 @@ TOPOLOGIES="topologies/available/lf_testbed1.yaml \
topologies/available/lf_testbed3.yaml"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+export PYTHONPATH=${SCRIPT_DIR}
+export DEBIAN_FRONTEND=noninteractive
# Reservation dir
RESERVATION_DIR="/tmp/reservation_dir"
@@ -41,31 +43,23 @@ then
if [[ ${TEST_TAG} == *DAILY ]] || \
[[ ${TEST_TAG} == *WEEKLY ]];
then
- # Download the latest VPP build .deb install packages
- echo Downloading VPP packages...
- bash ${SCRIPT_DIR}/resources/tools/scripts/download_install_vpp_pkgs.sh --skip-install
-
- VPP_DEBS="$( readlink -f *.deb | tr '\n' ' ' )"
- # Take vpp package and get the vpp version
- VPP_STABLE_VER="$( expr match $(ls *.deb | head -n 1) 'vpp-\(.*\)-deb.deb' )"
+ echo Downloading latest VPP packages from NEXUS...
+ bash ${SCRIPT_DIR}/resources/tools/scripts/download_install_vpp_pkgs.sh \
+ --skip-install
else
- DPDK_STABLE_VER=$(cat ${SCRIPT_DIR}/DPDK_STABLE_VER)_amd64
- VPP_REPO_URL=$(cat ${SCRIPT_DIR}/VPP_REPO_URL_UBUNTU)
+ echo Downloading VPP packages of specific version from NEXUS...
+ DPDK_STABLE_VER=$(cat ${SCRIPT_DIR}/DPDK_STABLE_VER)
VPP_STABLE_VER=$(cat ${SCRIPT_DIR}/VPP_STABLE_VER_UBUNTU)
- VPP_CLASSIFIER="-deb"
- # Download vpp build from nexus and set VPP_DEBS variable
- wget -q "${VPP_REPO_URL}/vpp/${VPP_STABLE_VER}/vpp-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
- wget -q "${VPP_REPO_URL}/vpp-dbg/${VPP_STABLE_VER}/vpp-dbg-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
- wget -q "${VPP_REPO_URL}/vpp-dev/${VPP_STABLE_VER}/vpp-dev-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
- # Temporary disable using dpdk
- # wget -q "${VPP_REPO_URL}/vpp-dpdk-dkms/${DPDK_STABLE_VER}/vpp-dpdk-dkms-${DPDK_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
- wget -q "${VPP_REPO_URL}/vpp-lib/${VPP_STABLE_VER}/vpp-lib-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
- wget -q "${VPP_REPO_URL}/vpp-plugins/${VPP_STABLE_VER}/vpp-plugins-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
- VPP_DEBS="$( readlink -f *.deb | tr '\n' ' ' )"
+ #Temporary if arch will not be removed from VPP_STABLE_VER_UBUNTU
+ #VPP_STABLE_VER=${VPP_STABLE_VER%_amd64}
+ bash ${SCRIPT_DIR}/resources/tools/scripts/download_install_vpp_pkgs.sh \
+ --skip-install --vpp ${VPP_STABLE_VER} --dkms ${DPDK_STABLE_VER}
fi
+ # Jenkins VPP deb paths (convert to full path)
+ VPP_DEBS="$( readlink -f *.deb | tr '\n' ' ' )"
+ # Take vpp package and get the vpp version
+ VPP_STABLE_VER="$( expr match $(ls *.deb | head -n 1) 'vpp_\(.*\)_amd64.deb' )"
- # Temporary workaround as ligato docker file requires specific file name
- rename -v 's/^(.*)-(\d.*)-deb.deb/$1_$2.deb/' *.deb
cd ${SCRIPT_DIR}
# If we run this script from vpp project we want to use local build
@@ -158,7 +152,6 @@ DOCKER_IMAGE="$( readlink -f prod_vpp_agent.tar.gz | tr '\n' ' ' )"
cd ${SCRIPT_DIR}
WORKING_TOPOLOGY=""
-export PYTHONPATH=${SCRIPT_DIR}
sudo apt-get -y update
sudo apt-get -y install libpython2.7-dev python-virtualenv
diff --git a/bootstrap-verify-perf.sh b/bootstrap-verify-perf.sh
index f2e4df58de..5aca852e8f 100755
--- a/bootstrap-verify-perf.sh
+++ b/bootstrap-verify-perf.sh
@@ -20,6 +20,8 @@ TOPOLOGIES="topologies/available/lf_testbed1.yaml \
topologies/available/lf_testbed3.yaml"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+export PYTHONPATH=${SCRIPT_DIR}
+export DEBIAN_FRONTEND=noninteractive
# Reservation dir
RESERVATION_DIR="/tmp/reservation_dir"
@@ -35,35 +37,23 @@ mkdir -p ${LOG_ARCHIVE_DIR}
# If we run this script from CSIT jobs we want to use stable vpp version
if [[ ${JOB_NAME} == csit-* ]] ;
then
- mkdir vpp_download
- cd vpp_download
-
if [[ ${TEST_TAG} == *DAILY ]] || \
[[ ${TEST_TAG} == *WEEKLY ]];
then
- # Download the latest VPP build .deb install packages
- echo Downloading VPP packages...
- bash ${SCRIPT_DIR}/resources/tools/scripts/download_install_vpp_pkgs.sh --skip-install
-
- VPP_DEBS="$( readlink -f *.deb | tr '\n' ' ' )"
- # Take vpp package and get the vpp version
- VPP_STABLE_VER="$( expr match $(ls *.deb | head -n 1) 'vpp-\(.*\)-deb.deb' )"
+ echo Downloading latest VPP packages from NEXUS...
+ bash ${SCRIPT_DIR}/resources/tools/scripts/download_install_vpp_pkgs.sh \
+ --skip-install
else
- DPDK_STABLE_VER=$(cat ${SCRIPT_DIR}/DPDK_STABLE_VER)_amd64
- VPP_REPO_URL=$(cat ${SCRIPT_DIR}/VPP_REPO_URL_UBUNTU)
+ echo Downloading VPP packages of specific version from NEXUS...
+ DPDK_STABLE_VER=$(cat ${SCRIPT_DIR}/DPDK_STABLE_VER)
VPP_STABLE_VER=$(cat ${SCRIPT_DIR}/VPP_STABLE_VER_UBUNTU)
- VPP_CLASSIFIER="-deb"
- # Download vpp build from nexus and set VPP_DEBS variable
- wget -q "${VPP_REPO_URL}/vpp/${VPP_STABLE_VER}/vpp-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
- wget -q "${VPP_REPO_URL}/vpp-dbg/${VPP_STABLE_VER}/vpp-dbg-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
- wget -q "${VPP_REPO_URL}/vpp-dev/${VPP_STABLE_VER}/vpp-dev-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
- wget -q "${VPP_REPO_URL}/vpp-dpdk-dkms/${DPDK_STABLE_VER}/vpp-dpdk-dkms-${DPDK_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
- wget -q "${VPP_REPO_URL}/vpp-lib/${VPP_STABLE_VER}/vpp-lib-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
- wget -q "${VPP_REPO_URL}/vpp-plugins/${VPP_STABLE_VER}/vpp-plugins-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
- VPP_DEBS="$( readlink -f *.deb | tr '\n' ' ' )"
+ #Temporary if arch will not be removed from VPP_STABLE_VER_UBUNTU
+ #VPP_STABLE_VER=${VPP_STABLE_VER%_amd64}
+ bash ${SCRIPT_DIR}/resources/tools/scripts/download_install_vpp_pkgs.sh \
+ --skip-install --vpp ${VPP_STABLE_VER} --dkms ${DPDK_STABLE_VER}
fi
-
- cd ${SCRIPT_DIR}
+ # Jenkins VPP deb paths (convert to full path)
+ VPP_DEBS="$( readlink -f vpp*.deb | tr '\n' ' ' )"
# If we run this script from vpp project we want to use local build
elif [[ ${JOB_NAME} == vpp-* ]] ;
@@ -71,15 +61,12 @@ then
# Use local packages provided as argument list
# Jenkins VPP deb paths (convert to full path)
VPP_DEBS="$( readlink -f $@ | tr '\n' ' ' )"
- # Take vpp package and get the vpp version
- VPP_STABLE_VER="$( expr match $1 'vpp-\(.*\)-deb.deb' )"
else
echo "Unable to identify job type based on JOB_NAME variable: ${JOB_NAME}"
exit 1
fi
WORKING_TOPOLOGY=""
-export PYTHONPATH=${SCRIPT_DIR}
sudo apt-get -y update
sudo apt-get -y install libpython2.7-dev python-virtualenv
diff --git a/bootstrap-vpp-verify-semiweekly.sh b/bootstrap-vpp-verify-semiweekly.sh
index fa0c30b475..14453e3003 100644
--- a/bootstrap-vpp-verify-semiweekly.sh
+++ b/bootstrap-vpp-verify-semiweekly.sh
@@ -39,14 +39,22 @@ mkdir ${SCRIPT_DIR}/tmp
# Use tmp dir to store log files
LOG_PATH="${SCRIPT_DIR}/tmp"
-if [ -f "/etc/redhat-release" ]; then
+OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
+OS_VERSION_ID=$(grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
+
+if [ "$OS_ID" == "centos" ]; then
DISTRO="CENTOS"
+ PACKAGE="rpm"
sudo yum install -y python-devel python-virtualenv
-else
+elif [ "$OS_ID" == "ubuntu" ]; then
DISTRO="UBUNTU"
+ PACKAGE="deb"
export DEBIAN_FRONTEND=noninteractive
sudo apt-get -y update
sudo apt-get -y install libpython2.7-dev python-virtualenv
+else
+ echo "$OS_ID is not yet supported."
+ exit 1
fi
# 1st step: Download and prepare VPP packages
@@ -56,31 +64,21 @@ if [ "${#}" -ne "0" ]; then
arr=(${@})
echo ${arr[0]}
else
- case "$DISTRO" in
- CENTOS )
- PACKAGE=rpm
- ;;
- UBUNTU )
- PACKAGE=deb
- esac
# Download the latest VPP build install packages
- rm -f *.${PACKAGE}
- echo Downloading VPP packages...
- bash ${SCRIPT_DIR}/resources/tools/scripts/download_install_vpp_pkgs.sh --skip-install
+ bash ${SCRIPT_DIR}/resources/tools/scripts/download_install_vpp_pkgs.sh \
+ --skip-install
fi
-# Take vpp package and get the vpp version
-VPP_PKGS=(*.$PACKAGE)
-case "$DISTRO" in
- CENTOS )
- VPP_VER="$( expr match $(ls *.rpm | head -n 1) 'vpp-\(.*\).rpm' )"
- ;;
- UBUNTU )
- VPP_VER="$( expr match $(ls *.deb | head -n 1) 'vpp-\(.*\)-deb.deb' )"
-esac
-
+VIRL_DIR_LOC="/tmp/"
+VPP_PKGS=(vpp*.$PACKAGE)
+VPP_PKGS_FULL=("${VPP_PKGS[@]/#/${VIRL_DIR_LOC}}")
echo ${VPP_PKGS[@]}
+VIRL_TOPOLOGY=$(cat ${SCRIPT_DIR}/VIRL_TOPOLOGY_${DISTRO})
+VIRL_RELEASE=$(cat ${SCRIPT_DIR}/VIRL_RELEASE_${DISTRO})
+
+VPP_VER="$( expr match $(ls vpp*.${PACKAGE} | head -n 1) 'vpp[-|_]\(.*\)'.${PACKAGE} )"
+
set +x
echo "****************************************************************************************************************************************"
echo "1st step: Download VPP packages FINISHED"
@@ -117,16 +115,6 @@ VIRL_SERVER_STATUS_FILE="status"
VIRL_SERVER_EXPECTED_STATUS="PRODUCTION"
VIRL_SESSION_EXPIRY="620"
-case "$DISTRO" in
- CENTOS )
- VIRL_TOPOLOGY=$(cat ${SCRIPT_DIR}/VIRL_TOPOLOGY_CENTOS)
- VIRL_RELEASE=$(cat ${SCRIPT_DIR}/VIRL_RELEASE_CENTOS)
- ;;
- UBUNTU )
- VIRL_TOPOLOGY=$(cat ${SCRIPT_DIR}/VIRL_TOPOLOGY_UBUNTU)
- VIRL_RELEASE=$(cat ${SCRIPT_DIR}/VIRL_RELEASE_UBUNTU)
-esac
-
SSH_OPTIONS="-i ${VIRL_PKEY} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o BatchMode=yes -o LogLevel=error"
function ssh_do() {
@@ -201,20 +189,8 @@ do
fi
done
-
-VIRL_DIR_LOC="/tmp"
-VPP_PKGS_VIRL=(${VPP_PKGS[@]})
-
-# Prepend directory location at remote host to deb file list
-for index in "${!VPP_PKGS_VIRL[@]}"; do
- VPP_PKGS_VIRL[${index}]=${VIRL_DIR_LOC}/${VPP_PKGS_VIRL[${index}]}
-done
-
-echo "Updated file names: " ${VPP_PKGS_VIRL[@]}
-
-cat ${VIRL_PKEY}
# Copy the files to VIRL host
-scp ${SSH_OPTIONS} *.${PACKAGE} \
+scp ${SSH_OPTIONS} ${VPP_PKGS[@]} \
${VIRL_USERNAME}@${VIRL_SERVER}:${VIRL_DIR_LOC}/
result=$?
@@ -236,7 +212,7 @@ VIRL_SID=$(ssh ${SSH_OPTIONS} \
${VIRL_USERNAME}@${VIRL_SERVER} \
"start-testcase -vv --copy ${VIRL_TOPOLOGY} \
--expiry ${VIRL_SESSION_EXPIRY} \
- --release ${VIRL_RELEASE} ${VPP_PKGS_VIRL[@]}")
+ --release ${VIRL_RELEASE} ${VPP_PKGS_FULL[@]}")
retval=$?
if [ ${retval} -ne "0" ]; then
echo "VIRL simulation start failed"
diff --git a/bootstrap-vpp-verify-weekly.sh b/bootstrap-vpp-verify-weekly.sh
index 8b12553e3f..738be34792 100644
--- a/bootstrap-vpp-verify-weekly.sh
+++ b/bootstrap-vpp-verify-weekly.sh
@@ -27,6 +27,7 @@ VIRL_SERVER_EXPECTED_STATUS="PRODUCTION"
VIRL_SESSION_EXPIRY="620"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+export PYTHONPATH=${SCRIPT_DIR}
# Create tmp dir
mkdir ${SCRIPT_DIR}/tmp
@@ -34,20 +35,44 @@ mkdir ${SCRIPT_DIR}/tmp
# Use tmp dir to store log files
LOG_PATH="${SCRIPT_DIR}/tmp"
-if [ -f "/etc/redhat-release" ]; then
+OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
+OS_VERSION_ID=$(grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
+
+if [ "$OS_ID" == "centos" ]; then
DISTRO="CENTOS"
+ PACKAGE="rpm"
sudo yum install -y python-devel python-virtualenv
- VIRL_TOPOLOGY=$(cat ${SCRIPT_DIR}/VIRL_TOPOLOGY_CENTOS)
- VIRL_RELEASE=$(cat ${SCRIPT_DIR}/VIRL_RELEASE_CENTOS)
-else
+elif [ "$OS_ID" == "ubuntu" ]; then
DISTRO="UBUNTU"
+ PACKAGE="deb"
export DEBIAN_FRONTEND=noninteractive
sudo apt-get -y update
sudo apt-get -y install libpython2.7-dev python-virtualenv
- VIRL_TOPOLOGY=$(cat ${SCRIPT_DIR}/VIRL_TOPOLOGY_UBUNTU)
- VIRL_RELEASE=$(cat ${SCRIPT_DIR}/VIRL_RELEASE_UBUNTU)
+else
+ echo "$OS_ID is not yet supported."
+ exit 1
fi
+# Temporarily download VPP packages from nexus.fd.io
+if [ "${#}" -ne "0" ]; then
+ arr=(${@})
+ echo ${arr[0]}
+else
+ # Download the specific VPP build install packages
+ DPDK_STABLE_VER=$(cat ${SCRIPT_DIR}/DPDK_STABLE_VER)
+ VPP_STABLE_VER=$(cat ${SCRIPT_DIR}/VPP_STABLE_VER_${DISTRO})
+ bash ${SCRIPT_DIR}/resources/tools/scripts/download_install_vpp_pkgs.sh \
+ --skip-install --vpp ${VPP_STABLE_VER} --dkms ${DPDK_STABLE_VER}
+fi
+
+VIRL_DIR_LOC="/tmp"
+VPP_PKGS=(vpp*.$PACKAGE)
+VPP_PKGS_FULL=("${VPP_PKGS[@]/#/${VIRL_DIR_LOC}}")
+echo ${VPP_PKGS[@]}
+
+VIRL_TOPOLOGY=$(cat ${SCRIPT_DIR}/VIRL_TOPOLOGY_${DISTRO})
+VIRL_RELEASE=$(cat ${SCRIPT_DIR}/VIRL_RELEASE_${DISTRO})
+
SSH_OPTIONS="-i ${VIRL_PKEY} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o BatchMode=yes -o LogLevel=error"
function ssh_do() {
@@ -122,58 +147,8 @@ do
fi
done
-# Temporarily download VPP and DPDK packages from nexus.fd.io
-case "$DISTRO" in
- CENTOS )
- VPP_ARTIFACTS="vpp vpp-selinux-policy vpp-devel vpp-lib vpp-plugins"
- DPDK_ARTIFACTS=""
- PACKAGE="rpm"
- VPP_CLASSIFIER=""
- DPDK_STABLE_VER=$(cat ${SCRIPT_DIR}/DPDK_STABLE_VER).x86_64
- VPP_REPO_URL=$(cat ${SCRIPT_DIR}/VPP_REPO_URL_CENTOS)
- VPP_STABLE_VER=$(cat ${SCRIPT_DIR}/VPP_STABLE_VER_CENTOS)
- ;;
- UBUNTU )
- VPP_ARTIFACTS="vpp vpp-dbg vpp-dev vpp-lib vpp-plugins"
- DPDK_ARTIFACTS="vpp-dpdk-dkms"
- PACKAGE="deb"
- VPP_CLASSIFIER="-deb"
- DPDK_STABLE_VER=$(cat ${SCRIPT_DIR}/DPDK_STABLE_VER)_amd64
- VPP_REPO_URL=$(cat ${SCRIPT_DIR}/VPP_REPO_URL_UBUNTU)
- VPP_STABLE_VER=$(cat ${SCRIPT_DIR}/VPP_STABLE_VER_UBUNTU)
-esac
-
-if [ "${#}" -ne "0" ]; then
- arr=(${@})
- echo ${arr[0]}
- # Download DPDK parts not included in dpdk plugin of vpp build
- for ARTIFACT in ${DPDK_ARTIFACTS}; do
- wget -q "${VPP_REPO_URL}/${ARTIFACT}/${DPDK_STABLE_VER}/${ARTIFACT}-${DPDK_STABLE_VER}${VPP_CLASSIFIER}.${PACKAGE}" || exit
- done
-else
- rm -f *.${PACKAGE}
- for ARTIFACT in ${DPDK_ARTIFACTS}; do
- wget -q "${VPP_REPO_URL}/${ARTIFACT}/${DPDK_STABLE_VER}/${ARTIFACT}-${DPDK_STABLE_VER}${VPP_CLASSIFIER}.${PACKAGE}" || exit
- done
- for ARTIFACT in ${VPP_ARTIFACTS}; do
- wget -q "${VPP_REPO_URL}/${ARTIFACT}/${VPP_STABLE_VER}/${ARTIFACT}-${VPP_STABLE_VER}${VPP_CLASSIFIER}.${PACKAGE}" || exit
- done
-fi
-
-VPP_PKGS=(*.$PACKAGE)
-echo ${VPP_PKGS[@]}
-VIRL_DIR_LOC="/tmp"
-VPP_PKGS_FULL=(${VPP_PKGS[@]})
-
-# Prepend directory location at remote host to deb file list
-for index in "${!VPP_PKGS_FULL[@]}"; do
- VPP_PKGS_FULL[${index}]=${VIRL_DIR_LOC}/${VPP_PKGS_FULL[${index}]}
-done
-
-echo "Updated file names: " ${VPP_PKGS_FULL[@]}
-
# Copy the files to VIRL host
-scp ${SSH_OPTIONS} *.${PACKAGE} \
+scp ${SSH_OPTIONS} ${VPP_PKGS[@]} \
${VIRL_USERNAME}@${VIRL_SERVER}:${VIRL_DIR_LOC}/
result=$?
diff --git a/bootstrap.sh b/bootstrap.sh
index cfb5a8f320..02aa7133e5 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
@@ -20,34 +20,43 @@ cat /etc/hosts
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export PYTHONPATH=${SCRIPT_DIR}
-if [ -f "/etc/redhat-release" ]; then
+OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
+OS_VERSION_ID=$(grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
+
+if [ "$OS_ID" == "centos" ]; then
DISTRO="CENTOS"
- sudo yum install -y python-devel python-virtualenv
- VPP_ARTIFACTS="vpp vpp-selinux-policy vpp-devel vpp-lib vpp-plugins"
- DPDK_ARTIFACTS=""
PACKAGE="rpm"
- VPP_CLASSIFIER=""
- DPDK_STABLE_VER=$(cat ${SCRIPT_DIR}/DPDK_STABLE_VER).x86_64
- VPP_REPO_URL=$(cat ${SCRIPT_DIR}/VPP_REPO_URL_CENTOS)
- VPP_STABLE_VER=$(cat ${SCRIPT_DIR}/VPP_STABLE_VER_CENTOS)
- VIRL_TOPOLOGY=$(cat ${SCRIPT_DIR}/VIRL_TOPOLOGY_CENTOS)
- VIRL_RELEASE=$(cat ${SCRIPT_DIR}/VIRL_RELEASE_CENTOS)
-else
+ sudo yum install -y python-devel python-virtualenv
+elif [ "$OS_ID" == "ubuntu" ]; then
DISTRO="UBUNTU"
+ PACKAGE="deb"
export DEBIAN_FRONTEND=noninteractive
sudo apt-get -y update
sudo apt-get -y install libpython2.7-dev python-virtualenv
- VPP_ARTIFACTS="vpp vpp-dbg vpp-dev vpp-lib vpp-plugins"
- DPDK_ARTIFACTS="vpp-dpdk-dkms"
- PACKAGE="deb"
- VPP_CLASSIFIER="-deb"
- DPDK_STABLE_VER=$(cat ${SCRIPT_DIR}/DPDK_STABLE_VER)_amd64
- VPP_REPO_URL=$(cat ${SCRIPT_DIR}/VPP_REPO_URL_UBUNTU)
- VPP_STABLE_VER=$(cat ${SCRIPT_DIR}/VPP_STABLE_VER_UBUNTU)
- VIRL_TOPOLOGY=$(cat ${SCRIPT_DIR}/VIRL_TOPOLOGY_UBUNTU)
- VIRL_RELEASE=$(cat ${SCRIPT_DIR}/VIRL_RELEASE_UBUNTU)
+else
+ echo "$OS_ID is not yet supported."
+ exit 1
+fi
+
+# Temporarily download VPP and DPDK packages from nexus.fd.io
+if [ "${#}" -ne "0" ]; then
+ arr=(${@})
+ echo ${arr[0]}
+ SKIP_PATCH="skip_patchORskip_vpp_patch"
+else
+ DPDK_STABLE_VER=$(cat ${SCRIPT_DIR}/DPDK_STABLE_VER)
+ VPP_STABLE_VER=$(cat ${SCRIPT_DIR}/VPP_STABLE_VER_${DISTRO})
+ bash ${SCRIPT_DIR}/resources/tools/scripts/download_install_vpp_pkgs.sh \
+ --skip-install --vpp ${VPP_STABLE_VER} --dkms ${DPDK_STABLE_VER}
fi
+VIRL_DIR_LOC="/tmp/"
+VPP_PKGS=(vpp*.$PACKAGE)
+VPP_PKGS_FULL=("${VPP_PKGS[@]/#/${VIRL_DIR_LOC}}")
+echo ${VPP_PKGS[@]}
+
+VIRL_TOPOLOGY=$(cat ${SCRIPT_DIR}/VIRL_TOPOLOGY_${DISTRO})
+VIRL_RELEASE=$(cat ${SCRIPT_DIR}/VIRL_RELEASE_${DISTRO})
VIRL_SERVERS=("10.30.51.28" "10.30.51.29" "10.30.51.30")
IPS_PER_VIRL=( "10.30.51.28:252"
"10.30.51.29:252"
@@ -188,33 +197,6 @@ done
echo "Selected VIRL servers: ${VIRL_SERVER[@]}"
-# Temporarily download VPP and DPDK packages from nexus.fd.io
-if [ "${#}" -ne "0" ]; then
- arr=(${@})
- echo ${arr[0]}
- SKIP_PATCH="skip_patchORskip_vpp_patch"
-else
- rm -f *.${PACKAGE}
- for ARTIFACT in ${DPDK_ARTIFACTS}; do
- wget -q "${VPP_REPO_URL}/${ARTIFACT}/${DPDK_STABLE_VER}/${ARTIFACT}-${DPDK_STABLE_VER}${VPP_CLASSIFIER}.${PACKAGE}" || exit
- done
- for ARTIFACT in ${VPP_ARTIFACTS}; do
- wget -q "${VPP_REPO_URL}/${ARTIFACT}/${VPP_STABLE_VER}/${ARTIFACT}-${VPP_STABLE_VER}${VPP_CLASSIFIER}.${PACKAGE}" || exit
- done
-fi
-
-VPP_PKGS=(*.$PACKAGE)
-echo ${VPP_PKGS[@]}
-VIRL_DIR_LOC="/tmp"
-VPP_PKGS_FULL=(${VPP_PKGS[@]})
-
-# Prepend directory location at remote host to package file list
-for index in "${!VPP_PKGS_FULL[@]}"; do
- VPP_PKGS_FULL[${index}]=${VIRL_DIR_LOC}/${VPP_PKGS_FULL[${index}]}
-done
-
-echo "Updated file names: " ${VPP_PKGS_FULL[@]}
-
cat ${VIRL_PKEY}
# Copy the files to VIRL hosts
@@ -226,8 +208,8 @@ for index in "${!VIRL_SERVER[@]}"; do
if [ "${copy}" -eq "0" ]; then
echo "VPP packages have already been copied to the VIRL host ${VIRL_SERVER[${index}]}"
else
- scp ${SSH_OPTIONS} *.${PACKAGE} \
- ${VIRL_USERNAME}@${VIRL_SERVER[${index}]}:${VIRL_DIR_LOC}/
+ scp ${SSH_OPTIONS} ${VPP_PKGS[@]} \
+ ${VIRL_USERNAME}@${VIRL_SERVER[${index}]}:${VIRL_DIR_LOC}
result=$?
if [ "${result}" -ne "0" ]; then
@@ -261,10 +243,12 @@ for index in "${!VIRL_SERVER[@]}"; do
# Set quota to lower value
IP_QUOTA=$([ $max_ips -le $max_ips_from_sims ] && echo "$max_ips" || echo "$max_ips_from_sims")
# Start the simulation
- VIRL_SID[${index}]=$(ssh ${SSH_OPTIONS} \
- ${VIRL_USERNAME}@${VIRL_SERVER[${index}]} \
- "start-testcase -vv --quota ${IP_QUOTA} --copy ${VIRL_TOPOLOGY} \
- --release ${VIRL_RELEASE} ${VPP_PKGS_FULL[@]}")
+ VIRL_SID[${index}]=$(ssh ${SSH_OPTIONS} ${VIRL_USERNAME}@${VIRL_SERVER[${index}]} \
+ "start-testcase -vv \
+ --quota ${IP_QUOTA} \
+ --copy ${VIRL_TOPOLOGY} \
+ --release ${VIRL_RELEASE} \
+ ${VPP_PKGS_FULL[@]}")
# TODO: remove param ${VPP_PKGS_FULL[@]} when start-testcase script is
# updated on all virl servers
retval=$?