HC Test: Add branch and os parameters to honeycomb scripts 37/5037/5
authorselias <samelias@cisco.com>
Mon, 6 Feb 2017 09:42:00 +0000 (10:42 +0100)
committerPeter Mikus <pmikus@cisco.com>
Tue, 14 Feb 2017 09:28:00 +0000 (09:28 +0000)
 - partial cherrypick of https://gerrit.fd.io/r/4933
 - add OS argument to scripts in preparation for Ubuntu16 and Centos7

Change-Id: I14119703be0f73766a731478e09e0126078f84ba
Signed-off-by: selias <samelias@cisco.com>
bootstrap-hc2vpp-integration.sh
bootstrap-hc2vpp-verify.sh
resources/tools/download_hc_build_pkgs.sh
resources/tools/download_hc_pkgs.sh

index d29d08e..e8c0d5e 100755 (executable)
@@ -29,8 +29,19 @@ VIRL_PKEY=priv_key
 VIRL_SERVER_STATUS_FILE="status"
 VIRL_SERVER_EXPECTED_STATUS="PRODUCTION"
 
-VIRL_TOPOLOGY=double-ring-nested.trusty
-VIRL_RELEASE=csit-ubuntu-14.04.4_2016-10-07_1.3
+STREAM=$1
+OS=$2
+
+if [ "${OS}" == "ubuntu1404" ]; then
+    VIRL_TOPOLOGY=double-ring-nested.trusty
+    VIRL_RELEASE=csit-ubuntu-14.04.4_2016-10-07_1.3
+elif [ "${OS}" == "ubuntu1604" ]; then
+    VIRL_TOPOLOGY=double-ring-nested.xenial
+    VIRL_RELEASE=csit-ubuntu-16.04.1_2016-12-19_1.6
+elif [ "${OS}" == "centos7" ]; then
+    VIRL_TOPOLOGY=double-ring-nested.centos7
+    VIRL_RELEASE=csit-centos-7.3-1611
+fi
 
 SSH_OPTIONS="-i ${VIRL_PKEY} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o BatchMode=yes -o LogLevel=error"
 
@@ -108,21 +119,25 @@ done
 
 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
-# Download the latest VPP and HC .deb packages
+# Download VPP and HC packages from the current branch
 echo Downloading packages...
-bash ${SCRIPT_DIR}/resources/tools/download_hc_pkgs.sh
+bash ${SCRIPT_DIR}/resources/tools/download_hc_pkgs.sh ${STREAM} ${OS}
 
-VPP_DEBS=(*.deb)
-echo ${VPP_DEBS[@]}
+if [ "${OS}" == "centos7" ]; then
+    VPP_PKGS=(*.rpm)
+else
+    VPP_PKGS=(*.deb)
+fi
+echo ${VPP_PKGS[@]}
 VIRL_DIR_LOC="/tmp"
-VPP_DEBS_FULL=(${VPP_DEBS[@]})
+VPP_PKGS_FULL=(${VPP_PKGS[@]})
 
-# Prepend directory location at remote host to deb file list
-for index in "${!VPP_DEBS_FULL[@]}"; do
-    VPP_DEBS_FULL[${index}]=${VIRL_DIR_LOC}/${VPP_DEBS_FULL[${index}]}
+# 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_DEBS_FULL[@]}
+echo "Updated file names: " ${VPP_PKGS_FULL[@]}
 
 cat ${VIRL_PKEY}
 
@@ -133,17 +148,17 @@ for index in "${!VIRL_SERVER[@]}"; do
     [[ "${DONE[@]}" =~ "${VIRL_SERVER[${index}]}" ]] && copy=0 || copy=1
 
     if [ "${copy}" -eq "0" ]; then
-        echo "deb files have already been copied to the VIRL host ${VIRL_SERVER[${index}]}"
+        echo "files have already been copied to the VIRL host ${VIRL_SERVER[${index}]}"
     else
-        scp ${SSH_OPTIONS} *.deb \
+        scp ${SSH_OPTIONS} *.deb *.rpm \
         ${VIRL_USERNAME}@${VIRL_SERVER[${index}]}:${VIRL_DIR_LOC}/
          result=$?
         if [ "${result}" -ne "0" ]; then
-            echo "Failed to copy deb files to VIRL host ${VIRL_SERVER[${index}]}"
+            echo "Failed to copy files to VIRL host ${VIRL_SERVER[${index}]}"
             echo ${result}
             exit ${result}
         else
-            echo "deb files successfully copied to the VIRL host ${VIRL_SERVER[${index}]}"
+            echo "files successfully copied to the VIRL host ${VIRL_SERVER[${index}]}"
         fi
         DONE+=(${VIRL_SERVER[${index}]})
     fi
@@ -159,7 +174,7 @@ function stop_virl_simulation {
 
 VIRL_SID=$(ssh ${SSH_OPTIONS} \
     ${VIRL_USERNAME}@${VIRL_SERVER} \
-    "start-testcase -c ${VIRL_TOPOLOGY} -r ${VIRL_RELEASE} ${VPP_DEBS_FULL[@]}")
+    "start-testcase -c ${VIRL_TOPOLOGY} -r ${VIRL_RELEASE} ${VPP_PKGS_FULL[@]}")
 retval=$?
 if [ "${retval}" -ne "0" ]; then
     echo "VIRL simulation start failed"
index 13a65bd..af21842 100755 (executable)
@@ -29,8 +29,18 @@ VIRL_PKEY=priv_key
 VIRL_SERVER_STATUS_FILE="status"
 VIRL_SERVER_EXPECTED_STATUS="PRODUCTION"
 
-VIRL_TOPOLOGY=double-ring-nested.trusty
-VIRL_RELEASE=csit-ubuntu-14.04.4_2016-10-07_1.3
+OS=$1
+
+if [ "${OS}" == "ubuntu1404" ]; then
+    VIRL_TOPOLOGY=double-ring-nested.trusty
+    VIRL_RELEASE=csit-ubuntu-14.04.4_2016-10-07_1.3
+elif [ "${OS}" == "ubuntu1604" ]; then
+    VIRL_TOPOLOGY=double-ring-nested.xenial
+    VIRL_RELEASE=csit-ubuntu-16.04.1_2016-12-19_1.6
+elif [ "${OS}" == "centos7" ]; then
+    VIRL_TOPOLOGY=double-ring-nested.centos7
+    VIRL_RELEASE=csit-centos-7.3-1611
+fi
 
 SSH_OPTIONS="-i ${VIRL_PKEY} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o BatchMode=yes -o LogLevel=error"
 
@@ -108,18 +118,22 @@ done
 
 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
-# VPP, VPP plugin and Honeycomb .deb packages should already be in working directory
-VPP_DEBS=(*.deb)
-echo ${VPP_DEBS[@]}
+# VPP, VPP plugin and Honeycomb packages should already be in working directory
+if [ "${OS}" == "centos7" ]; then
+    VPP_PKGS=(*.rpm)
+else
+    VPP_PKGS=(*.deb)
+fi
+echo ${VPP_PKGS[@]}
 VIRL_DIR_LOC="/tmp"
-VPP_DEBS_FULL=(${VPP_DEBS[@]})
+VPP_PKGS_FULL=(${VPP_PKGS[@]})
 
-# Prepend directory location at remote host to deb file list
-for index in "${!VPP_DEBS_FULL[@]}"; do
-    VPP_DEBS_FULL[${index}]=${VIRL_DIR_LOC}/${VPP_DEBS_FULL[${index}]}
+# 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_DEBS_FULL[@]}
+echo "Updated file names: " ${VPP_PKGS_FULL[@]}
 
 cat ${VIRL_PKEY}
 
@@ -130,17 +144,17 @@ for index in "${!VIRL_SERVER[@]}"; do
     [[ "${DONE[@]}" =~ "${VIRL_SERVER[${index}]}" ]] && copy=0 || copy=1
 
     if [ "${copy}" -eq "0" ]; then
-        echo "deb files have already been copied to the VIRL host ${VIRL_SERVER[${index}]}"
+        echo "files have already been copied to the VIRL host ${VIRL_SERVER[${index}]}"
     else
-        scp ${SSH_OPTIONS} *.deb \
+        scp ${SSH_OPTIONS} *.deb *.rpm \
         ${VIRL_USERNAME}@${VIRL_SERVER[${index}]}:${VIRL_DIR_LOC}/
          result=$?
         if [ "${result}" -ne "0" ]; then
-            echo "Failed to copy deb files to VIRL host ${VIRL_SERVER[${index}]}"
+            echo "Failed to copy files to VIRL host ${VIRL_SERVER[${index}]}"
             echo ${result}
             exit ${result}
         else
-            echo "deb files successfully copied to the VIRL host ${VIRL_SERVER[${index}]}"
+            echo "files successfully copied to the VIRL host ${VIRL_SERVER[${index}]}"
         fi
         DONE+=(${VIRL_SERVER[${index}]})
     fi
@@ -156,7 +170,7 @@ function stop_virl_simulation {
 
 VIRL_SID=$(ssh ${SSH_OPTIONS} \
     ${VIRL_USERNAME}@${VIRL_SERVER} \
-    "start-testcase -c ${VIRL_TOPOLOGY} -r ${VIRL_RELEASE} ${VPP_DEBS_FULL[@]}")
+    "start-testcase -c ${VIRL_TOPOLOGY} -r ${VIRL_RELEASE} ${VPP_PKGS_FULL[@]}")
 retval=$?
 if [ "${retval}" -ne "0" ]; then
     echo "VIRL simulation start failed"
index 71a2efe..3847c4a 100755 (executable)
@@ -17,17 +17,31 @@ set -ex
 
 trap 'rm -f *.deb.md5; exit' EXIT
 trap 'rm -f *.deb.md5;rm -f *.deb; exit' ERR
+STREAM=$1
+OS=$2
 
 # Download the latest VPP and VPP plugin .deb packages
 URL="https://nexus.fd.io/service/local/artifact/maven/content"
 VER="LATEST"
-REPO='fd.io.master.ubuntu.trusty.main'
+REPO="fd.io.${STREAM}.ubuntu.trusty.main"
 VPP_GROUP="io.fd.vpp"
 NSH_GROUP="io.fd.nsh_sfc"
 VPP_ARTIFACTS="vpp vpp-dbg vpp-dev vpp-dpdk-dev vpp-dpdk-dkms vpp-lib vpp-plugins vpp-api-java"
 NSH_ARTIFACTS="vpp-nsh-plugin"
-PACKAGE="deb deb.md5"
-CLASS="deb"
+
+if [ "${OS}" == "ubuntu1404" ]; then
+    OS="ubuntu.trusty.main"
+    PACKAGE="deb deb.md5"
+    CLASS="deb"
+elif [ "${OS}" == "ubuntu1604" ]; then
+    OS="ubuntu.xenial.main"
+    PACKAGE="deb deb.md5"
+    CLASS="deb"
+elif [ "${OS}" == "centos7" ]; then
+    OS="centos7"
+    PACKAGE="rpm rpm.md5"
+    CLASS="rpm"
+fi
 
 for ART in ${VPP_ARTIFACTS}; do
     for PAC in $PACKAGE; do
index d52e246..b958dc9 100755 (executable)
@@ -17,18 +17,32 @@ set -ex
 
 trap 'rm -f *.deb.md5; exit' EXIT
 trap 'rm -f *.deb.md5;rm -f *.deb; exit' ERR
+STREAM=$1
+OS=$2
 
 URL="https://nexus.fd.io/service/local/artifact/maven/content"
 VER="RELEASE"
-REPO='fd.io.master.ubuntu.trusty.main'
+REPO="fd.io.${STREAM}.${OS}"
 GROUP="io.fd.vpp"
 HC_GROUP="io.fd.hc2vpp"
 NSH_GROUP="io.fd.nsh_sfc"
 VPP_ARTIFACTS="vpp vpp-dbg vpp-dev vpp-dpdk-dev vpp-dpdk-dkms vpp-lib vpp-plugins vpp-api-java"
 HC_ARTIFACTS="honeycomb"
 NSH_ARTIFACTS="vpp-nsh-plugin"
-PACKAGE="deb deb.md5"
-CLASS="deb"
+
+if [ "${OS}" == "ubuntu1404" ]; then
+    OS="ubuntu.trusty.main"
+    PACKAGE="deb deb.md5"
+    CLASS="deb"
+elif [ "${OS}" == "ubuntu1604" ]; then
+    OS="ubuntu.xenial.main"
+    PACKAGE="deb deb.md5"
+    CLASS="deb"
+elif [ "${OS}" == "centos7" ]; then
+    OS="centos7"
+    PACKAGE="rpm rpm.md5"
+    CLASS="rpm"
+fi
 
 for ART in ${VPP_ARTIFACTS}; do
     for PAC in $PACKAGE; do

©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.