diff options
Diffstat (limited to 'jjb/functest')
-rw-r--r-- | jjb/functest/functest-alpine.sh | 72 | ||||
-rw-r--r-- | jjb/functest/functest-daily-jobs.yml | 56 |
2 files changed, 128 insertions, 0 deletions
diff --git a/jjb/functest/functest-alpine.sh b/jjb/functest/functest-alpine.sh new file mode 100644 index 000000000..4b4c36503 --- /dev/null +++ b/jjb/functest/functest-alpine.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +set -e +set +u +set +o pipefail + +[[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null" +FUNCTEST_DIR=/home/opnfv/functest + +# Prepare OpenStack credentials volume +if [[ ${INSTALLER_TYPE} == 'joid' ]]; then + rc_file=$LAB_CONFIG/admin-openrc +elif [[ ${INSTALLER_TYPE} == 'compass' && ${BRANCH} == 'master' ]]; then + cacert_file_vol="-v ${HOME}/os_cacert:${FUNCTEST_DIR}/conf/os_cacert" + echo "export OS_CACERT=${FUNCTEST_DIR}/conf/os_cacert" >> ${HOME}/opnfv-openrc.sh + rc_file=${HOME}/opnfv-openrc.sh +else + rc_file=${HOME}/opnfv-openrc.sh +fi +rc_file_vol="-v ${rc_file}:${FUNCTEST_DIR}/conf/openstack.creds" + + +# 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 +fi + +DEPLOY_TYPE=baremetal +[[ $BUILD_TAG =~ "virtual" ]] && DEPLOY_TYPE=virt +HOST_ARCH=$(uname -m) + +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} ${DEPLOY_SCENARIO} ${HOST_ARCH} 2> ${redirect} +images_vol="-v ${images_dir}:${FUNCTEST_DIR}/images" + +dir_result="${HOME}/opnfv/functest/results/${BRANCH##*/}" +mkdir -p ${dir_result} +sudo rm -rf ${dir_result}/* +results_vol="-v ${dir_result}:${FUNCTEST_DIR}/results" +custom_params= +test -f ${HOME}/opnfv/functest/custom/params_${DOCKER_TAG} && custom_params=$(cat ${HOME}/opnfv/functest/custom/params_${DOCKER_TAG}) + +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 DEPLOY_TYPE=${DEPLOY_TYPE}" + +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;" \ + | sed s/,/\\n/g | grep openo_ip | cut -d \" -f 4'):$openo_msb_port" + + envs=${env}" -e OPENO_MSB_ENDPOINT=${openo_msb_endpoint}" +fi + +volumes="${images_vol} ${results_vol} ${sshkey_vol} ${rc_file_vol}" + + +tiers=(healthcheck smoke) +for tier in ${tiers[@]}; do + FUNCTEST_IMAGE=opnfv/functest-${tier} + echo "Functest: Pulling Functest Docker image ${FUNCTEST_IMAGE} ..." + docker pull ${FUNCTEST_IMAGE}>/dev/null + cmd="docker run ${envs} ${volumes} ${FUNCTEST_IMAGE}" + echo "Running Functest tier '${tier}'. CMD: ${cmd}" + ${cmd} +done diff --git a/jjb/functest/functest-daily-jobs.yml b/jjb/functest/functest-daily-jobs.yml index fdef6f483..cc9bac0a9 100644 --- a/jjb/functest/functest-daily-jobs.yml +++ b/jjb/functest/functest-daily-jobs.yml @@ -209,6 +209,12 @@ # <<: *master #-------------------------------- + alpine-pod: + - ericsson-virtual-pod1bl01: + slave-label: '{alpine-pod}' + installer: fuel + <<: *master + testsuite: - 'suite': job-timeout: 60 @@ -217,6 +223,7 @@ jobs: - 'functest-{installer}-{pod}-{testsuite}-{stream}' + - 'functest-alpine-{installer}-{alpine-pod}-{testsuite}-{stream}' ################################ # job template @@ -269,6 +276,46 @@ description: "Built on $NODE_NAME" - 'functest-{testsuite}-builder' +- job-template: + name: 'functest-alpine-{installer}-{alpine-pod}-{testsuite}-{stream}' + + concurrent: true + + properties: + - logrotate-default + - throttle: + enabled: true + max-per-node: 1 + option: 'project' + + wrappers: + - build-name: + name: '$BUILD_NUMBER Suite: $FUNCTEST_SUITE_NAME Scenario: $DEPLOY_SCENARIO' + - timeout: + timeout: '{job-timeout}' + abort: true + + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + - '{installer}-defaults' + - '{slave-label}-defaults' + - 'functest-{testsuite}-parameter' + - string: + name: DEPLOY_SCENARIO + default: 'os-nosdn-nofeature-noha' + - functest-parameter: + gs-pathname: '{gs-pathname}' + + scm: + - git-scm + + builders: + - description-setter: + description: "Built on $NODE_NAME" + - 'functest-alpine-daily-builder' + ######################## # parameter macros ######################## @@ -360,6 +407,15 @@ - 'functest-exit' - builder: + name: functest-alpine-daily-builder + builders: + - shell: + !include-raw: + - ./functest-env-presetup.sh + - ../../utils/fetch_os_creds.sh + - ./functest-alpine.sh + +- builder: name: functest-daily builders: - shell: |