Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 1 | // Copyright 2019-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 | // deploy VOLTHA using kind-voltha and performs a scale test |
| 16 | |
| 17 | pipeline { |
| 18 | |
| 19 | /* no label, executor is determined by JJB */ |
| 20 | agent { |
| 21 | label "${params.buildNode}" |
| 22 | } |
| 23 | options { |
| 24 | timeout(time: 30, unit: 'MINUTES') |
| 25 | } |
| 26 | environment { |
| 27 | KUBECONFIG="$HOME/.kube/config" |
| 28 | VOLTCONFIG="$HOME/.volt/config" |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 29 | SSHPASS="karaf" |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 30 | PATH="$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
| 31 | TYPE="minimal" |
| 32 | FANCY=0 |
| 33 | WITH_SIM_ADAPTERS="no" |
| 34 | WITH_RADIUS="yes" |
| 35 | WITH_BBSIM="yes" |
| 36 | LEGACY_BBSIM_INDEX="no" |
| 37 | DEPLOY_K8S="no" |
| 38 | CONFIG_SADIS="external" |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 39 | WITH_KAFKA="kafka.default.svc.cluster.local" |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 40 | WITH_ETCD="external" |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 41 | |
| 42 | // install everything in the default namespace |
| 43 | VOLTHA_NS="default" |
| 44 | ADAPTER_NS="default" |
| 45 | INFRA_NS="default" |
| 46 | BBSIM_NS="default" |
| 47 | |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 48 | // configurable options |
| 49 | WITH_EAPOL="${withEapol}" |
| 50 | WITH_DHCP="${withDhcp}" |
| 51 | WITH_IGMP="${withIgmp}" |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 52 | VOLTHA_LOG_LEVEL="${logLevel}" |
| 53 | NUM_OF_BBSIM="${olts}" |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 54 | NUM_OF_OPENONU="${openonuAdapterReplicas}" |
| 55 | NUM_OF_ONOS="${onosReplicas}" |
| 56 | NUM_OF_ATOMIX="${atomixReplicas}" |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 57 | |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 58 | VOLTHA_CHART="${volthaChart}" |
| 59 | VOLTHA_BBSIM_CHART="${bbsimChart}" |
| 60 | VOLTHA_ADAPTER_OPEN_OLT_CHART="${openoltAdapterChart}" |
| 61 | VOLTHA_ADAPTER_OPEN_ONU_CHART="${openonuAdapterChart}" |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | stages { |
| 65 | stage ('Cleanup') { |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 66 | steps { |
| 67 | sh returnStdout: false, script: """ |
| 68 | test -e $WORKSPACE/kind-voltha/voltha && cd $WORKSPACE/kind-voltha && ./voltha down |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 69 | |
| 70 | for hchart in \$(helm list -q | grep -E -v 'docker-registry|kafkacat|etcd-operator'); |
| 71 | do |
| 72 | echo "Purging chart: \${hchart}" |
| 73 | helm delete --purge "\${hchart}" |
| 74 | done |
| 75 | bash /home/cord/voltha-scale/wait_for_pods.sh |
| 76 | |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 77 | cd $WORKSPACE |
| 78 | rm -rf $WORKSPACE/* |
| 79 | """ |
| 80 | } |
| 81 | } |
| 82 | stage('Clone kind-voltha') { |
| 83 | steps { |
| 84 | checkout([ |
| 85 | $class: 'GitSCM', |
| 86 | userRemoteConfigs: [[ url: "https://gerrit.opencord.org/kind-voltha", ]], |
| 87 | branches: [[ name: "master", ]], |
| 88 | extensions: [ |
| 89 | [$class: 'WipeWorkspace'], |
| 90 | [$class: 'RelativeTargetDirectory', relativeTargetDir: "kind-voltha"], |
| 91 | [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false], |
| 92 | ], |
| 93 | ]) |
| 94 | } |
| 95 | } |
| 96 | stage('Clone voltha-system-tests') { |
| 97 | steps { |
| 98 | checkout([ |
| 99 | $class: 'GitSCM', |
| 100 | userRemoteConfigs: [[ url: "https://gerrit.opencord.org/voltha-system-tests", ]], |
| 101 | branches: [[ name: "master", ]], |
| 102 | extensions: [ |
| 103 | [$class: 'WipeWorkspace'], |
| 104 | [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"], |
| 105 | [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false], |
| 106 | ], |
| 107 | ]) |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 108 | script { |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 109 | sh(script:""" |
| 110 | if [ ${volthaSystemTestsChange} != '' ] ; then |
| 111 | cd voltha-system-tests; |
| 112 | git fetch https://gerrit.opencord.org/voltha-system-tests ${volthaSystemTestsChange} && git checkout FETCH_HEAD |
| 113 | fi |
| 114 | """) |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 115 | } |
| 116 | } |
| 117 | } |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 118 | stage('Deploy common infrastructure') { |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 119 | // includes monitoring, kafka |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 120 | steps { |
| 121 | sh ''' |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 122 | helm install -n kafka incubator/kafka --version 0.13.3 --set replicas=3 --set persistence.enabled=false --set zookeeper.replicaCount=3 --set zookeeper.persistence.enabled=false --version=0.15.3 |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 123 | |
| 124 | if [ ${withMonitoring} = true ] ; then |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 125 | helm install -n nem-monitoring cord/nem-monitoring \ |
| 126 | --set prometheus.alertmanager.enabled=false,prometheus.pushgateway.enabled=false \ |
| 127 | --set kpi_exporter.enabled=false,dashboards.xos=false,dashboards.onos=false,dashboards.aaa=false,dashboards.voltha=false |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 128 | fi |
| 129 | |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 130 | # TODO download this file from https://github.com/opencord/helm-charts/blob/master/scripts/wait_for_pods.sh |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 131 | bash /home/cord/voltha-scale/wait_for_pods.sh |
| 132 | ''' |
| 133 | } |
| 134 | } |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 135 | stage('Deploy Voltha') { |
| 136 | steps { |
| 137 | script { |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 138 | // TODO install etcd outside kind-voltha (no need to redeploy the operator everytime) |
| 139 | sh returnStdout: false, script: """ |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 140 | export EXTRA_HELM_FLAGS+='--set enablePerf=true,pon=${pons},onu=${onus} ' |
| 141 | |
| 142 | # BBSim custom image handling |
| 143 | IFS=: read -r bbsimRepo bbsimTag <<< ${bbsimImg} |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 144 | EXTRA_HELM_FLAGS+="--set images.bbsim.repository=\$bbsimRepo,images.bbsim.tag=\$bbsimTag " |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 145 | |
| 146 | # VOLTHA and ofAgent custom image handling |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 147 | IFS=: read -r rwCoreRepo rwCoreTag <<< ${rwCoreImg} |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 148 | IFS=: read -r ofAgentRepo ofAgentTag <<< ${ofAgentImg} |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 149 | EXTRA_HELM_FLAGS+="--set images.rw_core.repository=\$rwCoreRepo,images.rw_core.tag=\$rwCoreTag,images.ofagent_go.repository=\$ofAgentRepo,images.ofagent_go.tag=\$ofAgentTag " |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 150 | |
| 151 | # OpenOLT custom image handling |
| 152 | IFS=: read -r openoltAdapterRepo openoltAdapterTag <<< ${openoltAdapterImg} |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 153 | EXTRA_HELM_FLAGS+="--set images.adapter_open_olt.repository=\$openoltAdapterRepo,images.adapter_open_olt.tag=\$openoltAdapterTag " |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 154 | |
| 155 | # OpenONU custom image handling |
| 156 | IFS=: read -r openonuAdapterRepo openonuAdapterTag <<< ${openonuAdapterImg} |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 157 | EXTRA_HELM_FLAGS+="--set images.adapter_open_onu.repository=\$openonuAdapterRepo,images.adapter_open_onu.tag=\$openonuAdapterTag " |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 158 | |
| 159 | # ONOS custom image handling |
| 160 | IFS=: read -r onosRepo onosTag <<< ${onosImg} |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 161 | EXTRA_HELM_FLAGS+="--set images.onos.repository=\$onosRepo,images.onos.tag=\$onosTag " |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 162 | |
| 163 | |
| 164 | cd $WORKSPACE/kind-voltha/ |
| 165 | |
| 166 | ./voltha up |
| 167 | """ |
| 168 | } |
| 169 | } |
| 170 | } |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 171 | stage('Configuration') { |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 172 | steps { |
| 173 | sh ''' |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 174 | # Always deactivate org.opencord.kafka |
| 175 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.kafka |
| 176 | |
| 177 | #Setting link discovery |
| 178 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg set org.onosproject.provider.lldp.impl.LldpLinkProvider enabled ${withLLDP} |
| 179 | |
| 180 | #Setting LOG level to ${logLevel} |
| 181 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 log:set ${logLevel} |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 182 | kubectl exec $(kubectl get pods | grep -E "bbsim[0-9]" | awk 'NR==1{print $1}') -- bbsimctl log ${logLevel} false |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 183 | |
| 184 | if [ ${withEapol} = false ] || [ ${withFlows} = false ]; then |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 185 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.aaa |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 186 | fi |
| 187 | |
| 188 | if [ ${withDhcp} = false ] || [ ${withFlows} = false ]; then |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 189 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.dhcpl2relay |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 190 | fi |
| 191 | |
| 192 | if [ ${withIgmp} = false ] || [ ${withFlows} = false ]; then |
| 193 | # FIXME will actually affected the tests only after VOL-3054 is addressed |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 194 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.igmpproxy |
| 195 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.mcast |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 196 | fi |
| 197 | |
| 198 | if [ ${withFlows} = false ]; then |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 199 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.olt |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 200 | fi |
| 201 | |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 202 | if [ ${withMibTemplate} = true ] ; then |
| 203 | rm -f BBSM-12345123451234512345-00000000000001-v1.json |
| 204 | wget https://raw.githubusercontent.com/opencord/voltha-openonu-adapter/master/templates/BBSM-12345123451234512345-00000000000001-v1.json |
| 205 | cat BBSM-12345123451234512345-00000000000001-v1.json | kubectl exec -it $(kubectl get pods | grep etcd-cluster | awk 'NR==1{print $1}') etcdctl put service/voltha/omci_mibs/templates/BBSM/12345123451234512345/00000000000001 |
| 206 | fi |
| 207 | ''' |
| 208 | } |
| 209 | } |
| 210 | stage('Run Test') { |
| 211 | steps { |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 212 | sh ''' |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 213 | ROBOT_PARAMS="-v olt:${olts} \ |
| 214 | -v pon:${pons} \ |
| 215 | -v onu:${onus} \ |
| 216 | -v workflow:${workflow} \ |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 217 | -v withEapol:${withEapol} \ |
| 218 | -v withDhcp:${withDhcp} \ |
| 219 | -v withIgmp:${withIgmp} \ |
| 220 | --noncritical non-critical \ |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 221 | -e teardown " |
| 222 | |
| 223 | if [ ${withEapol} = false ] ; then |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 224 | ROBOT_PARAMS+="-e authentication " |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 225 | fi |
| 226 | |
| 227 | if [ ${withDhcp} = false ] ; then |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 228 | ROBOT_PARAMS+="-e dhcp " |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 229 | fi |
| 230 | |
| 231 | if [ ${provisionSubscribers} = false ] ; then |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 232 | ROBOT_PARAMS+="-e provision -e flow-after " |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 233 | fi |
| 234 | |
| 235 | if [ ${withFlows} = false ] ; then |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 236 | ROBOT_PARAMS+="-i setup -i activation " |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 237 | fi |
| 238 | |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 239 | mkdir -p $WORKSPACE/RobotLogs |
| 240 | cd voltha-system-tests |
| 241 | make vst_venv |
| 242 | source ./vst_venv/bin/activate |
| 243 | robot -d $WORKSPACE/RobotLogs \ |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 244 | $ROBOT_PARAMS tests/scale/Voltha_Scale_Tests.robot |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 245 | ''' |
| 246 | } |
| 247 | } |
| 248 | stage('Collect results') { |
| 249 | steps { |
| 250 | sh ''' |
| 251 | cd voltha-system-tests |
| 252 | source ./vst_venv/bin/activate |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 253 | python tests/scale/collect-result.py -r $WORKSPACE/RobotLogs/output.xml -p $WORKSPACE/plots > $WORKSPACE/execution-time.txt |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 254 | cat $WORKSPACE/execution-time.txt |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 255 | ''' |
| 256 | } |
| 257 | } |
| 258 | } |
| 259 | post { |
| 260 | always { |
| 261 | plot([ |
| 262 | csvFileName: 'scale-test.csv', |
| 263 | csvSeries: [ |
Matteo Scandolo | 272aed4 | 2020-05-08 15:05:57 -0700 | [diff] [blame] | 264 | [file: 'plots/plot-voltha-onus.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 265 | [file: 'plots/plot-onos-ports.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 266 | [file: 'plots/plot-voltha-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 267 | [file: 'plots/plot-onos-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 268 | [file: 'plots/plot-onos-auth.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 269 | [file: 'plots/plot-voltha-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 270 | [file: 'plots/plot-onos-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 271 | [file: 'plots/plot-onos-dhcp.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 272 | ], |
| 273 | group: 'Voltha-Scale-Numbers', numBuilds: '20', style: 'line', title: "Scale Test (OLTs: ${olts}, PONs: ${pons}, ONUs: ${onus})", yaxis: 'Time (s)', useDescr: true |
| 274 | ]) |
| 275 | step([$class: 'RobotPublisher', |
| 276 | disableArchiveOutput: false, |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 277 | logFileName: 'RobotLogs/log.html', |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 278 | otherFiles: '', |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 279 | outputFileName: 'RobotLogs/output.xml', |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 280 | outputPath: '.', |
| 281 | passThreshold: 100, |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 282 | reportFileName: 'RobotLogs/report.html', |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 283 | unstableThreshold: 0]); |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 284 | // count how many ONUs have been activated |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 285 | sh ''' |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 286 | mkdir -p $WORKSPACE/logs |
| 287 | echo "#-of-ONUs" > $WORKSPACE/logs/voltha-devices-count.txt |
| 288 | echo $(voltctl device list | grep -v OLT | grep ACTIVE | wc -l) >> $WORKSPACE/logs/voltha-devices-count.txt |
| 289 | ''' |
| 290 | // count how many ports have been discovered |
| 291 | sh ''' |
| 292 | echo "#-of-ports" > $WORKSPACE/logs/onos-ports-count.txt |
| 293 | echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 ports -e | grep BBSM | wc -l) >> $WORKSPACE/logs/onos-ports-count.txt |
| 294 | ''' |
| 295 | // count how many flows have been provisioned |
| 296 | sh ''' |
| 297 | echo "#-of-flows" > $WORKSPACE/logs/onos-flows-count.txt |
| 298 | echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 flows -s | grep ADDED | wc -l) >> $WORKSPACE/logs/onos-flows-count.txt |
| 299 | ''' |
| 300 | // dump and count the authenticated users |
| 301 | sh ''' |
| 302 | if [ ${withOnosApps} = true ] && [ ${bbsimAuth} ] ; then |
| 303 | echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 aaa-users) >> $WORKSPACE/logs/onos-aaa-users.txt |
| 304 | |
| 305 | echo "#-of-authenticated-users" > $WORKSPACE/logs/onos-aaa-count.txt |
| 306 | echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 aaa-users | grep AUTHORIZED_STATE | wc -l) >> $WORKSPACE/logs/onos-aaa-count.txt |
| 307 | fi |
| 308 | ''' |
| 309 | // dump and count the dhcp users |
| 310 | sh ''' |
| 311 | if [ ${withOnosApps} = true ] && [ ${bbsimDhcp} ] ; then |
| 312 | echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 dhcpl2relay-allocations) >> $WORKSPACE/logs/onos-dhcp-allocations.txt |
| 313 | |
| 314 | echo "#-of-dhcp-allocations" > $WORKSPACE/logs/onos-dhcp-count.txt |
| 315 | echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 dhcpl2relay-allocations | grep DHCPACK | wc -l) >> $WORKSPACE/logs/onos-dhcp-count.txt |
| 316 | fi |
| 317 | ''' |
| 318 | // check which containers were used in this build |
| 319 | sh ''' |
| 320 | kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq |
| 321 | kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq |
| 322 | ''' |
| 323 | // dump all the VOLTHA devices informations |
| 324 | sh ''' |
| 325 | voltctl device list -o json > $WORKSPACE/logs/device-list.json |
| 326 | python -m json.tool $WORKSPACE/logs/device-list.json > $WORKSPACE/logs/voltha-devices-list.json |
| 327 | ''' |
| 328 | // dump all the BBSim(s) ONU informations |
| 329 | sh ''' |
| 330 | BBSIM_IDS=$(kubectl get pods | grep bbsim | grep -v server | awk '{print $1}') |
| 331 | IDS=($BBSIM_IDS) |
| 332 | |
| 333 | for bbsim in "${IDS[@]}" |
| 334 | do |
| 335 | kubectl exec -t $bbsim bbsimctl onu list > $WORKSPACE/logs/$bbsim-device-list.txt |
| 336 | done |
| 337 | ''' |
| 338 | // get ports and flows from ONOS |
| 339 | sh ''' |
| 340 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 ports > $WORKSPACE/logs/onos-ports-list.txt |
| 341 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 flows -s > $WORKSPACE/logs/onos-flows-list.txt |
| 342 | ''' |
| 343 | // get all the logs from kubernetes PODs |
| 344 | sh ''' |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 345 | kubectl get pods -o wide > $WORKSPACE/logs/pods.txt |
| 346 | kubectl logs -l app=adapter-open-olt > $WORKSPACE/logs/open-olt-logs.logs |
| 347 | kubectl logs -l app=adapter-open-onu > $WORKSPACE/logs/open-onu-logs.logs |
| 348 | kubectl logs -l app=rw-core > $WORKSPACE/logs/voltha-rw-core-logs.logs |
| 349 | kubectl logs -l app=ofagent > $WORKSPACE/logs/voltha-ofagent-logs.logs |
| 350 | kubectl logs -l app=bbsim > $WORKSPACE/logs/bbsim-logs.logs |
| 351 | kubectl logs -l app=onos > $WORKSPACE/logs/onos-logs.logs |
| 352 | ''' |
Matteo Scandolo | 0358d86 | 2020-05-08 14:25:10 -0700 | [diff] [blame] | 353 | archiveArtifacts artifacts: 'kind-voltha/install-minimal.log,execution-time.txt,logs/*' |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 354 | } |
| 355 | } |
| 356 | } |