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 |
Andrea Campanella | c8dce4b | 2021-05-24 13:12:12 +0200 | [diff] [blame] | 145 | cd $WORKSPACE/1t1gem/ |
Matteo Scandolo | 3a816c3 | 2021-05-24 10:33:49 -0700 | [diff] [blame] | 146 | gzip -k onos-voltha-combined.log |
Andrea Campanella | c8dce4b | 2021-05-24 13:12:12 +0200 | [diff] [blame] | 147 | rm onos-voltha-combined.log |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 148 | # get pods information |
| 149 | kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t1gem/pods.txt || true |
| 150 | ''' |
| 151 | } |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 152 | } |
| 153 | } |
| 154 | |
| 155 | stage('Run E2E Tests 1t4gem') { |
| 156 | environment { |
| 157 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/1t4gem" |
| 158 | } |
| 159 | steps { |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 160 | 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 |
TorstenThieme | 582d034 | 2021-01-25 14:16:55 +0000 | [diff] [blame] | 170 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 171 | 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} " |
TorstenThieme | 582d034 | 2021-01-25 14:16:55 +0000 | [diff] [blame] | 179 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 180 | # start logging |
| 181 | mkdir -p $WORKSPACE/1t4gem |
| 182 | _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] | 183 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 184 | DEPLOY_K8S=n ./voltha up |
TorstenThieme | 582d034 | 2021-01-25 14:16:55 +0000 | [diff] [blame] | 185 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 186 | mkdir -p $ROBOT_LOGS_DIR/1t4gem |
| 187 | export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR" |
| 188 | export KVSTOREPREFIX=voltha_voltha |
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 | make -C $WORKSPACE/voltha-system-tests ${make1t4gemTestTarget} || true |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 191 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 192 | # 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 Campanella | c8dce4b | 2021-05-24 13:12:12 +0200 | [diff] [blame] | 200 | cd $WORKSPACE/1t4gem/ |
Matteo Scandolo | 3a816c3 | 2021-05-24 10:33:49 -0700 | [diff] [blame] | 201 | gzip -k onos-voltha-combined.log |
Andrea Campanella | c8dce4b | 2021-05-24 13:12:12 +0200 | [diff] [blame] | 202 | rm onos-voltha-combined.log |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 203 | # get pods information |
| 204 | kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t4gem/pods.txt || true |
| 205 | ''' |
| 206 | } |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 207 | } |
| 208 | } |
| 209 | |
| 210 | stage('Run E2E Tests 1t8gem') { |
| 211 | environment { |
| 212 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/1t8gem" |
| 213 | } |
| 214 | steps { |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 215 | 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 |
TorstenThieme | 582d034 | 2021-01-25 14:16:55 +0000 | [diff] [blame] | 225 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 226 | 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} " |
TorstenThieme | 582d034 | 2021-01-25 14:16:55 +0000 | [diff] [blame] | 234 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 235 | # start logging |
| 236 | mkdir -p $WORKSPACE/1t8gem |
| 237 | _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] | 238 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 239 | DEPLOY_K8S=n ./voltha up |
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 | mkdir -p $ROBOT_LOGS_DIR/1t8gem |
| 242 | export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR" |
| 243 | export KVSTOREPREFIX=voltha_voltha |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 244 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 245 | make -C $WORKSPACE/voltha-system-tests ${make1t8gemTestTarget} || true |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 246 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 247 | # 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 Campanella | c8dce4b | 2021-05-24 13:12:12 +0200 | [diff] [blame] | 255 | cd $WORKSPACE/1t8gem/ |
Matteo Scandolo | 3a816c3 | 2021-05-24 10:33:49 -0700 | [diff] [blame] | 256 | gzip -k onos-voltha-combined.log |
Andrea Campanella | c8dce4b | 2021-05-24 13:12:12 +0200 | [diff] [blame] | 257 | rm onos-voltha-combined.log |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 258 | # get pods information |
| 259 | kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t8gem/pods.txt || true |
| 260 | ''' |
| 261 | } |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 262 | } |
| 263 | } |
| 264 | |
| 265 | stage('Run MIB Upload Tests') { |
TorstenThieme | 669258d | 2021-01-29 09:03:10 +0000 | [diff] [blame] | 266 | when { beforeAgent true; expression { return "${olts}" == "1" } } |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 267 | environment { |
| 268 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/openonu-go-MIB" |
| 269 | } |
| 270 | steps { |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 271 | 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 |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 281 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 282 | 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 " |
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 | # start logging |
| 293 | mkdir -p $WORKSPACE/mib |
| 294 | _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] | 295 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 296 | DEPLOY_K8S=n ./voltha up |
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 | 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 |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 301 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 302 | make -C $WORKSPACE/voltha-system-tests \$TARGET_DEFAULT || true |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 303 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 304 | # 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 Campanella | c8dce4b | 2021-05-24 13:12:12 +0200 | [diff] [blame] | 312 | cd $WORKSPACE/mib/ |
Matteo Scandolo | 3a816c3 | 2021-05-24 10:33:49 -0700 | [diff] [blame] | 313 | gzip -k onos-voltha-combined.log |
Andrea Campanella | c8dce4b | 2021-05-24 13:12:12 +0200 | [diff] [blame] | 314 | rm onos-voltha-combined.log |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 315 | # get pods information |
| 316 | kubectl get pods -o wide --all-namespaces > $WORKSPACE/mib/pods.txt || true |
| 317 | ''' |
| 318 | } |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 319 | } |
| 320 | } |
| 321 | |
| 322 | stage('Reconcile DT workflow') { |
| 323 | environment { |
| 324 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ReconcileDT" |
| 325 | } |
| 326 | steps { |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 327 | 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 |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 337 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 338 | 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} " |
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 | # 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" |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 354 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 355 | # start logging |
| 356 | mkdir -p $WORKSPACE/reconciledt |
| 357 | _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] | 358 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 359 | DEPLOY_K8S=n ./voltha up |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 360 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 361 | mkdir -p $ROBOT_LOGS_DIR |
| 362 | export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch" |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 363 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 364 | make -C $WORKSPACE/voltha-system-tests ${makeReconcileDtTestTarget} || true |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 365 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 366 | # 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 Campanella | c8dce4b | 2021-05-24 13:12:12 +0200 | [diff] [blame] | 374 | cd $WORKSPACE/reconciledt/ |
Matteo Scandolo | 3a816c3 | 2021-05-24 10:33:49 -0700 | [diff] [blame] | 375 | gzip -k onos-voltha-combined.log |
Andrea Campanella | c8dce4b | 2021-05-24 13:12:12 +0200 | [diff] [blame] | 376 | rm onos-voltha-combined.log |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 377 | # get pods information |
| 378 | kubectl get pods -o wide --all-namespaces > $WORKSPACE/reconciledt/pods.txt || true |
| 379 | ''' |
| 380 | } |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 381 | } |
| 382 | } |
| 383 | |
| 384 | stage('Reconcile ATT workflow') { |
| 385 | environment { |
| 386 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ReconcileATT" |
| 387 | } |
| 388 | steps { |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 389 | 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 |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 399 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 400 | 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} " |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 408 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 409 | # 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" |
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 | 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 |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 422 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 423 | # start logging |
| 424 | mkdir -p $WORKSPACE/reconcileatt |
| 425 | _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] | 426 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 427 | DEPLOY_K8S=n ./voltha up |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 428 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 429 | mkdir -p $ROBOT_LOGS_DIR |
| 430 | export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch" |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 431 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 432 | make -C $WORKSPACE/voltha-system-tests ${makeReconcileTestTarget} || true |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 433 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 434 | # 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 Campanella | c8dce4b | 2021-05-24 13:12:12 +0200 | [diff] [blame] | 442 | cd $WORKSPACE/reconcileatt/ |
Matteo Scandolo | 3a816c3 | 2021-05-24 10:33:49 -0700 | [diff] [blame] | 443 | gzip -k onos-voltha-combined.log |
Andrea Campanella | c8dce4b | 2021-05-24 13:12:12 +0200 | [diff] [blame] | 444 | rm onos-voltha-combined.log |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 445 | # get pods information |
| 446 | kubectl get pods -o wide --all-namespaces > $WORKSPACE/reconcileatt/pods.txt || true |
| 447 | ''' |
| 448 | } |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 449 | } |
| 450 | } |
| 451 | |
| 452 | stage('Reconcile TT workflow') { |
| 453 | environment { |
| 454 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ReconcileTT" |
| 455 | } |
| 456 | steps { |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 457 | 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 |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 467 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 468 | 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} " |
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 | # 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" |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 484 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 485 | # start logging |
| 486 | mkdir -p $WORKSPACE/reconcilett |
| 487 | _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] | 488 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 489 | DEPLOY_K8S=n ./voltha up |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 490 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 491 | mkdir -p $ROBOT_LOGS_DIR |
| 492 | export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch" |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 493 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 494 | make -C $WORKSPACE/voltha-system-tests ${makeReconcileTtTestTarget} || true |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 495 | |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 496 | # 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 Campanella | c8dce4b | 2021-05-24 13:12:12 +0200 | [diff] [blame] | 504 | cd $WORKSPACE/reconcilett/ |
Matteo Scandolo | 3a816c3 | 2021-05-24 10:33:49 -0700 | [diff] [blame] | 505 | gzip -k onos-voltha-combined.log |
Andrea Campanella | c8dce4b | 2021-05-24 13:12:12 +0200 | [diff] [blame] | 506 | rm onos-voltha-combined.log |
Matteo Scandolo | e4abf85 | 2021-05-18 09:12:11 -0700 | [diff] [blame] | 507 | # get pods information |
| 508 | kubectl get pods -o wide --all-namespaces > $WORKSPACE/reconcilett/pods.txt || true |
| 509 | ''' |
| 510 | } |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 511 | } |
| 512 | } |
| 513 | } |
| 514 | post { |
| 515 | always { |
| 516 | sh ''' |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 517 | # 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 | |
TorstenThieme | 326e797 | 2021-01-19 14:27:59 +0000 | [diff] [blame] | 526 | ''' |
| 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 | } |