diff options
author | jose.lausuch <jose.lausuch@ericsson.com> | 2017-07-18 12:48:43 +0200 |
---|---|---|
committer | jose.lausuch <jose.lausuch@ericsson.com> | 2017-07-19 11:06:42 +0200 |
commit | b691a18e4a5d4b1c232a240fae455979c6c8c1f4 (patch) | |
tree | 6ee8b54010f0170edd6108c82eb36618e4c63d0d /jjb | |
parent | f4077629308e7374d9e92923af996cf7bf79678c (diff) |
[Functest] Add script for running new Alpine containers
Change-Id: I96c7144578ee2e1f842e4bd22ffb79b9e1e54e4c
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/functest/functest-alpine.sh | 71 | ||||
-rw-r--r-- | jjb/functest/functest-daily-jobs.yml | 53 | ||||
-rw-r--r-- | jjb/global/slave-params.yml | 10 |
3 files changed, 134 insertions, 0 deletions
diff --git a/jjb/functest/functest-alpine.sh b/jjb/functest/functest-alpine.sh new file mode 100644 index 000000000..bd8c2e44e --- /dev/null +++ b/jjb/functest/functest-alpine.sh @@ -0,0 +1,71 @@ +#!/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 ${volumes} ${FUNCTEST_IMAGE}" + echo "Running Functest tier '${tier}'. CMD: ${cmd}" +done diff --git a/jjb/functest/functest-daily-jobs.yml b/jjb/functest/functest-daily-jobs.yml index fdef6f483..0616e2f39 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,12 @@ - 'functest-exit' - builder: + name: functest-alpine-daily-builder + builders: + - shell: + !include-raw: ./functest-alpine.sh + +- builder: name: functest-daily builders: - shell: diff --git a/jjb/global/slave-params.yml b/jjb/global/slave-params.yml index 50859c46f..3694c0bc9 100644 --- a/jjb/global/slave-params.yml +++ b/jjb/global/slave-params.yml @@ -935,6 +935,16 @@ default: https://gerrit.opnfv.org/gerrit/$PROJECT description: 'Git URL to use on this Jenkins Slave' - parameter: + name: 'ericsson-virtual-pod1bl01-defaults' + parameters: + - label: + name: SLAVE_LABEL + default: 'ericsson-virtual-pod1bl01' + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/$PROJECT + description: 'Git URL to use on this Jenkins Slave' +- parameter: name: 'odl-netvirt-virtual-defaults' parameters: - label: |