TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 1 | // 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 | |
| 19 | pipeline { |
| 20 | |
| 21 | /* no label, executor is determined by JJB */ |
| 22 | agent { |
| 23 | label "${params.buildNode}" |
| 24 | } |
| 25 | options { |
TorstenThieme | 685b89b | 2021-01-28 12:59:23 +0000 | [diff] [blame] | 26 | timeout(time: 130, unit: 'MINUTES') |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 27 | } |
| 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 { |
| 66 | sh """ |
Andrea Campanella | 57735a8 | 2021-05-18 13:22:49 +0200 | [diff] [blame^] | 67 | if [ "${branch}" != "master" ]; then |
| 68 | echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}" |
| 69 | source "$WORKSPACE/kind-voltha/releases/${branch}" |
| 70 | else |
| 71 | echo "on master, using default settings for kind-voltha" |
| 72 | fi |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 73 | cd $WORKSPACE/kind-voltha/ |
| 74 | WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down || ./voltha down |
| 75 | """ |
| 76 | } |
| 77 | } |
| 78 | stage('Clone voltha-system-tests') { |
| 79 | steps { |
| 80 | checkout([ |
| 81 | $class: 'GitSCM', |
| 82 | userRemoteConfigs: [[ |
| 83 | url: "https://gerrit.opencord.org/voltha-system-tests", |
| 84 | // refspec: "${volthaSystemTestsChange}" |
| 85 | ]], |
| 86 | branches: [[ name: "${branch}", ]], |
| 87 | extensions: [ |
| 88 | [$class: 'WipeWorkspace'], |
| 89 | [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"], |
| 90 | [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false], |
| 91 | ], |
| 92 | ]) |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | stage('Deploy Voltha') { |
| 97 | steps { |
| 98 | sh """ |
| 99 | export EXTRA_HELM_FLAGS="" |
| 100 | if [ "${branch}" != "master" ]; then |
| 101 | echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}" |
| 102 | source "$WORKSPACE/kind-voltha/releases/${branch}" |
| 103 | else |
| 104 | echo "on master, using default settings for kind-voltha" |
| 105 | fi |
| 106 | |
| 107 | EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${params.extraHelmFlags} --set defaults.image_registry=mirror.registry.opennetworking.org/ " |
| 108 | |
| 109 | cd $WORKSPACE/kind-voltha/ |
| 110 | ./voltha up |
TorstenThieme | 669258d | 2021-01-29 09:03:10 +0000 | [diff] [blame] | 111 | bash <( curl -sfL https://raw.githubusercontent.com/boz/kail/master/godownloader.sh) -b "$WORKSPACE/kind-voltha/bin" |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 112 | """ |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | stage('Run E2E Tests 1t1gem') { |
| 117 | environment { |
| 118 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/1t1gem" |
| 119 | } |
| 120 | steps { |
| 121 | sh ''' |
| 122 | # start logging |
| 123 | mkdir -p $WORKSPACE/1t1gem |
| 124 | _TAG=kail-1t1gem kail -n voltha -n default > $WORKSPACE/1t1gem/onos-voltha-combined.log & |
| 125 | |
| 126 | mkdir -p $ROBOT_LOGS_DIR/1t1gem |
| 127 | export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR" |
TorstenThieme | 41c0863 | 2021-02-11 11:08:18 +0000 | [diff] [blame] | 128 | export KVSTOREPREFIX=voltha_voltha |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 129 | |
TorstenThieme | 669258d | 2021-01-29 09:03:10 +0000 | [diff] [blame] | 130 | make -C $WORKSPACE/voltha-system-tests ${makeTarget} || true |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 131 | |
| 132 | # stop logging |
| 133 | P_IDS="$(ps e -ww -A | grep "_TAG=kail-1t1gem" | grep -v grep | awk '{print $1}')" |
| 134 | if [ -n "$P_IDS" ]; then |
| 135 | echo $P_IDS |
| 136 | for P_ID in $P_IDS; do |
| 137 | kill -9 $P_ID |
| 138 | done |
| 139 | fi |
| 140 | |
| 141 | # get pods information |
| 142 | kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t1gem/pods.txt || true |
| 143 | ''' |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | stage('Run E2E Tests 1t4gem') { |
| 148 | environment { |
| 149 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/1t4gem" |
| 150 | } |
| 151 | steps { |
| 152 | sh ''' |
Andrea Campanella | 57735a8 | 2021-05-18 13:22:49 +0200 | [diff] [blame^] | 153 | if [ "${branch}" != "master" ]; then |
| 154 | echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}" |
| 155 | source "$WORKSPACE/kind-voltha/releases/${branch}" |
| 156 | else |
| 157 | echo "on master, using default settings for kind-voltha" |
| 158 | fi |
TorstenThieme | 582d034 | 2021-01-25 14:16:55 +0000 | [diff] [blame] | 159 | cd $WORKSPACE/kind-voltha/ |
TorstenThieme | 582d034 | 2021-01-25 14:16:55 +0000 | [diff] [blame] | 160 | WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down |
| 161 | |
Matteo Scandolo | f15a2c2 | 2021-05-05 13:21:15 -0700 | [diff] [blame] | 162 | export EXTRA_HELM_FLAGS="" |
| 163 | if [ "${branch}" != "master" ]; then |
| 164 | echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}" |
| 165 | source "$WORKSPACE/kind-voltha/releases/${branch}" |
| 166 | else |
| 167 | echo "on master, using default settings for kind-voltha" |
| 168 | fi |
TorstenThieme | 582d034 | 2021-01-25 14:16:55 +0000 | [diff] [blame] | 169 | export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} " |
| 170 | |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 171 | # start logging |
| 172 | mkdir -p $WORKSPACE/1t4gem |
| 173 | _TAG=kail-1t4gem kail -n voltha -n default > $WORKSPACE/1t4gem/onos-voltha-combined.log & |
| 174 | |
TorstenThieme | 582d034 | 2021-01-25 14:16:55 +0000 | [diff] [blame] | 175 | DEPLOY_K8S=n ./voltha up |
| 176 | |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 177 | mkdir -p $ROBOT_LOGS_DIR/1t4gem |
| 178 | export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR" |
TorstenThieme | 41c0863 | 2021-02-11 11:08:18 +0000 | [diff] [blame] | 179 | export KVSTOREPREFIX=voltha_voltha |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 180 | |
TorstenThieme | 669258d | 2021-01-29 09:03:10 +0000 | [diff] [blame] | 181 | make -C $WORKSPACE/voltha-system-tests ${make1t4gemTestTarget} || true |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 182 | |
| 183 | # stop logging |
| 184 | P_IDS="$(ps e -ww -A | grep "_TAG=kail-1t4gem" | grep -v grep | awk '{print $1}')" |
| 185 | if [ -n "$P_IDS" ]; then |
| 186 | echo $P_IDS |
| 187 | for P_ID in $P_IDS; do |
| 188 | kill -9 $P_ID |
| 189 | done |
| 190 | fi |
| 191 | |
| 192 | # get pods information |
| 193 | kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t4gem/pods.txt || true |
| 194 | ''' |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | stage('Run E2E Tests 1t8gem') { |
| 199 | environment { |
| 200 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/1t8gem" |
| 201 | } |
| 202 | steps { |
| 203 | sh ''' |
Andrea Campanella | 57735a8 | 2021-05-18 13:22:49 +0200 | [diff] [blame^] | 204 | if [ "${branch}" != "master" ]; then |
| 205 | echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}" |
| 206 | source "$WORKSPACE/kind-voltha/releases/${branch}" |
| 207 | else |
| 208 | echo "on master, using default settings for kind-voltha" |
| 209 | fi |
TorstenThieme | 582d034 | 2021-01-25 14:16:55 +0000 | [diff] [blame] | 210 | cd $WORKSPACE/kind-voltha/ |
TorstenThieme | 582d034 | 2021-01-25 14:16:55 +0000 | [diff] [blame] | 211 | WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down |
| 212 | |
Matteo Scandolo | f15a2c2 | 2021-05-05 13:21:15 -0700 | [diff] [blame] | 213 | export EXTRA_HELM_FLAGS="" |
| 214 | if [ "${branch}" != "master" ]; then |
| 215 | echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}" |
| 216 | source "$WORKSPACE/kind-voltha/releases/${branch}" |
| 217 | else |
| 218 | echo "on master, using default settings for kind-voltha" |
| 219 | fi |
TorstenThieme | 582d034 | 2021-01-25 14:16:55 +0000 | [diff] [blame] | 220 | export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} " |
| 221 | |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 222 | # start logging |
| 223 | mkdir -p $WORKSPACE/1t8gem |
| 224 | _TAG=kail-1t8gem kail -n voltha -n default > $WORKSPACE/1t8gem/onos-voltha-combined.log & |
| 225 | |
| 226 | DEPLOY_K8S=n ./voltha up |
| 227 | |
| 228 | mkdir -p $ROBOT_LOGS_DIR/1t8gem |
| 229 | export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR" |
TorstenThieme | 41c0863 | 2021-02-11 11:08:18 +0000 | [diff] [blame] | 230 | export KVSTOREPREFIX=voltha_voltha |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 231 | |
TorstenThieme | 669258d | 2021-01-29 09:03:10 +0000 | [diff] [blame] | 232 | make -C $WORKSPACE/voltha-system-tests ${make1t8gemTestTarget} || true |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 233 | |
| 234 | # stop logging |
| 235 | P_IDS="$(ps e -ww -A | grep "_TAG=kail-1t8gem" | grep -v grep | awk '{print $1}')" |
| 236 | if [ -n "$P_IDS" ]; then |
| 237 | echo $P_IDS |
| 238 | for P_ID in $P_IDS; do |
| 239 | kill -9 $P_ID |
| 240 | done |
| 241 | fi |
| 242 | |
| 243 | # get pods information |
| 244 | kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t8gem/pods.txt || true |
| 245 | ''' |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | stage('Run MIB Upload Tests') { |
TorstenThieme | 669258d | 2021-01-29 09:03:10 +0000 | [diff] [blame] | 250 | when { beforeAgent true; expression { return "${olts}" == "1" } } |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 251 | environment { |
| 252 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/openonu-go-MIB" |
| 253 | } |
| 254 | steps { |
| 255 | sh ''' |
Andrea Campanella | 57735a8 | 2021-05-18 13:22:49 +0200 | [diff] [blame^] | 256 | if [ "${branch}" != "master" ]; then |
| 257 | echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}" |
| 258 | source "$WORKSPACE/kind-voltha/releases/${branch}" |
| 259 | else |
| 260 | echo "on master, using default settings for kind-voltha" |
| 261 | fi |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 262 | cd $WORKSPACE/kind-voltha/ |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 263 | WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down |
| 264 | |
Matteo Scandolo | f15a2c2 | 2021-05-05 13:21:15 -0700 | [diff] [blame] | 265 | export EXTRA_HELM_FLAGS="" |
| 266 | if [ "${branch}" != "master" ]; then |
| 267 | echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}" |
| 268 | source "$WORKSPACE/kind-voltha/releases/${branch}" |
| 269 | else |
| 270 | echo "on master, using default settings for kind-voltha" |
| 271 | fi |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 272 | export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} " |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 273 | export EXTRA_HELM_FLAGS+="--set pon=2,onu=2,controlledActivation=only-onu " |
| 274 | |
| 275 | # start logging |
| 276 | mkdir -p $WORKSPACE/mib |
| 277 | _TAG=kail-mib kail -n voltha -n default > $WORKSPACE/mib/onos-voltha-combined.log & |
| 278 | |
| 279 | DEPLOY_K8S=n ./voltha up |
| 280 | |
| 281 | mkdir -p $ROBOT_LOGS_DIR |
| 282 | export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR" |
| 283 | export TARGET_DEFAULT=mib-upload-templating-openonu-go-adapter-test |
| 284 | |
| 285 | make -C $WORKSPACE/voltha-system-tests \$TARGET_DEFAULT || true |
| 286 | |
| 287 | # stop logging |
| 288 | P_IDS="$(ps e -ww -A | grep "_TAG=kail-mib" | grep -v grep | awk '{print $1}')" |
| 289 | if [ -n "$P_IDS" ]; then |
| 290 | echo $P_IDS |
| 291 | for P_ID in $P_IDS; do |
| 292 | kill -9 $P_ID |
| 293 | done |
| 294 | fi |
| 295 | |
| 296 | # get pods information |
| 297 | kubectl get pods -o wide --all-namespaces > $WORKSPACE/mib/pods.txt || true |
| 298 | ''' |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | stage('Reconcile DT workflow') { |
| 303 | environment { |
| 304 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ReconcileDT" |
| 305 | } |
| 306 | steps { |
| 307 | sh ''' |
Andrea Campanella | 57735a8 | 2021-05-18 13:22:49 +0200 | [diff] [blame^] | 308 | if [ "${branch}" != "master" ]; then |
| 309 | echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}" |
| 310 | source "$WORKSPACE/kind-voltha/releases/${branch}" |
| 311 | else |
| 312 | echo "on master, using default settings for kind-voltha" |
| 313 | fi |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 314 | cd $WORKSPACE/kind-voltha/ |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 315 | WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down |
| 316 | |
Matteo Scandolo | f15a2c2 | 2021-05-05 13:21:15 -0700 | [diff] [blame] | 317 | export EXTRA_HELM_FLAGS="" |
| 318 | if [ "${branch}" != "master" ]; then |
| 319 | echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}" |
| 320 | source "$WORKSPACE/kind-voltha/releases/${branch}" |
| 321 | else |
| 322 | echo "on master, using default settings for kind-voltha" |
| 323 | fi |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 324 | export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} " |
| 325 | |
| 326 | # Workflow-specific flags |
| 327 | export WITH_RADIUS=no |
| 328 | export WITH_EAPOL=no |
| 329 | export WITH_DHCP=no |
| 330 | export WITH_IGMP=no |
| 331 | export CONFIG_SADIS="external" |
| 332 | export BBSIM_CFG="configs/bbsim-sadis-dt.yaml" |
| 333 | |
| 334 | # start logging |
TorstenThieme | a223e1e | 2021-01-29 13:22:14 +0000 | [diff] [blame] | 335 | mkdir -p $WORKSPACE/reconciledt |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 336 | _TAG=kail-reconcile-dt kail -n voltha -n default > $WORKSPACE/reconciledt/onos-voltha-combined.log & |
| 337 | |
| 338 | DEPLOY_K8S=n ./voltha up |
| 339 | |
| 340 | mkdir -p $ROBOT_LOGS_DIR |
| 341 | export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch" |
| 342 | |
TorstenThieme | 4542261 | 2021-03-23 10:38:59 +0000 | [diff] [blame] | 343 | make -C $WORKSPACE/voltha-system-tests ${makeReconcileDtTestTarget} || true |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 344 | |
| 345 | # stop logging |
| 346 | P_IDS="$(ps e -ww -A | grep "_TAG=kail-reconcile-dt" | grep -v grep | awk '{print $1}')" |
| 347 | if [ -n "$P_IDS" ]; then |
| 348 | echo $P_IDS |
| 349 | for P_ID in $P_IDS; do |
| 350 | kill -9 $P_ID |
| 351 | done |
| 352 | fi |
| 353 | |
| 354 | # get pods information |
| 355 | kubectl get pods -o wide --all-namespaces > $WORKSPACE/reconciledt/pods.txt || true |
| 356 | ''' |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | stage('Reconcile ATT workflow') { |
| 361 | environment { |
| 362 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ReconcileATT" |
| 363 | } |
| 364 | steps { |
| 365 | sh ''' |
Andrea Campanella | 57735a8 | 2021-05-18 13:22:49 +0200 | [diff] [blame^] | 366 | if [ "${branch}" != "master" ]; then |
| 367 | echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}" |
| 368 | source "$WORKSPACE/kind-voltha/releases/${branch}" |
| 369 | else |
| 370 | echo "on master, using default settings for kind-voltha" |
| 371 | fi |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 372 | cd $WORKSPACE/kind-voltha/ |
| 373 | WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down |
| 374 | |
Matteo Scandolo | f15a2c2 | 2021-05-05 13:21:15 -0700 | [diff] [blame] | 375 | export EXTRA_HELM_FLAGS="" |
| 376 | if [ "${branch}" != "master" ]; then |
| 377 | echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}" |
| 378 | source "$WORKSPACE/kind-voltha/releases/${branch}" |
| 379 | else |
| 380 | echo "on master, using default settings for kind-voltha" |
| 381 | fi |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 382 | export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} " |
| 383 | |
| 384 | # Workflow-specific flags |
| 385 | export WITH_RADIUS=yes |
| 386 | export WITH_EAPOL=yes |
| 387 | export WITH_BBSIM=yes |
| 388 | export DEPLOY_K8S=yes |
| 389 | export CONFIG_SADIS="external" |
| 390 | export BBSIM_CFG="configs/bbsim-sadis-att.yaml" |
| 391 | |
| 392 | if [ "${gerritProject}" = "voltctl" ]; then |
| 393 | export VOLTCTL_VERSION=$(cat $WORKSPACE/voltctl/VERSION) |
| 394 | cp $WORKSPACE/voltctl/voltctl $WORKSPACE/kind-voltha/bin/voltctl |
| 395 | md5sum $WORKSPACE/kind-voltha/bin/voltctl |
| 396 | fi |
| 397 | |
| 398 | # start logging |
TorstenThieme | a223e1e | 2021-01-29 13:22:14 +0000 | [diff] [blame] | 399 | mkdir -p $WORKSPACE/reconcileatt |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 400 | _TAG=kail-reconcile-att kail -n voltha -n default > $WORKSPACE/reconcileatt/onos-voltha-combined.log & |
| 401 | |
| 402 | DEPLOY_K8S=n ./voltha up |
| 403 | |
| 404 | mkdir -p $ROBOT_LOGS_DIR |
| 405 | export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch" |
| 406 | |
TorstenThieme | 4542261 | 2021-03-23 10:38:59 +0000 | [diff] [blame] | 407 | make -C $WORKSPACE/voltha-system-tests ${makeReconcileTestTarget} || true |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 408 | |
| 409 | # stop logging |
| 410 | P_IDS="$(ps e -ww -A | grep "_TAG=kail-reconcile-att" | grep -v grep | awk '{print $1}')" |
| 411 | if [ -n "$P_IDS" ]; then |
| 412 | echo $P_IDS |
| 413 | for P_ID in $P_IDS; do |
| 414 | kill -9 $P_ID |
| 415 | done |
| 416 | fi |
| 417 | |
| 418 | # get pods information |
| 419 | kubectl get pods -o wide --all-namespaces > $WORKSPACE/reconcileatt/pods.txt || true |
| 420 | ''' |
| 421 | } |
| 422 | } |
| 423 | |
| 424 | stage('Reconcile TT workflow') { |
| 425 | environment { |
| 426 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ReconcileTT" |
| 427 | } |
| 428 | steps { |
| 429 | sh ''' |
Andrea Campanella | 57735a8 | 2021-05-18 13:22:49 +0200 | [diff] [blame^] | 430 | if [ "${branch}" != "master" ]; then |
| 431 | echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}" |
| 432 | source "$WORKSPACE/kind-voltha/releases/${branch}" |
| 433 | else |
| 434 | echo "on master, using default settings for kind-voltha" |
| 435 | fi |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 436 | cd $WORKSPACE/kind-voltha/ |
| 437 | WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down |
| 438 | |
Matteo Scandolo | f15a2c2 | 2021-05-05 13:21:15 -0700 | [diff] [blame] | 439 | export EXTRA_HELM_FLAGS="" |
| 440 | if [ "${branch}" != "master" ]; then |
| 441 | echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}" |
| 442 | source "$WORKSPACE/kind-voltha/releases/${branch}" |
| 443 | else |
| 444 | echo "on master, using default settings for kind-voltha" |
| 445 | fi |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 446 | export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} " |
| 447 | |
| 448 | # Workflow-specific flags |
| 449 | export WITH_RADIUS=no |
| 450 | export WITH_EAPOL=no |
| 451 | export WITH_DHCP=yes |
| 452 | export WITH_IGMP=yes |
| 453 | export CONFIG_SADIS="external" |
| 454 | export BBSIM_CFG="configs/bbsim-sadis-tt.yaml" |
| 455 | |
| 456 | # start logging |
TorstenThieme | a223e1e | 2021-01-29 13:22:14 +0000 | [diff] [blame] | 457 | mkdir -p $WORKSPACE/reconcilett |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 458 | _TAG=kail-reconcile-tt kail -n voltha -n default > $WORKSPACE/reconcilett/onos-voltha-combined.log & |
| 459 | |
| 460 | DEPLOY_K8S=n ./voltha up |
| 461 | |
| 462 | mkdir -p $ROBOT_LOGS_DIR |
| 463 | export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch" |
| 464 | |
TorstenThieme | 4542261 | 2021-03-23 10:38:59 +0000 | [diff] [blame] | 465 | make -C $WORKSPACE/voltha-system-tests ${makeReconcileTtTestTarget} || true |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 466 | |
| 467 | # stop logging |
| 468 | P_IDS="$(ps e -ww -A | grep "_TAG=kail-reconcile-tt" | grep -v grep | awk '{print $1}')" |
| 469 | if [ -n "$P_IDS" ]; then |
| 470 | echo $P_IDS |
| 471 | for P_ID in $P_IDS; do |
| 472 | kill -9 $P_ID |
| 473 | done |
| 474 | fi |
| 475 | |
| 476 | # get pods information |
| 477 | kubectl get pods -o wide --all-namespaces > $WORKSPACE/reconcilett/pods.txt || true |
| 478 | ''' |
| 479 | } |
| 480 | } |
| 481 | } |
| 482 | post { |
| 483 | always { |
| 484 | sh ''' |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 485 | # get pods information |
| 486 | kubectl get pods -o wide |
| 487 | kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" |
| 488 | helm ls |
| 489 | |
| 490 | sync |
| 491 | pkill kail || true |
| 492 | md5sum $WORKSPACE/kind-voltha/bin/voltctl |
| 493 | |
| 494 | ## Pull out errors from log files |
| 495 | extract_errors_go() { |
| 496 | echo |
| 497 | echo "Error summary for $1:" |
| 498 | grep $1 $WORKSPACE/onos-voltha-combined.log | grep '"level":"error"' | cut -d ' ' -f 2- | jq -r '.msg' |
| 499 | echo |
| 500 | } |
| 501 | |
| 502 | extract_errors_python() { |
| 503 | echo |
| 504 | echo "Error summary for $1:" |
| 505 | grep $1 $WORKSPACE/onos-voltha-combined.log | grep 'ERROR' | cut -d ' ' -f 2- |
| 506 | echo |
| 507 | } |
| 508 | |
| 509 | extract_errors_go voltha-rw-core > $WORKSPACE/error-report.log || true |
| 510 | extract_errors_go adapter-open-olt >> $WORKSPACE/error-report.log || true |
| 511 | extract_errors_python adapter-open-onu >> $WORKSPACE/error-report.log || true |
| 512 | extract_errors_python voltha-ofagent >> $WORKSPACE/error-report.log || true |
| 513 | |
| 514 | gzip $WORKSPACE/onos-voltha-combined.log || true |
| 515 | ''' |
| 516 | step([$class: 'RobotPublisher', |
| 517 | disableArchiveOutput: false, |
| 518 | logFileName: 'RobotLogs/*/log*.html', |
| 519 | otherFiles: '', |
| 520 | outputFileName: 'RobotLogs/*/output*.xml', |
| 521 | outputPath: '.', |
| 522 | passThreshold: 100, |
| 523 | reportFileName: 'RobotLogs/*/report*.html', |
| 524 | unstableThreshold: 0]); |
| 525 | archiveArtifacts artifacts: '**/*.log,**/*.gz,**/*.txt' |
| 526 | } |
| 527 | } |
| 528 | } |