perf ipsec: test renaming
[csit.git] / bootstrap-vpp-verify-semiweekly.sh
index fa0c30b..d6d411b 100644 (file)
@@ -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,24 @@ 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
+    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
 
-# 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 +118,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 +192,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 +215,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"
@@ -282,7 +261,7 @@ echo Running functional tests on the VIRL system...
 # There are used three iterations of functional tests there
 # to check the stability and reliability of the results.
 partial_logs=""
-for test_set in 1 2 3
+for test_set in 1 2
 do
     echo
     echo Functional test loop: ${test_set}
@@ -294,6 +273,8 @@ do
         --include vm_envAND3_node_single_link_topo \
         --include vm_envAND3_node_double_link_topo \
         --exclude PERFTEST \
+        --exclude SOFTWIRE \
+        --exclude SKIP_TEST \
         --noncritical EXPECTED_FAILING \
         --output ${LOG_PATH}/output_func_test_set${test_set} \
         tests/