summaryrefslogtreecommitdiffstats
path: root/jjb/xci
diff options
context:
space:
mode:
Diffstat (limited to 'jjb/xci')
-rw-r--r--jjb/xci/bifrost-periodic-jobs.yml2
-rw-r--r--jjb/xci/bifrost-verify-jobs.yml18
-rwxr-xr-xjjb/xci/bifrost-verify.sh6
-rw-r--r--jjb/xci/osa-periodic-jobs.yml7
-rwxr-xr-xjjb/xci/xci-cleanup.sh8
-rw-r--r--jjb/xci/xci-daily-jobs.yml14
-rwxr-xr-xjjb/xci/xci-deploy.sh6
-rw-r--r--jjb/xci/xci-merge-jobs.yml15
-rwxr-xr-xjjb/xci/xci-promote.sh3
-rwxr-xr-xjjb/xci/xci-run-functest.sh32
-rwxr-xr-xjjb/xci/xci-set-scenario.sh191
-rwxr-xr-xjjb/xci/xci-start-deployment.sh17
-rwxr-xr-xjjb/xci/xci-start-new-vm.sh20
-rw-r--r--jjb/xci/xci-verify-jobs.yml61
14 files changed, 356 insertions, 44 deletions
diff --git a/jjb/xci/bifrost-periodic-jobs.yml b/jjb/xci/bifrost-periodic-jobs.yml
index 0bca26aa5..fbe2e205a 100644
--- a/jjb/xci/bifrost-periodic-jobs.yml
+++ b/jjb/xci/bifrost-periodic-jobs.yml
@@ -123,7 +123,7 @@
name: SLAVE_LABEL
default: '{slave-label}'
- string:
- name: XCI_LOOP
+ name: CI_LOOP
default: 'periodic'
wrappers:
diff --git a/jjb/xci/bifrost-verify-jobs.yml b/jjb/xci/bifrost-verify-jobs.yml
index e4c2d0e5b..2fb7c2167 100644
--- a/jjb/xci/bifrost-verify-jobs.yml
+++ b/jjb/xci/bifrost-verify-jobs.yml
@@ -71,7 +71,14 @@
use-build-blocker: true
blocking-jobs:
- 'xci-verify-{distro}-.*'
+ - 'xci-.*-{distro}-merge-.*'
- '.*-bifrost-verify.*-{type}'
+ - throttle:
+ max-per-node: 2
+ max-total: 10
+ categories:
+ - xci-verify-virtual
+ option: category
block-level: 'NODE'
@@ -122,7 +129,7 @@
name: SLAVE_LABEL
default: 'xci-virtual'
- string:
- name: XCI_LOOP
+ name: CI_LOOP
default: 'verify'
scm:
@@ -147,7 +154,7 @@
wrappers:
- fix-workspace-permissions
- build-timeout:
- timeout: 90
+ timeout: 180
publishers:
# yamllint disable rule:line-length
@@ -155,6 +162,13 @@
recipients: fatih.degirmenci@ericsson.com yroblamo@redhat.com mchandras@suse.de jack.morgan@intel.com julienjut@gmail.com
# yamllint enable rule:line-length
- email-jenkins-admins-on-failure
+ - postbuildscript:
+ script-only-if-succeeded: false
+ script-only-if-failed: false
+ builders:
+ - shell:
+ !include-raw: ./xci-cleanup.sh
+
# -------------------------------
# trigger macros
# -------------------------------
diff --git a/jjb/xci/bifrost-verify.sh b/jjb/xci/bifrost-verify.sh
index 451f33b4b..9219d0020 100755
--- a/jjb/xci/bifrost-verify.sh
+++ b/jjb/xci/bifrost-verify.sh
@@ -28,7 +28,7 @@ set -o pipefail
cd ~/bifrost
# provision 3 VMs; xcimaster, controller, and compute
-./scripts/bifrost-provision.sh
+./scripts/bifrost-provision.sh | ts
sudo -H -E virsh list
EOF
@@ -46,6 +46,6 @@ export XCI_UPDATE_CLEAN_VM_OS=true
./xci/scripts/vm/start-new-vm.sh $VM_DISTRO
-rsync -a -e "ssh -F $HOME/.ssh/xci-vm-config" $WORKSPACE/ ${VM_DISTRO}_xci_vm:~/bifrost
+rsync -a -e "ssh -F $HOME/.ssh/${VM_DISTRO}-xci-vm-config" $WORKSPACE/ ${VM_DISTRO}_xci_vm:~/bifrost
-ssh -F $HOME/.ssh/xci-vm-config ${VM_DISTRO}_xci_vm "cd ~/bifrost/releng-xci && ./bifrost_test.sh"
+ssh -F $HOME/.ssh/${VM_DISTRO}-xci-vm-config ${VM_DISTRO}_xci_vm "cd ~/bifrost/releng-xci && ./bifrost_test.sh"
diff --git a/jjb/xci/osa-periodic-jobs.yml b/jjb/xci/osa-periodic-jobs.yml
index 64daa696b..6c2d165a4 100644
--- a/jjb/xci/osa-periodic-jobs.yml
+++ b/jjb/xci/osa-periodic-jobs.yml
@@ -216,6 +216,7 @@
export FUNCTEST_MODE=$FUNCTEST_MODE
export FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
export XCI_FLAVOR=$XCI_FLAVOR
+ export CORE_OPENSTACK_INSTALL=true
export CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
export OPNFV_RELENG_DEV_PATH=/home/devuser/releng-xci/
export INSTALLER_TYPE=$INSTALLER_TYPE
@@ -234,7 +235,7 @@
- shell: |
#!/bin/bash
- ssh -F $HOME/.ssh/xci-vm-config ${DISTRO}_xci_vm "cd releng-xci && ./xci_test.sh"
+ ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm "cd releng-xci && ./xci_test.sh"
- builder:
@@ -247,8 +248,8 @@
- shell: |
#!/bin/bash
- sudo virsh destroy ${DISTRO}_xci_vm
- sudo virsh undefine ${DISTRO}_xci_vm
+ sudo virsh destroy ${DISTRO}_xci_vm || true
+ sudo virsh undefine ${DISTRO}_xci_vm || true
# this will be enabled once the xci is prepared
# - builder:
diff --git a/jjb/xci/xci-cleanup.sh b/jjb/xci/xci-cleanup.sh
index 45b4ec273..51a863da2 100755
--- a/jjb/xci/xci-cleanup.sh
+++ b/jjb/xci/xci-cleanup.sh
@@ -14,11 +14,15 @@
# what you are doing.
#----------------------------------------------------------------------
+# Need to cover macros with and without parameters
+VM_NAME=$DISTRO
+VM_NAME+=_xci_vm
+
# 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
+sudo virsh destroy $VM_NAME || true
+sudo virsh undefine $VM_NAME || true
diff --git a/jjb/xci/xci-daily-jobs.yml b/jjb/xci/xci-daily-jobs.yml
index a95374933..11db4e168 100644
--- a/jjb/xci/xci-daily-jobs.yml
+++ b/jjb/xci/xci-daily-jobs.yml
@@ -113,7 +113,7 @@
name: SLAVE_LABEL
default: '{slave-label}'
- string:
- name: XCI_LOOP
+ name: CI_LOOP
default: 'daily'
triggers:
@@ -131,7 +131,7 @@
predefined-parameters: |
DEPLOY_SCENARIO=$DEPLOY_SCENARIO
XCI_FLAVOR=$XCI_FLAVOR
- XCI_LOOP=$XCI_LOOP
+ CI_LOOP=$CI_LOOP
same-node: true
block: true
- trigger-builds:
@@ -140,7 +140,7 @@
predefined-parameters: |
DEPLOY_SCENARIO=$DEPLOY_SCENARIO
XCI_FLAVOR=$XCI_FLAVOR
- XCI_LOOP=$XCI_LOOP
+ CI_LOOP=$CI_LOOP
same-node: true
block: true
block-thresholds:
@@ -154,6 +154,12 @@
recipients: fatih.degirmenci@ericsson.com yroblamo@redhat.com mchandras@suse.de jack.morgan@intel.com julienjut@gmail.com
# yamllint enable rule:line-length
- email-jenkins-admins-on-failure
+ - postbuildscript:
+ script-only-if-succeeded: false
+ script-only-if-failed: false
+ builders:
+ - shell:
+ !include-raw: ./xci-cleanup.sh
- job-template:
name: 'xci-{phase}-{pod}-{distro}-daily-{stream}'
@@ -214,7 +220,7 @@
name: SLAVE_LABEL
default: '{slave-label}'
- string:
- name: XCI_LOOP
+ name: CI_LOOP
default: 'daily'
- string:
name: INSTALLER_TYPE
diff --git a/jjb/xci/xci-deploy.sh b/jjb/xci/xci-deploy.sh
index 211d282d3..71cf96d8d 100755
--- a/jjb/xci/xci-deploy.sh
+++ b/jjb/xci/xci-deploy.sh
@@ -15,14 +15,14 @@ cd $WORKSPACE/xci
# for daily jobs, we want to use working versions
# for periodic jobs, we will use whatever is set in the job, probably master
-if [[ "$XCI_LOOP" == "daily" ]]; then
+if [[ "$CI_LOOP" == "daily" ]]; then
# source pinned-vars to get releng version
source ./config/pinned-versions
# checkout the version
git checkout -q $OPNFV_RELENG_VERSION
echo "Info: Using $OPNFV_RELENG_VERSION"
-elif [[ "$XCI_LOOP" == "periodic" ]]; then
+elif [[ "$CI_LOOP" == "periodic" ]]; then
echo "Info: Using $OPNFV_RELENG_VERSION"
fi
@@ -31,7 +31,7 @@ fi
# to take this into account while deploying anyways
# clone openstack-ansible
# stable/ocata already use pinned versions so this is only valid for master
-if [[ "$XCI_LOOP" == "periodic" && "$OPENSTACK_OSA_VERSION" == "master" ]]; then
+if [[ "$CI_LOOP" == "periodic" && "$OPENSTACK_OSA_VERSION" == "master" ]]; then
cd $WORKSPACE
# get the url to openstack-ansible git
source ./config/env-vars
diff --git a/jjb/xci/xci-merge-jobs.yml b/jjb/xci/xci-merge-jobs.yml
index b8da6128a..92eea190f 100644
--- a/jjb/xci/xci-merge-jobs.yml
+++ b/jjb/xci/xci-merge-jobs.yml
@@ -61,8 +61,7 @@
blocking-jobs:
- 'xci-verify-{distro}-.*'
- 'xci-.*-{distro}-merge-.*'
- - 'bifrost-verify-{distro}-.*'
- - 'bifrost-periodic-{distro}-.*'
+ - 'openstack-bifrost-verify-{distro}-.*'
- 'xci-osa-verify-{distro}-.*'
- 'xci-osa-periodic-{distro}-.*'
- 'xci-(os|k8s).*?-virtual-{distro}-.*'
@@ -71,7 +70,7 @@
max-per-node: 2
max-total: 10
categories:
- - xci-merge-virtual
+ - xci-verify-virtual
option: category
wrappers:
@@ -168,6 +167,14 @@
kill-phase-on: NEVER
abort-all-job: true
+ publishers:
+ - postbuildscript:
+ script-only-if-succeeded: false
+ script-only-if-failed: false
+ builders:
+ - shell:
+ !include-raw: ./xci-cleanup.sh
+
- job-template:
name: 'xci-{phase}-{type}-{distro}-merge-{stream}'
@@ -254,8 +261,6 @@
builders:
- shell:
!include-raw: ./xci-run-functest.sh
- - shell:
- !include-raw: ./xci-cleanup.sh
- builder:
name: 'xci-merge-promote-macro'
diff --git a/jjb/xci/xci-promote.sh b/jjb/xci/xci-promote.sh
index 98ad7ff4a..62818abee 100755
--- a/jjb/xci/xci-promote.sh
+++ b/jjb/xci/xci-promote.sh
@@ -14,6 +14,9 @@
# 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!"
diff --git a/jjb/xci/xci-run-functest.sh b/jjb/xci/xci-run-functest.sh
index b2421de32..60b48cf7f 100755
--- a/jjb/xci/xci-run-functest.sh
+++ b/jjb/xci/xci-run-functest.sh
@@ -7,6 +7,9 @@
# 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.
@@ -14,12 +17,33 @@
# 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!"
exit 0
fi
+# skip the healthcheck if the scenario is Kubernetes scenario
+if [[ "$DEPLOY_SCENARIO" =~ k8 ]]; then
+ echo "Skipping the healthcheck!"
+ exit 0
+fi
+
+# if the scenario is external, we need to wipe WORKSPACE to place releng-xci there since
+# the project where the scenario is coming from is cloned and the patch checked out to the
+# xci/scenarios/$DEPLOY_SCENARIO to be synched on clean VM
+# apart from that, we need releng-xci stuff in WORKSPACE for things to function correctly on Jenkins.
+# if the change is coming to releng-xci, we don't need to do anything since the patch is checked
+# out to the WORKSPACE anyways
+if [[ $GERRIT_PROJECT != "releng-xci" ]]; then
+ cd $HOME && /bin/rm -rf $WORKSPACE
+ git clone https://gerrit.opnfv.org/gerrit/releng-xci $WORKSPACE && cd $WORKSPACE
+ chmod -R go-rwx $WORKSPACE/xci/scripts/vm
+fi
+
# skip the deployment if the scenario is not supported on this distro
OPNFV_SCENARIO_REQUIREMENTS=$WORKSPACE/xci/opnfv-scenario-requirements.yml
if ! sed -n "/^- scenario: $DEPLOY_SCENARIO$/,/^$/p" $OPNFV_SCENARIO_REQUIREMENTS | grep -q $DISTRO; then
@@ -27,4 +51,10 @@ if ! sed -n "/^- scenario: $DEPLOY_SCENARIO$/,/^$/p" $OPNFV_SCENARIO_REQUIREMENT
exit 0
fi
-ssh -F $HOME/.ssh/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/run-functest.yml"
+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"
+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 "---------------------------------------------------------------------------------"
diff --git a/jjb/xci/xci-set-scenario.sh b/jjb/xci/xci-set-scenario.sh
new file mode 100755
index 000000000..62b26c019
--- /dev/null
+++ b/jjb/xci/xci-set-scenario.sh
@@ -0,0 +1,191 @@
+#!/bin/bash
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2018 SUSE and others.
+# All rights reserved. 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
+##############################################################################
+set -o errexit
+set -o pipefail
+
+#----------------------------------------------------------------------
+# This script is used by CI and executed by Jenkins jobs.
+# You are not supposed to use this script manually if you don't know
+# what you are doing.
+#----------------------------------------------------------------------
+
+# This function allows developers to specify the impacted scenario by adding
+# the info about installer and scenario into the commit message or using
+# the topic branch names. This results in either skipping the real verification
+# totally or skipping the determining the installer and scenario programmatically.
+# It is important to note that this feature is only available to generic scenarios
+# and only single installer/scenario pair is allowed.
+# The input in commit message should be placed at the end of the commit message body,
+# before the signed-off and change-id lines.
+#
+# Pattern to be searched in Commit Message
+# deploy-scenario:<scenario-name>
+# installer-type:<installer-type>
+# Examples:
+# deploy-scenario:os-odl-nofeature
+# installer-type:osa
+#
+# deploy-scenario:k8-nosdn-nofeature
+# installer-type:kubespray
+#
+# Patterns to be searched in topic branch name
+# skip-verify
+# skip-deployment
+# force-verify
+function override_generic_scenario() {
+ echo "Processing $GERRIT_PROJECT patchset $GERRIT_REFSPEC"
+
+ # process topic branch names
+ if [[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment ]]; then
+ # skip the real verification
+ echo "Skipping verify!"
+ echo "INSTALLER_TYPE=osa" > $WORK_DIRECTORY/scenario.properties
+ echo "DEPLOY_SCENARIO=os-nosdn-nofeature" >> $WORK_DIRECTORY/scenario.properties
+ exit 0
+ elif [[ "$GERRIT_TOPIC" =~ 'force-verify' ]]; then
+ # Run the deployment with default installer and scenario when multiple things change
+ # and we want to force that.
+ echo "Recording the installer 'osa' and scenario 'os-nosdn-nofeature' for downstream jobs"
+ echo "Forcing CI verification of default scenario and installer!"
+ echo "INSTALLER_TYPE=osa" > $WORK_DIRECTORY/scenario.properties
+ echo "DEPLOY_SCENARIO=os-nosdn-nofeature" >> $WORK_DIRECTORY/scenario.properties
+ exit 0
+ fi
+
+ # process commit message
+ if [[ "$GERRIT_CHANGE_COMMIT_MESSAGE" =~ "installer-type:" && "$GERRIT_CHANGE_COMMIT_MESSAGE" =~ "deploy-scenario:" ]]; then
+ INSTALLER_TYPE=$(echo $GERRIT_CHANGE_COMMIT_MESSAGE | awk '/installer-type:/' RS=" " | cut -d":" -f2)
+ DEPLOY_SCENARIO=$(echo $GERRIT_CHANGE_COMMIT_MESSAGE | awk '/deploy-scenario:/' RS=" " | cut -d":" -f2)
+
+ if [[ -z "$INSTALLER_TYPE" || -z "$DEPLOY_SCENARIO" ]]; then
+ echo "Installer type or deploy scenario is not specified. Falling back to programmatically determining them."
+ else
+ echo "Recording the installer '$INSTALLER_TYPE' and scenario '$DEPLOY_SCENARIO' for downstream jobs"
+ echo "INSTALLER_TYPE=$INSTALLER_TYPE" > $WORK_DIRECTORY/scenario.properties
+ echo "DEPLOY_SCENARIO=$DEPLOY_SCENARIO" >> $WORK_DIRECTORY/scenario.properties
+ exit 0
+ fi
+ else
+ echo "Installer type or deploy scenario is not specified. Falling back to programmatically determining them."
+ fi
+}
+
+# This function determines the impacted generic scenario by processing the
+# change and using diff to see what changed. If changed files belong to a scenario
+# its name gets recorded for deploying and testing the right scenario.
+#
+# Pattern to be searched in Changeset
+# releng-xci/scenarios/<scenario>/<impacted files>: <scenario>
+# releng-xci/xci/installer/osa/<impacted files>: os-nosdn-nofeature
+# releng-xci/xci/installer/kubespray/<impacted files>: k8-nosdn-nofeature
+# the rest: os-nosdn-nofeature
+function determine_generic_scenario() {
+ echo "Processing $GERRIT_PROJECT patchset $GERRIT_REFSPEC"
+
+ # get the changeset
+ cd $WORKSPACE
+ CHANGESET=$(git diff HEAD^..HEAD --name-only)
+ for CHANGED_FILE in $CHANGESET; do
+ case $CHANGED_FILE in
+ *k8-nosdn*|*kubespray*)
+ [[ ${DEPLOY_SCENARIO[@]} =~ "k8-nosdn-nofeature" ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='k8-nosdn-nofeature'
+ ;;
+ *os-odl*)
+ [[ ${DEPLOY_SCENARIO[@]} =~ "os-odl-nofeature" ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='os-odl-nofeature'
+ ;;
+ *os-nosdn*|*osa*)
+ [[ ${DEPLOY_SCENARIO[@]} =~ "os-nosdn-nofeature" ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='os-nosdn-nofeature'
+ ;;
+ *)
+ [[ ${DEPLOY_SCENARIO[@]} =~ "os-nosdn-nofeature" ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='os-nosdn-nofeature'
+ ;;
+ esac
+ done
+}
+
+# This function determines the impacted external scenario by processing the Gerrit
+# change and using diff to see what changed. If changed files belong to a scenario
+# its name gets recorded for deploying and testing the right scenario.
+#
+# Pattern
+# <project-repo>/scenarios/<scenario>/<impacted files>: <scenario>
+function determine_external_scenario() {
+ echo "Processing $GERRIT_PROJECT patchset $GERRIT_REFSPEC"
+
+ # remove the clone that is done via jenkins and place releng-xci there so the
+ # things continue functioning properly
+ cd $HOME && /bin/rm -rf $WORKSPACE
+ git clone -q https://gerrit.opnfv.org/gerrit/releng-xci $WORKSPACE && cd $WORKSPACE
+
+ # fix the permissions so ssh doesn't complain due to having world-readable keyfiles
+ chmod -R go-rwx $WORKSPACE/xci/scripts/vm
+
+ # clone the project repo and fetch the patchset to process for further processing
+ git clone -q https://gerrit.opnfv.org/gerrit/$GERRIT_PROJECT $WORK_DIRECTORY/$GERRIT_PROJECT
+ cd $WORK_DIRECTORY/$GERRIT_PROJECT
+ git fetch -q https://gerrit.opnfv.org/gerrit/$GERRIT_PROJECT $GERRIT_REFSPEC && git checkout -q FETCH_HEAD
+
+ # process the diff to find out what scenario(s) are impacted - there should only be 1
+ DEPLOY_SCENARIO+=$(git diff HEAD^..HEAD --name-only | grep scenarios | awk -F '[/|/]' '{print $2}' | uniq)
+}
+
+echo "Determining the impacted scenario"
+
+declare -a DEPLOY_SCENARIO
+
+# ensure GERRIT_TOPIC is set
+GERRIT_TOPIC="${GERRIT_TOPIC:-''}"
+
+# this directory is where the temporary clones and files are created
+# while extracting the impacted scenario
+WORK_DIRECTORY=/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO
+/bin/rm -rf $WORK_DIRECTORY && mkdir -p $WORK_DIRECTORY
+
+if [[ $GERRIT_PROJECT == "releng-xci" ]]; then
+ override_generic_scenario
+ determine_generic_scenario
+else
+ determine_external_scenario
+fi
+
+# ensure single scenario is impacted
+ if [[ $(IFS=$'\n' echo ${DEPLOY_SCENARIO[@]} | wc -w) != 1 ]]; then
+ echo "Change impacts multiple scenarios!"
+ echo "XCI doesn't support testing of changes that impact multiple scenarios currently."
+ echo "Please split your change into multiple different/dependent changes, each modifying single scenario."
+ exit 1
+fi
+
+# set the installer
+case ${DEPLOY_SCENARIO[0]} in
+ os-*)
+ INSTALLER_TYPE=osa
+ ;;
+ k8-*)
+ INSTALLER_TYPE=kubespray
+ ;;
+ *)
+ echo "Unable to determine the installer. Exiting!"
+ exit 1
+ ;;
+esac
+
+# save the installer and scenario names into java properties file
+# so they can be injected to downstream jobs via envInject
+echo "Recording the installer '$INSTALLER_TYPE' and scenario '${DEPLOY_SCENARIO[0]}' for downstream jobs"
+echo "INSTALLER_TYPE=$INSTALLER_TYPE" > $WORK_DIRECTORY/scenario.properties
+echo "DEPLOY_SCENARIO=$DEPLOY_SCENARIO" >> $WORK_DIRECTORY/scenario.properties
+
+# skip the deployment if the scenario is not supported on this distro
+OPNFV_SCENARIO_REQUIREMENTS=$WORKSPACE/xci/opnfv-scenario-requirements.yml
+if ! sed -n "/^- scenario: ${DEPLOY_SCENARIO[0]}$/,/^$/p" $OPNFV_SCENARIO_REQUIREMENTS | grep -q $DISTRO; then
+ echo "# SKIPPED: Scenario ${DEPLOY_SCENARIO[0]} is NOT supported on $DISTRO"
+ exit 0
+fi
diff --git a/jjb/xci/xci-start-deployment.sh b/jjb/xci/xci-start-deployment.sh
index e86f5b3a1..102ca41c3 100755
--- a/jjb/xci/xci-start-deployment.sh
+++ b/jjb/xci/xci-start-deployment.sh
@@ -14,12 +14,27 @@
# what you are doing.
#----------------------------------------------------------------------
+# ensure GERRIT_TOPIC is set
+GERRIT_TOPIC="${GERRIT_TOPIC:-''}"
+
# skip the deployment if the patch doesn't impact the deployment
if [[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment ]]; then
echo "Skipping the deployment!"
exit 0
fi
+# if the scenario is external, we need to wipe WORKSPACE to place releng-xci there since
+# the project where the scenario is coming from is cloned and the patch checked out to the
+# xci/scenarios/$DEPLOY_SCENARIO to be synched on clean VM
+# apart from that, we need releng-xci stuff in WORKSPACE for things to function correctly on Jenkins.
+# if the change is coming to releng-xci, we don't need to do anything since the patch is checked
+# out to the WORKSPACE anyways
+if [[ $GERRIT_PROJECT != "releng-xci" ]]; then
+ cd $HOME && /bin/rm -rf $WORKSPACE
+ git clone https://gerrit.opnfv.org/gerrit/releng-xci $WORKSPACE && cd $WORKSPACE
+ chmod -R go-rwx $WORKSPACE/xci/scripts/vm
+fi
+
# skip the deployment if the scenario is not supported on this distro
OPNFV_SCENARIO_REQUIREMENTS=$WORKSPACE/xci/opnfv-scenario-requirements.yml
if ! sed -n "/^- scenario: $DEPLOY_SCENARIO$/,/^$/p" $OPNFV_SCENARIO_REQUIREMENTS | grep -q $DISTRO; then
@@ -27,4 +42,4 @@ if ! sed -n "/^- scenario: $DEPLOY_SCENARIO$/,/^$/p" $OPNFV_SCENARIO_REQUIREMENT
exit 0
fi
-ssh -F $HOME/.ssh/xci-vm-config ${DISTRO}_xci_vm "cd releng-xci && ./xci_test.sh"
+ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm "cd releng-xci && ./xci_test.sh"
diff --git a/jjb/xci/xci-start-new-vm.sh b/jjb/xci/xci-start-new-vm.sh
index b72c33920..7874e6776 100755
--- a/jjb/xci/xci-start-new-vm.sh
+++ b/jjb/xci/xci-start-new-vm.sh
@@ -14,12 +14,27 @@
# what you are doing.
#----------------------------------------------------------------------
+# ensure GERRIT_TOPIC is set
+GERRIT_TOPIC="${GERRIT_TOPIC:-''}"
+
# skip the deployment if the patch doesn't impact the deployment
if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
echo "Skipping the deployment!"
exit 0
fi
+# if the scenario is external, we need to wipe WORKSPACE to place releng-xci there since
+# the project where the scenario is coming from is cloned and the patch checked out to the
+# xci/scenarios/$DEPLOY_SCENARIO to be synched on clean VM
+# apart from that, we need releng-xci stuff in WORKSPACE for things to function correctly on Jenkins.
+# if the change is coming to releng-xci, we don't need to do anything since the patch is checked
+# out to the WORKSPACE anyways
+if [[ $GERRIT_PROJECT != "releng-xci" ]]; then
+ cd $HOME && /bin/rm -rf $WORKSPACE
+ git clone https://gerrit.opnfv.org/gerrit/releng-xci $WORKSPACE && cd $WORKSPACE
+ chmod -R go-rwx $WORKSPACE/xci/scripts/vm
+fi
+
# skip the deployment if the scenario is not supported on this distro
OPNFV_SCENARIO_REQUIREMENTS=$WORKSPACE/xci/opnfv-scenario-requirements.yml
if ! sed -n "/^- scenario: $DEPLOY_SCENARIO$/,/^$/p" $OPNFV_SCENARIO_REQUIREMENTS | grep -q $DISTRO; then
@@ -35,11 +50,14 @@ cd $WORKSPACE
# yourself.
cat > xci_test.sh<<EOF
#!/bin/bash
+set -o pipefail
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 CORE_OPENSTACK_INSTALL=true
+export BIFROST_USE_PREBUILT_IMAGES=true
export CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
export OPNFV_RELENG_DEV_PATH=/home/devuser/releng-xci/
export INSTALLER_TYPE=$INSTALLER_TYPE
@@ -53,7 +71,7 @@ if [[ ! -z ${WORKSPACE+x} && $GERRIT_PROJECT != "releng-xci" ]]; then
fi
cd xci
-./xci-deploy.sh
+./xci-deploy.sh | ts
EOF
chmod a+x xci_test.sh
diff --git a/jjb/xci/xci-verify-jobs.yml b/jjb/xci/xci-verify-jobs.yml
index 7c6871c22..4c9ff9e69 100644
--- a/jjb/xci/xci-verify-jobs.yml
+++ b/jjb/xci/xci-verify-jobs.yml
@@ -67,8 +67,7 @@
blocking-jobs:
- 'xci-verify-{distro}-.*'
- 'xci-.*-{distro}-merge-.*'
- - 'bifrost-verify-{distro}-.*'
- - 'bifrost-periodic-{distro}-.*'
+ - 'openstack-bifrost-verify-{distro}-.*'
- 'xci-osa-verify-{distro}-.*'
- 'xci-osa-periodic-{distro}-.*'
block-level: 'NODE'
@@ -103,7 +102,7 @@
comment-contains-value: 'reverify'
projects:
- project-compare-type: 'ANT'
- project-pattern: '{project}'
+ project-pattern: 'releng-xci'
branches:
- branch-compare-type: 'ANT'
branch-pattern: '**/{branch}'
@@ -111,6 +110,15 @@
forbidden-file-paths:
- compare-type: ANT
pattern: 'xci/scripts/vm/**'
+ - project-compare-type: 'REG_EXP'
+ project-pattern: 'sfc|sdnvpn'
+ branches:
+ - branch-compare-type: 'ANT'
+ branch-pattern: '**/{branch}'
+ disable-strict-forbidden-file-verification: 'true'
+ file-paths:
+ - compare-type: ANT
+ pattern: 'scenarios/**'
readable-message: true
custom-url: '* $JOB_NAME $BUILD_URL'
skip-vote:
@@ -121,12 +129,15 @@
parameters:
- project-parameter:
- project: '{project}'
+ project: $GERRIT_PROJECT
branch: '{branch}'
- label:
name: SLAVE_LABEL
default: 'xci-virtual'
- string:
+ name: DISTRO
+ default: '{distro}'
+ - string:
name: CLEAN_DIB_IMAGES
default: 'true'
- string:
@@ -135,8 +146,11 @@
description: 'Git URL to use on this Jenkins Slave'
builders:
+ - 'xci-verify-set-scenario-macro'
+ - inject:
+ properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
- description-setter:
- description: "Built on $NODE_NAME"
+ description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
- multijob:
name: deploy
condition: SUCCESSFUL
@@ -145,8 +159,8 @@
current-parameters: true
predefined-parameters: |
DISTRO={distro}
- DEPLOY_SCENARIO=os-nosdn-nofeature
CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
+ GERRIT_PROJECT=$GERRIT_PROJECT
GERRIT_BRANCH=$GERRIT_BRANCH
GERRIT_REFSPEC=$GERRIT_REFSPEC
GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
@@ -162,18 +176,27 @@
current-parameters: true
predefined-parameters: |
DISTRO={distro}
- DEPLOY_SCENARIO=os-nosdn-nofeature
CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
- FUNCTEST_MODE=tier
- FUNCTEST_TIER=healthcheck
+ GERRIT_PROJECT=$GERRIT_PROJECT
GERRIT_BRANCH=$GERRIT_BRANCH
GERRIT_REFSPEC=$GERRIT_REFSPEC
GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
+ FUNCTEST_MODE=tier
+ FUNCTEST_TIER=healthcheck
node-parameters: true
kill-phase-on: NEVER
abort-all-job: true
+ publishers:
+ - postbuildscript:
+ script-only-if-succeeded: false
+ script-only-if-failed: false
+ builders:
+ - shell:
+ !include-raw: ./xci-cleanup.sh
+
+
- job-template:
name: 'xci-verify-{distro}-{phase}-{type}-{stream}'
@@ -195,14 +218,11 @@
parameters:
- string:
name: PROJECT
- default: 'releng-xci'
+ default: $GERRIT_PROJECT
- string:
name: DISTRO
default: 'ubuntu'
- string:
- name: DEPLOY_SCENARIO
- default: 'os-nosdn-nofeature'
- - string:
name: FUNCTEST_MODE
default: 'tier'
- string:
@@ -218,14 +238,13 @@
name: OPNFV_RELENG_DEV_PATH
default: $WORKSPACE/
- string:
- name: INSTALLER_TYPE
- default: 'osa'
- - string:
name: GIT_BASE
default: https://gerrit.opnfv.org/gerrit/$PROJECT
description: 'Git URL to use on this Jenkins Slave'
wrappers:
+ - inject:
+ properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
- ssh-agent-wrapper
- build-timeout:
timeout: 240
@@ -236,13 +255,19 @@
builders:
- description-setter:
- description: "Built on $NODE_NAME"
+ description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
- 'xci-verify-{phase}-macro'
# -------------------------------
# builder macros
# -------------------------------
- builder:
+ name: 'xci-verify-set-scenario-macro'
+ builders:
+ - shell:
+ !include-raw: ./xci-set-scenario.sh
+
+- builder:
name: 'xci-verify-deploy-macro'
builders:
- shell:
@@ -255,4 +280,4 @@
name: 'xci-verify-healthcheck-macro'
builders:
- shell:
- !include-raw: ./xci-cleanup.sh
+ !include-raw: ./xci-run-functest.sh