Use common files to store distro related data for VIRL
[csit.git] / bootstrap-vpp-verify-semiweekly.sh
index 2897292..c3fc4e0 100644 (file)
@@ -21,10 +21,6 @@ RETURN_STATUS=0
 cat /etc/hostname
 cat /etc/hosts
 
-export DEBIAN_FRONTEND=noninteractive
-sudo apt-get -y update
-sudo apt-get -y install libpython2.7-dev python-virtualenv
-
 PYBOT_ARGS="--noncritical MULTI_THREAD"
 
 ARCHIVE_ARTIFACTS=(log.html output.xml report.html)
@@ -34,8 +30,12 @@ export PYTHONPATH=${SCRIPT_DIR}
 
 if [ -f "/etc/redhat-release" ]; then
     DISTRO="CENTOS"
+    sudo yum install -y python-devel python-virtualenv
 else
     DISTRO="UBUNTU"
+    export DEBIAN_FRONTEND=noninteractive
+    sudo apt-get -y update
+    sudo apt-get -y install libpython2.7-dev python-virtualenv
 fi
 
 # 1st step: Download and prepare VPP packages
@@ -47,29 +47,29 @@ if [ "${#}" -ne "0" ]; then
 else
     case "$DISTRO" in
         CENTOS )
-            rm -f *.rpm
+            PACKAGE=rpm
             ;;
         UBUNTU )
-            rm -f *.deb
+            PACKAGE=deb
     esac
-    # Download the latest VPP build .deb install packages
+    # Download the latest VPP build install packages
+    rm -f *.${PACKAGE}
     echo Downloading VPP packages...
     bash ${SCRIPT_DIR}/resources/tools/download_install_vpp_pkgs.sh --skip-install
 fi
 
 # Take vpp package and get the vpp version
+VPP_PKGS=(*.$PACKAGE)
 case "$DISTRO" in
         CENTOS )
-            VPP_PKGS="$( readlink -f *.rpm | tr '\n' ' ' )"
             VPP_VER="$( expr match $(ls *.rpm | head -n 1) 'vpp-\(.*\).rpm' )"
-            echo ${VPP_PKGS[@]}
             ;;
         UBUNTU )
-            VPP_PKGS="$( readlink -f *.deb | tr '\n' ' ' )"
             VPP_VER="$( expr match $(ls *.deb | head -n 1) 'vpp-\(.*\)-deb.deb' )"
-            echo ${VPP_PKGS[@]}
 esac
 
+echo ${VPP_PKGS[@]}
+
 set +x
 echo "****************************************************************************************************************************************"
 echo "1st step: Download VPP packages                                                                                                 FINISHED"
@@ -107,12 +107,12 @@ VIRL_SERVER_EXPECTED_STATUS="PRODUCTION"
 
 case "$DISTRO" in
         CENTOS )
-            VIRL_TOPOLOGY=double-ring-nested.centos7
-            VIRL_RELEASE=csit-centos-7.3-1611_2017-02-14_1.3
+            VIRL_TOPOLOGY=$(cat ${SCRIPT_DIR}/VIRL_TOPOLOGY_CENTOS)
+            VIRL_RELEASE=$(cat ${SCRIPT_DIR}/VIRL_RELEASE_CENTOS)
             ;;
         UBUNTU )
-            VIRL_TOPOLOGY=double-ring-nested.xenial
-            VIRL_RELEASE=csit-ubuntu-16.04.1_2016-12-19_1.6
+            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"
@@ -202,7 +202,7 @@ echo "Updated file names: " ${VPP_PKGS_VIRL[@]}
 
 cat ${VIRL_PKEY}
 # Copy the files to VIRL host
-scp ${SSH_OPTIONS} *.deb \
+scp ${SSH_OPTIONS} *.${PACKAGE} \
     ${VIRL_USERNAME}@${VIRL_SERVER}:${VIRL_DIR_LOC}/
 
 result=$?

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.