aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap-vpp-verify-semiweekly.sh
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 /bootstrap-vpp-verify-semiweekly.sh
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>
Diffstat (limited to 'bootstrap-vpp-verify-semiweekly.sh')
-rw-r--r--bootstrap-vpp-verify-semiweekly.sh68
1 files changed, 22 insertions, 46 deletions
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"