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