Download images and map the folder to container 21/34421/4
authorhelenyao <yaohelan@huawei.com>
Mon, 8 May 2017 07:41:48 +0000 (15:41 +0800)
committerhelenyao <yaohelan@huawei.com>
Fri, 19 May 2017 07:04:35 +0000 (15:04 +0800)
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 <yaohelan@huawei.com>
jjb/functest/set-functest-env.sh

index 569f371..72412ea 100755 (executable)
@@ -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} \