blob: 1c8b38a747a56fd69bfed72ffdf6836af7225ac5 [file] [log] [blame]
Kailash6f5acb62019-08-28 14:38:45 -07001// 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
15node ("${TestNodeName}") {
Suchitra Vemurib4f365f2020-03-27 15:09:36 -070016 def withKind = false
Andy Bavieraf5883e2020-06-03 12:54:21 -070017 def VolthaEtcdPort = '2379'
Suchitra Vemurib4f365f2020-03-27 15:09:36 -070018 if (params.withKind != null){
19 withKind = params.withKind
20 }
Andy Bavieraf5883e2020-06-03 12:54:21 -070021 if (params.VolthaEtcdPort != null){
22 VolthaEtcdPort = params.VolthaEtcdPort
23 }
Kailash6f5acb62019-08-28 14:38:45 -070024 timeout (100) {
25 try {
26 stage ("Parse deployment configuration file") {
Suchitra Vemurib4f365f2020-03-27 15:09:36 -070027 sh returnStdout: true, script: "rm -rf ${configBaseDir} voltha-system-tests kind-voltha"
Suchitra Vemurie514b8c2019-09-23 19:37:18 -070028 sh returnStdout: true, script: "git clone -b master ${cordRepoUrl}/${configBaseDir}"
Suchitra Vemurib4f365f2020-03-27 15:09:36 -070029 sh returnStdout: true, script: "git clone -b ${branch} ${cordRepoUrl}/voltha-system-tests"
Suchitra Vemuria9562212020-04-10 19:32:03 -070030 sh returnStdout: true, script: "git clone -b master ${cordRepoUrl}/kind-voltha"
Suchitra Vemurib4f365f2020-03-27 15:09:36 -070031 if ( params.workFlow == "DT" ) {
32 deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml"
33 }
34 else
35 {
36 deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml"
37 }
Kailash6f5acb62019-08-28 14:38:45 -070038 }
39 stage('Clean up') {
Suchitra Vemuri76261d02020-05-08 16:33:32 -070040 timeout(15) {
Kailash6f5acb62019-08-28 14:38:45 -070041 sh returnStdout: true, script: """
42 export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
Matteo Scandolo1294aeb2019-09-24 16:20:32 -070043 for hchart in \$(helm list -q | grep -E -v 'docker-registry|mavenrepo|ponnet');
44 do
45 echo "Purging chart: \${hchart}"
46 helm delete --purge "\${hchart}"
47 done
Kailash6f5acb62019-08-28 14:38:45 -070048 """
49 timeout(5) {
50 waitUntil {
51 helm_deleted = sh returnStdout: true, script: """
52 export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf &&
53 helm ls -q | grep -E -v 'docker-registry|mavenrepo|ponnet' | wc -l
54 """
55 return helm_deleted.toInteger() == 0
56 }
57 }
58 timeout(5) {
59 waitUntil {
60 kubectl_deleted = sh returnStdout: true, script: """
61 export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf &&
62 kubectl get pods --all-namespaces --no-headers | grep -E -v 'kube-system|docker-registry|mavenrepo|ponnet' | wc -l
63 """
64 return kubectl_deleted.toInteger() == 0
65 }
66 }
Suchitra Vemurib4f365f2020-03-27 15:09:36 -070067 timeout(1) {
Hung-Wei Chiu2fa15622020-04-07 16:40:35 -070068 sh returnStdout: false, script: """
69 #Remove all while true; do kubectl port-forward ...done; rules
70 for port_fwd_id in `ps -ax | grep "port-forward" | grep -E "onos|voltha" | grep "while true"| awk '{print \$1}'`;
71 do
72 cat /proc/\$port_fwd_id/cmdline
73 kill -9 \$port_fwd_id
74 done
75
76 #Remove all kubectl port-forward rules
77 for port_fwd_id in `ps -ax | grep "port-forward" | grep -E "onos|voltha" | awk '{print \$1}'`;
78 do
79 cat /proc/\$port_fwd_id/cmdline
80 kill -9 \$port_fwd_id
81 done
Suchitra Vemurib4f365f2020-03-27 15:09:36 -070082 """
83 }
Kailash6f5acb62019-08-28 14:38:45 -070084 }
85 }
Suchitra Vemuri1934abc2019-11-05 12:41:11 -080086 stage('Install Voltha') {
Suchitra Vemuri76261d02020-05-08 16:33:32 -070087 timeout(20) {
Kailash6f5acb62019-08-28 14:38:45 -070088 sh returnStdout: true, script: """
89 export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
90 cd kind-voltha/
Andy Bavier4f23d9d2020-07-02 06:14:00 -070091 export EXTRA_HELM_FLAGS=""
Suchitra Vemurib4f365f2020-03-27 15:09:36 -070092 if [ "${branch}" != "master" ]; then
93 cd $WORKSPACE/kind-voltha
Andy Bavier4f23d9d2020-07-02 06:14:00 -070094 # The releases/ file also specifies EXTRA_HELM_FLAGS
Suchitra Vemurib4f365f2020-03-27 15:09:36 -070095 source releases/${branch}
Suchitra Vemuri1934abc2019-11-05 12:41:11 -080096 fi
Andy Bavier4f23d9d2020-07-02 06:14:00 -070097 # Make sure that the EXTRA_HELM_FLAGS from the releases/ file appear at the end to override earlier values
98 export EXTRA_HELM_FLAGS="-f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/voltha/${configFileName}.yml \$EXTRA_HELM_FLAGS"
Andy Bavier7cee6f42019-11-05 16:49:47 -070099
Andy Bavieraf5883e2020-06-03 12:54:21 -0700100 # JENKINS_NODE_COOKIE=dontKillMe ask Jenkins doesn't kill the proces after this job.
101 # we want the `while true; do kubectl port-forward` keep alive
102 export JENKINS_NODE_COOKIE=dontKillMe
103 export NUM_OF_OPENONU=${NumOfOpenOnu}
104 export NUM_OF_ONOS=${NumOfOnos}
105 export NUM_OF_ATOMIX=${NumOfAtomix}
Andy Bavier7cee6f42019-11-05 16:49:47 -0700106 # VOL-2194 ONOS SSH and REST ports hardcoded to 30115/30120 in tests
Andy Bavieraf5883e2020-06-03 12:54:21 -0700107 export ONOS_SSH_PORT=30115
108 export ONOS_API_PORT=30120
109 export VOLTHA_LOG_LEVEL=DEBUG
110 export WITH_SIM_ADAPTERS=n
111 export DEPLOY_K8S=no
112 export INSTALL_KUBECTL=no
113 export INSTALL_HELM=no
Matteo Scandolo1fdb2f82020-06-04 09:26:43 -0700114 export WITH_RADIUS=yes
Andy Bavieraf5883e2020-06-03 12:54:21 -0700115 export FANCY=0
116 # VOL-3162 Forwaring port 2379 does not work on ONF demo pod
117 export VOLTHA_ETCD_PORT=${VolthaEtcdPort}
118
Suchitra Vemurib4f365f2020-03-27 15:09:36 -0700119 if [[ "${workFlow}" == "DT" ]]; then
Andy Bavieraf5883e2020-06-03 12:54:21 -0700120 WITH_EAPOL=no WITH_DHCP=no WITH_IGMP=no WITH_RADIUS=no ./voltha up
Suchitra Vemurib4f365f2020-03-27 15:09:36 -0700121 else
Andy Bavieraf5883e2020-06-03 12:54:21 -0700122 ./voltha up
Suchitra Vemurib4f365f2020-03-27 15:09:36 -0700123 fi
Andy Bavier7cee6f42019-11-05 16:49:47 -0700124
Matteo Scandolo727c7972020-04-13 13:09:25 -0700125 kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\t'}{.image}{'\\n'}" | sort | uniq
126 kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\t'}{.imageID}{'\\n'}" | sort | uniq
Suchitra Vemuri1934abc2019-11-05 12:41:11 -0800127 kubectl get nodes -o wide
128 kubectl get pods -n voltha -o wide
Kailash6f5acb62019-08-28 14:38:45 -0700129 """
Suchitra Vemuri1934abc2019-11-05 12:41:11 -0800130 }
Kailash6f5acb62019-08-28 14:38:45 -0700131 }
Suchitra Vemurib4f365f2020-03-27 15:09:36 -0700132 if ( withKind && deployment_config.fabric_switches.size() > 0 ) {
133 stage('OpenFlow port forward for aggregation switch') {
134 timeout(1) {
135 sh returnStdout: true, script: """
136 export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
137 #This uses the default route out, porperly configured is the management
138 mgmt_address=`ip route get 1 | awk '{print \$NF;exit}'`
Andrea Campanellac5f7db72020-05-08 10:58:11 +0200139 JENKINS_NODE_COOKIE=dontkill kubectl port-forward -n default service/onos-onos-classic-hs --address=\$mgmt_address 6653:6653 >> /dev/null 2>&1 &
Suchitra Vemurib4f365f2020-03-27 15:09:36 -0700140 """
141 }
142 }
143 }
144 if ( params.configurePod && params.profile != "Default" ) {
Suchitra Vemuri72680092019-10-03 12:39:20 -0700145 stage('Push Tech-Profile') {
Andrea Campanellabea02762020-04-23 10:59:08 +0200146 for(int i=0; i < deployment_config.olts.size(); i++) {
147 def tech_prof_directory = "XGS-PON"
148 if (deployment_config.olts[i].oltDebVersion.contains("asgvolt64")){
149 tech_prof_directory = "GPON"
150 }
151 timeout(1) {
152 out_push_tp = sh returnStatus: true, script: """
153 export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
Suchitra Vemuri2d045902020-06-08 18:32:19 -0700154 etcd_container=\$(kubectl get pods | grep etcd | awk 'NR==1{print \$1}')
155 kubectl cp $WORKSPACE/voltha-system-tests/tests/data/TechProfile-${profile}.json \$etcd_container:/tmp/flexpod.json
156 put_result=\$(kubectl exec -it \$etcd_container -- /bin/sh -c 'cat /tmp/flexpod.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/${tech_prof_directory}/64')
Suchitra Vemuri992377e2020-06-20 18:03:49 -0700157 //kubectl cp $WORKSPACE/voltha-system-tests/tests/data/MIB_Alpha.json \$etcd_container:/tmp/MIB_Alpha.json
158 //put_result=\$(kubectl exec -it \$etcd_container -- /bin/sh -c 'cat /tmp/MIB_Alpha.json | ETCDCTL_API=3 etcdctl put service/voltha/omci_mibs/templates/BRCM/BVM4K00BRA0915-0083/5023_020O02414')
Suchitra Vemuri2d045902020-06-08 18:32:19 -0700159 //kubectl cp $WORKSPACE/voltha-system-tests/tests/data/MIB_Iskratel.json \$etcd_container:/tmp/MIB_Iskratel.json
160 //put_result=\$(kubectl exec -it \$etcd_container -- /bin/sh -c 'cat /tmp/MIB_Iskratel.json | ETCDCTL_API=3 etcdctl put service/voltha/omci_mibs/templates/BRCM/G108_10/7.0.1b8-0.6')
Andrea Campanellabea02762020-04-23 10:59:08 +0200161 """
162 return out_push_tp == 0
163 }
164 timeout(1) {
165 out_get_tp = sh returnStatus: true, script: """
Andrea Campanella85b0a8d2020-05-14 12:56:47 +0200166 export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
Suchitra Vemuri2d045902020-06-08 18:32:19 -0700167 etcd_container=\$(kubectl get pods | grep etcd | awk 'NR==1{print \$1}')
168 get_result=\$(kubectl exec -it \$etcd_container -- /bin/sh -c 'ETCDCTL_API=3 etcdctl get --prefix service/voltha/technology_profiles/${tech_prof_directory}/64')
Andrea Campanellabea02762020-04-23 10:59:08 +0200169 """
170 return out_get_tp == 0
171 }
Suchitra Vemuri72680092019-10-03 12:39:20 -0700172 }
hwchiuc77c7d22019-10-18 13:58:35 -0700173 }
174 }
175 stage('Push Sadis-config') {
176 timeout(1) {
177 sadis_out = sh returnStatus: true, script: """
Suchitra Vemuri992377e2020-06-20 18:03:49 -0700178 export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
179 etcd_container=\$(kubectl get pods | grep etcd | awk 'NR==1{print \$1}')
180 kubectl cp $WORKSPACE/voltha-system-tests/tests/data/MIB_Alpha.json \$etcd_container:/tmp/MIB_Alpha.json
181 put_result=\$(kubectl exec -it \$etcd_container -- /bin/sh -c 'cat /tmp/MIB_Alpha.json | ETCDCTL_API=3 etcdctl put service/voltha/omci_mibs/templates/BRCM/BVM4K00BRA0915-0083/5023_020O02414')
Suchitra Vemurib4f365f2020-03-27 15:09:36 -0700182 if [[ "${workFlow}" == "DT" ]]; then
183 curl -sSL --user karaf:karaf -X POST -H Content-Type:application/json http://${deployment_config.nodes[0].ip}:30120/onos/v1/network/configuration --data @$WORKSPACE/voltha-system-tests/tests/data/${configFileName}-sadis-DT.json
184 else
Suchitra Vemuri72680092019-10-03 12:39:20 -0700185 curl -sSL --user karaf:karaf -X POST -H Content-Type:application/json http://${deployment_config.nodes[0].ip}:30120/onos/v1/network/configuration --data @$WORKSPACE/voltha-system-tests/tests/data/${configFileName}-sadis.json
Suchitra Vemurib4f365f2020-03-27 15:09:36 -0700186 fi
187 """
188 return sadis_out == 0
You Wangb9526e62019-10-07 15:25:48 -0700189 }
hwchiuc77c7d22019-10-18 13:58:35 -0700190 }
Kailash6f5acb62019-08-28 14:38:45 -0700191 if ( params.reinstallOlt ) {
192 stage('Reinstall OLT software') {
193 for(int i=0; i < deployment_config.olts.size(); i++) {
194 sh returnStdout: true, script: """
Suchitra Vemuri66174b02020-05-14 16:44:28 -0700195 if [ "${branch}" != "master" ]; then
196 sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} "dpkg --install ${deployment_config.olts[i].oltDebVersion23}"
197 else
198 sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} "dpkg --install ${deployment_config.olts[i].oltDebVersion}"
199 fi
Suchitra Vemurib4f365f2020-03-27 15:09:36 -0700200 sleep 10
Kailash6f5acb62019-08-28 14:38:45 -0700201 """
202 timeout(5) {
203 waitUntil {
204 olt_sw_present = sh returnStdout: true, script: """
Suchitra Vemuri66174b02020-05-14 16:44:28 -0700205 if [[ "${deployment_config.olts[i].oltDebVersion}" == *"asfvolt16-2.4"* ]] || [[ "${deployment_config.olts[i].oltDebVersion23}" == *"asfvolt16-2.4"* ]]; then
Andrea Campanellace9e9902020-04-07 18:29:42 +0200206 sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'dpkg --list | grep asfvolt16 | wc -l'
207 else
208 sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'dpkg --list | grep asgvolt64 | wc -l'
209 fi
Suchitra Vemuri66174b02020-05-14 16:44:28 -0700210 if (${deployment_config.olts[i].fortygig}); then
211 if [[ "${deployment_config.olts[i].oltDebVersion}" == *"asfvolt16-2.4"* ]] || [[ "${deployment_config.olts[i].oltDebVersion23}" == *"asfvolt16-2.4"* ]]; then
212 sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'echo "port ce128 sp=40000 if=XLAUI" >> /broadcom/qax.soc'
213 else
214 sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'echo "port ce128 sp=40000" >> /broadcom/qax.soc'
215 fi
Suchitra Vemurib4f365f2020-03-27 15:09:36 -0700216 fi
Kailash6f5acb62019-08-28 14:38:45 -0700217 """
Andrea Campanellace9e9902020-04-07 18:29:42 +0200218 return olt_sw_present.toInteger() > 0
Kailash6f5acb62019-08-28 14:38:45 -0700219 }
220 }
Kailash6f5acb62019-08-28 14:38:45 -0700221 }
222 }
Suchitra Vemurib4f365f2020-03-27 15:09:36 -0700223 stage('Restart OLT processes') {
Kailash6f5acb62019-08-28 14:38:45 -0700224 for(int i=0; i < deployment_config.olts.size(); i++) {
225 timeout(5) {
226 sh returnStdout: true, script: """
227 ssh-keyscan -H ${deployment_config.olts[i].ip} >> ~/.ssh/known_hosts
Andy Bavier1923ecc2020-06-18 14:06:40 -0700228 sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'rm -f /var/log/openolt.log; rm -f /var/log/dev_mgmt_daemon.log; reboot' || true
Suchitra Vemurib4f365f2020-03-27 15:09:36 -0700229 sleep 120
Kailash6f5acb62019-08-28 14:38:45 -0700230 """
231 }
232 timeout(15) {
233 waitUntil {
Suchitra Vemurib4f365f2020-03-27 15:09:36 -0700234 devprocess = sh returnStdout: true, script: "sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'ps -ef | grep dev_mgmt_daemon | wc -l'"
235 return devprocess.toInteger() > 0
236 }
237 }
238 timeout(15) {
239 waitUntil {
240 openoltprocess = sh returnStdout: true, script: "sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'ps -ef | grep openolt | wc -l'"
241 return openoltprocess.toInteger() > 0
Kailash6f5acb62019-08-28 14:38:45 -0700242 }
243 }
244 }
245 }
246 }
Matteo Scandolo1294aeb2019-09-24 16:20:32 -0700247 if ( deployment_config.fabric_switches.size() > 0 ) {
You Wang25e58612019-10-01 16:30:28 -0700248 stage('Switch Configurations in ONOS') {
249 timeout(1) {
250 netcfg_out = sh returnStatus: true, script: """
251 curl -sSL --user karaf:karaf -X POST -H Content-Type:application/json http://${deployment_config.nodes[0].ip}:30120/onos/v1/network/configuration --data @$WORKSPACE/${configBaseDir}/${configToscaDir}/voltha/${configFileName}-onos-netcfg-switch.json
252 curl -sSL --user karaf:karaf -X POST http://${deployment_config.nodes[0].ip}:30120/onos/v1/applications/org.onosproject.segmentrouting/active
Suchitra Vemurib4f365f2020-03-27 15:09:36 -0700253
You Wang25e58612019-10-01 16:30:28 -0700254 """
255 return netcfg_out == 0
256 }
257 timeout(1) {
258 waitUntil {
259 sr_active_out = sh returnStatus: true, script: """
You Wangeb76aeb2019-12-09 22:08:23 -0800260 ssh-keygen -R [${deployment_config.nodes[0].ip}]:30115
Suchitra Vemuric3257262019-12-05 19:06:42 -0800261 ssh-keyscan -p 30115 -H ${deployment_config.nodes[0].ip} >> ~/.ssh/known_hosts
262 sshpass -p karaf ssh -p 30115 karaf@${deployment_config.nodes[0].ip} "log:set TRACE org.opencord.dhcpl2relay"
263 sshpass -p karaf ssh -p 30115 karaf@${deployment_config.nodes[0].ip} "log:set TRACE org.opencord.aaa"
264 sshpass -p karaf ssh -p 30115 karaf@${deployment_config.nodes[0].ip} "log:set TRACE org.opencord.olt"
You Wang25e58612019-10-01 16:30:28 -0700265 curl -sSL --user karaf:karaf -X GET http://${deployment_config.nodes[0].ip}:30120/onos/v1/applications/org.onosproject.segmentrouting | jq '.state' | grep ACTIVE
Suchitra Vemurib4f365f2020-03-27 15:09:36 -0700266 sshpass -p karaf ssh -p 30115 karaf@${deployment_config.nodes[0].ip} "cfg set org.onosproject.net.flow.impl.FlowRuleManager purgeOnDisconnection false"
Andrea Campanella086bcbb2020-04-01 09:56:23 +0200267 sshpass -p karaf ssh -p 30115 karaf@${deployment_config.nodes[0].ip} "cfg set org.onosproject.net.meter.impl.MeterManager purgeOnDisconnection false"
You Wang25e58612019-10-01 16:30:28 -0700268 """
269 return sr_active_out == 0
270 }
271 }
Andrea Campanellabea02762020-04-23 10:59:08 +0200272 timeout(5) {
You Wang25e58612019-10-01 16:30:28 -0700273 for(int i=0; i < deployment_config.hosts.src.size(); i++) {
Andrea Campanellabea02762020-04-23 10:59:08 +0200274 def aggPort = -1
275 for(int j=0; j < deployment_config.olts.size(); j++) {
276 if(deployment_config.olts[j].serial == deployment_config.hosts.src[j].olt){
277 aggPort = deployment_config.olts[j].aggPort
278 }
279 }
280 if(aggPort == -1){
281 throw new Exception("Upstream port for the olt is not configured, field aggPort is empty")
282 }
You Wang25e58612019-10-01 16:30:28 -0700283 xconnect_out = sh returnStatus: true, script: """
Suchitra Vemuri992377e2020-06-20 18:03:49 -0700284 sleep 30
Suchitra Vemurif82086d2020-01-16 19:55:16 -0800285 version=\$(sshpass -p karaf ssh -p 30115 karaf@${deployment_config.nodes[0].ip} "summary" | grep version)
Suchitra Vemurib4f365f2020-03-27 15:09:36 -0700286 sleep 10
Suchitra Vemurif82086d2020-01-16 19:55:16 -0800287 if [[ \$version == *"version=2.2"* ]]; then
Andrea Campanellabea02762020-04-23 10:59:08 +0200288 curl -X POST --user karaf:karaf --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"deviceId": "${deployment_config.fabric_switches[0].device_id}", "vlanId": "${deployment_config.hosts.src[i].s_tag}", "endpoints": [${deployment_config.fabric_switches[0].bngPort},${aggPort}]}' 'http://${deployment_config.nodes[0].ip}:30120/onos/segmentrouting/xconnect'
Suchitra Vemurif82086d2020-01-16 19:55:16 -0800289 else
Andrea Campanellabea02762020-04-23 10:59:08 +0200290 curl -X POST --user karaf:karaf --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"deviceId": "${deployment_config.fabric_switches[0].device_id}", "vlanId": "${deployment_config.hosts.src[i].s_tag}", "ports": [${deployment_config.fabric_switches[0].bngPort},${aggPort}]}' 'http://${deployment_config.nodes[0].ip}:30120/onos/segmentrouting/xconnect'
Suchitra Vemurif82086d2020-01-16 19:55:16 -0800291 fi
You Wang25e58612019-10-01 16:30:28 -0700292 """
293 }
294 }
Kailash6f5acb62019-08-28 14:38:45 -0700295 }
Matteo Scandolo1294aeb2019-09-24 16:20:32 -0700296 }
Kailash6f5acb62019-08-28 14:38:45 -0700297 currentBuild.result = 'SUCCESS'
298 } catch (err) {
299 currentBuild.result = 'FAILURE'
300 step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false])
301 throw err
302 }
303 echo "RESULT: ${currentBuild.result}"
304 }
305}