blob: e684f549226b6fe069cc8bf6f9a8660aac50c4f4 [file] [log] [blame]
Suchitra Vemuribaed17e2019-08-30 15:22:09 -07001// Copyright 2017-present Open Networking Foundation
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15node ("${TestNodeName}") {
16 timeout (200) {
17 try {
18 stage ("Parse deployment configuration file") {
19 sh returnStdout: true, script: "rm -rf ${configBaseDir}"
20 sh returnStdout: true, script: "git clone -b ${branch} ${cordRepoUrl}/${configBaseDir}"
21 deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml"
22 }
23 stage('Download Test repos') {
24 timeout(2) {
25 sh returnStdout: true, script: """
26 rm -rf helm-charts cord-tester voltha
27 git clone -b ${branch} ${cordRepoUrl}/helm-charts
28 git clone -b ${branch} ${cordRepoUrl}/cord-tester
29 git clone -b ${branch} ${cordRepoUrl}/voltha-system-tests
30 git clone -b ${branch} ${cordRepoUrl}/voltha
31 """
32 }
33 }
34 stage('Subscriber Validation and Ping Tests') {
35 timeout(180) {
36 sh """
37 export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
38 cd $WORKSPACE/voltha-system-tests/tests
39 robot --removekeywords wuks -d Log -T -l Voltha_PODTests -V $WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} Voltha_PODTests.robot || true
40 """
41 }
42 }
43 stage('Publish test results') {
44 sh returnStdout: true, script: """
45 if [ -d RobotLogs ]; then rm -r RobotLogs; fi; mkdir RobotLogs;
46 mkdir RobotLogs/TestDoc || true
47 cp -r $WORKSPACE/voltha-system-tests/tests/Log/* $WORKSPACE/RobotLogs || true
48 """
49 step([$class: 'RobotPublisher',
50 disableArchiveOutput: false,
51 logFileName: 'RobotLogs/log*.html',
52 otherFiles: '',
53 outputFileName: 'RobotLogs/output*.xml',
54 outputPath: '.',
55 passThreshold: 100,
56 reportFileName: 'RobotLogs/report*.html',
57 unstableThreshold: 0
58 ])
59 }
60 currentBuild.result = 'SUCCESS'
61 } catch (err) {
62 currentBuild.result = 'FAILURE'
63 step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false])
64 }
65 echo "RESULT: ${currentBuild.result}"
66 }
67}