From 2b297615ca7a994eb69ef16e52d6a61624e62aa4 Mon Sep 17 00:00:00 2001 From: helenyao Date: Mon, 8 May 2017 15:41:48 +0800 Subject: Download images and map the folder to container This patch is to accommadate with the change in patch[1] Before running the Functest Docker container, downloading all required images first and map the folder to the container [1] https://gerrit.opnfv.org/gerrit/#/c/34033 Change-Id: I617bd988caf1fd354cf9ef675661d40742b693c6 Signed-off-by: helenyao --- jjb/functest/set-functest-env.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/jjb/functest/set-functest-env.sh b/jjb/functest/set-functest-env.sh index 569f371c4..72412eafc 100755 --- a/jjb/functest/set-functest-env.sh +++ b/jjb/functest/set-functest-env.sh @@ -48,7 +48,6 @@ if [[ ${INSTALLER_TYPE} == 'apex' ]]; then fi - # Set iptables rule to allow forwarding return traffic for container if ! sudo iptables -C FORWARD -j RETURN 2> ${redirect} || ! sudo iptables -L FORWARD | awk 'NR==3' | grep RETURN 2> ${redirect}; then sudo iptables -I FORWARD -j RETURN @@ -59,6 +58,12 @@ DEPLOY_TYPE=baremetal echo "Functest: Start Docker and prepare environment" +echo "Functest: Download images that will be used by test cases" +images_dir="${HOME}/opnfv/functest/images" +chmod +x ${WORKSPACE}/functest/ci/download_images.sh +${WORKSPACE}/functest/ci/download_images.sh ${images_dir} +images_vol="-v ${images_dir}:/home/opnfv/functest/images" + dir_result="${HOME}/opnfv/functest/results/${BRANCH##*/}" mkdir -p ${dir_result} sudo rm -rf ${dir_result}/* @@ -80,7 +85,7 @@ if [[ ${INSTALLER_TYPE} == 'compass' && ${DEPLOY_SCENARIO} == *'os-nosdn-openo-h envs=${env}" -e OPENO_MSB_ENDPOINT=${openo_msb_endpoint}" fi -volumes="${results_vol} ${sshkey_vol} ${stackrc_vol} ${rc_file_vol}" +volumes="${images_vol} ${results_vol} ${sshkey_vol} ${stackrc_vol} ${rc_file_vol}" HOST_ARCH=$(uname -m) FUNCTEST_IMAGE="opnfv/functest" @@ -88,7 +93,7 @@ if [ "$HOST_ARCH" = "aarch64" ]; then FUNCTEST_IMAGE="${FUNCTEST_IMAGE}_${HOST_ARCH}" fi -echo "Functest: Pulling image ${FUNCTEST_IMAGE}:${DOCKER_TAG}" +echo "Functest: Pulling Functest Docker image ${FUNCTEST_IMAGE}:${DOCKER_TAG}" docker pull ${FUNCTEST_IMAGE}:$DOCKER_TAG >/dev/null cmd="sudo docker run --privileged=true -id ${envs} ${volumes} \ -- cgit 1.2.3-korg