X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fxci%2Fxci-run-functest.sh;h=aa98e07aa949ea310de23949b8513b17a8df0395;hb=a2ffc4d1f172b81ec1bdf4ba7e8b00a199b97660;hp=1bc569aef6a0c8a7c23366da8893a2ca179d420a;hpb=a14cf5ebf3d699d6c4ad2c3233636f2660266e65;p=releng.git diff --git a/jjb/xci/xci-run-functest.sh b/jjb/xci/xci-run-functest.sh index 1bc569aef..aa98e07aa 100755 --- a/jjb/xci/xci-run-functest.sh +++ b/jjb/xci/xci-run-functest.sh @@ -7,9 +7,7 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -set -o errexit set -o nounset -set -o pipefail #---------------------------------------------------------------------- # This script is used by CI and executed by Jenkins jobs. @@ -17,6 +15,9 @@ set -o pipefail # what you are doing. #---------------------------------------------------------------------- +# ensure GERRIT_TOPIC is set +GERRIT_TOPIC="${GERRIT_TOPIC:-''}" + # skip the healthcheck if the patch doesn't impact the deployment if [[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment ]]; then echo "Skipping the healthcheck!" @@ -48,10 +49,18 @@ if ! sed -n "/^- scenario: $DEPLOY_SCENARIO$/,/^$/p" $OPNFV_SCENARIO_REQUIREMENT exit 0 fi -ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm "cd releng-xci/xci && PATH=/home/devuser/.local/bin:$PATH ansible-playbook -i installer/osa/files/$XCI_FLAVOR/inventory playbooks/prepare-functest.yml" +# set XCI_VENV for ansible +export XCI_VENV=/home/devuser/releng-xci/venv + +ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm "source $XCI_VENV/bin/activate; cd releng-xci/xci && ansible-playbook -i installer/osa/files/$XCI_FLAVOR/inventory playbooks/prepare-functest.yml" echo "Running functest" ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm_opnfv "/root/run-functest.sh" echo "Functest log" echo "---------------------------------------------------------------------------------" ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm_opnfv "cat /root/results/functest.log" echo "---------------------------------------------------------------------------------" +# check the log to see if we have any error +if ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm_opnfv "grep -q 'FAIL' /root/results/functest.log"; then + echo "Error: Functest failed!" + exit 1 +fi