diff options
Diffstat (limited to 'jjb/functest')
-rwxr-xr-x[-rw-r--r--] | jjb/functest/functest-alpine.sh | 9 | ||||
-rw-r--r-- | jjb/functest/functest-daily-jobs.yml | 45 | ||||
-rw-r--r-- | jjb/functest/functest-project-jobs.yml | 205 | ||||
-rwxr-xr-x | jjb/functest/set-functest-env.sh | 28 |
4 files changed, 192 insertions, 95 deletions
diff --git a/jjb/functest/functest-alpine.sh b/jjb/functest/functest-alpine.sh index f0e08e171..57398faf6 100644..100755 --- a/jjb/functest/functest-alpine.sh +++ b/jjb/functest/functest-alpine.sh @@ -68,9 +68,14 @@ volumes="${images_vol} ${results_vol} ${sshkey_vol} ${rc_file_vol} ${cacert_file set +e -tiers=(healthcheck smoke features vnf) +if [ ${FUNCTEST_SUITE_NAME} == 'healthcheck' ]; then + tiers=(healthcheck) +else + tiers=(healthcheck smoke features vnf) +fi + for tier in ${tiers[@]}; do - FUNCTEST_IMAGE=ollivier/functest-${tier} + 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}" diff --git a/jjb/functest/functest-daily-jobs.yml b/jjb/functest/functest-daily-jobs.yml index 23649fc08..b1d7e748d 100644 --- a/jjb/functest/functest-daily-jobs.yml +++ b/jjb/functest/functest-daily-jobs.yml @@ -150,22 +150,6 @@ slave-label: '{pod}' installer: apex <<: *master - - arm-pod2: - slave-label: '{pod}' - installer: fuel - <<: *master - - arm-pod5: - slave-label: '{pod}' - installer: fuel - <<: *master - - arm-pod4: - slave-label: '{pod}' - installer: fuel - <<: *master - - arm-virtual2: - slave-label: '{pod}' - installer: fuel - <<: *master - zte-pod1: slave-label: '{pod}' installer: fuel @@ -186,22 +170,6 @@ slave-label: '{pod}' installer: fuel <<: *danube - - arm-pod2: - slave-label: '{pod}' - installer: fuel - <<: *danube - - arm-pod5: - slave-label: '{pod}' - installer: fuel - <<: *danube - - arm-pod4: - slave-label: '{pod}' - installer: fuel - <<: *danube - - arm-virtual2: - slave-label: '{pod}' - installer: fuel - <<: *danube # PODs for verify jobs triggered by each patch upload # - ool-virtual1: # slave-label: '{pod}' @@ -396,10 +364,9 @@ name: functest-daily-builder builders: - 'functest-cleanup' - - 'set-functest-env' + - 'set-functest-env-alpine' - 'functest-daily' - 'functest-store-results' - - 'functest-exit' - builder: name: functest-suite-builder @@ -424,7 +391,7 @@ name: functest-daily builders: - shell: - !include-raw: ./functest-loop.sh + !include-raw: ./functest-alpine.sh - builder: @@ -443,6 +410,14 @@ - ./set-functest-env.sh - builder: + name: set-functest-env-alpine + builders: + - shell: + !include-raw: + - ./functest-env-presetup.sh + - ../../utils/fetch_os_creds.sh + +- builder: name: functest-store-results builders: - shell: diff --git a/jjb/functest/functest-project-jobs.yml b/jjb/functest/functest-project-jobs.yml index 07d5df46e..c25e4ab4a 100644 --- a/jjb/functest/functest-project-jobs.yml +++ b/jjb/functest/functest-project-jobs.yml @@ -9,6 +9,7 @@ jobs: - 'functest-verify-{stream}' + - 'functest-verify-{phase}-{stream}' - 'functest-docs-upload-{stream}' stream: @@ -21,11 +22,21 @@ gs-pathname: '/{stream}' disabled: true + phase: + - 'unit-tests-and-docs': + slave-label: 'opnfv-build-ubuntu' + - 'build-x86_64': + slave-label: 'opnfv-build-ubuntu' + - 'build-aarch64': + slave-label: 'opnfv-build-ubuntu-arm' + - job-template: name: 'functest-verify-{stream}' disabled: '{obj:disabled}' + project-type: 'multijob' + parameters: - project-parameter: project: '{project}' @@ -36,6 +47,109 @@ - git-scm-gerrit triggers: + - 'functest-verify-triggers-macro': + project: '{project}' + branch: '{branch}' + + builders: + - shell: | + #!/bin/bash + # we do nothing here as the main stuff will be done + # in phase jobs + echo "Triggering phase jobs!" + - multijob: + name: 'functest-build-and-unittest' + execution-type: PARALLEL + projects: + - name: 'functest-verify-unit-tests-and-docs-{stream}' + current-parameters: false + predefined-parameters: | + GERRIT_BRANCH=$GERRIT_BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE + git-revision: true + node-parameters: false + kill-phase-on: FAILURE + abort-all-job: false + - name: 'functest-verify-build-x86_64-{stream}' + current-parameters: false + predefined-parameters: | + GERRIT_BRANCH=$GERRIT_BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE + ARCH=x86_64 + git-revision: true + node-parameters: false + kill-phase-on: FAILURE + abort-all-job: false + - name: 'functest-verify-build-aarch64-{stream}' + current-parameters: false + predefined-parameters: | + GERRIT_BRANCH=$GERRIT_BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE + ARCH=aarch64 + git-revision: true + node-parameters: false + kill-phase-on: FAILURE + abort-all-job: false + +- job-template: + name: 'functest-verify-{phase}-{stream}' + + disabled: '{obj:disabled}' + + wrappers: + - ssh-agent-wrapper + - build-timeout: + timeout: 30 + + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + - '{slave-label}-defaults' + + scm: + - git-scm-gerrit + + builders: + - 'functest-verify-{phase}-builders-macro' + + publishers: + - 'functest-verify-{phase}-publishers-macro' + +- job-template: + name: 'functest-docs-upload-{stream}' + + disabled: '{obj:disabled}' + + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + - 'opnfv-build-ubuntu-defaults' + + scm: + - git-scm + + triggers: + - 'functest-docs-upload-triggers-macro': + project: '{project}' + branch: '{branch}' + + builders: + - functest-upload-doc-artifact + +################################ +# job triggers +################################ +- trigger: + name: 'functest-verify-triggers-macro' + triggers: - gerrit: server-name: 'gerrit.opnfv.org' trigger-on: @@ -58,44 +172,8 @@ forbidden-file-paths: - compare-type: ANT pattern: 'docs/**|.gitignore' - - builders: - - functest-unit-tests-and-docs-build - - publishers: - - junit: - results: nosetests.xml - - cobertura: - report-file: "coverage.xml" - only-stable: "true" - health-auto-update: "true" - stability-auto-update: "true" - zoom-coverage-chart: "true" - targets: - - files: - healthy: 10 - unhealthy: 20 - failing: 30 - - method: - healthy: 50 - unhealthy: 40 - failing: 30 - - email-jenkins-admins-on-failure - -- job-template: - name: 'functest-docs-upload-{stream}' - - disabled: '{obj:disabled}' - - parameters: - - project-parameter: - project: '{project}' - branch: '{branch}' - - 'opnfv-build-ubuntu-defaults' - - scm: - - git-scm - +- trigger: + name: 'functest-docs-upload-triggers-macro' triggers: - gerrit: server-name: 'gerrit.opnfv.org' @@ -113,23 +191,60 @@ forbidden-file-paths: - compare-type: ANT pattern: 'docs/**|.gitignore' - - builders: - - functest-upload-doc-artifact - ################################ # job builders ################################ - builder: - name: functest-unit-tests-and-docs-build + name: 'functest-verify-unit-tests-and-docs-builders-macro' builders: - shell: | cd $WORKSPACE && tox - - builder: - name: functest-upload-doc-artifact + name: 'functest-verify-build-x86_64-builders-macro' + builders: + - shell: | + echo "Not activated!" +- builder: + name: 'functest-verify-build-aarch64-builders-macro' + builders: + - shell: | + echo "Not activated!" +- builder: + name: 'functest-upload-doc-artifact' builders: - shell: | cd $WORKSPACE && tox -edocs wget -O - https://git.opnfv.org/releng/plain/utils/upload-artifact.sh | bash -s "api/_build" "docs" +################################ +# job publishers +################################ +- publisher: + name: 'functest-verify-unit-tests-and-docs-publishers-macro' + publishers: + - junit: + results: nosetests.xml + - cobertura: + report-file: "coverage.xml" + only-stable: "true" + health-auto-update: "true" + stability-auto-update: "true" + zoom-coverage-chart: "true" + targets: + - files: + healthy: 10 + unhealthy: 20 + failing: 30 + - method: + healthy: 50 + unhealthy: 40 + failing: 30 + - email-jenkins-admins-on-failure +- publisher: + name: 'functest-verify-build-x86_64-publishers-macro' + publishers: + - email-jenkins-admins-on-failure +- publisher: + name: 'functest-verify-build-aarch64-publishers-macro' + publishers: + - email-jenkins-admins-on-failure diff --git a/jjb/functest/set-functest-env.sh b/jjb/functest/set-functest-env.sh index e54c3bf13..bb79dacbe 100755 --- a/jjb/functest/set-functest-env.sh +++ b/jjb/functest/set-functest-env.sh @@ -6,15 +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" 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 - rc_file_vol="-v ${HOME}/opnfv-openrc.sh:/home/opnfv/functest/conf/openstack.creds" -else - rc_file_vol="-v ${HOME}/opnfv-openrc.sh:/home/opnfv/functest/conf/openstack.creds" +elif [[ ${INSTALLER_TYPE} == 'fuel' && ${DEPLOY_TYPE} == 'baremetal' ]]; then + cacert_file_vol="-v ${HOME}/os_cacert:/etc/ssl/certs/mcp_os_cacert" fi @@ -23,17 +28,13 @@ 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} > ${redirect} 2>&1 + ${WORKSPACE}/functest/ci/download_images.sh ${images_dir} > ${redirect} images_vol="-v ${images_dir}:/home/opnfv/functest/images" echo "Functest: Images successfully downloaded" fi @@ -50,14 +51,15 @@ 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}" -if [[ ${INSTALLER_TYPE} == 'fuel' && ! -z ${SALT_MASTER_IP} ]]; then - HOST_ARCH=$(ssh -l ubuntu ${SALT_MASTER_IP} -i ${SSH_KEY} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \ - "sudo salt 'cmp*' grains.get cpuarch --out yaml |awk '{print \$2; exit}'") - envs="${envs} -e POD_ARCH=${HOST_ARCH}" +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;" \ |