diff options
author | selias <samelias@cisco.com> | 2016-11-10 13:27:26 +0100 |
---|---|---|
committer | Samuel Eliáš <samelias@cisco.com> | 2016-11-10 12:44:10 +0000 |
commit | 7889a8bc03746d41643af32d5514e499df41fb3e (patch) | |
tree | d974bcda3dc0ee2ffa96cc837c07bff62a3a053c /bootstrap-vpp-honeycomb.sh | |
parent | 67a5922484a983e1e8d99fcd43212344ff7e4504 (diff) |
CSIT-454: HC Test: fix package installation in csit-honeycomb job
Change-Id: Ie8ef408d87f2bd0327489179507076c6ea619e1e
Signed-off-by: selias <samelias@cisco.com>
Diffstat (limited to 'bootstrap-vpp-honeycomb.sh')
-rwxr-xr-x | bootstrap-vpp-honeycomb.sh | 46 |
1 files changed, 39 insertions, 7 deletions
diff --git a/bootstrap-vpp-honeycomb.sh b/bootstrap-vpp-honeycomb.sh index df5a5f97ab..ec7be15f2b 100755 --- a/bootstrap-vpp-honeycomb.sh +++ b/bootstrap-vpp-honeycomb.sh @@ -106,17 +106,49 @@ do fi done +# Download the latest VPP and HC .deb packages +echo Downloading packages... +bash ${SCRIPT_DIR}/resources/tools/download_hc_pkgs.sh + SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +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" @@ -128,7 +160,7 @@ function stop_virl_simulation { VIRL_SID=$(ssh ${SSH_OPTIONS} \ ${VIRL_USERNAME}@${VIRL_SERVER} \ - "start-honeycomb-testcase ${VIRL_TOPOLOGY} -r ${VIRL_RELEASE}") + "start-testcase ${VIRL_TOPOLOGY} -r ${VIRL_RELEASE}") retval=$? if [ "$?" -ne "0" ]; then echo "VIRL simulation start failed" |