blob: e1c1f48676f424802a0f3a60f55c497622c02d18 [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: """
Suchitra Vemurib9945942019-09-11 15:39:02 -070026 rm -rf helm-charts cord-tester voltha voltha-system-tests
Suchitra Vemuribaed17e2019-08-30 15:22:09 -070027 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
Suchitra Vemurib9945942019-09-11 15:39:02 -070038 export VOLTCONFIG=/home/cord/.volt/config
Suchitra Vemuribaed17e2019-08-30 15:22:09 -070039 cd $WORKSPACE/voltha-system-tests/tests
Suchitra Vemurib9945942019-09-11 15:39:02 -070040 robot --removekeywords wuks -d Log -V $WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} Voltha_PODTests.robot || true
Suchitra Vemuribaed17e2019-08-30 15:22:09 -070041 """
42 }
43 }
44 stage('Publish test results') {
45 sh returnStdout: true, script: """
46 if [ -d RobotLogs ]; then rm -r RobotLogs; fi; mkdir RobotLogs;
47 mkdir RobotLogs/TestDoc || true
48 cp -r $WORKSPACE/voltha-system-tests/tests/Log/* $WORKSPACE/RobotLogs || true
49 """
50 step([$class: 'RobotPublisher',
51 disableArchiveOutput: false,
52 logFileName: 'RobotLogs/log*.html',
53 otherFiles: '',
54 outputFileName: 'RobotLogs/output*.xml',
55 outputPath: '.',
56 passThreshold: 100,
57 reportFileName: 'RobotLogs/report*.html',
58 unstableThreshold: 0
59 ])
60 }
61 currentBuild.result = 'SUCCESS'
62 } catch (err) {
63 currentBuild.result = 'FAILURE'
64 step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false])
65 }
66 echo "RESULT: ${currentBuild.result}"
67 }
68}