docs: report updates in physical_testbeds section.
[csit.git] / bootstrap-vpp-verify-weekly.sh
index c04db57..6aea26f 100644 (file)
@@ -24,21 +24,57 @@ VIRL_USERNAME=jenkins-in
 VIRL_PKEY=priv_key
 VIRL_SERVER_STATUS_FILE="status"
 VIRL_SERVER_EXPECTED_STATUS="PRODUCTION"
+VIRL_SESSION_EXPIRY="620"
 
-if [ -f "/etc/redhat-release" ]; then
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+export PYTHONPATH=${SCRIPT_DIR}
+
+# Create tmp dir
+mkdir ${SCRIPT_DIR}/tmp
+
+# Use tmp dir to store log files
+LOG_PATH="${SCRIPT_DIR}/tmp"
+
+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
-    VIRL_TOPOLOGY=double-ring-nested.centos7
-    VIRL_RELEASE=csit-centos-7.3-1611_2017-02-14_1.3
-else
+    PACKAGE="rpm"
+    sudo yum install -y python-devel python-virtualenv openssh-clients sshpass
+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=double-ring-nested.xenial
-    VIRL_RELEASE=csit-ubuntu-16.04.1_2017-02-20_1.7
+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
+    VPP_VERSION=$(< ${SCRIPT_DIR}/VPP_STABLE_VER_${DISTRO})
+    CSIT_DIR=${SCRIPT_DIR}
+    source "${SCRIPT_DIR}/resources/libraries/bash/function/artifacts.sh"
+    download_artifacts
+    # Need to revert -euo as the rest of script is not optimized for this.
+    set +euo pipefail
+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() {
@@ -113,61 +149,9 @@ do
     fi
 done
 
-# Temporarily download VPP and DPDK packages from nexus.fd.io
-SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-
-case "$DISTRO" in
-        CENTOS )
-            VPP_ARTIFACTS="vpp vpp-debuginfo vpp-devel vpp-lib vpp-plugins"
-            DPDK_ARTIFACTS="vpp-dpdk-devel"
-            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-dev 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]}
-    # DPDK is not part of the 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} \
-    ${VIRL_USERNAME}@${VIRL_SERVER}:${VIRL_DIR_LOC}/
+scp ${SSH_OPTIONS} ${VPP_PKGS[@]} \
+    ${VIRL_USERNAME}@${VIRL_SERVER}:${VIRL_DIR_LOC}
 
 result=$?
 if [ "${result}" -ne "0" ]; then
@@ -186,7 +170,9 @@ function stop_virl_simulation {
 
 VIRL_SID=$(ssh ${SSH_OPTIONS} \
     ${VIRL_USERNAME}@${VIRL_SERVER} \
-    "start-testcase -c ${VIRL_TOPOLOGY} -r ${VIRL_RELEASE} ${VPP_PKGS_FULL[@]}")
+    "start-testcase -vv --copy ${VIRL_TOPOLOGY} \
+    --expiry ${VIRL_SESSION_EXPIRY} \
+    --release ${VIRL_RELEASE} ${VPP_PKGS_FULL[@]}")
 retval=$?
 if [ ${retval} -ne "0" ]; then
     echo "VIRL simulation start failed"
@@ -228,20 +214,24 @@ pip install -r ${SCRIPT_DIR}/requirements.txt
 RC=0
 MORE_FAILS=0
 
-for test_set in 1 2 3
+partial_logs=""
+for test_set in 1 2
 do
     echo
     echo ${test_set}. test loop
     PYTHONPATH=`pwd` pybot -L TRACE -W 136\
         -v TOPOLOGY_PATH:${SCRIPT_DIR}/topologies/enabled/topology.yaml \
-        --suite "tests.func" \
+        --suite "tests.vpp.func" \
         --include vm_envAND3_node_single_link_topo \
-        --include vm_envAND3_nodePACAKGE_double_link_topo \
+        --include vm_envAND3_node_double_link_topo \
         --exclude PERFTEST \
+        --exclude SOFTWIRE \
+        --exclude SKIP_TEST \
         --noncritical EXPECTED_FAILING \
-        --output log_test_set${test_set} \
+        --output ${LOG_PATH}/output_test_set${test_set} \
         tests/
     PARTIAL_RC=$(echo $?)
+    partial_logs="${partial_logs} ${LOG_PATH}/output_test_set${test_set}.xml"
     if [ ${PARTIAL_RC} -eq 250 ]; then
         MORE_FAILS=1
     fi
@@ -287,11 +277,10 @@ echo Post-processing test data...
 
 # Rebot output post-processing
 rebot --noncritical EXPECTED_FAILING \
-      --output output.xml \
-      ./log_test_set1.xml ./log_test_set2.xml ./log_test_set3.xml
+      --output output.xml ${partial_logs}
 
 # Remove unnecessary log files
-rm -f ./log_test_set1.xml ./log_test_set2.xml ./log_test_set3.xml
+rm -f ${partial_logs}
 
 echo Post-processing finished.
 

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