sudo apt-get -y update
sudo apt-get -y install libpython2.7-dev python-virtualenv
-# Source the VIRL server parameters:
-source virl_params.sh
+VIRL_SERVERS=("10.30.51.28" "10.30.51.29" "10.30.51.30")
+VIRL_SERVER=""
+
+VIRL_USERNAME=jenkins-in
+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
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
+echo Downloading packages...
+bash ${SCRIPT_DIR}/resources/tools/download_hc_pkgs.sh
+
+VPP_DEBS=(*.deb)
+echo ${VPP_DEBS[@]}
+VIRL_DIR_LOC="/tmp"
+VPP_DEBS_FULL=(${VPP_DEBS[@]})
+
+# 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}]}
+done
+
+echo "Updated file names: " ${VPP_DEBS_FULL[@]}
+
cat ${VIRL_PKEY}
-# Copy start-honeycomb-testcase to VIRL
-START_FILE="resources/tools/virl/bin/start-honeycomb-testcase"
-DST_DIR_1="/home/jenkins-in/testcase-infra/bin/"
-DST_DIR_2="/home/jenkins-in/bin/"
+# Copy the files to VIRL hosts
+DONE=""
+for index in "${!VIRL_SERVER[@]}"; do
+ # Do not copy files in case they have already been copied to the VIRL host
+ [[ "${DONE[@]}" =~ "${VIRL_SERVER[${index}]}" ]] && copy=0 || copy=1
-scp ${SSH_OPTIONS} ${START_FILE} ${VIRL_USERNAME}@${VIRL_SERVER}:${DST_DIR_1}
-scp ${SSH_OPTIONS} ${START_FILE} ${VIRL_USERNAME}@${VIRL_SERVER}:${DST_DIR_2}
+ if [ "${copy}" -eq "0" ]; then
+ echo "deb 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}/
+
+ result=$?
+ if [ "${result}" -ne "0" ]; then
+ echo "Failed to copy deb files to VIRL host ${VIRL_SERVER[${index}]}"
+ echo ${result}
+ exit ${result}
+ else
+ echo "deb files successfully copied to the VIRL host ${VIRL_SERVER[${index}]}"
+ fi
+ DONE+=(${VIRL_SERVER[${index}]})
+ fi
+done
# Start a simulation on VIRL server
echo "Starting simulation on VIRL server"
VIRL_SID=$(ssh ${SSH_OPTIONS} \
${VIRL_USERNAME}@${VIRL_SERVER} \
- "start-honeycomb-testcase double-ring-nested")
+ "start-testcase -c ${VIRL_TOPOLOGY} -r ${VIRL_RELEASE} ${VPP_DEBS_FULL[@]}")
retval=$?
-if [ "$?" -ne "0" ]; then
+if [ ${retval} -ne "0" ]; then
echo "VIRL simulation start failed"
exit ${retval}
fi
topologies/enabled/topology.yaml
retval=$?
-if [ "$?" -ne "0" ]; then
+if [ ${retval} -ne "0" ]; then
echo "Failed to copy topology file from VIRL simulation"
exit ${retval}
fi