From 41a2d0c59d27d75f124e168bc2acca0e91ab16f4 Mon Sep 17 00:00:00 2001 From: eprasad Date: Thu, 21 Jan 2021 08:39:32 +0000 Subject: [PATCH] Add support for ONAP testing in release jobs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This change request adds support for ONAP testing in release jobs. - xTesting framework is used for executing tests 
 - Healthcheck and Infra-healthcheck testsuites added Signed-off-by: eprasad Change-Id: I04ba63addcf952f8ef9a57b329754e7e8a57bb5f Signed-off-by: eprasad --- jjb/cloud-infra/engine-macros.yaml | 12 ++ .../onap-jobs/onap-release-deploy-test.yaml | 114 +++++++++++++++--- .../scripts/xtesting-healthcheck.sh | 39 ++++++ .../scripts/xtesting-infra-healthcheck.sh | 39 ++++++ 4 files changed, 187 insertions(+), 17 deletions(-) create mode 100755 jjb/cloud-infra/scripts/xtesting-healthcheck.sh create mode 100755 jjb/cloud-infra/scripts/xtesting-infra-healthcheck.sh diff --git a/jjb/cloud-infra/engine-macros.yaml b/jjb/cloud-infra/engine-macros.yaml index 4218645e..8a37b942 100644 --- a/jjb/cloud-infra/engine-macros.yaml +++ b/jjb/cloud-infra/engine-macros.yaml @@ -133,3 +133,15 @@ builders: - shell: !include-raw: ./scripts/promote.sh + +- builder: + name: 'xtesting-infra-healthcheck-macro' + builders: + - shell: + !include-raw: ./scripts/xtesting-infra-healthcheck.sh + +- builder: + name: 'xtesting-healthcheck-macro' + builders: + - shell: + !include-raw: ./scripts/xtesting-healthcheck.sh diff --git a/jjb/cloud-infra/onap-jobs/onap-release-deploy-test.yaml b/jjb/cloud-infra/onap-jobs/onap-release-deploy-test.yaml index f0f95d1a..ffc0d9e4 100644 --- a/jjb/cloud-infra/onap-jobs/onap-release-deploy-test.yaml +++ b/jjb/cloud-infra/onap-jobs/onap-release-deploy-test.yaml @@ -44,9 +44,10 @@ - offline: disabled: false execution-mode: offline-deployment - # just deploy phase for now and ONAP testing isn't defined yet + phase: - deploy + - test type: @@ -67,6 +68,8 @@ - 'onap-release-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}' - 'onap-release-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}' - 'onap-release-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}' + - 'onap-release-{environment-type}-xtesting-infra-healthcheck-{distro}-{cloud}-{type}-{stream}' + - 'onap-release-{environment-type}-xtesting-healthcheck-{distro}-{cloud}-{type}-{stream}' - job-template: name: 'onap-release-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}' @@ -126,22 +129,6 @@ name: USE_PREBUILT_DEPLOYMENT_IMAGE default: 'true' description: 'Use prebuilt deployment image while running as part of CI/CD' - - string: - name: TEST_REPO_URL - default: 'https://gerrit.nordix.org/infra/test.git' - description: 'URL to clone the test repo from' - - string: - name: TEST_FW - default: 'functest' - description: 'Test framework to use' - - string: - name: TEST_SUITE - default: 'healthcheck' - description: 'Test suite to run' - - string: - name: YARDSTICK_DISPATCHER - default: 'file' - description: 'Dispatcher to use for Yardstick reporting' - string: name: DELETE_STACK default: 'false' @@ -233,6 +220,22 @@ node-parameters: true kill-phase-on: FAILURE abort-all-job: false + - multijob: + name: xTesting for infra-healthcheck and healthcheck + condition: ALWAYS + projects: + - name: 'onap-release-{environment-type}-xtesting-infra-healthcheck-{distro}-{cloud}-{type}-{stream}' + current-parameters: true + git-revision: true + node-parameters: true + kill-phase-on: FAILURE + abort-all-job: false + - name: 'onap-release-{environment-type}-xtesting-healthcheck-{distro}-{cloud}-{type}-{stream}' + current-parameters: true + git-revision: true + node-parameters: true + kill-phase-on: FAILURE + abort-all-job: false publishers: - postbuildscript: builders: @@ -313,3 +316,80 @@ - 'wait-pkg-mgr-macro' - 'download-deploy-artifact-macro' - 'deploy-macro' + +- job-template: + name: 'onap-release-{environment-type}-xtesting-infra-healthcheck-{distro}-{cloud}-{type}-{stream}' + + disabled: '{obj:disabled}' + + parameters: + - string: + name: EXECUTION_MODE + default: '{execution-mode}' + description: 'Execution mode' + - string: + name: TEST_REPO_URL + default: 'https://gerrit.nordix.org/infra/test.git' + description: 'URL to clone the test repo from' + - string: + name: TEST_FW + default: 'xtesting' + description: 'Test framework to use' + - string: + name: TEST_SUITE + default: 'infra-healthcheck' + description: 'Test suite to run' + + + properties: + - logrotate + - throttle: + max-per-node: 1 + max-total: 3 + option: project + wrappers: + - build-timeout: + timeout: 600 + - mask-passwords + - fix-workspace-permissions + + builders: + - 'xtesting-infra-healthcheck-macro' + +- job-template: + name: 'onap-release-{environment-type}-xtesting-healthcheck-{distro}-{cloud}-{type}-{stream}' + + disabled: '{obj:disabled}' + + parameters: + - string: + name: EXECUTION_MODE + default: '{execution-mode}' + description: 'Execution mode' + - string: + name: TEST_REPO_URL + default: 'https://gerrit.nordix.org/infra/test.git' + description: 'URL to clone the test repo from' + - string: + name: TEST_FW + default: 'xtesting' + description: 'Test framework to use' + - string: + name: TEST_SUITE + default: 'healthcheck' + description: 'Test suite to run' + + properties: + - logrotate + - throttle: + max-per-node: 1 + max-total: 3 + option: project + wrappers: + - build-timeout: + timeout: 600 + - mask-passwords + - fix-workspace-permissions + + builders: + - 'xtesting-healthcheck-macro' diff --git a/jjb/cloud-infra/scripts/xtesting-healthcheck.sh b/jjb/cloud-infra/scripts/xtesting-healthcheck.sh new file mode 100755 index 00000000..a85c3a75 --- /dev/null +++ b/jjb/cloud-infra/scripts/xtesting-healthcheck.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# ============LICENSE_START======================================================= +# Copyright (C) 2021 The Nordix Foundation. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +set -o errexit +set -o pipefail + +echo "Info : Cloning infra/test repository" +cd $HOME && /bin/rm -rf $WORKSPACE +git clone -q $TEST_REPO_URL $WORKSPACE + +# NOTE (eprasad): we need to override execution mode variable coming from change.properties file +if [[ "$CI_LOOP" != "release" ]]; then + export EXECUTION_MODE=$(echo "$EXECUTION_MODE" | sed 's/deployment/test/g') +else + export EXECUTION_MODE=online-test +fi + +cd $WORKSPACE/test +./test.sh -s "$STACK_TYPE" -b "$BRANCH" -c "$DEPLOY_SCENARIO" -f "$TEST_FW" -t "$TEST_SUITE" \ + -o /tmp/openrc -i /tmp/inventory.ini -y -v + +# vim: set ts=2 sw=2 expandtab: diff --git a/jjb/cloud-infra/scripts/xtesting-infra-healthcheck.sh b/jjb/cloud-infra/scripts/xtesting-infra-healthcheck.sh new file mode 100755 index 00000000..a85c3a75 --- /dev/null +++ b/jjb/cloud-infra/scripts/xtesting-infra-healthcheck.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# ============LICENSE_START======================================================= +# Copyright (C) 2021 The Nordix Foundation. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +set -o errexit +set -o pipefail + +echo "Info : Cloning infra/test repository" +cd $HOME && /bin/rm -rf $WORKSPACE +git clone -q $TEST_REPO_URL $WORKSPACE + +# NOTE (eprasad): we need to override execution mode variable coming from change.properties file +if [[ "$CI_LOOP" != "release" ]]; then + export EXECUTION_MODE=$(echo "$EXECUTION_MODE" | sed 's/deployment/test/g') +else + export EXECUTION_MODE=online-test +fi + +cd $WORKSPACE/test +./test.sh -s "$STACK_TYPE" -b "$BRANCH" -c "$DEPLOY_SCENARIO" -f "$TEST_FW" -t "$TEST_SUITE" \ + -o /tmp/openrc -i /tmp/inventory.ini -y -v + +# vim: set ts=2 sw=2 expandtab: -- 2.25.1