diff options
45 files changed, 714 insertions, 625 deletions
diff --git a/jjb/3rd_party_ci/odl-netvirt.yml b/jjb/3rd_party_ci/odl-netvirt.yml index 01017f307..863eb94dd 100644 --- a/jjb/3rd_party_ci/odl-netvirt.yml +++ b/jjb/3rd_party_ci/odl-netvirt.yml @@ -137,6 +137,7 @@ - name: 'functest-netvirt-virtual-suite-master' predefined-parameters: | DEPLOY_SCENARIO=os-odl_l3-nofeature-ha + FUNCTEST_MODE=testcase FUNCTEST_SUITE_NAME=odl_netvirt RC_FILE_PATH=$HOME/cloner-info/overcloudrc node-parameters: true diff --git a/jjb/apex/apex-build.sh b/jjb/apex/apex-build.sh index 23ce81015..cf5999832 100755 --- a/jjb/apex/apex-build.sh +++ b/jjb/apex/apex-build.sh @@ -46,6 +46,12 @@ echo "Cache Directory Contents:" echo "-------------------------" ls -al $CACHE_DIRECTORY +if [[ "$BUILD_ARGS" =~ '--iso' ]]; then + mkdir -p /tmp/apex-iso/ + rm -f /tmp/apex-iso/*.iso + cp -f $BUILD_DIRECTORY/../.build/release/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso /tmp/apex-iso/ +fi + if ! echo $ARTIFACT_VERSION | grep "dev" 1> /dev/null; then echo "Writing opnfv.properties file" # save information regarding artifact into file diff --git a/jjb/apex/apex-iso-verify.sh b/jjb/apex/apex-iso-verify.sh index f102421f3..4faeb607e 100755 --- a/jjb/apex/apex-iso-verify.sh +++ b/jjb/apex/apex-iso-verify.sh @@ -8,7 +8,14 @@ echo "Starting the Apex iso verify." echo "--------------------------------------------------------" echo -source $BUILD_DIRECTORY/../opnfv.properties +# Must be RPMs/ISO +echo "Downloading latest properties file" + +# get the properties file in order to get info regarding artifacts +curl --fail -s -o opnfv.properties http://$GS_URL/latest.properties + +# source the file so we get OPNFV vars +source opnfv.properties if ! rpm -q virt-install > /dev/null; then sudo yum -y install virt-install @@ -35,9 +42,9 @@ sudo rm -f /var/log/libvirt/qemu/apex-iso-verify-console.log sudo virt-install -n apex-iso-verify -r 4096 --vcpus 4 --os-variant=rhel7 \ --accelerate -v --noautoconsole \ --disk path=/var/lib/libvirt/images/apex-iso-verify.qcow2,size=30,format=qcow2 \ - -l $BUILD_DIRECTORY/release/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso \ + -l /tmp/apex-iso/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso \ --extra-args 'console=ttyS0 console=ttyS0,115200n8 serial inst.ks=file:/iso-verify.ks inst.stage2=hd:LABEL=OPNFV\x20CentOS\x207\x20x86_64:/' \ - --initrd-inject $BUILD_DIRECTORY/../ci/iso-verify.ks \ + --initrd-inject ci/iso-verify.ks \ --serial file,path=/var/log/libvirt/qemu/apex-iso-verify-console.log echo "Waiting for install to finish..." diff --git a/jjb/apex/apex.yml b/jjb/apex/apex.yml index bed67f416..6bd2248bd 100644 --- a/jjb/apex/apex.yml +++ b/jjb/apex/apex.yml @@ -28,6 +28,7 @@ baremetal-slave: 'apex-baremetal-master' verify-scenario: 'os-odl-nofeature-ha' scenario_stream: 'master' + disable_daily: true - euphrates: &euphrates branch: 'stable/euphrates' gs-pathname: '/euphrates' @@ -36,6 +37,7 @@ baremetal-slave: 'apex-baremetal-master' verify-scenario: 'os-odl-nofeature-ha' scenario_stream: 'euphrates' + disable_daily: false - danube: &danube branch: 'stable/danube' gs-pathname: '/danube' @@ -45,6 +47,7 @@ verify-scenario: 'os-odl_l3-nofeature-ha' scenario_stream: 'danube' disabled: true + disable_daily: true scenario: - 'os-nosdn-nofeature-noha': @@ -500,7 +503,8 @@ current-parameters: false predefined-parameters: | DEPLOY_SCENARIO=$DEPLOY_SCENARIO - FUNCTEST_SUITE_NAME=healthcheck + FUNCTEST_MODE=tier + FUNCTEST_TIER=healthcheck GERRIT_BRANCH=$GERRIT_BRANCH GERRIT_REFSPEC=$GERRIT_REFSPEC GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER @@ -898,7 +902,7 @@ node: '{baremetal-slave}' - disabled: false + disabled: '{obj:disable_daily}' scm: - git-scm @@ -914,6 +918,11 @@ properties: - logrotate-default + - build-blocker: + use-build-blocker: true + block-level: 'NODE' + blocking-jobs: + - 'apex-daily.*' triggers: - 'apex-{stream}' diff --git a/jjb/apex/apex.yml.j2 b/jjb/apex/apex.yml.j2 index 3c36e8f62..6bebf3b5c 100644 --- a/jjb/apex/apex.yml.j2 +++ b/jjb/apex/apex.yml.j2 @@ -28,6 +28,7 @@ baremetal-slave: 'apex-baremetal-master' verify-scenario: 'os-odl-nofeature-ha' scenario_stream: 'master' + disable_daily: true - euphrates: &euphrates branch: 'stable/euphrates' gs-pathname: '/euphrates' @@ -36,6 +37,7 @@ baremetal-slave: 'apex-baremetal-master' verify-scenario: 'os-odl-nofeature-ha' scenario_stream: 'euphrates' + disable_daily: false - danube: &danube branch: 'stable/danube' gs-pathname: '/danube' @@ -45,6 +47,7 @@ verify-scenario: 'os-odl_l3-nofeature-ha' scenario_stream: 'danube' disabled: true + disable_daily: true scenario: {%- for stream in scenarios %} @@ -370,7 +373,8 @@ current-parameters: false predefined-parameters: | DEPLOY_SCENARIO=$DEPLOY_SCENARIO - FUNCTEST_SUITE_NAME=healthcheck + FUNCTEST_MODE=tier + FUNCTEST_TIER=healthcheck GERRIT_BRANCH=$GERRIT_BRANCH GERRIT_REFSPEC=$GERRIT_REFSPEC GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER @@ -768,7 +772,7 @@ node: '{baremetal-slave}' - disabled: false + disabled: '{obj:disable_daily}' scm: - git-scm @@ -784,6 +788,11 @@ properties: - logrotate-default + - build-blocker: + use-build-blocker: true + block-level: 'NODE' + blocking-jobs: + - 'apex-daily.*' triggers: - 'apex-{stream}' diff --git a/jjb/ci_gate_security/anteater-security-audit.sh b/jjb/ci_gate_security/anteater-security-audit.sh index 35f9354e0..8a170b044 100644 --- a/jjb/ci_gate_security/anteater-security-audit.sh +++ b/jjb/ci_gate_security/anteater-security-audit.sh @@ -2,6 +2,8 @@ cd $WORKSPACE REPORTDIR='.reports' mkdir -p $REPORTDIR +# Ensure any user can read the reports directory +chmod 777 $REPORTDIR echo "Generating patchset file to list changed files" git diff HEAD^1 --name-only | sed "s#^#/home/opnfv/anteater/$PROJECT/#" > $WORKSPACE/patchset echo "Changed files are" diff --git a/jjb/ci_gate_security/opnfv-ci-gate-security.yml b/jjb/ci_gate_security/opnfv-ci-gate-security.yml index 33179537c..e09339a4b 100644 --- a/jjb/ci_gate_security/opnfv-ci-gate-security.yml +++ b/jjb/ci_gate_security/opnfv-ci-gate-security.yml @@ -50,7 +50,7 @@ parameters: - label: name: SLAVE_LABEL - default: 'ericsson-build3' + default: 'opnfv-build' description: 'Slave label on Jenkins' - project-parameter: project: $GERRIT_PROJECT diff --git a/jjb/compass4nfv/compass-ci-jobs.yml b/jjb/compass4nfv/compass-ci-jobs.yml index 9f266b00c..74a134eda 100644 --- a/jjb/compass4nfv/compass-ci-jobs.yml +++ b/jjb/compass4nfv/compass-ci-jobs.yml @@ -16,7 +16,7 @@ euphrates: &euphrates stream: euphrates branch: 'stable/{stream}' - disabled: true + disabled: false gs-pathname: '/{stream}' ppa-pathname: '/{stream}' openstack-version: ocata @@ -629,23 +629,23 @@ - trigger: name: 'compass-os-nosdn-nofeature-ha-baremetal-euphrates-trigger' triggers: - - timed: '' #'0 9 * * *' + - timed: '0 1 * * *' - trigger: name: 'compass-os-nosdn-openo-ha-baremetal-euphrates-trigger' triggers: - - timed: '' #'0 13 * * *' + - timed: '' - trigger: name: 'compass-os-odl_l2-nofeature-ha-baremetal-euphrates-trigger' triggers: - - timed: '' #'0 17 * * *' + - timed: '' - trigger: name: 'compass-os-odl_l3-nofeature-ha-baremetal-euphrates-trigger' triggers: - - timed: '' #'0 21 * * *' + - timed: '0 21 * * *' - trigger: name: 'compass-os-onos-nofeature-ha-baremetal-euphrates-trigger' triggers: - - timed: '' #'0 1 * * *' + - timed: '' - trigger: name: 'compass-os-ocl-nofeature-ha-baremetal-euphrates-trigger' triggers: @@ -653,19 +653,19 @@ - trigger: name: 'compass-os-onos-sfc-ha-baremetal-euphrates-trigger' triggers: - - timed: '' #'0 5 * * *' + - timed: '' - trigger: name: 'compass-os-odl_l2-moon-ha-baremetal-euphrates-trigger' triggers: - - timed: '' + - timed: '0 5 * * *' - trigger: name: 'compass-os-nosdn-kvm-ha-baremetal-euphrates-trigger' triggers: - - timed: '' + - timed: '0 13 * * *' - trigger: name: 'compass-os-nosdn-dpdk-ha-baremetal-euphrates-trigger' triggers: - - timed: '' + - timed: '0 9 * * *' - trigger: name: 'compass-k8-nosdn-nofeature-ha-baremetal-euphrates-trigger' triggers: @@ -673,7 +673,7 @@ - trigger: name: 'compass-os-odl-sfc-ha-baremetal-euphrates-trigger' triggers: - - timed: '' + - timed: '0 17 * * *' #---------------------- # noha-baremetal-euphrates @@ -737,7 +737,7 @@ - trigger: name: 'compass-os-odl_l2-moon-ha-virtual-master-trigger' triggers: - - timed: '0 12 * * *' + - timed: '30 12 * * *' - trigger: name: 'compass-os-nosdn-kvm-ha-virtual-master-trigger' triggers: @@ -761,7 +761,7 @@ - trigger: name: 'compass-os-nosdn-kvm-noha-virtual-master-trigger' triggers: - - timed: '0 13 * * *' + - timed: '30 13 * * *' - trigger: name: 'compass-os-nosdn-nofeature-noha-virtual-master-trigger' triggers: @@ -789,23 +789,23 @@ - trigger: name: 'compass-os-nosdn-nofeature-ha-virtual-euphrates-trigger' triggers: - - timed: '' #'0 21 * * *' + - timed: '0 23 * * *' - trigger: name: 'compass-os-nosdn-openo-ha-virtual-euphrates-trigger' triggers: - - timed: '' #'0 22 * * *' + - timed: '' - trigger: name: 'compass-os-odl_l2-nofeature-ha-virtual-euphrates-trigger' triggers: - - timed: '' #'0 20 * * *' + - timed: '' - trigger: name: 'compass-os-odl_l3-nofeature-ha-virtual-euphrates-trigger' triggers: - - timed: '' #'0 19 * * *' + - timed: '0 22 * * *' - trigger: name: 'compass-os-onos-nofeature-ha-virtual-euphrates-trigger' triggers: - - timed: '' #'0 18 * * *' + - timed: '' - trigger: name: 'compass-os-ocl-nofeature-ha-virtual-euphrates-trigger' triggers: @@ -813,27 +813,27 @@ - trigger: name: 'compass-os-onos-sfc-ha-virtual-euphrates-trigger' triggers: - - timed: '' #'0 15 * * *' + - timed: '' - trigger: name: 'compass-os-odl_l2-moon-ha-virtual-euphrates-trigger' triggers: - - timed: '' #'0 14 * * *' + - timed: '0 20 * * *' - trigger: name: 'compass-os-nosdn-kvm-ha-virtual-euphrates-trigger' triggers: - - timed: '' + - timed: '0 16 * * *' - trigger: name: 'compass-os-nosdn-dpdk-ha-virtual-euphrates-trigger' triggers: - - timed: '' + - timed: '0 14 * * *' - trigger: name: 'compass-os-odl-sfc-ha-virtual-euphrates-trigger' triggers: - - timed: '' + - timed: '0 18 * * *' - trigger: name: 'compass-k8-nosdn-nofeature-ha-virtual-euphrates-trigger' triggers: - - timed: '' + - timed: '0 13 * * *' #-------------------- # noha-virtual-euphrates @@ -841,24 +841,24 @@ - trigger: name: 'compass-os-nosdn-kvm-noha-virtual-euphrates-trigger' triggers: - - timed: '' + - timed: '0 15 * * *' - trigger: name: 'compass-os-nosdn-nofeature-noha-virtual-euphrates-trigger' triggers: - - timed: '' + - timed: '0 17 * * *' - trigger: name: 'compass-os-odl_l3-nofeature-noha-virtual-euphrates-trigger' triggers: - - timed: '' + - timed: '0 23 * * *' - trigger: name: 'compass-os-odl_l2-moon-noha-virtual-euphrates-trigger' triggers: - - timed: '' + - timed: '0 21 * * *' - trigger: name: 'compass-os-odl-sfc-noha-virtual-euphrates-trigger' triggers: - - timed: '' + - timed: '0 19 * * *' - trigger: name: 'compass-os-nosdn-dpdk-noha-virtual-euphrates-trigger' triggers: - - timed: '' + - timed: '0 12 * * *' diff --git a/jjb/compass4nfv/compass-project-jobs.yml b/jjb/compass4nfv/compass-project-jobs.yml index e612ef65f..fe9170578 100644 --- a/jjb/compass4nfv/compass-project-jobs.yml +++ b/jjb/compass4nfv/compass-project-jobs.yml @@ -19,6 +19,11 @@ gs-pathname: '/{stream}' ppa-pathname: '/{stream}' disabled: false + - euphrates: + branch: 'stable/{stream}' + gs-pathname: '/{stream}' + ppa-pathname: '/{stream}' + disabled: false jobs: - '{installer}-build-daily-{stream}' diff --git a/jjb/compass4nfv/compass-verify-jobs.yml b/jjb/compass4nfv/compass-verify-jobs.yml index ee91e02da..f4fe8f66c 100644 --- a/jjb/compass4nfv/compass-verify-jobs.yml +++ b/jjb/compass4nfv/compass-verify-jobs.yml @@ -159,7 +159,8 @@ - name: 'functest-compass-virtual-suite-{stream}' current-parameters: false predefined-parameters: | - FUNCTEST_SUITE_NAME=healthcheck + FUNCTEST_MODE=tier + FUNCTEST_TIER=healthcheck DEPLOY_SCENARIO=os-nosdn-nofeature-ha node-parameters: true kill-phase-on: NEVER @@ -167,6 +168,7 @@ - name: 'functest-compass-virtual-suite-{stream}' current-parameters: false predefined-parameters: | + FUNCTEST_MODE=testcase FUNCTEST_SUITE_NAME=vping_ssh DEPLOY_SCENARIO=os-nosdn-nofeature-ha node-parameters: true diff --git a/jjb/daisy4nfv/daisy-daily-jobs.yml b/jjb/daisy4nfv/daisy-daily-jobs.yml index a9249eaf8..7b753836d 100644 --- a/jjb/daisy4nfv/daisy-daily-jobs.yml +++ b/jjb/daisy4nfv/daisy-daily-jobs.yml @@ -37,6 +37,12 @@ - virtual: slave-label: daisy-virtual <<: *master + - baremetal: + slave-label: daisy-baremetal + <<: *euphrates + - virtual: + slave-label: daisy-virtual + <<: *euphrates #-------------------------------- # None-CI PODs #-------------------------------- @@ -225,6 +231,11 @@ name: 'daisy-os-nosdn-nofeature-ha-baremetal-daily-euphrates-trigger' triggers: - timed: '0 0 * * *' +# Basic NOHA Scenarios +- trigger: + name: 'daisy-os-nosdn-nofeature-noha-baremetal-daily-euphrates-trigger' + triggers: + - timed: '' # ODL Scenarios - trigger: name: 'daisy-os-odl-nofeature-ha-baremetal-daily-euphrates-trigger' @@ -238,6 +249,11 @@ name: 'daisy-os-nosdn-nofeature-ha-virtual-daily-euphrates-trigger' triggers: - timed: '0 0 * * *' +# Basic NOHA Scenarios +- trigger: + name: 'daisy-os-nosdn-nofeature-noha-virtual-daily-euphrates-trigger' + triggers: + - timed: '' # ODL Scenarios - trigger: name: 'daisy-os-odl-nofeature-ha-virtual-daily-euphrates-trigger' diff --git a/jjb/doctor/doctor.yml b/jjb/doctor/doctor.yml index 012d37398..c80642979 100644 --- a/jjb/doctor/doctor.yml +++ b/jjb/doctor/doctor.yml @@ -143,6 +143,9 @@ description: 'Scenario to deploy and test' # functest-suite-parameter - string: + name: FUNCTEST_MODE + default: 'testcase' + - string: name: FUNCTEST_SUITE_NAME default: 'doctor-notification' - string: diff --git a/jjb/dovetail/dovetail-ci-jobs.yml b/jjb/dovetail/dovetail-ci-jobs.yml index 4c3d72fb5..1474803e9 100644 --- a/jjb/dovetail/dovetail-ci-jobs.yml +++ b/jjb/dovetail/dovetail-ci-jobs.yml @@ -167,6 +167,11 @@ SUT: apex auto-trigger-name: 'daily-trigger-disabled' <<: *danube + - huawei-pod7: + slave-label: huawei-pod7 + SUT: compass + auto-trigger-name: 'daily-trigger-disabled' + <<: *danube #-------------------------------- testsuite: - 'compliance_set' diff --git a/jjb/dovetail/dovetail-run.sh b/jjb/dovetail/dovetail-run.sh index 9c4e205ae..1b09cca08 100755 --- a/jjb/dovetail/dovetail-run.sh +++ b/jjb/dovetail/dovetail-run.sh @@ -186,14 +186,6 @@ cat << EOF >$tempest_conf_file compute: min_compute_nodes: 2 volume_device_name: ${volume_device} - min_microversion: 2.2 - max_microversion: latest - -compute-feature-enabled: - live_migration: True - block_migration_for_live_migration: True - block_migrate_cinder_iscsi: True - attach_encrypted_volume: True EOF diff --git a/jjb/fuel/fuel-deploy.sh b/jjb/fuel/fuel-deploy.sh index d44c060ac..be4560493 100755 --- a/jjb/fuel/fuel-deploy.sh +++ b/jjb/fuel/fuel-deploy.sh @@ -103,7 +103,7 @@ echo "--------------------------------------------------------" echo "Scenario: ${DEPLOY_SCENARIO}" echo "Lab: ${LAB_NAME}" echo "POD: ${POD_NAME}" -[[ "${BRANCH}" != 'master' ]] && echo "ISO: ${OPNFV_ARTIFACT_URL/*\/}" +[[ "${BRANCH}" =~ 'danube' ]] && echo "ISO: ${OPNFV_ARTIFACT_URL/*\/}" echo echo "Starting the deployment using ${INSTALLER_TYPE}. This could take some time..." echo "--------------------------------------------------------" diff --git a/jjb/functest/functest-alpine.sh b/jjb/functest/functest-alpine.sh index c9484304f..ffd86f876 100755 --- a/jjb/functest/functest-alpine.sh +++ b/jjb/functest/functest-alpine.sh @@ -4,6 +4,68 @@ set -e set +u set +o pipefail +run_tiers() { + tiers=$1 + cmd_opt="prepare_env start && run_tests -r -t all" + [[ $BUILD_TAG =~ "suite" ]] && cmd_opt="prepare_env start && run_tests -t all" + ret_val_file="${HOME}/opnfv/functest/results/${BRANCH##*/}/return_value" + echo 0 > ${ret_val_file} + + 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 --privileged=true ${envs} ${volumes} ${FUNCTEST_IMAGE} /bin/bash -c '${cmd_opt}'" + echo "Running Functest tier '${tier}'. CMD: ${cmd}" + eval ${cmd} + ret_value=$? + if [ ${ret_value} != 0 ]; then + echo ${ret_value} > ${ret_val_file} + if [ ${tier} == 'healthcheck' ]; then + echo "Healthcheck tier failed. Exiting Functest..." + exit 1 + fi + fi + done +} + +run_test() { + test_name=$1 + cmd_opt="prepare_env start && run_tests -r -t ${test_name}" + [[ $BUILD_TAG =~ "suite" ]] && cmd_opt="prepare_env start && run_tests -t ${test_name}" + ret_val_file="${HOME}/opnfv/functest/results/${BRANCH##*/}/return_value" + echo 0 > ${ret_val_file} + # Determine which Functest image should be used for the test case + case ${test_name} in + connection_check|api_check|snaps_health_check) + FUNCTEST_IMAGE=opnfv/functest-healthcheck ;; + vping_ssh|vping_userdata|tempest_smoke_serial|rally_sanity|refstack_defcore|odl|odl_netvirt|fds|snaps_smoke) + FUNCTEST_IMAGE=opnfv/functest-smoke ;; + tempest_full_parallel|tempest_custom|rally_full) + FUNCTEST_IMAGE=opnfv/functest-components ;; + cloudify_ims|orchestra_openims|orchestra_clearwaterims|vyos_vrouter) + FUNCTEST_IMAGE=opnfv/functest-vnf ;; + promise|doctor-notification|bgpvpn|functest-odl-sfc|domino-multinode|barometercollectd) + FUNCTEST_IMAGE=opnfv/functest-features ;; + parser-basics) + FUNCTEST_IMAGE=opnfv/functest-parser ;; + *) + echo "Unkown test case $test_name" + exit 1 + ;; + esac + echo "Functest: Pulling Functest Docker image ${FUNCTEST_IMAGE} ..." + docker pull ${FUNCTEST_IMAGE}>/dev/null + cmd="docker run --privileged=true ${envs} ${volumes} ${FUNCTEST_IMAGE} /bin/bash -c '${cmd_opt}'" + echo "Running Functest test case '${test_name}'. CMD: ${cmd}" + eval ${cmd} + ret_value=$? + if [ ${ret_value} != 0 ]; then + echo ${ret_value} > ${ret_val_file} + fi +} + + [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null" FUNCTEST_DIR=/home/opnfv/functest DEPLOY_TYPE=baremetal @@ -15,7 +77,7 @@ rc_file=${HOME}/opnfv-openrc.sh if [[ ${INSTALLER_TYPE} == 'joid' ]]; then rc_file=$LAB_CONFIG/admin-openrc -elif [[ ${INSTALLER_TYPE} == 'compass' && ${BRANCH} == 'master' ]]; then +elif [[ ${INSTALLER_TYPE} == 'compass' ]]; 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 elif [[ ${INSTALLER_TYPE} == 'fuel' && ${DEPLOY_TYPE} == 'baremetal' ]]; then @@ -56,16 +118,8 @@ envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} \ ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -if [[ ${INSTALLER_TYPE} == 'compass' && ${DEPLOY_SCENARIO} == *'os-nosdn-openo-ha'* ]]; then - 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 - -if [ "${INSTALLER_TYPE}" == 'fuel' ] && [ "$BRANCH" != 'stable/danube' ]; then +if [ "${INSTALLER_TYPE}" == 'fuel' ]; 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}" @@ -75,29 +129,23 @@ volumes="${images_vol} ${results_vol} ${sshkey_vol} ${rc_file_vol} ${cacert_file set +e -if [ ${FUNCTEST_SUITE_NAME} == 'healthcheck' ]; then - tiers=(healthcheck) -else - if [ ${DEPLOY_TYPE} == 'baremetal' ]; then - tiers=(healthcheck smoke features vnf parser) + +if [[ ${DEPLOY_SCENARIO} =~ ^os-.* ]]; then + if [ ${FUNCTEST_MODE} == 'testcase' ]; then + echo "FUNCTEST_MODE=testcase, FUNCTEST_SUITE_NAME=${FUNCTEST_SUITE_NAME}" + run_test ${FUNCTEST_SUITE_NAME} + elif [ ${FUNCTEST_MODE} == 'tier' ]; then + echo "FUNCTEST_MODE=tier, FUNCTEST_TIER=${FUNCTEST_TIER}" + tiers=(${FUNCTEST_TIER}) + run_tiers ${tiers} else - tiers=(healthcheck smoke features) + if [ ${DEPLOY_TYPE} == 'baremetal' ]; then + tiers=(healthcheck smoke features vnf parser) + else + tiers=(healthcheck smoke features) + fi + run_tiers ${tiers} fi +else + echo "k8 deployment has not been supported by functest yet" fi - -cmd_opt='prepare_env start && run_tests -r -t all' -ret_val_file="${HOME}/opnfv/functest/results/${BRANCH##*/}/return_value" -echo 0 > ${ret_val_file} - -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 --privileged=true ${envs} ${volumes} ${FUNCTEST_IMAGE} /bin/bash -c '${cmd_opt}'" - echo "Running Functest tier '${tier}'. CMD: ${cmd}" - eval ${cmd} - ret_value=$? - if [ ${ret_value} != 0 ]; then - echo ${ret_value} > ${ret_val_file} - fi -done diff --git a/jjb/functest/functest-daily-jobs.yml b/jjb/functest/functest-daily-jobs.yml index ea39de44b..04a293618 100644 --- a/jjb/functest/functest-daily-jobs.yml +++ b/jjb/functest/functest-daily-jobs.yml @@ -122,6 +122,14 @@ slave-label: daisy-virtual installer: daisy <<: *master + - baremetal: + slave-label: daisy-baremetal + installer: daisy + <<: *euphrates + - virtual: + slave-label: daisy-virtual + installer: daisy + <<: *euphrates # netvirt 3rd party ci - virtual: slave-label: odl-netvirt-virtual @@ -160,15 +168,19 @@ <<: *euphrates - zte-pod2: slave-label: '{pod}' - installer: fuel + installer: daisy <<: *master + - zte-pod2: + slave-label: '{pod}' + installer: daisy + <<: *euphrates - zte-pod3: slave-label: '{pod}' - installer: fuel + installer: daisy <<: *master - zte-pod3: slave-label: '{pod}' - installer: fuel + installer: daisy <<: *euphrates # PODs for verify jobs triggered by each patch upload # - ool-virtual1: @@ -216,7 +228,7 @@ wrappers: - build-name: - name: '$BUILD_NUMBER Suite: $FUNCTEST_SUITE_NAME Scenario: $DEPLOY_SCENARIO' + name: '$BUILD_NUMBER Suite: $FUNCTEST_MODE Scenario: $DEPLOY_SCENARIO' - timeout: timeout: '{job-timeout}' abort: true @@ -297,20 +309,27 @@ name: functest-daily-parameter parameters: - string: - name: FUNCTEST_SUITE_NAME + name: FUNCTEST_MODE default: 'daily' description: "Daily suite name to run" - parameter: name: functest-arm-daily-parameter parameters: - string: - name: FUNCTEST_SUITE_NAME + name: FUNCTEST_MODE default: 'arm-daily' description: "Daily suite name (Aarch64) to run" - parameter: name: functest-suite-parameter parameters: - choice: + name: FUNCTEST_MODE + choices: + - 'tier' + - 'testcase' + default: 'tier' + description: "Test case or Tier to be run" + - choice: name: FUNCTEST_SUITE_NAME choices: - 'connection_check' @@ -322,7 +341,6 @@ - 'rally_sanity' - 'odl' - 'odl_netvirt' - - 'onos' - 'snaps_smoke' - 'refstack_defcore' - 'promise' @@ -336,6 +354,16 @@ - 'cloudify_vrouter' - 'orchestra_openims' - 'orchestra_clearwaterims' + default: 'connection_check' + - choice: + name: FUNCTEST_TIER + choices: + - 'healthcheck' + - 'smoke' + - 'features' + - 'components' + - 'vnf' + default: 'healthcheck' - string: name: TESTCASE_OPTIONS default: '' @@ -395,7 +423,7 @@ name: functest-suite-builder builders: - 'functest-cleanup' - - 'set-functest-env' + - 'set-functest-env-alpine' - 'functest-suite' - 'functest-store-results' - 'functest-exit' @@ -407,6 +435,7 @@ - 'set-functest-env-alpine' - 'functest-daily' - 'functest-store-results' + - 'functest-exit' - builder: name: functest-daily @@ -427,7 +456,8 @@ name: functest-suite builders: - shell: - !include-raw: ./functest-suite.sh + !include-raw: + - ./functest-alpine.sh - builder: name: set-functest-env diff --git a/jjb/joid/joid-daily-jobs.yml b/jjb/joid/joid-daily-jobs.yml index ac04962e0..b28efc3b3 100644 --- a/jjb/joid/joid-daily-jobs.yml +++ b/jjb/joid/joid-daily-jobs.yml @@ -13,11 +13,11 @@ # ------------------------------- # BRANCH ANCHORS # ------------------------------- - master: &master - stream: master - branch: '{stream}' - disabled: false - gs-pathname: '' + euphrates: &euphrates + stream: euphrates + branch: 'stable/{stream}' + disabled: false + gs-pathname: '/{stream}' # ------------------------------- # POD, INSTALLER, AND BRANCH MAPPING # ------------------------------- @@ -26,19 +26,8 @@ pod: - baremetal: slave-label: joid-baremetal - <<: *master - - virtual: - slave-label: joid-virtual - <<: *master - # ------------------------------- - # None-CI PODs - # ------------------------------- - - orange-pod1: - slave-label: orange-pod1 - <<: *master - - cengn-pod1: - slave-label: cengn-pod1 - <<: *master + <<: *euphrates + # ------------------------------- # scenarios # ------------------------------- @@ -53,18 +42,12 @@ auto-trigger-name: 'joid-{scenario}-{pod}-{stream}-trigger' - 'os-odl_l2-nofeature-ha': auto-trigger-name: 'daily-trigger-disabled' - - 'os-onos-nofeature-ha': - auto-trigger-name: 'daily-trigger-disabled' - 'os-odl_l2-nofeature-noha': auto-trigger-name: 'daily-trigger-disabled' - - 'os-onos-nofeature-noha': - auto-trigger-name: 'daily-trigger-disabled' - - 'os-onos-sfc-ha': - auto-trigger-name: 'daily-trigger-disabled' - 'os-ocl-nofeature-ha': - auto-trigger-name: 'daily-trigger-disabled' + auto-trigger-name: 'joid-{scenario}-{pod}-{stream}-trigger' - 'os-ocl-nofeature-noha': - auto-trigger-name: 'daily-trigger-disabled' + auto-trigger-name: 'joid-{scenario}-{pod}-{stream}-trigger' - 'k8-nosdn-nofeature-noha': auto-trigger-name: 'daily-trigger-disabled' - 'k8-nosdn-lb-noha': @@ -151,7 +134,7 @@ build-step-failure-threshold: 'never' failure-threshold: 'never' unstable-threshold: 'FAILURE' -# 1.dovetail only master by now, not sync with A/B/C branches +# 1.dovetail only euphrates by now, not sync with A/B/C branches # 2.here the stream means the SUT stream, dovetail stream is defined in # its own job # 3.only debug testsuite here(includes basic testcase, @@ -234,191 +217,58 @@ ######################## # trigger macros ######################## -# os-nosdn-nofeature-ha trigger - branch: master +# os-nosdn-nofeature-ha trigger - branch: euphrates - trigger: - name: 'joid-os-nosdn-nofeature-ha-baremetal-master-trigger' + name: 'joid-os-nosdn-nofeature-ha-baremetal-euphrates-trigger' triggers: - timed: '5 2 * * *' +# os-odl_l2-nofeature-ha trigger - branch: euphrates - trigger: - name: 'joid-os-nosdn-nofeature-ha-virtual-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-os-nosdn-nofeature-ha-orange-pod1-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-os-nosdn-nofeature-ha-cengn-pod1-master-trigger' - triggers: - - timed: '' -# os-odl_l2-nofeature-ha trigger - branch: master -- trigger: - name: 'joid-os-odl_l2-nofeature-ha-baremetal-master-trigger' + name: 'joid-os-odl_l2-nofeature-ha-baremetal-euphrates-trigger' triggers: - timed: '5 7 * * *' +# os-nosdn-lxd-noha trigger - branch: euphrates - trigger: - name: 'joid-os-odl_l2-nofeature-ha-virtual-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-os-odl_l2-nofeature-ha-orange-pod1-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-os-odl_l2-nofeature-ha-cengn-pod1-master-trigger' - triggers: - - timed: '' -# os-onos-nofeature-ha trigger - branch: master -- trigger: - name: 'joid-os-onos-nofeature-ha-baremetal-master-trigger' - triggers: - - timed: '5 12 * * *' -- trigger: - name: 'joid-os-onos-nofeature-ha-virtual-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-os-onos-nofeature-ha-orange-pod1-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-os-onos-nofeature-ha-cengn-pod1-master-trigger' - triggers: - - timed: '' -# os-onos-sfc-ha trigger - branch: master -- trigger: - name: 'joid-os-onos-sfc-ha-baremetal-master-trigger' - triggers: - - timed: '5 17 * * *' -- trigger: - name: 'joid-os-onos-sfc-ha-virtual-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-os-onos-sfc-ha-orange-pod1-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-os-onos-sfc-ha-cengn-pod1-master-trigger' - triggers: - - timed: '' -# os-nosdn-lxd-noha trigger - branch: master -- trigger: - name: 'joid-os-nosdn-lxd-noha-baremetal-master-trigger' + name: 'joid-os-nosdn-lxd-noha-baremetal-euphrates-trigger' triggers: - timed: '5 22 * * *' +# os-nosdn-lxd-ha trigger - branch: euphrates - trigger: - name: 'joid-os-nosdn-lxd-noha-virtual-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-os-nosdn-lxd-noha-orange-pod1-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-os-nosdn-lxd-noha-cengn-pod1-master-trigger' - triggers: - - timed: '' -# os-nosdn-lxd-ha trigger - branch: master -- trigger: - name: 'joid-os-nosdn-lxd-ha-baremetal-master-trigger' + name: 'joid-os-nosdn-lxd-ha-baremetal-euphrates-trigger' triggers: - timed: '5 10 * * *' +# os-nosdn-nofeature-noha trigger - branch: euphrates - trigger: - name: 'joid-os-nosdn-lxd-ha-virtual-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-os-nosdn-lxd-ha-orange-pod1-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-os-nosdn-lxd-ha-cengn-pod1-master-trigger' - triggers: - - timed: '' -# os-nosdn-nofeature-noha trigger - branch: master -- trigger: - name: 'joid-os-nosdn-nofeature-noha-baremetal-master-trigger' + name: 'joid-os-nosdn-nofeature-noha-baremetal-euphrates-trigger' triggers: - timed: '5 4 * * *' +# k8-nosdn-nofeature-noha trigger - branch: euphrates - trigger: - name: 'joid-os-nosdn-nofeature-noha-virtual-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-os-nosdn-nofeature-noha-orange-pod1-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-os-nosdn-nofeature-noha-cengn-pod1-master-trigger' - triggers: - - timed: '' -# k8-nosdn-nofeature-noha trigger - branch: master -- trigger: - name: 'joid-k8-nosdn-nofeature-noha-baremetal-master-trigger' + name: 'joid-k8-nosdn-nofeature-noha-baremetal-euphrates-trigger' triggers: - timed: '5 15 * * *' +# k8-nosdn-lb-noha trigger - branch: euphrates - trigger: - name: 'joid-k8-nosdn-nofeature-noha-virtual-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-k8-nosdn-nofeature-noha-orange-pod1-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-k8-nosdn-nofeature-noha-cengn-pod1-master-trigger' - triggers: - - timed: '' -# k8-nosdn-lb-noha trigger - branch: master -- trigger: - name: 'joid-k8-nosdn-lb-noha-baremetal-master-trigger' + name: 'joid-k8-nosdn-lb-noha-baremetal-euphrates-trigger' triggers: - timed: '5 20 * * *' +# k8-ovn-lb-noha trigger - branch: euphrates - trigger: - name: 'joid-k8-nosdn-lb-noha-virtual-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-k8-nosdn-lb-noha-orange-pod1-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-k8-nosdn-lb-noha-cengn-pod1-master-trigger' - triggers: - - timed: '' -# k8-ovn-lb-noha trigger - branch: master -- trigger: - name: 'joid-k8-ovn-lb-noha-baremetal-master-trigger' + name: 'joid-k8-ovn-lb-noha-baremetal-euphrates-trigger' triggers: - timed: '5 17 * * *' +# os-nosdn-openbaton-ha trigger - branch: euphrates - trigger: - name: 'joid-k8-ovn-lb-noha-virtual-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-k8-ovn-lb-noha-orange-pod1-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-k8-ovn-lb-noha-cengn-pod1-master-trigger' - triggers: - - timed: '' - -# os-nosdn-openbaton-ha trigger - branch: master -- trigger: - name: 'joid-os-nosdn-openbaton-ha-baremetal-master-trigger' + name: 'joid-os-nosdn-openbaton-ha-baremetal-euphrates-trigger' triggers: - timed: '5 25 * * *' +# os-ocl-nofeature-ha trigger - branch: euphrates - trigger: - name: 'joid-os-nosdn-openbaton-ha-virtual-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'joid-os-nosdn-openbaton-ha-orange-pod1-master-trigger' + name: 'joid-os-ocl-nofeature-ha-baremetal-euphrates-trigger' triggers: - - timed: '' + - timed: '5 13 * * *' +# os-ocl-nofeature-ha trigger - branch: euphrates - trigger: - name: 'joid-os-nosdn-openbaton-ha-cengn-pod1-master-trigger' + name: 'joid-os-ocl-nofeature-noha-baremetal-euphrates-trigger' triggers: - - timed: '' + - timed: '5 17 * * *' diff --git a/jjb/kvmfornfv/kvmfornfv.yml b/jjb/kvmfornfv/kvmfornfv.yml index ad497e97d..2055da969 100644 --- a/jjb/kvmfornfv/kvmfornfv.yml +++ b/jjb/kvmfornfv/kvmfornfv.yml @@ -8,19 +8,19 @@ - master: branch: '{stream}' gs-pathname: '' - disabled: false - euphrates: branch: 'stable/{stream}' gs-pathname: '/{stream}' - disabled: true ##################################### # patch verification phases ##################################### phase: - 'build': slave-label: 'opnfv-build-ubuntu' + disabled: false - 'test': slave-label: 'intel-pod10' + disabled: true ##################################### # patch verification phases ##################################### diff --git a/jjb/opera/opera-daily-jobs.yml b/jjb/opera/opera-daily-jobs.yml index d0dd0525a..5d7526bba 100644 --- a/jjb/opera/opera-daily-jobs.yml +++ b/jjb/opera/opera-daily-jobs.yml @@ -92,6 +92,7 @@ current-parameters: false predefined-parameters: | DEPLOY_SCENARIO=os-nosdn-openo-ha + FUNCTEST_MODE=testcase FUNCTEST_SUITE_NAME=opera_vims node-parameters: true kill-phase-on: NEVER diff --git a/jjb/orchestra/orchestra-daily-jobs.yml b/jjb/orchestra/orchestra-daily-jobs.yml index 74c997cad..7c2deaec4 100644 --- a/jjb/orchestra/orchestra-daily-jobs.yml +++ b/jjb/orchestra/orchestra-daily-jobs.yml @@ -93,6 +93,7 @@ current-parameters: false predefined-parameters: | DEPLOY_SCENARIO=os-nosdn-openbaton-ha + FUNCTEST_MODE=testcase FUNCTEST_SUITE_NAME=orchestra_ims node-parameters: true kill-phase-on: NEVER diff --git a/jjb/ovn4nfv/ovn4nfv-daily-jobs.yml b/jjb/ovn4nfv/ovn4nfv-daily-jobs.yml index a4c5865c0..ca4cfeede 100644 --- a/jjb/ovn4nfv/ovn4nfv-daily-jobs.yml +++ b/jjb/ovn4nfv/ovn4nfv-daily-jobs.yml @@ -81,6 +81,7 @@ current-parameters: false predefined-parameters: | DEPLOY_SCENARIO=os-ovn-nofeature-ha + FUNCTEST_MODE=testcase FUNCTEST_SUITE_NAME=ovn4nfv_test_suite node-parameters: true kill-phase-on: NEVER diff --git a/jjb/qtip/qtip-verify-jobs.yml b/jjb/qtip/qtip-verify-jobs.yml index a91972823..047d7f2be 100644 --- a/jjb/qtip/qtip-verify-jobs.yml +++ b/jjb/qtip/qtip-verify-jobs.yml @@ -8,8 +8,8 @@ project: qtip jobs: - 'qtip-verify-{stream}' - - 'qtip-review-notebook-{stream}' - - 'qtip-merge-{stream}' + - 'qtip-verify-notebook-{stream}' + - 'qtip-merged-notebook-{stream}' stream: - master: branch: '{stream}' @@ -69,7 +69,7 @@ # upload juypter notebook to artifacts for review - job-template: - name: 'qtip-review-notebook-{stream}' + name: 'qtip-verify-notebook-{stream}' disabled: '{obj:disabled}' @@ -104,14 +104,14 @@ disable-strict-forbidden-file-verification: 'true' file-paths: - compare-type: ANT - pattern: 'examples/**' + pattern: '**/*.ipynb' builders: - upload-under-review-notebooks-to-opnfv-artifacts - report-build-result-to-gerrit - job-template: - name: 'qtip-merge-{stream}' + name: 'qtip-merged-notebook-{stream}' disabled: '{obj:disabled}' @@ -146,7 +146,7 @@ branch-pattern: '**/{branch}' file-paths: - compare-type: ANT - pattern: examples/** + pattern: '**/*ipynb' builders: - remove-old-docs-from-opnfv-artifacts @@ -178,7 +178,6 @@ export PATH=$PATH:/usr/local/bin/ [[ $GERRIT_CHANGE_NUMBER =~ .+ ]] - [[ -d examples ]] || exit 0 echo echo "###########################" @@ -190,8 +189,9 @@ gs_path="$gs_base/$GERRIT_CHANGE_NUMBER" local_path="upload/$GERRIT_CHANGE_NUMBER" - mkdir -p upload - cp -r examples "$local_path" + mkdir -p $local_path + + git diff HEAD~1 --name-only | grep -E ".+\.ipynb$" | xargs -I '{}' cp '{}' $local_path gsutil -m cp -r "$local_path" "gs://$gs_base/" echo "Document link(s):" >> gerrit_comment.txt diff --git a/jjb/releng/opnfv-docker-arm.yml b/jjb/releng/opnfv-docker-arm.yml index acf123142..7f2574ec4 100644 --- a/jjb/releng/opnfv-docker-arm.yml +++ b/jjb/releng/opnfv-docker-arm.yml @@ -10,10 +10,6 @@ stream: master branch: '{stream}' disabled: false - danube: &danube - stream: danube - branch: 'stable/{stream}' - disabled: false euphrates: &euphrates stream: euphrates branch: 'stable/{stream}' @@ -22,6 +18,7 @@ receivers: > cristina.pauna@enea.com alexandru.avadanii@enea.com + delia.popescu@enea.com dovetail-arm-receivers: &dovetail-arm-receivers receivers: > cristina.pauna@enea.com @@ -38,6 +35,7 @@ alexandru.avadanii@enea.com alexandru.nemes@enea.com catalina.focsa@enea.com + delia.popescu@enea.com other-receivers: &other-receivers receivers: '' @@ -101,6 +99,14 @@ <<: *master <<: *yardstick-arm-receivers # projects with jobs for stable/euphrates + - 'functest': + project: 'functest' + <<: *euphrates + <<: *functest-arm-receivers + - 'dovetail': + project: 'dovetail' + <<: *euphrates + <<: *dovetail-arm-receivers - 'storperf-master': project: 'storperf' dockerdir: 'docker/storperf-master' @@ -141,6 +147,10 @@ arch_tag: 'aarch64' <<: *euphrates <<: *storperf-arm-receivers + - 'yardstick': + project: 'yardstick' + <<: *euphrates + <<: *yardstick-arm-receivers jobs: - '{dockerrepo}-docker-build-arm-push-{stream}' @@ -183,6 +193,11 @@ default: "{arch_tag}" description: "If set, this value will be added to the docker image tag" + properties: + - throttle: + max-per-node: 1 + option: 'project' + scm: - git-scm diff --git a/jjb/releng/opnfv-docker.sh b/jjb/releng/opnfv-docker.sh index b03505e81..954d7c8ab 100644 --- a/jjb/releng/opnfv-docker.sh +++ b/jjb/releng/opnfv-docker.sh @@ -17,17 +17,6 @@ echo "Starting opnfv-docker for $DOCKER_REPO_NAME ..." echo "--------------------------------------------------------" echo -count=30 # docker build jobs might take up to ~30 min -while [[ -n `ps -ef|grep 'docker build'|grep -v grep` ]]; do - echo "Build in progress. Waiting..." - sleep 60 - count=$(( $count - 1 )) - if [ $count -eq 0 ]; then - echo "Timeout. Aborting..." - exit 1 - fi -done - # Remove previous running containers if exist if [[ -n "$(docker ps -a | grep $DOCKER_REPO_NAME)" ]]; then echo "Removing existing $DOCKER_REPO_NAME containers..." diff --git a/jjb/releng/opnfv-docker.yml b/jjb/releng/opnfv-docker.yml index 2b8fd2726..01736c2c0 100644 --- a/jjb/releng/opnfv-docker.yml +++ b/jjb/releng/opnfv-docker.yml @@ -101,19 +101,19 @@ <<: *master <<: *other-receivers # projects with jobs for Danube - - 'bottlenecks': - project: 'bottlenecks' - <<: *danube - <<: *other-receivers - 'qtip': project: 'qtip' <<: *euphrates <<: *other-receivers - 'yardstick': project: 'yardstick' - <<: *danube + <<: *euphrates <<: *other-receivers # projects with jobs for euphrates + - 'bottlenecks': + project: 'bottlenecks' + <<: *euphrates + <<: *other-receivers - 'functest': project: 'functest' <<: *euphrates @@ -188,6 +188,10 @@ arch_tag: 'x86_64' <<: *euphrates <<: *storperf-receivers + - 'nfvbench': + project: 'nfvbench' + <<: *euphrates + <<: *other-receivers jobs: - "{dockerrepo}-docker-build-push-{stream}" @@ -255,6 +259,11 @@ default: "{arch_tag}" description: "If set, this value will be added to the docker image tag as a prefix" + properties: + - throttle: + max-per-node: 1 + option: 'project' + scm: - git-scm diff --git a/jjb/releng/verify-releng.sh b/jjb/releng/verify-releng.sh index 682a8beda..a6eaa0f50 100755 --- a/jjb/releng/verify-releng.sh +++ b/jjb/releng/verify-releng.sh @@ -8,7 +8,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## #test for non-ascii characters, these can pass the test and end up breaking things in production -for x in $(find . -name *\.yml -or -name *\.yaml); do +for x in $(find . -name *\.yml -or -name *\.yaml -or -name *\.sh); do if LC_ALL=C grep -q '[^[:print:][:space:]]' "$x"; then echo "file "$x" contains non-ascii characters" diff --git a/jjb/securedlab/check-jinja2.sh b/jjb/securedlab/check-jinja2.sh deleted file mode 100755 index 4c1927d77..000000000 --- a/jjb/securedlab/check-jinja2.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set +x -set -o errexit -for lab_configs in $(find labs/ -name 'pod*.yaml'); do - while IFS= read -r jinja_templates; do - echo "./utils/generate_config.py -y $lab_configs -j $jinja_templates" - ./utils/generate_config.py -y $lab_configs -j $jinja_templates - done < <(find installers/ -name '*.j2') -done diff --git a/jjb/securedlab/check-jinja2.yml b/jjb/securedlab/check-jinja2.yml index 430ced560..155be175d 100644 --- a/jjb/securedlab/check-jinja2.yml +++ b/jjb/securedlab/check-jinja2.yml @@ -1,5 +1,6 @@ +--- ######################## -# Job configuration to validate jninja2 files +# Job configuration to validate jinja2 files ######################## - project: @@ -8,15 +9,15 @@ project: 'securedlab' jobs: - - 'validate-jinja2-templates-{stream}' + - 'validate-jinja2-templates-{stream}' stream: - - master: - branch: '{stream}' - disabled: false - - danube: - branch: 'stable/{stream}' - disabled: false + - master: + branch: '{stream}' + disabled: false + - euphrates: + branch: 'stable/{stream}' + disabled: false ######################## # job templates @@ -30,57 +31,55 @@ concurrent: true parameters: - - project-parameter: - project: $GERRIT_PROJECT - branch: '{branch}' - - node: - name: SLAVE_NAME - description: Slave to execute jnija template test - default-slaves: - - lf-build1 - allowed-multiselect: true - ignore-offline-nodes: true + - project-parameter: + project: $GERRIT_PROJECT + branch: '{branch}' + - node: + name: SLAVE_NAME + description: Slave to execute jnija template test + default-slaves: + - lf-build1 + allowed-multiselect: true + ignore-offline-nodes: true scm: - - git-scm-gerrit + - git-scm-gerrit triggers: - - gerrit: - server-name: 'gerrit.opnfv.org' - trigger-on: - - patchset-created-event: - exclude-drafts: 'false' - exclude-trivial-rebase: 'false' - exclude-no-code-change: 'false' - - draft-published-event - - comment-added-contains-event: - comment-contains-value: 'recheck' - - comment-added-contains-event: - comment-contains-value: 'reverify' - projects: - - project-compare-type: 'REG_EXP' - project-pattern: '{project}' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - file-paths: - - compare-type: ANT - pattern: 'utils/generate_config.yml' - - compare-type: ANT - pattern: '**/*.jinja2' - - compare-type: ANT - pattern: '**/*.yaml' - skip-vote: - successful: true - failed: true - unstable: true - notbuilt: true + - gerrit: + server-name: 'gerrit.opnfv.org' + trigger-on: + - patchset-created-event: + exclude-drafts: 'false' + exclude-trivial-rebase: 'false' + exclude-no-code-change: 'false' + - draft-published-event + - comment-added-contains-event: + comment-contains-value: 'recheck' + - comment-added-contains-event: + comment-contains-value: 'reverify' + projects: + - project-compare-type: 'REG_EXP' + project-pattern: '{project}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + file-paths: + - compare-type: ANT + pattern: '**/*.yaml' + - compare-type: ANT + pattern: 'check-jinja2.sh' + skip-vote: + successful: true + failed: true + unstable: true + notbuilt: true builders: - - check-jinja + - check-jinja - builder: name: check-jinja builders: - - shell: - !include-raw-escape: ./check-jinja2.sh + - shell: | + $WORKSPACE/check-jinja2.sh diff --git a/jjb/xci/osa-periodic-jobs.yml b/jjb/xci/osa-periodic-jobs.yml index 86910ac4f..048825e74 100644 --- a/jjb/xci/osa-periodic-jobs.yml +++ b/jjb/xci/osa-periodic-jobs.yml @@ -106,7 +106,8 @@ predefined-parameters: | DISTRO={distro} DEPLOY_SCENARIO=os-nosdn-nofeature-noha - FUNCTEST_SUITE_NAME=healthcheck + FUNCTEST_MODE=tier + FUNCTEST_TIER=healthcheck node-parameters: true kill-phase-on: NEVER abort-all-job: false @@ -159,6 +160,9 @@ name: OPNFV_RELENG_DEV_PATH default: $WORKSPACE/releng-xci - string: + name: FUNCTEST_MODE + default: 'tier' + - string: name: FUNCTEST_SUITE_NAME default: 'healthcheck' - string: diff --git a/jjb/xci/xci-daily-jobs.yml b/jjb/xci/xci-daily-jobs.yml index 64659da40..7d95429da 100644 --- a/jjb/xci/xci-daily-jobs.yml +++ b/jjb/xci/xci-daily-jobs.yml @@ -215,6 +215,9 @@ name: INSTALLER_TYPE default: 'osa' - string: + name: FUNCTEST_MODE + default: 'daily' + - string: name: FUNCTEST_SUITE_NAME default: 'daily' description: "Daily suite name to run" diff --git a/jjb/xci/xci-verify-jobs.yml b/jjb/xci/xci-verify-jobs.yml index 324bfd14c..35dee62e2 100644 --- a/jjb/xci/xci-verify-jobs.yml +++ b/jjb/xci/xci-verify-jobs.yml @@ -12,12 +12,24 @@ # distros #-------------------------------- distro: - - 'xenial': + - ubuntu: disabled: false - - 'centos7': - disabled: true - - 'suse': - disabled: true + successful: false + failed: false + unstable: false + notbuilt: false + - centos: + disabled: false + successful: true + failed: true + unstable: true + notbuilt: true + - opensuse: + disabled: false + successful: true + failed: true + unstable: true + notbuilt: true #-------------------------------- # type #-------------------------------- @@ -34,7 +46,7 @@ #-------------------------------- jobs: - 'xci-verify-{distro}-{type}-{stream}' - - 'xci-verify-{phase}-{type}-{stream}' + - 'xci-verify-{distro}-{phase}-{type}-{stream}' #-------------------------------- # job templates #-------------------------------- @@ -52,12 +64,18 @@ - build-blocker: use-build-blocker: true blocking-jobs: - - 'xci-verify-.*' - - 'bifrost-verify-.*' - - 'bifrost-periodic-.*' - - 'osa-verify-.*' - - 'osa-periodic-.*' + - 'xci-verify-{distro}-.*' + - 'bifrost-verify-{distro}-.*' + - 'bifrost-periodic-{distro}-.*' + - 'osa-verify-{distro}-.*' + - 'osa-periodic-{distro}-.*' block-level: 'NODE' + - throttle: + max-per-node: 2 + max-total: 10 + categories: + - xci-verify-virtual + option: category wrappers: - ssh-agent-wrapper @@ -103,6 +121,11 @@ - compare-type: ANT pattern: 'docs/**' readable-message: true + skip-vote: + successful: '{obj:successful}' + failed: '{obj:failed}' + unstable: '{obj:unstable}' + notbuilt: '{obj:notbuilt}' parameters: - project-parameter: @@ -110,7 +133,7 @@ branch: '{branch}' - label: name: SLAVE_LABEL - default: 'xci-virtual-{distro}' + default: 'xci-virtual' - string: name: CLEAN_DIB_IMAGES default: 'true' @@ -126,12 +149,16 @@ name: deploy condition: SUCCESSFUL projects: - - name: 'xci-verify-deploy-{type}-{stream}' + - name: 'xci-verify-{distro}-deploy-{type}-{stream}' current-parameters: true predefined-parameters: | DISTRO={distro} DEPLOY_SCENARIO=os-nosdn-nofeature-noha CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES + GERRIT_BRANCH=$GERRIT_BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE node-parameters: true kill-phase-on: FAILURE abort-all-job: true @@ -139,19 +166,24 @@ name: healthcheck condition: SUCCESSFUL projects: - - name: 'xci-verify-healthcheck-{type}-{stream}' + - name: 'xci-verify-{distro}-healthcheck-{type}-{stream}' current-parameters: true predefined-parameters: | DISTRO={distro} DEPLOY_SCENARIO=os-nosdn-nofeature-noha CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES - FUNCTEST_SUITE_NAME=healthcheck + FUNCTEST_MODE=tier + FUNCTEST_TIER=healthcheck + GERRIT_BRANCH=$GERRIT_BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE node-parameters: true kill-phase-on: NEVER abort-all-job: true - job-template: - name: 'xci-verify-{phase}-{type}-{stream}' + name: 'xci-verify-{distro}-{phase}-{type}-{stream}' disabled: false @@ -162,8 +194,6 @@ - build-blocker: use-build-blocker: true blocking-jobs: - - 'xci-verify-deploy-.*' - - 'xci-verify-healthcheck-.*' - 'bifrost-verify-.*' - 'bifrost-periodic-.*' - 'osa-verify-.*' @@ -172,12 +202,18 @@ parameters: - string: + name: PROJECT + default: 'releng-xci' + - string: name: DISTRO - default: 'xenial' + default: 'ubuntu' - string: name: DEPLOY_SCENARIO default: 'os-nosdn-nofeature-noha' - string: + name: FUNCTEST_MODE + default: 'tier' + - string: name: FUNCTEST_SUITE_NAME default: 'healthcheck' - string: @@ -226,12 +262,41 @@ exit 0 fi - # for some reason, the PATH is not set correctly - # setting PATH for ansible stuff - export PATH=/home/jenkins/.local/bin:$PATH + cd $WORKSPACE - cd $WORKSPACE/xci + # The start-new-vm.sh script will copy the entire releng-xci directory + # so lets prepare the test script now so it can be copied by the script. + # Please do not move it elsewhere or you would have to move it to the VM + # yourself. + cat > xci_test.sh<<EOF + #!/bin/bash + export DISTRO=$DISTRO + export DEPLOY_SCENARIO=$DEPLOY_SCENARIO + export FUNCTEST_MODE=$FUNCTEST_MODE + export FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME + export XCI_FLAVOR=$XCI_FLAVOR + export CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES + export OPNFV_RELENG_DEV_PATH=/home/devuser/releng-xci/ + export INSTALLER_TYPE=$INSTALLER_TYPE + export GIT_BASE=$GIT_BASE + export JENKINS_HOME=$JENKINS_HOME + + cd xci ./xci-deploy.sh + EOF + chmod a+x xci_test.sh + + ./xci/scripts/vm/start-new-vm.sh $DISTRO + - shell: | + #!/bin/bash + + # skip the deployment if the patch doesn't impact the deployment + if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then + echo "Skipping the deployment!" + exit 0 + fi + + ssh ${DISTRO}_xci_vm "cd releng-xci && ./xci_test.sh" - builder: @@ -247,6 +312,17 @@ fi echo "Hello World!" + - shell: | + #!/bin/bash + + # skip the deployment if the patch doesn't impact the deployment + if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then + echo "Skipping the deployment!" + exit 0 + fi + + sudo virsh destroy ${DISTRO}_xci_vm + sudo virsh undefine ${DISTRO}_xci_vm # this will be enabled once the xci is prepared #- builder: diff --git a/utils/test/testapi/tools/watchdog/docker_watch.sh b/utils/test/opts/watchdog.sh index f1d8946b6..51868d709 100644 --- a/utils/test/testapi/tools/watchdog/docker_watch.sh +++ b/utils/test/opts/watchdog.sh @@ -27,7 +27,7 @@ declare -A urls=( ["testapi"]="http://testresults.opnfv.org/test/" \ ### Functions related to checking. function is_deploying() { - xml=$(curl -m10 "https://build.opnfv.org/ci/job/${1}-automate-master/lastBuild/api/xml?depth=1") + xml=$(curl -m10 "https://build.opnfv.org/ci/job/${1}-automate-docker-deploy-master/lastBuild/api/xml?depth=1") building=$(grep -oPm1 "(?<=<building>)[^<]+" <<< "$xml") if [[ $building == "false" ]] then @@ -64,12 +64,11 @@ function check_modules() { failed_modules=() for module in "${modules[@]}" do - if is_deploying $module; then - continue - fi if ! check_connectivity $module "${urls[$module]}"; then - echo -e "$module failed" - failed_modules+=($module) + if ! is_deploying $module; then + echo -e "$module failed" + failed_modules+=($module) + fi fi done if [ ! -z "$failed_modules" ]; then @@ -114,13 +113,11 @@ function start_containers_fix() { function start_container_fix() { echo -e "Starting a container $module" - sudo docker stop $module - sudo docker start $module + sudo docker restart $module sleep 5 if ! check_connectivity $module "${urls[$module]}"; then echo -e "Starting an old container $module_old" - sudo docker stop $module - sudo docker start $module"_old" + sudo docker restart $module"_old" sleep 5 fi } diff --git a/utils/test/reporting/docker/Dockerfile b/utils/test/reporting/docker/Dockerfile index f2357909d..07440ad29 100644 --- a/utils/test/reporting/docker/Dockerfile +++ b/utils/test/reporting/docker/Dockerfile @@ -22,7 +22,7 @@ ARG BRANCH=master ENV HOME /home/opnfv ENV working_dir ${HOME}/releng/utils/test/reporting -ENV CONFIG_REPORTING_YAML ${working_dir}/reporting.yaml +ENV CONFIG_REPORTING_YAML ${working_dir}/reporting/reporting.yaml WORKDIR ${HOME} # Packaged dependencies diff --git a/utils/test/reporting/docker/nginx.conf b/utils/test/reporting/docker/nginx.conf index 95baf0e48..66bd7e497 100644 --- a/utils/test/reporting/docker/nginx.conf +++ b/utils/test/reporting/docker/nginx.conf @@ -15,7 +15,7 @@ server { } location /api/ { - http_pass http://backends/; + proxy_pass http://backends/; } location /display/ { diff --git a/utils/test/reporting/docker/reporting.sh b/utils/test/reporting/docker/reporting.sh index 6cc7a7c9e..25d3ef117 100755 --- a/utils/test/reporting/docker/reporting.sh +++ b/utils/test/reporting/docker/reporting.sh @@ -3,7 +3,7 @@ export PYTHONPATH="${PYTHONPATH}:./reporting" export CONFIG_REPORTING_YAML=./reporting/reporting.yaml -declare -a versions=(danube master) +declare -a versions=(euphrates danube master) declare -a projects=(functest storperf yardstick qtip vsperf bottlenecks) project=$1 diff --git a/utils/test/reporting/html/euphrates.html b/utils/test/reporting/html/euphrates.html index 86258ac23..ff7061b4a 100644 --- a/utils/test/reporting/html/euphrates.html +++ b/utils/test/reporting/html/euphrates.html @@ -35,7 +35,7 @@ <div id="main"> <div class="inner"> <header> - <h1>Danube reporting</h1> + <h1>Euphrates reporting</h1> </header> <section class="tiles"> <article class="style3"> diff --git a/utils/test/reporting/reporting/functest/reporting-status.py b/utils/test/reporting/reporting/functest/reporting-status.py index 02bf67d0e..808c84144 100755 --- a/utils/test/reporting/reporting/functest/reporting-status.py +++ b/utils/test/reporting/reporting/functest/reporting-status.py @@ -22,7 +22,7 @@ Functest reporting status """ # Logger -logger = rp_utils.getLogger("Functest-Status") +LOGGER = rp_utils.getLogger("Functest-Status") # Initialization testValid = [] @@ -46,16 +46,16 @@ exclude_virtual = rp_utils.get_config('functest.exclude_virtual') functest_yaml_config = rp_utils.getFunctestConfig() -logger.info("*******************************************") -logger.info("* *") -logger.info("* Generating reporting scenario status *") -logger.info("* Data retention: %s days *" % period) -logger.info("* Log level: %s *" % log_level) -logger.info("* *") -logger.info("* Virtual PODs exluded: %s *" % exclude_virtual) -logger.info("* NOHA scenarios excluded: %s *" % exclude_noha) -logger.info("* *") -logger.info("*******************************************") +LOGGER.info("*******************************************") +LOGGER.info("* *") +LOGGER.info("* Generating reporting scenario status *") +LOGGER.info("* Data retention: %s days *", period) +LOGGER.info("* Log level: %s *", log_level) +LOGGER.info("* *") +LOGGER.info("* Virtual PODs exluded: %s *", exclude_virtual) +LOGGER.info("* NOHA scenarios excluded: %s *", exclude_noha) +LOGGER.info("* *") +LOGGER.info("*******************************************") # Retrieve test cases of Tier 1 (smoke) config_tiers = functest_yaml_config.get("tiers") @@ -75,9 +75,9 @@ for tier in config_tiers: elif tier['order'] == 2: for case in tier['testcases']: if case['case_name'] not in blacklist: - testValid.append(tc.TestCase(case['case_name'], - case['case_name'], - case['dependencies'])) + otherTestCases.append(tc.TestCase(case['case_name'], + case['case_name'], + case['dependencies'])) elif tier['order'] > 2: for case in tier['testcases']: if case['case_name'] not in blacklist: @@ -85,7 +85,7 @@ for tier in config_tiers: "functest", case['dependencies'])) -logger.debug("Functest reporting start") +LOGGER.debug("Functest reporting start") # For all the versions for version in versions: @@ -101,7 +101,7 @@ for version in versions: # initiate scenario file if it does not exist if not os.path.isfile(scenario_file_name): with open(scenario_file_name, "a") as my_file: - logger.debug("Create scenario file: %s" % scenario_file_name) + LOGGER.debug("Create scenario file: %s", scenario_file_name) my_file.write("date,scenario,installer,detail,score\n") for installer in installers: @@ -113,10 +113,10 @@ for version in versions: version) # get nb of supported architecture (x86, aarch64) architectures = rp_utils.getArchitectures(scenario_results) - logger.info("Supported architectures: {}".format(architectures)) + LOGGER.info("Supported architectures: %s", architectures) for architecture in architectures: - logger.info("architecture: {}".format(architecture)) + LOGGER.info("Architecture: %s", architecture) # Consider only the results for the selected architecture # i.e drop x86 for aarch64 and vice versa filter_results = rp_utils.filterArchitecture(scenario_results, @@ -133,10 +133,10 @@ for version in versions: # For all the scenarios get results for s, s_result in filter_results.items(): - logger.info("---------------------------------") - logger.info("installer %s, version %s, scenario %s:" % - (installer, version, s)) - logger.debug("Scenario results: %s" % s_result) + LOGGER.info("---------------------------------") + LOGGER.info("installer %s, version %s, scenario %s:", + installer, version, s) + LOGGER.debug("Scenario results: %s", s_result) # Green or Red light for a given scenario nb_test_runnable_for_this_scenario = 0 @@ -146,11 +146,11 @@ for version in versions: s_url = "" if len(s_result) > 0: build_tag = s_result[len(s_result)-1]['build_tag'] - logger.debug("Build tag: %s" % build_tag) + LOGGER.debug("Build tag: %s", build_tag) s_url = rp_utils.getJenkinsUrl(build_tag) if s_url is None: s_url = "http://testresultS.opnfv.org/reporting" - logger.info("last jenkins url: %s" % s_url) + LOGGER.info("last jenkins url: %s", s_url) testCases2BeDisplayed = [] # Check if test case is runnable / installer, scenario # for the test case used for Scenario validation @@ -160,24 +160,24 @@ for version in versions: for test_case in testValid: test_case.checkRunnable(installer, s, test_case.getConstraints()) - logger.debug("testcase %s (%s) is %s" % - (test_case.getDisplayName(), - test_case.getName(), - test_case.isRunnable)) + LOGGER.debug("testcase %s (%s) is %s", + test_case.getDisplayName(), + test_case.getName(), + test_case.isRunnable) time.sleep(1) if test_case.isRunnable: name = test_case.getName() displayName = test_case.getDisplayName() project = test_case.getProject() nb_test_runnable_for_this_scenario += 1 - logger.info(" Searching results for case %s " % - (displayName)) + LOGGER.info(" Searching results for case %s ", + displayName) result = rp_utils.getResult(name, installer, s, version) # if no result set the value to 0 if result < 0: result = 0 - logger.info(" >>>> Test score = " + str(result)) + LOGGER.info(" >>>> Test score = " + str(result)) test_case.setCriteria(result) test_case.setIsRunnable(True) testCases2BeDisplayed.append(tc.TestCase(name, @@ -193,17 +193,17 @@ for version in versions: for test_case in otherTestCases: test_case.checkRunnable(installer, s, test_case.getConstraints()) - logger.debug("testcase %s (%s) is %s" % - (test_case.getDisplayName(), - test_case.getName(), - test_case.isRunnable)) + LOGGER.debug("testcase %s (%s) is %s", + test_case.getDisplayName(), + test_case.getName(), + test_case.isRunnable) time.sleep(1) if test_case.isRunnable: name = test_case.getName() displayName = test_case.getDisplayName() project = test_case.getProject() - logger.info(" Searching results for case %s " % - (displayName)) + LOGGER.info(" Searching results for case %s ", + displayName) result = rp_utils.getResult(name, installer, s, version) # at least 1 result for the test @@ -218,13 +218,13 @@ for version in versions: True, 4)) else: - logger.debug("No results found") + LOGGER.debug("No results found") items[s] = testCases2BeDisplayed except Exception: - logger.error("Error: installer %s, version %s, scenario %s" - % (installer, version, s)) - logger.error("No data available: %s" % (sys.exc_info()[0])) + LOGGER.error("Error installer %s, version %s, scenario %s", + installer, version, s) + LOGGER.error("No data available: %s", sys.exc_info()[0]) # ********************************************** # Evaluate the results for scenario validation @@ -243,11 +243,11 @@ for version in versions: s_status = "KO" if scenario_score < scenario_criteria: - logger.info(">>>> scenario not OK, score = %s/%s" % - (scenario_score, scenario_criteria)) + LOGGER.info(">>>> scenario not OK, score = %s/%s", + scenario_score, scenario_criteria) s_status = "KO" else: - logger.info(">>>>> scenario OK, save the information") + LOGGER.info(">>>>> scenario OK, save the information") s_status = "OK" path_validation_file = ("./display/" + version + "/functest/" + @@ -270,7 +270,7 @@ for version in versions: s_score, s_score_percent, s_url) - logger.info("--------------------------") + LOGGER.info("--------------------------") templateLoader = jinja2.FileSystemLoader(".") templateEnv = jinja2.Environment( @@ -294,9 +294,9 @@ for version in versions: installer_display + ".html", "wb") as fh: fh.write(outputText) - logger.info("Manage export CSV & PDF") + LOGGER.info("Manage export CSV & PDF") rp_utils.export_csv(scenario_file_name, installer_display, version) - logger.error("CSV generated...") + LOGGER.error("CSV generated...") # Generate outputs for export # pdf @@ -306,4 +306,4 @@ for version in versions: pdf_doc_name = ("./display/" + version + "/functest/status-" + installer_display + ".pdf") rp_utils.export_pdf(pdf_path, pdf_doc_name) - logger.info("PDF generated...") + LOGGER.info("PDF generated...") diff --git a/utils/test/reporting/reporting/functest/reporting-vims.py b/utils/test/reporting/reporting/functest/reporting-vims.py index 14fddbe25..3b25e911d 100755 --- a/utils/test/reporting/reporting/functest/reporting-vims.py +++ b/utils/test/reporting/reporting/functest/reporting-vims.py @@ -1,112 +1,128 @@ +#!/usr/bin/python +# +# This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +""" +vIMS reporting status +""" from urllib2 import Request, urlopen, URLError import json import jinja2 -# manage conf -import utils.reporting_utils as rp_utils - -logger = rp_utils.getLogger("vIMS") - - -def sig_test_format(sig_test): - nbPassed = 0 - nbFailures = 0 - nbSkipped = 0 - for data_test in sig_test: - if data_test['result'] == "Passed": - nbPassed += 1 - elif data_test['result'] == "Failed": - nbFailures += 1 - elif data_test['result'] == "Skipped": - nbSkipped += 1 - total_sig_test_result = {} - total_sig_test_result['passed'] = nbPassed - total_sig_test_result['failures'] = nbFailures - total_sig_test_result['skipped'] = nbSkipped - return total_sig_test_result - -period = rp_utils.get_config('general.period') -versions = rp_utils.get_config('general.versions') -url_base = rp_utils.get_config('testapi.url') - -logger.info("****************************************") -logger.info("* Generating reporting vIMS *") -logger.info("* Data retention = %s days *" % period) -logger.info("* *") -logger.info("****************************************") - -installers = rp_utils.get_config('general.installers') -step_order = ["initialisation", "orchestrator", "vIMS", "sig_test"] -logger.info("Start processing....") +import reporting.utils.reporting_utils as rp_utils + +LOGGER = rp_utils.getLogger("vIMS") + +PERIOD = rp_utils.get_config('general.period') +VERSIONS = rp_utils.get_config('general.versions') +URL_BASE = rp_utils.get_config('testapi.url') + +LOGGER.info("****************************************") +LOGGER.info("* Generating reporting vIMS *") +LOGGER.info("* Data retention = %s days *", PERIOD) +LOGGER.info("* *") +LOGGER.info("****************************************") + +INSTALLERS = rp_utils.get_config('general.installers') +STEP_ORDER = ["initialisation", "orchestrator", "vnf", "test_vnf"] +LOGGER.info("Start vIMS reporting processing....") # For all the versions -for version in versions: - for installer in installers: - logger.info("Search vIMS results for installer: %s, version: %s" - % (installer, version)) - request = Request("http://" + url_base + '?case=vims&installer=' + - installer + '&version=' + version) - - try: - response = urlopen(request) - k = response.read() - results = json.loads(k) - except URLError as e: - logger.error("Error code: %s" % e) - - test_results = results['results'] - - logger.debug("Results found: %s" % test_results) - - scenario_results = {} - for r in test_results: - if not r['scenario'] in scenario_results.keys(): - scenario_results[r['scenario']] = [] - scenario_results[r['scenario']].append(r) - - for s, s_result in scenario_results.items(): - scenario_results[s] = s_result[0:5] - logger.debug("Search for success criteria") - for result in scenario_results[s]: - result["start_date"] = result["start_date"].split(".")[0] - sig_test = result['details']['sig_test']['result'] - if not sig_test == "" and isinstance(sig_test, list): - format_result = sig_test_format(sig_test) - if format_result['failures'] > format_result['passed']: - result['details']['sig_test']['duration'] = 0 - result['details']['sig_test']['result'] = format_result - nb_step_ok = 0 - nb_step = len(result['details']) - - for step_name, step_result in result['details'].items(): - if step_result['duration'] != 0: - nb_step_ok += 1 - m, s = divmod(step_result['duration'], 60) - m_display = "" - if int(m) != 0: - m_display += str(int(m)) + "m " - - step_result['duration_display'] = (m_display + - str(int(s)) + "s") - - result['pr_step_ok'] = 0 - if nb_step != 0: - result['pr_step_ok'] = (float(nb_step_ok) / nb_step) * 100 - try: - logger.debug("Scenario %s, Installer %s" - % (s_result[1]['scenario'], installer)) - res = result['details']['orchestrator']['duration'] - logger.debug("Orchestrator deployment: %s s" - % res) - logger.debug("vIMS deployment: %s s" - % result['details']['vIMS']['duration']) - logger.debug("Signaling testing: %s s" - % result['details']['sig_test']['duration']) - logger.debug("Signaling testing results: %s" - % format_result) - except Exception: - logger.error("Data badly formatted") - logger.debug("----------------------------------------") +for version in VERSIONS: + for installer in INSTALLERS: + + # get nb of supported architecture (x86, aarch64) + # get scenarios + scenario_results = rp_utils.getScenarios("functest", + "cloudify_ims", + installer, + version) + + architectures = rp_utils.getArchitectures(scenario_results) + LOGGER.info("Supported architectures: %s", architectures) + + for architecture in architectures: + LOGGER.info("Architecture: %s", architecture) + # Consider only the results for the selected architecture + # i.e drop x86 for aarch64 and vice versa + filter_results = rp_utils.filterArchitecture(scenario_results, + architecture) + scenario_stats = rp_utils.getScenarioStats(filter_results) + items = {} + scenario_result_criteria = {} + + # in case of more than 1 architecture supported + # precise the architecture + installer_display = installer + if "fuel" in installer: + installer_display = installer + "@" + architecture + + LOGGER.info("Search vIMS results for installer: %s, version: %s", + installer, version) + request = Request("http://" + URL_BASE + '?case=cloudify_ims&' + 'installer=' + installer + '&version=' + version) + try: + response = urlopen(request) + k = response.read() + results = json.loads(k) + except URLError as err: + LOGGER.error("Error code: %s", err) + + test_results = results['results'] + + # LOGGER.debug("Results found: %s" % test_results) + + scenario_results = {} + for r in test_results: + if not r['scenario'] in scenario_results.keys(): + scenario_results[r['scenario']] = [] + scenario_results[r['scenario']].append(r) + + # LOGGER.debug("scenario result: %s" % scenario_results) + + for s, s_result in scenario_results.items(): + scenario_results[s] = s_result[0:5] + for result in scenario_results[s]: + try: + format_result = result['details']['test_vnf']['result'] + + # round durations of the different steps + result['details']['orchestrator']['duration'] = round( + result['details']['orchestrator']['duration'], 1) + result['details']['vnf']['duration'] = round( + result['details']['vnf']['duration'], 1) + result['details']['test_vnf']['duration'] = round( + result['details']['test_vnf']['duration'], 1) + + res_orch = \ + result['details']['orchestrator']['duration'] + res_vnf = result['details']['vnf']['duration'] + res_test_vnf = \ + result['details']['test_vnf']['duration'] + res_signaling = \ + result['details']['test_vnf']['result']['failures'] + + # Manage test result status + if res_signaling != 0: + LOGGER.debug("At least 1 signalig test FAIL") + result['details']['test_vnf']['status'] = "FAIL" + else: + LOGGER.debug("All signalig tests PASS") + result['details']['test_vnf']['status'] = "PASS" + + LOGGER.debug("Scenario %s, Installer %s", + s_result[1]['scenario'], installer) + LOGGER.debug("Orchestrator deployment: %ss", res_orch) + LOGGER.debug("vIMS deployment: %ss", res_vnf) + LOGGER.debug("VNF testing: %ss", res_test_vnf) + LOGGER.debug("VNF testing results: %s", format_result) + except Exception as err: # pylint: disable=broad-except + LOGGER.error("Uncomplete data %s", err) + LOGGER.debug("----------------------------------------") templateLoader = jinja2.FileSystemLoader(".") templateEnv = jinja2.Environment(loader=templateLoader, @@ -116,11 +132,11 @@ for version in versions: template = templateEnv.get_template(TEMPLATE_FILE) outputText = template.render(scenario_results=scenario_results, - step_order=step_order, - installer=installer) - + step_order=STEP_ORDER, + installer=installer_display) + LOGGER.debug("Generate html page for %s", installer_display) with open("./display/" + version + "/functest/vims-" + - installer + ".html", "wb") as fh: + installer_display + ".html", "wb") as fh: fh.write(outputText) -logger.info("vIMS report succesfully generated") +LOGGER.info("vIMS report succesfully generated") diff --git a/utils/test/reporting/reporting/functest/template/index-vims-tmpl.html b/utils/test/reporting/reporting/functest/template/index-vims-tmpl.html index cd51607b7..9bd2b2f66 100644 --- a/utils/test/reporting/reporting/functest/template/index-vims-tmpl.html +++ b/utils/test/reporting/reporting/functest/template/index-vims-tmpl.html @@ -22,11 +22,12 @@ <nav> <ul class="nav nav-justified"> <li class="active"><a href="../../index.html">Home</a></li> - <li><a href="vims-fuel.html">Fuel</a></li> + <li><a href="vims-apex.html">Apex</a></li> <li><a href="vims-compass.html">Compass</a></li> <li><a href="vims-daisy.html">Daisy</a></li> - <li><a href="vims-joid.html">JOID</a></li> - <li><a href="vims-apex.html">APEX</a></li> + <li><a href="vims-fuel@x86.html">Fuel@x86</a></li> + <li><a href="vims-fuel@aarch64.html">Fuel@aarch64</a></li> + <li><a href="vims-joid.html">Joid</a></li> </ul> </nav> </div> @@ -58,17 +59,17 @@ <tr> <th width="20%">Step</th> <th width="10%">Status</th> - <th width="10%">Duration</th> + <th width="10%">Duration(s)</th> <th width="60%">Result</th> </tr> {% for step_od_name in step_order -%} {% if step_od_name in result.details.keys() -%} {% set step_result = result.details[step_od_name] -%} - {% if step_result.duration != 0 -%} + {% if step_result.status == "PASS" -%} <tr class="tr-ok"> <td>{{step_od_name}}</td> <td><span class="glyphicon glyphicon-ok"></td> - <td><b>{{step_result.duration_display}}</b></td> + <td><b>{{step_result.duration}}</b></td> <td>{{step_result.result}}</td> </tr> {%- else -%} diff --git a/utils/test/reporting/reporting/functest/testCase.py b/utils/test/reporting/reporting/functest/testCase.py index 9834f0753..a182dd4cf 100644 --- a/utils/test/reporting/reporting/functest/testCase.py +++ b/utils/test/reporting/reporting/functest/testCase.py @@ -50,9 +50,10 @@ class TestCase(object): 'gluon_vping': 'Netready', 'fds': 'FDS', 'cloudify_ims': 'vIMS (Cloudify)', - 'orchestra_ims': 'OpenIMS (OpenBaton)', + 'orchestra_openims': 'OpenIMS (OpenBaton)', + 'orchestra_clearwaterims': 'vIMS (OpenBaton)', 'opera_ims': 'vIMS (Open-O)', - 'vyos_vrouter': 'vyos', + 'vyos_vrouter': 'vyos (Cloudify)', 'barometercollectd': 'Barometer', 'odl_netvirt': 'Netvirt', 'security_scan': 'Security'} diff --git a/utils/test/reporting/reporting/yardstick/scenarios.py b/utils/test/reporting/reporting/yardstick/scenarios.py index 26e8c8bb0..7504493b2 100644 --- a/utils/test/reporting/reporting/yardstick/scenarios.py +++ b/utils/test/reporting/reporting/yardstick/scenarios.py @@ -9,7 +9,7 @@ import requests import yaml -import utils.reporting_utils as rp_utils +import reporting.utils.reporting_utils as rp_utils yardstick_conf = rp_utils.get_config('yardstick.test_conf') response = requests.get(yardstick_conf) diff --git a/utils/test/testapi/deployment/deploy.py b/utils/test/testapi/deployment/deploy.py deleted file mode 100644 index 6433fa6b2..000000000 --- a/utils/test/testapi/deployment/deploy.py +++ /dev/null @@ -1,40 +0,0 @@ -import argparse -import os - -from jinja2 import Environment, FileSystemLoader - -env = Environment(loader=FileSystemLoader('./')) -docker_compose_yml = './docker-compose.yml' -docker_compose_template = './docker-compose.yml.template' - - -def render_docker_compose(port, base_url): - vars = { - "expose_port": port, - "base_url": base_url, - } - template = env.get_template(docker_compose_template) - yml = template.render(vars=vars) - - with open(docker_compose_yml, 'w') as f: - f.write(yml) - f.close() - - -def main(args): - render_docker_compose(args.expose_port, args.base_url) - os.system('docker-compose -f {} up -d'.format(docker_compose_yml)) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='Backup MongoDBs') - parser.add_argument('-p', '--expose-port', - type=int, - required=False, - default=8000, - help='testapi exposed port') - parser.add_argument('-l', '--base-url', - type=str, - required=True, - help='testapi exposed base-url') - main(parser.parse_args()) diff --git a/utils/test/testapi/deployment/docker-compose.yml.template b/utils/test/testapi/deployment/docker-compose.yml.template deleted file mode 100644 index cd684048e..000000000 --- a/utils/test/testapi/deployment/docker-compose.yml.template +++ /dev/null @@ -1,15 +0,0 @@ -version: '2' -services: - mongo: - image: mongo:3.2.1 - container_name: opnfv-mongo - testapi: - image: opnfv/testapi:latest - container_name: opnfv-testapi - environment: - - mongodb_url=mongodb://mongo:27017/ - - base_url={{ vars.base_url }} - ports: - - "{{ vars.expose_port }}:8000" - links: - - mongo diff --git a/utils/test/testapi/opts/deploy.py b/utils/test/testapi/opts/deploy.py new file mode 100644 index 000000000..f58690c5d --- /dev/null +++ b/utils/test/testapi/opts/deploy.py @@ -0,0 +1,55 @@ +import argparse +import os + +from jinja2 import Environment + +DOCKER_COMPOSE_FILE = './docker-compose.yml' +DOCKER_COMPOSE_TEMPLATE = """ +version: '2' +services: + mongo: + image: mongo:3.2.1 + container_name: opnfv-mongo + testapi: + image: opnfv/testapi:latest + container_name: opnfv-testapi + environment: + - mongodb_url=mongodb://mongo:27017/ + - base_url={{ vars.testapi_base_url }} + ports: + - "{{ vars.testapi_port }}:8000" + links: + - mongo +""" + + +def render_docker_compose(testapi_port, testapi_base_url): + vars = { + "testapi_port": testapi_port, + "testapi_base_url": testapi_base_url, + } + + yml = Environment().from_string(DOCKER_COMPOSE_TEMPLATE).render(vars=vars) + + with open(DOCKER_COMPOSE_FILE, 'w') as f: + f.write(yml) + f.close() + + +def main(args): + render_docker_compose(args.testapi_port, args.testapi_base_url) + os.system('docker-compose -f {} up -d'.format(DOCKER_COMPOSE_FILE)) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Backup MongoDBs') + parser.add_argument('-tp', '--testapi-port', + type=int, + required=False, + default=8000, + help='testapi exposed port') + parser.add_argument('-tl', '--testapi-base-url', + type=str, + required=True, + help='testapi exposed base-url') + main(parser.parse_args()) |