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
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
VIRL_SERVERS=("10.30.51.28" "10.30.51.29" "10.30.51.30")
VIRL_SERVER=""
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
+ARCHIVE_ARTIFACTS=(log.html output.xml report.html honeycomb.log)
+
+STREAM=$1
+OS=$2
+
+if [ -f "/etc/redhat-release" ]; then
+ DISTRO="CENTOS"
+ sudo yum install -y python-devel python-virtualenv
+ VIRL_TOPOLOGY=$(cat ${SCRIPT_DIR}/VIRL_TOPOLOGY_CENTOS)
+ VIRL_RELEASE=$(cat ${SCRIPT_DIR}/VIRL_RELEASE_CENTOS)
+else
+ DISTRO="UBUNTU"
+ export DEBIAN_FRONTEND=noninteractive
+ sudo apt-get -y update
+ sudo apt-get -y install libpython2.7-dev python-virtualenv
+ VIRL_TOPOLOGY=$(cat ${SCRIPT_DIR}/VIRL_TOPOLOGY_UBUNTU)
+ VIRL_RELEASE=$(cat ${SCRIPT_DIR}/VIRL_RELEASE_UBUNTU)
+fi
SSH_OPTIONS="-i ${VIRL_PKEY} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o BatchMode=yes -o LogLevel=error"
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/scripts/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}
[[ "${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 \
- ${VIRL_USERNAME}@${VIRL_SERVER[${index}]}:${VIRL_DIR_LOC}/
+ if [ "${OS}" == "centos7" ]; then
+ scp ${SSH_OPTIONS} *.rpm \
+ ${VIRL_USERNAME}@${VIRL_SERVER[${index}]}:${VIRL_DIR_LOC}/
+ else
+ scp ${SSH_OPTIONS} *.deb \
+ ${VIRL_USERNAME}@${VIRL_SERVER[${index}]}:${VIRL_DIR_LOC}/
+ fi
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
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"
echo "However, the tests will start."
fi
+# TODO(CSIT-994): reenable NSH
PYTHONPATH=`pwd` pybot -L TRACE -W 136\
-v TOPOLOGY_PATH:${SCRIPT_DIR}/topologies/enabled/topology.yaml \
- --suite "tests.func" \
- --include honeycomb_sanity \
+ --suite "tests.honeycomb.func" \
+ --include HC_FUNC \
+ --exclude HC_NSH \
--noncritical EXPECTED_FAILING \
tests/
+RETURN_STATUS=$?
+
# Get Honeycomb log file from virl host
-# log only exists on DUT1
-for index in "${!VIRL_SERVER[@]}"; do
- scp ${SSH_OPTIONS} ${VIRL_USERNAME}@${VIRL_SERVER[${index}]}:/var/log/honeycomb/honeycomb.log . || true
+scp ${SSH_OPTIONS} \
+ ${VIRL_USERNAME}@${VIRL_SERVER}:/scratch/${VIRL_SID}/honeycomb.log . || true
+
+# Archive artifacts
+mkdir archive
+for i in ${ARCHIVE_ARTIFACTS[@]}; do
+ cp $( readlink -f ${i} | tr '\n' ' ' ) archive/
done
+
+exit ${RETURN_STATUS}