diff options
-rw-r--r-- | bootstrap-vpp-verify-semiweekly.sh | 51 | ||||
-rwxr-xr-x | resources/tools/download_install_vpp_pkgs.sh | 58 |
2 files changed, 79 insertions, 30 deletions
diff --git a/bootstrap-vpp-verify-semiweekly.sh b/bootstrap-vpp-verify-semiweekly.sh index 7f41dbf434..2897292eb2 100644 --- a/bootstrap-vpp-verify-semiweekly.sh +++ b/bootstrap-vpp-verify-semiweekly.sh @@ -32,25 +32,43 @@ ARCHIVE_ARTIFACTS=(log.html output.xml report.html) SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" export PYTHONPATH=${SCRIPT_DIR} +if [ -f "/etc/redhat-release" ]; then + DISTRO="CENTOS" +else + DISTRO="UBUNTU" +fi # 1st step: Download and prepare VPP packages # Temporarily download VPP packages from nexus.fd.io -rm -f *.deb if [ "${#}" -ne "0" ]; then arr=(${@}) echo ${arr[0]} else + case "$DISTRO" in + CENTOS ) + rm -f *.rpm + ;; + UBUNTU ) + rm -f *.deb + esac # Download the latest VPP build .deb install packages echo Downloading VPP packages... bash ${SCRIPT_DIR}/resources/tools/download_install_vpp_pkgs.sh --skip-install fi -VPP_DEBS=(*.deb) -echo ${VPP_DEBS[@]} - -VPP_VER=$(echo ${VPP_DEBS#vpp-}) -VPP_VER=$(echo ${VPP_VER%-deb.deb}) +# Take vpp package and get the vpp version +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 set +x echo "****************************************************************************************************************************************" @@ -87,8 +105,15 @@ VIRL_PKEY=priv_key VIRL_SERVER_STATUS_FILE="status" VIRL_SERVER_EXPECTED_STATUS="PRODUCTION" -VIRL_TOPOLOGY=double-ring-nested.xenial -VIRL_RELEASE=csit-ubuntu-16.04.1_2016-12-19_1.6 +case "$DISTRO" in + CENTOS ) + VIRL_TOPOLOGY=double-ring-nested.centos7 + VIRL_RELEASE=csit-centos-7.3-1611_2017-02-14_1.3 + ;; + UBUNTU ) + VIRL_TOPOLOGY=double-ring-nested.xenial + VIRL_RELEASE=csit-ubuntu-16.04.1_2016-12-19_1.6 +esac SSH_OPTIONS="-i ${VIRL_PKEY} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o BatchMode=yes -o LogLevel=error" @@ -166,14 +191,14 @@ done VIRL_DIR_LOC="/tmp" -VPP_DEBS_VIRL=(${VPP_DEBS[@]}) +VPP_PKGS_VIRL=(${VPP_PKGS[@]}) # Prepend directory location at remote host to deb file list -for index in "${!VPP_DEBS_VIRL[@]}"; do - VPP_DEBS_VIRL[${index}]=${VIRL_DIR_LOC}/${VPP_DEBS_VIRL[${index}]} +for index in "${!VPP_PKGS_VIRL[@]}"; do + VPP_PKGS_VIRL[${index}]=${VIRL_DIR_LOC}/${VPP_PKGS_VIRL[${index}]} done -echo "Updated file names: " ${VPP_DEBS_VIRL[@]} +echo "Updated file names: " ${VPP_PKGS_VIRL[@]} cat ${VIRL_PKEY} # Copy the files to VIRL host @@ -197,7 +222,7 @@ function stop_virl_simulation { VIRL_SID=$(ssh ${SSH_OPTIONS} \ ${VIRL_USERNAME}@${VIRL_SERVER} \ - "start-testcase -c ${VIRL_TOPOLOGY} -r ${VIRL_RELEASE} ${VPP_DEBS_VIRL[@]}") + "start-testcase -c ${VIRL_TOPOLOGY} -r ${VIRL_RELEASE} ${VPP_PKGS_VIRL[@]}") retval=$? if [ ${retval} -ne "0" ]; then echo "VIRL simulation start failed" diff --git a/resources/tools/download_install_vpp_pkgs.sh b/resources/tools/download_install_vpp_pkgs.sh index 67c8362b7e..547f44493e 100755 --- a/resources/tools/download_install_vpp_pkgs.sh +++ b/resources/tools/download_install_vpp_pkgs.sh @@ -15,25 +15,49 @@ set -ex -trap 'rm -f *.deb.md5; exit' EXIT -trap 'rm -f *.deb.md5;rm -f *.deb; exit' ERR - URL="https://nexus.fd.io/service/local/artifact/maven/content" VER="RELEASE" +GROUP="io.fd.vpp" + +if [ -f "/etc/redhat-release" ]; then + trap 'rm -f *.rpm.md5; exit' EXIT + trap 'rm -f *.rpm.md5;rm -f *.rpm; exit' ERR + + VPP_REPO_URL_PATH="./VPP_REPO_URL_CENTOS" + if [ -e "$VPP_REPO_URL_PATH" ]; then + VPP_REPO_URL=$(cat $VPP_REPO_URL_PATH) + REPO=$(echo ${VPP_REPO_URL#https://nexus.fd.io/content/repositories/}) + REPO=$(echo ${REPO%/io/fd/vpp/}) + else + REPO='fd.io.master.centos7' + FILES=*.rpm + MD5FILES=*.rpm.md5 + fi -VPP_REPO_URL_PATH="./VPP_REPO_URL" -if [ -e "$VPP_REPO_URL_PATH" ]; then - VPP_REPO_URL=$(cat $VPP_REPO_URL_PATH) - REPO=$(echo ${VPP_REPO_URL#https://nexus.fd.io/content/repositories/}) - REPO=$(echo ${REPO%/io/fd/vpp/}) + ARTIFACTS="vpp vpp-debuginfo vpp-devel vpp-dpdk-devel vpp-lib vpp-plugins" + PACKAGE="rpm rpm.md5" + CLASS="" + VPP_INSTALL_COMMAND="rpm -ivh *.rpm" else - REPO='fd.io.master.ubuntu.xenial.main' -fi + trap 'rm -f *.deb.md5; exit' EXIT + trap 'rm -f *.deb.md5;rm -f *.deb; exit' ERR -GROUP="io.fd.vpp" -ARTIFACTS="vpp vpp-dbg vpp-dev vpp-dpdk-dev vpp-dpdk-dkms vpp-lib vpp-plugins" -PACKAGE="deb deb.md5" -CLASS="deb" + VPP_REPO_URL_PATH="./VPP_REPO_URL_UBUNTU" + if [ -e "$VPP_REPO_URL_PATH" ]; then + VPP_REPO_URL=$(cat $VPP_REPO_URL_PATH) + REPO=$(echo ${VPP_REPO_URL#https://nexus.fd.io/content/repositories/}) + REPO=$(echo ${REPO%/io/fd/vpp/}) + else + REPO='fd.io.master.ubuntu.xenial.main' + FILES=*.deb + MD5FILES=*.deb.md5 + fi + + ARTIFACTS="vpp vpp-dbg vpp-dev vpp-dpdk-dev vpp-dpdk-dkms vpp-lib vpp-plugins" + PACKAGE="deb deb.md5" + CLASS="deb" + VPP_INSTALL_COMMAND="dpkg -i *.deb" +fi for ART in ${ARTIFACTS}; do for PAC in $PACKAGE; do @@ -41,17 +65,17 @@ for ART in ${ARTIFACTS}; do done done -for FILE in *.deb; do +for FILE in ${FILES}; do echo " "${FILE} >> ${FILE}.md5 done -for MD5FILE in *.md5; do +for MD5FILE in ${MD5FILES}; do md5sum -c ${MD5FILE} || exit done if [ "$1" != "--skip-install" ]; then echo Installing VPP - sudo dpkg -i *.deb + sudo ${VPP_INSTALL_COMMAND} else echo VPP Installation skipped fi |