X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Ffunctest%2Fset-functest-env.sh;h=bb79dacbedae301ccdede9d1652b2d8d154637d6;hb=f7d8f8a8b885b2892c7328b7e9a31842b0e925d8;hp=5daefa2ce5558dad98a3225bfe19208496ede833;hpb=3fca8e9b0ee76f060a0b0e0f5ed750906ac43ea2;p=releng.git diff --git a/jjb/functest/set-functest-env.sh b/jjb/functest/set-functest-env.sh index 5daefa2ce..bb79dacbe 100755 --- a/jjb/functest/set-functest-env.sh +++ b/jjb/functest/set-functest-env.sh @@ -6,11 +6,20 @@ set +o pipefail [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null" +DEPLOY_TYPE=baremetal +[[ $BUILD_TAG =~ "virtual" ]] && DEPLOY_TYPE=virt +HOST_ARCH=$(uname -m) + # Prepare OpenStack credentials volume +rc_file_vol="-v ${HOME}/opnfv-openrc.sh:/home/opnfv/functest/conf/openstack.creds" + if [[ ${INSTALLER_TYPE} == 'joid' ]]; then rc_file_vol="-v $LAB_CONFIG/admin-openrc:/home/opnfv/functest/conf/openstack.creds" -else - rc_file_vol="-v ${HOME}/opnfv-openrc.sh:/home/opnfv/functest/conf/openstack.creds" +elif [[ ${INSTALLER_TYPE} == 'compass' && ${BRANCH} == 'master' ]]; then + cacert_file_vol="-v ${HOME}/os_cacert:/home/opnfv/functest/conf/os_cacert" + echo "export OS_CACERT=/home/opnfv/functest/conf/os_cacert" >> ${HOME}/opnfv-openrc.sh +elif [[ ${INSTALLER_TYPE} == 'fuel' && ${DEPLOY_TYPE} == 'baremetal' ]]; then + cacert_file_vol="-v ${HOME}/os_cacert:/etc/ssl/certs/mcp_os_cacert" fi @@ -19,18 +28,15 @@ if ! sudo iptables -C FORWARD -j RETURN 2> ${redirect} || ! sudo iptables -L FOR sudo iptables -I FORWARD -j RETURN fi -DEPLOY_TYPE=baremetal -[[ $BUILD_TAG =~ "virtual" ]] && DEPLOY_TYPE=virt -HOST_ARCH=$(uname -m) - echo "Functest: Start Docker and prepare environment" if [ "$BRANCH" != 'stable/danube' ]; then 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} ${DEPLOY_SCENARIO} ${HOST_ARCH} 2> ${redirect} + ${WORKSPACE}/functest/ci/download_images.sh ${images_dir} > ${redirect} images_vol="-v ${images_dir}:/home/opnfv/functest/images" + echo "Functest: Images successfully downloaded" fi dir_result="${HOME}/opnfv/functest/results/${BRANCH##*/}" @@ -39,13 +45,21 @@ sudo rm -rf ${dir_result}/* results_vol="-v ${dir_result}:/home/opnfv/functest/results" custom_params= test -f ${HOME}/opnfv/functest/custom/params_${DOCKER_TAG} && custom_params=$(cat ${HOME}/opnfv/functest/custom/params_${DOCKER_TAG}) +echo "Functest: custom parameters successfully retrieved: ${custom_params}" envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} \ -e NODE_NAME=${NODE_NAME} -e DEPLOY_SCENARIO=${DEPLOY_SCENARIO} \ -e BUILD_TAG=${BUILD_TAG} -e CI_DEBUG=${CI_DEBUG} -e DEPLOY_TYPE=${DEPLOY_TYPE}" +ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + +if [ "${INSTALLER_TYPE}" == 'fuel' ] && [ "$BRANCH" != 'stable/danube' ]; then + COMPUTE_ARCH=$(ssh -l ubuntu ${INSTALLER_IP} -i ${SSH_KEY} ${ssh_options} \ + "sudo salt 'cmp*' grains.get cpuarch --out yaml | awk '{print \$2; exit}'") + envs="${envs} -e POD_ARCH=${COMPUTE_ARCH}" +fi + if [[ ${INSTALLER_TYPE} == 'compass' && ${DEPLOY_SCENARIO} == *'os-nosdn-openo-ha'* ]]; then - ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" openo_msb_port=${openo_msb_port:-80} openo_msb_endpoint="$(sshpass -p'root' ssh 2>/dev/null $ssh_options root@${installer_ip} \ 'mysql -ucompass -pcompass -Dcompass -e "select package_config from cluster;" \ @@ -55,11 +69,13 @@ if [[ ${INSTALLER_TYPE} == 'compass' && ${DEPLOY_SCENARIO} == *'os-nosdn-openo-h fi if [ "$BRANCH" != 'stable/danube' ]; then - volumes="${images_vol} ${results_vol} ${sshkey_vol} ${stackrc_vol} ${rc_file_vol}" + volumes="${images_vol} ${results_vol} ${sshkey_vol} ${stackrc_vol} ${rc_file_vol} ${cacert_file_vol}" else volumes="${results_vol} ${sshkey_vol} ${stackrc_vol} ${rc_file_vol}" fi +echo "Functest: volumes defined" + FUNCTEST_IMAGE="opnfv/functest" if [ "$HOST_ARCH" = "aarch64" ]; then FUNCTEST_IMAGE="${FUNCTEST_IMAGE}_${HOST_ARCH}"