blob: 0c259b96f1dfc5edb6cf33295bae6737c07a8606 [file] [log] [blame]
Hardik Windlass0f9621d2021-02-24 21:23:19 +05301// Copyright 2021-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.
Hardik Windlass0f9621d2021-02-24 21:23:19 +053014// voltha-2.x e2e tests
15// uses bbsim to simulate OLT/ONUs
Hardik Windlass0f9621d2021-02-24 21:23:19 +053016// NOTE we are importing the library even if it's global so that it's
17// easier to change the keywords during a replay
18library identifier: 'cord-jenkins-libraries@master',
19 retriever: modernSCM([
20 $class: 'GitSCMSource',
21 remote: 'https://gerrit.opencord.org/ci-management.git'
22])
Hardik Windlass317ad022022-02-21 11:18:18 +000023
24// fetches the versions/tags of the voltha component
25// returns the deployment version which is one less than the latest available tag of the repo, first voltha stack gets deployed using this;
26// returns the test version which is the latest tag of the repo, the component upgrade gets tested on this.
27// Note: if there is a major version change between deployment and test tags, then deployment tag will be same as test tag, i.e. both as latest.
28def get_voltha_comp_versions(component) {
29 def comp_test_tag = sh (
30 script: "git ls-remote --refs --tags https://github.com/opencord/${component} | cut --delimiter='/' --fields=3 | tr '-' '~' | sort --version-sort | tail --lines=1 | sed 's/v//'",
31 returnStdout: true
32 ).trim()
33 def comp_deploy_tag = sh (
34 script: "git ls-remote --refs --tags https://github.com/opencord/${component} | cut --delimiter='/' --fields=3 | tr '-' '~' | sort --version-sort | tail --lines=2 | head -n 1 | sed 's/v//'",
35 returnStdout: true
36 ).trim()
37 def comp_deploy_major = comp_deploy_tag.substring(0, comp_deploy_tag.indexOf('.'))
38 def comp_test_major = comp_test_tag.substring(0, comp_test_tag.indexOf('.'))
39 if ( "${comp_deploy_major.trim()}" != "${comp_test_major.trim()}") {
40 comp_deploy_tag = comp_test_tag
41 }
42 println "${component}: deploy_tag: ${comp_deploy_tag}, test_tag: ${comp_test_tag}"
43 return [comp_deploy_tag, comp_test_tag]
44}
45
Hardik Windlass0f9621d2021-02-24 21:23:19 +053046def test_software_upgrade(name) {
Hardik Windlass7e4e3152021-09-29 06:42:05 +000047 def infraNamespace = "infra"
48 def volthaNamespace = "voltha"
Hardik Windlass555a0862022-02-23 13:17:54 +053049 def openolt_adapter_deploy_tag = ""
50 def openolt_adapter_test_tag = ""
51 def openonu_adapter_deploy_tag = ""
52 def openonu_adapter_test_tag = ""
53 def rw_core_deploy_tag = ""
54 def rw_core_test_tag = ""
55 def ofagent_deploy_tag = ""
56 def ofagent_test_tag = ""
Hardik Windlassdad8e5c2021-11-11 05:19:47 +000057 def logsDir = "$WORKSPACE/${name}"
Hardik Windlass0f9621d2021-02-24 21:23:19 +053058 stage('Deploy Voltha - '+ name) {
Matteo Scandolo4b040342021-10-08 14:26:06 -070059 timeout(10) {
Hardik Windlasscb955822021-10-21 14:59:11 +000060 // start logging
61 sh """
Hardik Windlassdad8e5c2021-11-11 05:19:47 +000062 rm -rf ${logsDir} || true
63 mkdir -p ${logsDir}
64 _TAG=kail-${name} kail -n ${infraNamespace} -n ${volthaNamespace} > ${logsDir}/onos-voltha-startup-combined.log &
Hardik Windlasscb955822021-10-21 14:59:11 +000065 """
Andrea Campanella9e41a602021-09-14 14:45:11 +020066 def extraHelmFlags = extraHelmFlags.trim()
Hardik Windlass1bb96a32022-01-19 10:10:08 +000067 if ("${name}" == "onos-app-upgrade" || "${name}" == "onu-software-upgrade" || "${name}" == "voltha-component-upgrade" || "${name}" == "voltha-component-rolling-upgrade") {
Andrea Campanella0442dd02021-12-30 15:44:34 +010068 extraHelmFlags = " --set global.log_level=${logLevel.toUpperCase()},onu=1,pon=1 --set onos-classic.replicas=3,onos-classic.atomix.replicas=3 " + extraHelmFlags
TorstenThiemecf20f4b2021-11-12 13:38:26 +000069 }
70 if ("${name}" == "onu-image-dwl-simultaneously") {
Andrea Campanella0442dd02021-12-30 15:44:34 +010071 extraHelmFlags = " --set global.log_level=${logLevel.toUpperCase()},onu=2,pon=2 --set onos-classic.replicas=3,onos-classic.atomix.replicas=3 " + extraHelmFlags
TorstenThiemecf20f4b2021-11-12 13:38:26 +000072 }
73 if ("${name}" == "onos-app-upgrade" || "${name}" == "onu-software-upgrade" || "${name}" == "onu-image-dwl-simultaneously") {
Andrea Campanella0442dd02021-12-30 15:44:34 +010074 extraHelmFlags = " --set global.image_tag=master --set onos-classic.image.tag=master " + extraHelmFlags
Hardik Windlassd87caad2021-05-06 06:55:09 +000075 }
Hardik Windlass1bb96a32022-01-19 10:10:08 +000076 if ("${name}" == "voltha-component-upgrade" || "${name}" == "voltha-component-rolling-upgrade") {
Andrea Campanella0442dd02021-12-30 15:44:34 +010077 extraHelmFlags = " --set images.onos_config_loader.tag=master-onos-config-loader --set onos-classic.image.tag=master " + extraHelmFlags
Hardik Windlassff97f652021-03-18 15:11:13 +053078 }
Andrea Campanella834f27b2021-06-08 17:08:41 +020079 extraHelmFlags = extraHelmFlags + " --set onos-classic.onosSshPort=30115 --set onos-classic.onosApiPort=30120 "
80 extraHelmFlags = extraHelmFlags + " --set voltha.onos_classic.replicas=3"
Andrea Campanella5764e182021-03-18 14:17:59 +010081 //ONOS custom image handling
82 if ( onosImg.trim() != '' ) {
83 String[] split;
84 onosImg = onosImg.trim()
85 split = onosImg.split(':')
Andrea Campanella0442dd02021-12-30 15:44:34 +010086 extraHelmFlags = extraHelmFlags + " --set onos-classic.image.repository=" + split[0] +",onos-classic.image.tag=" + split[1] + " "
Andrea Campanella5764e182021-03-18 14:17:59 +010087 }
TorstenThiemecf20f4b2021-11-12 13:38:26 +000088 def olts = 1
89 if ("${name}" == "onu-image-dwl-simultaneously") {
90 olts = 2
91 }
Hardik Windlass317ad022022-02-21 11:18:18 +000092 if ("${name}" == "voltha-component-upgrade" || "${name}" == "voltha-component-rolling-upgrade") {
93 // fetch voltha components versions/tags
94 (openolt_adapter_deploy_tag, openolt_adapter_test_tag) = get_voltha_comp_versions("voltha-openolt-adapter")
95 extraHelmFlags = extraHelmFlags + " --set voltha-adapter-openolt.images.adapter_open_olt.tag=${openolt_adapter_deploy_tag} "
96 (openonu_adapter_deploy_tag, openonu_adapter_test_tag) = get_voltha_comp_versions("voltha-openonu-adapter-go")
97 extraHelmFlags = extraHelmFlags + " --set voltha-adapter-openonu.images.adapter_open_onu_go.tag=${openonu_adapter_deploy_tag} "
98 (rw_core_deploy_tag, rw_core_test_tag) = get_voltha_comp_versions("voltha-go")
99 extraHelmFlags = extraHelmFlags + " --set voltha.images.rw_core.tag=${rw_core_deploy_tag} "
100 (ofagent_deploy_tag, ofagent_test_tag) = get_voltha_comp_versions("ofagent-go")
101 extraHelmFlags = extraHelmFlags + " --set voltha.images.ofagent.tag=${ofagent_deploy_tag} "
102 }
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530103 def localCharts = false
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530104 // Currently only testing with ATT workflow
105 // TODO: Support for other workflows
TorstenThiemecf20f4b2021-11-12 13:38:26 +0000106 volthaDeploy([bbsimReplica: olts.toInteger(), workflow: "att", extraHelmFlags: extraHelmFlags, localCharts: localCharts])
Hardik Windlasscb955822021-10-21 14:59:11 +0000107 // stop logging
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530108 sh """
Hardik Windlasscb955822021-10-21 14:59:11 +0000109 P_IDS="\$(ps e -ww -A | grep "_TAG=kail-${name}" | grep -v grep | awk '{print \$1}')"
110 if [ -n "\$P_IDS" ]; then
111 echo \$P_IDS
112 for P_ID in \$P_IDS; do
113 kill -9 \$P_ID
114 done
115 fi
Hardik Windlassdad8e5c2021-11-11 05:19:47 +0000116 cd ${logsDir}
Hardik Windlasscb955822021-10-21 14:59:11 +0000117 gzip -k onos-voltha-startup-combined.log
118 rm onos-voltha-startup-combined.log
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530119 """
120 // forward ONOS and VOLTHA ports
121 sh """
Andrea Campanella1b7c0942021-09-14 11:02:58 +0200122 JENKINS_NODE_COOKIE="dontKillMe" _TAG=onos-port-forward /bin/bash -c "while true; do kubectl -n infra port-forward --address 0.0.0.0 service/voltha-infra-onos-classic-hs 8101:8101; done 2>&1 " &
123 JENKINS_NODE_COOKIE="dontKillMe" _TAG=onos-port-forward /bin/bash -c "while true; do kubectl -n infra port-forward --address 0.0.0.0 service/voltha-infra-onos-classic-hs 8181:8181; done 2>&1 " &
124 JENKINS_NODE_COOKIE="dontKillMe" _TAG=port-forward-voltha-api /bin/bash -c "while true; do kubectl -n voltha port-forward --address 0.0.0.0 service/voltha-voltha-api 55555:55555; done 2>&1 " &
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530125 """
Andrea Campanella9eeb4e72021-03-19 10:00:43 +0100126 sh """
127 sshpass -e ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 log:set DEBUG org.opencord
128 """
Matteo Scandolo4b040342021-10-08 14:26:06 -0700129 }
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530130 }
131 stage('Test - '+ name) {
Hardik Windlassc87dbce2022-01-28 10:13:20 +0000132 timeout(75) {
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530133 sh """
Hardik Windlass25c8ddb2021-03-05 20:26:16 +0530134 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/${name}"
135 mkdir -p \$ROBOT_LOGS_DIR
136 if [[ ${name} == 'onos-app-upgrade' ]]; then
137 export ONOS_APPS_UNDER_TEST+=''
Hardik Windlassb360f6e2021-03-09 17:46:21 +0530138 if [ ${aaaVer.trim()} != '' ] && [ ${aaaOarUrl.trim()} != '' ]; then
Hardik Windlass98506e72021-03-09 14:29:17 +0530139 ONOS_APPS_UNDER_TEST+="org.opencord.aaa,${aaaVer.trim()},${aaaOarUrl.trim()}*"
140 fi
Hardik Windlassb360f6e2021-03-09 17:46:21 +0530141 if [ ${oltVer.trim()} != '' ] && [ ${oltOarUrl.trim()} != '' ]; then
Hardik Windlass98506e72021-03-09 14:29:17 +0530142 ONOS_APPS_UNDER_TEST+="org.opencord.olt,${oltVer.trim()},${oltOarUrl.trim()}*"
143 fi
Hardik Windlassb360f6e2021-03-09 17:46:21 +0530144 if [ ${dhcpl2relayVer.trim()} != '' ] && [ ${dhcpl2relayOarUrl.trim()} != '' ]; then
Hardik Windlass98506e72021-03-09 14:29:17 +0530145 ONOS_APPS_UNDER_TEST+="org.opencord.dhcpl2relay,${dhcpl2relayVer.trim()},${dhcpl2relayOarUrl.trim()}*"
146 fi
Hardik Windlassb360f6e2021-03-09 17:46:21 +0530147 if [ ${igmpproxyVer.trim()} != '' ] && [ ${igmpproxyOarUrl.trim()} != '' ]; then
Hardik Windlass98506e72021-03-09 14:29:17 +0530148 ONOS_APPS_UNDER_TEST+="org.opencord.igmpproxy,${igmpproxyVer.trim()},${igmpproxyOarUrl.trim()}*"
149 fi
Hardik Windlassb360f6e2021-03-09 17:46:21 +0530150 if [ ${sadisVer.trim()} != '' ] && [ ${sadisOarUrl.trim()} != '' ]; then
Hardik Windlass98506e72021-03-09 14:29:17 +0530151 ONOS_APPS_UNDER_TEST+="org.opencord.sadis,${sadisVer.trim()},${sadisOarUrl.trim()}*"
152 fi
Hardik Windlassb360f6e2021-03-09 17:46:21 +0530153 if [ ${mcastVer.trim()} != '' ] && [ ${mcastOarUrl.trim()} != '' ]; then
Hardik Windlass98506e72021-03-09 14:29:17 +0530154 ONOS_APPS_UNDER_TEST+="org.opencord.mcast,${mcastVer.trim()},${mcastOarUrl.trim()}*"
155 fi
Hardik Windlassb360f6e2021-03-09 17:46:21 +0530156 if [ ${kafkaVer.trim()} != '' ] && [ ${kafkaOarUrl.trim()} != '' ]; then
Hardik Windlass98506e72021-03-09 14:29:17 +0530157 ONOS_APPS_UNDER_TEST+="org.opencord.kafka,${kafkaVer.trim()},${kafkaOarUrl.trim()}*"
Hardik Windlass25c8ddb2021-03-05 20:26:16 +0530158 fi
159 export ROBOT_MISC_ARGS="-d \$ROBOT_LOGS_DIR -v onos_apps_under_test:\$ONOS_APPS_UNDER_TEST -e PowerSwitch"
160 export TARGET=onos-app-upgrade-test
161 fi
Hardik Windlass1bb96a32022-01-19 10:10:08 +0000162 if [ ${name} == 'voltha-component-upgrade' ] || [ ${name} == 'voltha-component-rolling-upgrade' ]; then
Hardik Windlass25c8ddb2021-03-05 20:26:16 +0530163 export VOLTHA_COMPS_UNDER_TEST+=''
Hardik Windlass317ad022022-02-21 11:18:18 +0000164 VOLTHA_COMPS_UNDER_TEST+="adapter-open-olt,adapter-open-olt,voltha/voltha-openolt-adapter:${openolt_adapter_test_tag}*"
165 VOLTHA_COMPS_UNDER_TEST+="adapter-open-onu,adapter-open-onu,voltha/voltha-openonu-adapter-go:${openonu_adapter_test_tag}*"
166 VOLTHA_COMPS_UNDER_TEST+="rw-core,voltha,voltha/voltha-rw-core:${rw_core_test_tag}*"
167 VOLTHA_COMPS_UNDER_TEST+="ofagent,ofagent,voltha/voltha-ofagent-go:${ofagent_test_tag}*"
Hardik Windlass25c8ddb2021-03-05 20:26:16 +0530168 export ROBOT_MISC_ARGS="-d \$ROBOT_LOGS_DIR -v voltha_comps_under_test:\$VOLTHA_COMPS_UNDER_TEST -e PowerSwitch"
Hardik Windlass1bb96a32022-01-19 10:10:08 +0000169 fi
170 if [[ ${name} == 'voltha-component-upgrade' ]]; then
Hardik Windlass25c8ddb2021-03-05 20:26:16 +0530171 export TARGET=voltha-comp-upgrade-test
172 fi
Hardik Windlass1bb96a32022-01-19 10:10:08 +0000173 if [[ ${name} == 'voltha-component-rolling-upgrade' ]]; then
174 export TARGET=voltha-comp-rolling-upgrade-test
175 fi
Hardik Windlass834afbb2021-03-23 11:48:15 +0530176 if [[ ${name} == 'onu-software-upgrade' ]]; then
Hardik Windlass88814542021-06-22 09:43:46 +0000177 export ROBOT_MISC_ARGS="-d \$ROBOT_LOGS_DIR -v image_version:${onuImageVersion.trim()} -v image_url:${onuImageUrl.trim()} -v image_vendor:${onuImageVendor.trim()} -v image_activate_on_success:${onuImageActivateOnSuccess.trim()} -v image_commit_on_success:${onuImageCommitOnSuccess.trim()} -v image_crc:${onuImageCrc.trim()} -e PowerSwitch"
Hardik Windlass834afbb2021-03-23 11:48:15 +0530178 export TARGET=onu-upgrade-test
179 fi
TorstenThiemecf20f4b2021-11-12 13:38:26 +0000180 if [[ ${name} == 'onu-image-dwl-simultaneously' ]]; then
181 export ROBOT_MISC_ARGS="-d \$ROBOT_LOGS_DIR -v image_version:${onuImageVersion.trim()} -v image_url:${onuImageUrl.trim()} -v image_vendor:${onuImageVendor.trim()} -v image_activate_on_success:${onuImageActivateOnSuccess.trim()} -v image_commit_on_success:${onuImageCommitOnSuccess.trim()} -v image_crc:${onuImageCrc.trim()} -e PowerSwitch"
182 export TARGET=onu-upgrade-test-multiolt-kind-att
183 fi
Hardik Windlass85491a02021-10-21 17:14:37 +0000184 testLogging='False'
Hardik Windlasscb955822021-10-21 14:59:11 +0000185 if [ ${logging} = true ]; then
Hardik Windlass85491a02021-10-21 17:14:37 +0000186 testLogging='True'
Hardik Windlasscb955822021-10-21 14:59:11 +0000187 fi
Hardik Windlass25c8ddb2021-03-05 20:26:16 +0530188 export VOLTCONFIG=$HOME/.volt/config-minimal
189 export KUBECONFIG=$HOME/.kube/kind-config-voltha-minimal
Hardik Windlassdad8e5c2021-11-11 05:19:47 +0000190 ROBOT_MISC_ARGS+=" -v ONOS_SSH_PORT:30115 -v ONOS_REST_PORT:30120 -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace} -v container_log_dir:${logsDir} -v logging:\$testLogging"
Hardik Windlass25c8ddb2021-03-05 20:26:16 +0530191 # Run the specified tests
192 make -C $WORKSPACE/voltha-system-tests \$TARGET || true
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530193 """
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530194 // remove port-forwarding
195 sh """
196 # remove orphaned port-forward from different namespaces
Andrea Campanella4c8af942021-05-12 10:12:13 +0200197 ps aux | grep port-forw | grep -v grep | awk '{print \$2}' | xargs --no-run-if-empty kill -9 || true
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530198 """
199 // collect pod details
Hardik Windlass428f5132021-03-15 12:17:47 +0530200 get_pods_info("$WORKSPACE/${name}")
Hardik Windlassdad8e5c2021-11-11 05:19:47 +0000201 sh """
202 set +e
203 # collect logs collected in the Robot Framework StartLogging keyword
204 cd ${logsDir}
205 gzip *-combined.log || true
206 rm *-combined.log || true
207 """
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530208 helmTeardown(['infra', 'voltha'])
Matteo Scandolo4b040342021-10-08 14:26:06 -0700209 }
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530210 }
211}
Hardik Windlass428f5132021-03-15 12:17:47 +0530212def get_pods_info(dest) {
213 // collect pod details, this is here in case of failure
214 sh """
Hardik Windlass3db9adf2021-03-25 15:49:45 +0530215 mkdir -p ${dest} || true
Hardik Windlass428f5132021-03-15 12:17:47 +0530216 kubectl get pods --all-namespaces -o wide > ${dest}/pods.txt || true
217 kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq | tee ${dest}/pod-images.txt || true
218 kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq | tee ${dest}/pod-imagesId.txt || true
Andrea Campanellaea2379a2021-03-22 13:56:26 +0100219 kubectl describe pods --all-namespaces -l app.kubernetes.io/part-of=voltha > ${dest}/voltha-pods-describe.txt
220 kubectl describe pods -n infra -l app=onos-classic > ${dest}/onos-pods-describe.txt
Hardik Windlass428f5132021-03-15 12:17:47 +0530221 helm ls --all-namespaces > ${dest}/helm-charts.txt
222 """
Andrea Campanella5764e182021-03-18 14:17:59 +0100223 sh '''
224 # copy the ONOS logs directly from the container to avoid the color codes
Andrea Campanella188e50d2022-01-14 11:30:05 +0100225 printf '%s\\n' $(kubectl get pods -n infra -l app=onos-classic -o=jsonpath="{.items[*]['metadata.name']}") | xargs --no-run-if-empty -I# bash -c 'kubectl -n infra cp #:apache-karaf-4.2.14/data/log/karaf.log ''' + dest + '''/#.log' || true
Andrea Campanella5764e182021-03-18 14:17:59 +0100226 '''
Hardik Windlass428f5132021-03-15 12:17:47 +0530227}
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530228pipeline {
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530229 /* no label, executor is determined by JJB */
230 agent {
231 label "${params.buildNode}"
232 }
233 options {
Hardik Windlassc87dbce2022-01-28 10:13:20 +0000234 timeout(time: 150, unit: 'MINUTES')
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530235 }
236 environment {
237 PATH="$PATH:$WORKSPACE/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
Hardik Windlass25c8ddb2021-03-05 20:26:16 +0530238 KUBECONFIG="$HOME/.kube/kind-config-voltha-minimal"
Andrea Campanella9eeb4e72021-03-19 10:00:43 +0100239 SSHPASS="karaf"
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530240 }
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530241 stages{
242 stage('Download Code') {
243 steps {
244 getVolthaCode([
245 branch: "${branch}",
246 volthaSystemTestsChange: "${volthaSystemTestsChange}",
247 volthaHelmChartsChange: "${volthaHelmChartsChange}",
248 ])
249 }
250 }
Hardik Windlass834afbb2021-03-23 11:48:15 +0530251 stage('Cleanup') {
252 steps {
253 // remove port-forwarding
254 sh """
255 # remove orphaned port-forward from different namespaces
Andrea Campanella4c8af942021-05-12 10:12:13 +0200256 ps aux | grep port-forw | grep -v grep | awk '{print \$2}' | xargs --no-run-if-empty kill -9 || true
Hardik Windlass834afbb2021-03-23 11:48:15 +0530257 """
258 helmTeardown(['infra', 'voltha'])
259 }
260 }
Hardik Windlass9f5bee12021-05-07 06:47:21 +0000261 stage('Create K8s Cluster') {
262 steps {
263 createKubernetesCluster([nodes: 3])
264 }
265 }
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530266 stage('Run Test') {
267 steps {
268 test_software_upgrade("onos-app-upgrade")
269 test_software_upgrade("voltha-component-upgrade")
Hardik Windlass1bb96a32022-01-19 10:10:08 +0000270 test_software_upgrade("voltha-component-rolling-upgrade")
Hardik Windlass834afbb2021-03-23 11:48:15 +0530271 test_software_upgrade("onu-software-upgrade")
TorstenThiemecf20f4b2021-11-12 13:38:26 +0000272 test_software_upgrade("onu-image-dwl-simultaneously")
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530273 }
274 }
275 }
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530276 post {
Hardik Windlass428f5132021-03-15 12:17:47 +0530277 aborted {
278 get_pods_info("$WORKSPACE/failed")
279 }
280 failure {
281 get_pods_info("$WORKSPACE/failed")
282 }
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530283 always {
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530284 step([$class: 'RobotPublisher',
285 disableArchiveOutput: false,
286 logFileName: 'RobotLogs/*/log*.html',
287 otherFiles: '',
288 outputFileName: 'RobotLogs/*/output*.xml',
289 outputPath: '.',
290 passThreshold: 100,
291 reportFileName: 'RobotLogs/*/report*.html',
Andrea Campanellaabc09772021-06-16 12:08:57 +0200292 unstableThreshold: 0,
293 onlyCritical: true]);
Hardik Windlass428f5132021-03-15 12:17:47 +0530294 archiveArtifacts artifacts: '*.log,**/*.log,**/*.gz,*.gz,*.txt,**/*.txt'
Hardik Windlass0f9621d2021-02-24 21:23:19 +0530295 }
296 }
297}