blob: 9d990a17848300723ce38b2fc675bf4c7380442c [file] [log] [blame]
TorstenThieme326e7972021-01-19 14:27:59 +00001// 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
15// voltha-2.x e2e tests
16// uses kind-voltha to deploy voltha-2.X
17// uses bbsim to simulate OLT/ONUs
18
19pipeline {
20
21 /* no label, executor is determined by JJB */
22 agent {
23 label "${params.buildNode}"
24 }
25 options {
TorstenThieme685b89b2021-01-28 12:59:23 +000026 timeout(time: 130, unit: 'MINUTES')
TorstenThieme326e7972021-01-19 14:27:59 +000027 }
28 environment {
29 KUBECONFIG="$HOME/.kube/kind-config-voltha-minimal"
30 VOLTCONFIG="$HOME/.volt/config-minimal"
31 PATH="$PATH:$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
32 NAME="minimal"
33 FANCY=0
34 WITH_SIM_ADAPTERS="no"
35 WITH_RADIUS="yes"
36 WITH_BBSIM="yes"
37 DEPLOY_K8S="yes"
38 VOLTHA_LOG_LEVEL="DEBUG"
39 CONFIG_SADIS="external"
40 BBSIM_CFG="configs/bbsim-sadis-att.yaml"
41 ROBOT_MISC_ARGS="-e PowerSwitch ${params.extraRobotArgs}"
42 KARAF_HOME="${params.karafHome}"
43 DIAGS_PROFILE="VOLTHA_PROFILE"
44 NUM_OF_BBSIM="${olts}"
45 }
46 stages {
47 stage('Clone kind-voltha') {
48 steps {
49 checkout([
50 $class: 'GitSCM',
51 userRemoteConfigs: [[
52 url: "https://gerrit.opencord.org/kind-voltha",
53 // refspec: "${kindVolthaChange}"
54 ]],
55 branches: [[ name: "master", ]],
56 extensions: [
57 [$class: 'WipeWorkspace'],
58 [$class: 'RelativeTargetDirectory', relativeTargetDir: "kind-voltha"],
59 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
60 ],
61 ])
62 }
63 }
64 stage('Cleanup') {
65 steps {
Matteo Scandoloe4abf852021-05-18 09:12:11 -070066 timeout(time: 10, unit: 'MINUTES') {
67 sh """
68 if [ "${branch}" != "master" ]; then
69 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
70 source "$WORKSPACE/kind-voltha/releases/${branch}"
71 else
72 echo "on master, using default settings for kind-voltha"
73 fi
74 cd $WORKSPACE/kind-voltha/
75 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down || ./voltha down
76 """
77 }
TorstenThieme326e7972021-01-19 14:27:59 +000078 }
79 }
80 stage('Clone voltha-system-tests') {
81 steps {
82 checkout([
83 $class: 'GitSCM',
84 userRemoteConfigs: [[
85 url: "https://gerrit.opencord.org/voltha-system-tests",
86 // refspec: "${volthaSystemTestsChange}"
87 ]],
88 branches: [[ name: "${branch}", ]],
89 extensions: [
90 [$class: 'WipeWorkspace'],
91 [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"],
92 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
93 ],
94 ])
95 }
96 }
97
98 stage('Deploy Voltha') {
99 steps {
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700100 timeout(time: 10, unit: 'MINUTES') {
101 sh """
102 export EXTRA_HELM_FLAGS=""
103 if [ "${branch}" != "master" ]; then
104 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
105 source "$WORKSPACE/kind-voltha/releases/${branch}"
106 else
107 echo "on master, using default settings for kind-voltha"
108 fi
TorstenThieme326e7972021-01-19 14:27:59 +0000109
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700110 EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${params.extraHelmFlags} --set defaults.image_registry=mirror.registry.opennetworking.org/ "
TorstenThieme326e7972021-01-19 14:27:59 +0000111
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700112 cd $WORKSPACE/kind-voltha/
113 ./voltha up
114 bash <( curl -sfL https://raw.githubusercontent.com/boz/kail/master/godownloader.sh) -b "$WORKSPACE/kind-voltha/bin"
115 """
116 }
TorstenThieme326e7972021-01-19 14:27:59 +0000117 }
118 }
119
120 stage('Run E2E Tests 1t1gem') {
121 environment {
122 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/1t1gem"
123 }
124 steps {
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700125 timeout(time: 10, unit: 'MINUTES') {
126 sh '''
127 # start logging
128 mkdir -p $WORKSPACE/1t1gem
129 _TAG=kail-1t1gem kail -n voltha -n default > $WORKSPACE/1t1gem/onos-voltha-combined.log &
TorstenThieme326e7972021-01-19 14:27:59 +0000130
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700131 mkdir -p $ROBOT_LOGS_DIR/1t1gem
132 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
133 export KVSTOREPREFIX=voltha_voltha
TorstenThieme326e7972021-01-19 14:27:59 +0000134
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700135 make -C $WORKSPACE/voltha-system-tests ${makeTarget} || true
TorstenThieme326e7972021-01-19 14:27:59 +0000136
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700137 # stop logging
138 P_IDS="$(ps e -ww -A | grep "_TAG=kail-1t1gem" | grep -v grep | awk '{print $1}')"
139 if [ -n "$P_IDS" ]; then
140 echo $P_IDS
141 for P_ID in $P_IDS; do
142 kill -9 $P_ID
143 done
144 fi
Andrea Campanellac8dce4b2021-05-24 13:12:12 +0200145 cd $WORKSPACE/1t1gem/
146 gzip onos-voltha-combined.log
147 rm onos-voltha-combined.log
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700148 # get pods information
149 kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t1gem/pods.txt || true
150 '''
151 }
TorstenThieme326e7972021-01-19 14:27:59 +0000152 }
153 }
154
155 stage('Run E2E Tests 1t4gem') {
156 environment {
157 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/1t4gem"
158 }
159 steps {
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700160 timeout(time: 10, unit: 'MINUTES') {
161 sh '''
162 if [ "${branch}" != "master" ]; then
163 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
164 source "$WORKSPACE/kind-voltha/releases/${branch}"
165 else
166 echo "on master, using default settings for kind-voltha"
167 fi
168 cd $WORKSPACE/kind-voltha/
169 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
TorstenThieme582d0342021-01-25 14:16:55 +0000170
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700171 export EXTRA_HELM_FLAGS=""
172 if [ "${branch}" != "master" ]; then
173 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
174 source "$WORKSPACE/kind-voltha/releases/${branch}"
175 else
176 echo "on master, using default settings for kind-voltha"
177 fi
178 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
TorstenThieme582d0342021-01-25 14:16:55 +0000179
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700180 # start logging
181 mkdir -p $WORKSPACE/1t4gem
182 _TAG=kail-1t4gem kail -n voltha -n default > $WORKSPACE/1t4gem/onos-voltha-combined.log &
TorstenThieme326e7972021-01-19 14:27:59 +0000183
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700184 DEPLOY_K8S=n ./voltha up
TorstenThieme582d0342021-01-25 14:16:55 +0000185
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700186 mkdir -p $ROBOT_LOGS_DIR/1t4gem
187 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
188 export KVSTOREPREFIX=voltha_voltha
TorstenThieme326e7972021-01-19 14:27:59 +0000189
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700190 make -C $WORKSPACE/voltha-system-tests ${make1t4gemTestTarget} || true
TorstenThieme326e7972021-01-19 14:27:59 +0000191
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700192 # stop logging
193 P_IDS="$(ps e -ww -A | grep "_TAG=kail-1t4gem" | grep -v grep | awk '{print $1}')"
194 if [ -n "$P_IDS" ]; then
195 echo $P_IDS
196 for P_ID in $P_IDS; do
197 kill -9 $P_ID
198 done
199 fi
Andrea Campanellac8dce4b2021-05-24 13:12:12 +0200200 cd $WORKSPACE/1t4gem/
201 gzip onos-voltha-combined.log
202 rm onos-voltha-combined.log
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700203 # get pods information
204 kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t4gem/pods.txt || true
205 '''
206 }
TorstenThieme326e7972021-01-19 14:27:59 +0000207 }
208 }
209
210 stage('Run E2E Tests 1t8gem') {
211 environment {
212 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/1t8gem"
213 }
214 steps {
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700215 timeout(time: 10, unit: 'MINUTES') {
216 sh '''
217 if [ "${branch}" != "master" ]; then
218 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
219 source "$WORKSPACE/kind-voltha/releases/${branch}"
220 else
221 echo "on master, using default settings for kind-voltha"
222 fi
223 cd $WORKSPACE/kind-voltha/
224 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
TorstenThieme582d0342021-01-25 14:16:55 +0000225
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700226 export EXTRA_HELM_FLAGS=""
227 if [ "${branch}" != "master" ]; then
228 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
229 source "$WORKSPACE/kind-voltha/releases/${branch}"
230 else
231 echo "on master, using default settings for kind-voltha"
232 fi
233 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
TorstenThieme582d0342021-01-25 14:16:55 +0000234
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700235 # start logging
236 mkdir -p $WORKSPACE/1t8gem
237 _TAG=kail-1t8gem kail -n voltha -n default > $WORKSPACE/1t8gem/onos-voltha-combined.log &
TorstenThieme326e7972021-01-19 14:27:59 +0000238
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700239 DEPLOY_K8S=n ./voltha up
TorstenThieme326e7972021-01-19 14:27:59 +0000240
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700241 mkdir -p $ROBOT_LOGS_DIR/1t8gem
242 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
243 export KVSTOREPREFIX=voltha_voltha
TorstenThieme326e7972021-01-19 14:27:59 +0000244
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700245 make -C $WORKSPACE/voltha-system-tests ${make1t8gemTestTarget} || true
TorstenThieme326e7972021-01-19 14:27:59 +0000246
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700247 # stop logging
248 P_IDS="$(ps e -ww -A | grep "_TAG=kail-1t8gem" | grep -v grep | awk '{print $1}')"
249 if [ -n "$P_IDS" ]; then
250 echo $P_IDS
251 for P_ID in $P_IDS; do
252 kill -9 $P_ID
253 done
254 fi
Andrea Campanellac8dce4b2021-05-24 13:12:12 +0200255 cd $WORKSPACE/1t8gem/
256 gzip onos-voltha-combined.log
257 rm onos-voltha-combined.log
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700258 # get pods information
259 kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t8gem/pods.txt || true
260 '''
261 }
TorstenThieme326e7972021-01-19 14:27:59 +0000262 }
263 }
264
265 stage('Run MIB Upload Tests') {
TorstenThieme669258d2021-01-29 09:03:10 +0000266 when { beforeAgent true; expression { return "${olts}" == "1" } }
TorstenThieme326e7972021-01-19 14:27:59 +0000267 environment {
268 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/openonu-go-MIB"
269 }
270 steps {
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700271 timeout(time: 10, unit: 'MINUTES') {
272 sh '''
273 if [ "${branch}" != "master" ]; then
274 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
275 source "$WORKSPACE/kind-voltha/releases/${branch}"
276 else
277 echo "on master, using default settings for kind-voltha"
278 fi
279 cd $WORKSPACE/kind-voltha/
280 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
TorstenThieme326e7972021-01-19 14:27:59 +0000281
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700282 export EXTRA_HELM_FLAGS=""
283 if [ "${branch}" != "master" ]; then
284 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
285 source "$WORKSPACE/kind-voltha/releases/${branch}"
286 else
287 echo "on master, using default settings for kind-voltha"
288 fi
289 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
290 export EXTRA_HELM_FLAGS+="--set pon=2,onu=2,controlledActivation=only-onu "
TorstenThieme326e7972021-01-19 14:27:59 +0000291
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700292 # start logging
293 mkdir -p $WORKSPACE/mib
294 _TAG=kail-mib kail -n voltha -n default > $WORKSPACE/mib/onos-voltha-combined.log &
TorstenThieme326e7972021-01-19 14:27:59 +0000295
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700296 DEPLOY_K8S=n ./voltha up
TorstenThieme326e7972021-01-19 14:27:59 +0000297
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700298 mkdir -p $ROBOT_LOGS_DIR
299 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
300 export TARGET_DEFAULT=mib-upload-templating-openonu-go-adapter-test
TorstenThieme326e7972021-01-19 14:27:59 +0000301
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700302 make -C $WORKSPACE/voltha-system-tests \$TARGET_DEFAULT || true
TorstenThieme326e7972021-01-19 14:27:59 +0000303
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700304 # stop logging
305 P_IDS="$(ps e -ww -A | grep "_TAG=kail-mib" | grep -v grep | awk '{print $1}')"
306 if [ -n "$P_IDS" ]; then
307 echo $P_IDS
308 for P_ID in $P_IDS; do
309 kill -9 $P_ID
310 done
311 fi
Andrea Campanellac8dce4b2021-05-24 13:12:12 +0200312 cd $WORKSPACE/mib/
313 gzip onos-voltha-combined.log
314 rm onos-voltha-combined.log
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700315 # get pods information
316 kubectl get pods -o wide --all-namespaces > $WORKSPACE/mib/pods.txt || true
317 '''
318 }
TorstenThieme326e7972021-01-19 14:27:59 +0000319 }
320 }
321
322 stage('Reconcile DT workflow') {
323 environment {
324 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ReconcileDT"
325 }
326 steps {
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700327 timeout(time: 20, unit: 'MINUTES') {
328 sh '''
329 if [ "${branch}" != "master" ]; then
330 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
331 source "$WORKSPACE/kind-voltha/releases/${branch}"
332 else
333 echo "on master, using default settings for kind-voltha"
334 fi
335 cd $WORKSPACE/kind-voltha/
336 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
TorstenThieme326e7972021-01-19 14:27:59 +0000337
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700338 export EXTRA_HELM_FLAGS=""
339 if [ "${branch}" != "master" ]; then
340 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
341 source "$WORKSPACE/kind-voltha/releases/${branch}"
342 else
343 echo "on master, using default settings for kind-voltha"
344 fi
345 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
TorstenThieme326e7972021-01-19 14:27:59 +0000346
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700347 # Workflow-specific flags
348 export WITH_RADIUS=no
349 export WITH_EAPOL=no
350 export WITH_DHCP=no
351 export WITH_IGMP=no
352 export CONFIG_SADIS="external"
353 export BBSIM_CFG="configs/bbsim-sadis-dt.yaml"
TorstenThieme326e7972021-01-19 14:27:59 +0000354
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700355 # start logging
356 mkdir -p $WORKSPACE/reconciledt
357 _TAG=kail-reconcile-dt kail -n voltha -n default > $WORKSPACE/reconciledt/onos-voltha-combined.log &
TorstenThieme326e7972021-01-19 14:27:59 +0000358
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700359 DEPLOY_K8S=n ./voltha up
TorstenThieme326e7972021-01-19 14:27:59 +0000360
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700361 mkdir -p $ROBOT_LOGS_DIR
362 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
TorstenThieme326e7972021-01-19 14:27:59 +0000363
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700364 make -C $WORKSPACE/voltha-system-tests ${makeReconcileDtTestTarget} || true
TorstenThieme326e7972021-01-19 14:27:59 +0000365
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700366 # stop logging
367 P_IDS="$(ps e -ww -A | grep "_TAG=kail-reconcile-dt" | grep -v grep | awk '{print $1}')"
368 if [ -n "$P_IDS" ]; then
369 echo $P_IDS
370 for P_ID in $P_IDS; do
371 kill -9 $P_ID
372 done
373 fi
Andrea Campanellac8dce4b2021-05-24 13:12:12 +0200374 cd $WORKSPACE/reconciledt/
375 gzip onos-voltha-combined.log
376 rm onos-voltha-combined.log
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700377 # get pods information
378 kubectl get pods -o wide --all-namespaces > $WORKSPACE/reconciledt/pods.txt || true
379 '''
380 }
TorstenThieme326e7972021-01-19 14:27:59 +0000381 }
382 }
383
384 stage('Reconcile ATT workflow') {
385 environment {
386 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ReconcileATT"
387 }
388 steps {
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700389 timeout(time: 20, unit: 'MINUTES') {
390 sh '''
391 if [ "${branch}" != "master" ]; then
392 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
393 source "$WORKSPACE/kind-voltha/releases/${branch}"
394 else
395 echo "on master, using default settings for kind-voltha"
396 fi
397 cd $WORKSPACE/kind-voltha/
398 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
TorstenThieme326e7972021-01-19 14:27:59 +0000399
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700400 export EXTRA_HELM_FLAGS=""
401 if [ "${branch}" != "master" ]; then
402 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
403 source "$WORKSPACE/kind-voltha/releases/${branch}"
404 else
405 echo "on master, using default settings for kind-voltha"
406 fi
407 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
TorstenThieme326e7972021-01-19 14:27:59 +0000408
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700409 # Workflow-specific flags
410 export WITH_RADIUS=yes
411 export WITH_EAPOL=yes
412 export WITH_BBSIM=yes
413 export DEPLOY_K8S=yes
414 export CONFIG_SADIS="external"
415 export BBSIM_CFG="configs/bbsim-sadis-att.yaml"
TorstenThieme326e7972021-01-19 14:27:59 +0000416
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700417 if [ "${gerritProject}" = "voltctl" ]; then
418 export VOLTCTL_VERSION=$(cat $WORKSPACE/voltctl/VERSION)
419 cp $WORKSPACE/voltctl/voltctl $WORKSPACE/kind-voltha/bin/voltctl
420 md5sum $WORKSPACE/kind-voltha/bin/voltctl
421 fi
TorstenThieme326e7972021-01-19 14:27:59 +0000422
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700423 # start logging
424 mkdir -p $WORKSPACE/reconcileatt
425 _TAG=kail-reconcile-att kail -n voltha -n default > $WORKSPACE/reconcileatt/onos-voltha-combined.log &
TorstenThieme326e7972021-01-19 14:27:59 +0000426
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700427 DEPLOY_K8S=n ./voltha up
TorstenThieme326e7972021-01-19 14:27:59 +0000428
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700429 mkdir -p $ROBOT_LOGS_DIR
430 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
TorstenThieme326e7972021-01-19 14:27:59 +0000431
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700432 make -C $WORKSPACE/voltha-system-tests ${makeReconcileTestTarget} || true
TorstenThieme326e7972021-01-19 14:27:59 +0000433
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700434 # stop logging
435 P_IDS="$(ps e -ww -A | grep "_TAG=kail-reconcile-att" | grep -v grep | awk '{print $1}')"
436 if [ -n "$P_IDS" ]; then
437 echo $P_IDS
438 for P_ID in $P_IDS; do
439 kill -9 $P_ID
440 done
441 fi
Andrea Campanellac8dce4b2021-05-24 13:12:12 +0200442 cd $WORKSPACE/reconcileatt/
443 gzip onos-voltha-combined.log
444 rm onos-voltha-combined.log
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700445 # get pods information
446 kubectl get pods -o wide --all-namespaces > $WORKSPACE/reconcileatt/pods.txt || true
447 '''
448 }
TorstenThieme326e7972021-01-19 14:27:59 +0000449 }
450 }
451
452 stage('Reconcile TT workflow') {
453 environment {
454 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ReconcileTT"
455 }
456 steps {
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700457 timeout(time: 20, unit: 'MINUTES') {
458 sh '''
459 if [ "${branch}" != "master" ]; then
460 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
461 source "$WORKSPACE/kind-voltha/releases/${branch}"
462 else
463 echo "on master, using default settings for kind-voltha"
464 fi
465 cd $WORKSPACE/kind-voltha/
466 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
TorstenThieme326e7972021-01-19 14:27:59 +0000467
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700468 export EXTRA_HELM_FLAGS=""
469 if [ "${branch}" != "master" ]; then
470 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
471 source "$WORKSPACE/kind-voltha/releases/${branch}"
472 else
473 echo "on master, using default settings for kind-voltha"
474 fi
475 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
TorstenThieme326e7972021-01-19 14:27:59 +0000476
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700477 # Workflow-specific flags
478 export WITH_RADIUS=no
479 export WITH_EAPOL=no
480 export WITH_DHCP=yes
481 export WITH_IGMP=yes
482 export CONFIG_SADIS="external"
483 export BBSIM_CFG="configs/bbsim-sadis-tt.yaml"
TorstenThieme326e7972021-01-19 14:27:59 +0000484
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700485 # start logging
486 mkdir -p $WORKSPACE/reconcilett
487 _TAG=kail-reconcile-tt kail -n voltha -n default > $WORKSPACE/reconcilett/onos-voltha-combined.log &
TorstenThieme326e7972021-01-19 14:27:59 +0000488
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700489 DEPLOY_K8S=n ./voltha up
TorstenThieme326e7972021-01-19 14:27:59 +0000490
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700491 mkdir -p $ROBOT_LOGS_DIR
492 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
TorstenThieme326e7972021-01-19 14:27:59 +0000493
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700494 make -C $WORKSPACE/voltha-system-tests ${makeReconcileTtTestTarget} || true
TorstenThieme326e7972021-01-19 14:27:59 +0000495
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700496 # stop logging
497 P_IDS="$(ps e -ww -A | grep "_TAG=kail-reconcile-tt" | grep -v grep | awk '{print $1}')"
498 if [ -n "$P_IDS" ]; then
499 echo $P_IDS
500 for P_ID in $P_IDS; do
501 kill -9 $P_ID
502 done
503 fi
Andrea Campanellac8dce4b2021-05-24 13:12:12 +0200504 cd $WORKSPACE/reconcilett/
505 gzip onos-voltha-combined.log
506 rm onos-voltha-combined.log
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700507 # get pods information
508 kubectl get pods -o wide --all-namespaces > $WORKSPACE/reconcilett/pods.txt || true
509 '''
510 }
TorstenThieme326e7972021-01-19 14:27:59 +0000511 }
512 }
513 }
514 post {
515 always {
516 sh '''
TorstenThieme326e7972021-01-19 14:27:59 +0000517 # get pods information
518 kubectl get pods -o wide
519 kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}"
520 helm ls
521
522 sync
523 pkill kail || true
524 md5sum $WORKSPACE/kind-voltha/bin/voltctl
525
TorstenThieme326e7972021-01-19 14:27:59 +0000526 '''
527 step([$class: 'RobotPublisher',
528 disableArchiveOutput: false,
529 logFileName: 'RobotLogs/*/log*.html',
530 otherFiles: '',
531 outputFileName: 'RobotLogs/*/output*.xml',
532 outputPath: '.',
533 passThreshold: 100,
534 reportFileName: 'RobotLogs/*/report*.html',
535 unstableThreshold: 0]);
536 archiveArtifacts artifacts: '**/*.log,**/*.gz,**/*.txt'
537 }
538 }
539}