Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [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 | |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 15 | node ("${TestNodeName}") { |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 16 | timeout (100) { |
| 17 | try { |
| 18 | stage ("Parse deployment configuration file") { |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 19 | sh returnStdout: true, script: "rm -rf ${configBaseDir}" |
| 20 | sh returnStdout: true, script: "git clone -b ${branch} ${cordRepoUrl}/${configBaseDir}" |
| 21 | deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}.yml" |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 22 | } |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 23 | stage('Clean up') { |
| 24 | timeout(10) { |
| 25 | sh returnStdout: true, script: """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 26 | rm -rf helm-charts cord-tester |
| 27 | git clone -b ${branch} ${cordRepoUrl}/helm-charts |
| 28 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Luca Prete | 5a97015 | 2018-08-29 15:20:47 -0700 | [diff] [blame] | 29 | for hchart in \$(helm list -q | grep -E -v 'docker-registry|mavenrepo|ponnet'); |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 30 | do |
| 31 | echo "Purging chart: \${hchart}" |
| 32 | helm delete --purge "\${hchart}" |
| 33 | done |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 34 | """ |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 35 | timeout(5) { |
| 36 | waitUntil { |
| 37 | helm_deleted = sh returnStdout: true, script: """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 38 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
Luca Prete | b496667 | 2018-08-29 16:49:48 -0700 | [diff] [blame] | 39 | helm ls -q | grep -E -v 'docker-registry|mavenrepo|ponnet' | wc -l |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 40 | """ |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 41 | return helm_deleted.toInteger() == 0 |
| 42 | } |
| 43 | } |
| 44 | timeout(5) { |
| 45 | waitUntil { |
| 46 | kubectl_deleted = sh returnStdout: true, script: """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 47 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
Luca Prete | b496667 | 2018-08-29 16:49:48 -0700 | [diff] [blame] | 48 | kubectl get pods --all-namespaces --no-headers | grep -E -v 'kube-system|docker-registry|mavenrepo|ponnet' | wc -l |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 49 | """ |
| 50 | return kubectl_deleted.toInteger() == 0 |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 51 | } |
| 52 | } |
| 53 | } |
| 54 | } |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 55 | dir ("helm-charts") { |
| 56 | stage('Install Voltha Kafka') { |
| 57 | timeout(10) { |
| 58 | sh returnStdout: true, script: """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 59 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 60 | helm install --name voltha-kafka --set replicas=1 --set persistence.enabled=false --set zookeeper.replicaCount=1 --set zookeeper.persistence.enabled=false incubator/kafka |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 61 | """ |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 62 | } |
| 63 | timeout(10) { |
| 64 | waitUntil { |
| 65 | kafka_instances_running = sh returnStdout: true, script: """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 66 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 67 | kubectl get pods | grep voltha-kafka | grep -i running | grep 1/1 | wc -l |
| 68 | """ |
| 69 | return kafka_instances_running.toInteger() == 2 |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | stage('Install voltha') { |
| 74 | timeout(10) { |
| 75 | sh returnStdout: true, script: """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 76 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 77 | helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/ |
| 78 | helm dep build voltha |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 79 | helm install -n voltha -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml --set etcd-operator.customResources.createEtcdClusterCRD=false voltha |
Matteo Scandolo | a6e1f9d | 2018-08-29 17:23:19 -0700 | [diff] [blame^] | 80 | helm upgrade -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml --set etcd-operator.customResources.createEtcdClusterCRD=true voltha ./voltha |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 81 | """ |
| 82 | } |
| 83 | timeout(10) { |
| 84 | waitUntil { |
| 85 | voltha_completed = sh returnStdout: true, script: """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 86 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 87 | kubectl get pods -n voltha | grep -i running | grep 1/1 | wc -l |
| 88 | """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 89 | return voltha_completed.toInteger() == 8 |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 90 | } |
| 91 | } |
| 92 | } |
Luca Prete | b1d2db2 | 2018-08-28 10:31:44 -0700 | [diff] [blame] | 93 | stage('Install CORD Kafka') { |
| 94 | timeout(10) { |
| 95 | sh returnStdout: true, script: """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 96 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Luca Prete | b1d2db2 | 2018-08-28 10:31:44 -0700 | [diff] [blame] | 97 | helm install --name cord-kafka --set replicas=1 --set persistence.enabled=false --set zookeeper.replicaCount=1 --set zookeeper.persistence.enabled=false incubator/kafka |
| 98 | """ |
| 99 | } |
| 100 | timeout(10) { |
| 101 | waitUntil { |
| 102 | kafka_instances_running = sh returnStdout: true, script: """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 103 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
Luca Prete | b1d2db2 | 2018-08-28 10:31:44 -0700 | [diff] [blame] | 104 | kubectl get pods | grep cord-kafka | grep -i running | grep 1/1 | wc -l |
| 105 | """ |
| 106 | return kafka_instances_running.toInteger() == 2 |
| 107 | } |
| 108 | } |
| 109 | } |
Luca Prete | 5a97015 | 2018-08-29 15:20:47 -0700 | [diff] [blame] | 110 | stage('Install ONOS') { |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 111 | timeout(10) { |
| 112 | sh returnStdout: true, script: """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 113 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Luca Prete | 5a97015 | 2018-08-29 15:20:47 -0700 | [diff] [blame] | 114 | helm install -n onos -f configs/onos.yaml -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml onos |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 115 | """ |
| 116 | } |
| 117 | timeout(10) { |
| 118 | waitUntil { |
Luca Prete | 5a97015 | 2018-08-29 15:20:47 -0700 | [diff] [blame] | 119 | onos_completed = sh returnStdout: true, script: """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 120 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
Luca Prete | 5a97015 | 2018-08-29 15:20:47 -0700 | [diff] [blame] | 121 | kubectl get pods | grep -i onos | grep -i running | grep 1/1 | wc -l |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 122 | """ |
Luca Prete | 5a97015 | 2018-08-29 15:20:47 -0700 | [diff] [blame] | 123 | return onos_completed.toInteger() == 1 |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 124 | } |
| 125 | } |
| 126 | } |
| 127 | stage('Install xos-core') { |
| 128 | timeout(10) { |
| 129 | sh returnStdout: true, script: """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 130 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 131 | helm dep update xos-core |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 132 | helm install -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n xos-core xos-core |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 133 | """ |
| 134 | } |
| 135 | timeout(10) { |
| 136 | waitUntil { |
| 137 | xos_core_completed = sh returnStdout: true, script: """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 138 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 139 | kubectl get pods | grep -i xos | grep -i running | grep 1/1 | wc -l |
| 140 | """ |
| 141 | return xos_core_completed.toInteger() == 7 |
| 142 | } |
| 143 | } |
| 144 | } |
| 145 | stage('Install rcord-lite') { |
| 146 | timeout(10) { |
| 147 | sh returnStdout: true, script: """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 148 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 149 | helm dep update xos-profiles/rcord-lite |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 150 | helm install -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n rcord-lite xos-profiles/rcord-lite |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 151 | """ |
| 152 | } |
| 153 | timeout(10) { |
| 154 | waitUntil { |
| 155 | rcord_tosca_completed = sh returnStdout: true, script: """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 156 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 157 | kubectl get pods | grep -i tosca-loader | grep -i completed | wc -l |
| 158 | """ |
| 159 | return rcord_tosca_completed.toInteger() == 1 |
| 160 | } |
| 161 | } |
| 162 | } |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 163 | stage('Install hippie-oss') { |
| 164 | timeout(10) { |
| 165 | sh returnStdout: true, script: """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 166 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 167 | helm install -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n hippie-oss xos-services/hippie-oss |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 168 | """ |
| 169 | } |
| 170 | timeout(10) { |
| 171 | waitUntil { |
| 172 | hippie_oss_running = sh returnStdout: true, script: """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 173 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 174 | kubectl get pods | grep -i hippie-oss | grep -i running | grep 1/1 | wc -l |
| 175 | """ |
| 176 | return hippie_oss_running.toInteger() == 1 |
| 177 | } |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 178 | } |
| 179 | } |
| 180 | } |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 181 | stage('Reinstall OLT software') { |
| 182 | for(int i=0; i < deployment_config.olts.size(); i++) { |
| 183 | sh returnStdout: true, script: """ |
| 184 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'dpkg --remove asfvolt16 && dpkg --purge asfvolt16' |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 185 | """ |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 186 | timeout(5) { |
| 187 | waitUntil { |
| 188 | olt_sw_present = sh returnStdout: true, script: """ |
| 189 | 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' |
| 190 | """ |
| 191 | return olt_sw_present.toInteger() == 0 |
| 192 | } |
| 193 | } |
| 194 | sh returnStdout: true, script: """ |
| 195 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} "dpkg --install ${oltDebVersion}" |
| 196 | """ |
| 197 | timeout(5) { |
| 198 | waitUntil { |
| 199 | olt_sw_present = sh returnStdout: true, script: """ |
| 200 | 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' |
| 201 | """ |
| 202 | return olt_sw_present.toInteger() == 1 |
| 203 | } |
| 204 | } |
| 205 | // If the OLT is connected to a 40G switch interface, set the NNI port to be downgraded |
| 206 | if ("${deployment_config.olts[i].fortygig}" != null && "${deployment_config.olts[i].fortygig}" == 'true') { |
| 207 | sh returnStdout: true, script: """ |
| 208 | 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' |
| 209 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} '/opt/bcm68620/svk_init.sh' |
| 210 | """ |
| 211 | } |
| 212 | } |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 213 | } |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 214 | stage('Restart OLT processes') { |
| 215 | for(int i=0; i < deployment_config.olts.size(); i++) { |
| 216 | timeout(5) { |
| 217 | sh returnStdout: true, script: """ |
| 218 | ssh-keyscan -H ${deployment_config.olts[i].ip} >> ~/.ssh/known_hosts |
| 219 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'pkill bal_core_dist' || true |
| 220 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'pkill openolt' || true |
| 221 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} '> /broadcom/bal.log' |
| 222 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} '> /broadcom/openolt.log' |
| 223 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'cd /broadcom; ./bal_core_dist -C :55001 < /dev/tty1 > ./bal.log 2>&1 &' |
| 224 | sleep 5 |
| 225 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'cd /broadcom; ./openolt -C 127.0.0.1:55001 < /dev/tty1 > ./openolt.log 2>&1 &' |
| 226 | """ |
| 227 | } |
| 228 | timeout(15) { |
| 229 | waitUntil { |
| 230 | onu_discovered = sh returnStdout: true, script: "sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'cat /broadcom/openolt.log | grep \"oper_state:up\" | wc -l'" |
| 231 | return onu_discovered.toInteger() > 0 |
| 232 | } |
| 233 | } |
| 234 | } |
| 235 | } |
| 236 | stage('Download cord-tester repo') { |
| 237 | timeout(2) { |
| 238 | sh returnStdout: true, script: """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 239 | git clone -b ${branch} ${cordRepoUrl}/cord-tester |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 240 | """ |
| 241 | } |
| 242 | } |
| 243 | stage('Validate installed PODs') { |
| 244 | timeout(10) { |
Kailash Khalasi | 4f2ee5f | 2018-08-28 08:57:11 -0700 | [diff] [blame] | 245 | sh """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 246 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Kailash Khalasi | 4f2ee5f | 2018-08-28 08:57:11 -0700 | [diff] [blame] | 247 | cd $WORKSPACE/cord-tester/src/test/robot/ |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 248 | rm -rf Log/ || true |
Kailash Khalasi | e9ad83c | 2018-08-07 11:22:36 -0700 | [diff] [blame] | 249 | pybot -d Log -T SanityK8POD.robot || true |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 250 | """ |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 251 | } |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 252 | } |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 253 | stage('Configurations and Tests') { |
| 254 | timeout(10) { |
Kailash Khalasi | 4f2ee5f | 2018-08-28 08:57:11 -0700 | [diff] [blame] | 255 | sh """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 256 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Kailash Khalasi | 4f2ee5f | 2018-08-28 08:57:11 -0700 | [diff] [blame] | 257 | cd $WORKSPACE/cord-tester/src/test/cord-api/Properties/ |
Kailash Khalasi | 2bd5894 | 2018-08-28 09:10:20 -0700 | [diff] [blame] | 258 | sed -i \"s/^\\(SERVER_IP = \\).*/\\1\'${deployment_config.nodes[0].ip}\'/\" RestApiProperties.py |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 259 | sed -i \"s/^\\(SERVER_PORT = \\).*/\\1\'30006\'/\" RestApiProperties.py |
| 260 | sed -i \"s/^\\(XOS_USER = \\).*/\\1\'admin@opencord.org\'/\" RestApiProperties.py |
| 261 | sed -i \"s/^\\(XOS_PASSWD = \\).*/\\1\'letmein\'/\" RestApiProperties.py |
Kailash Khalasi | 4f2ee5f | 2018-08-28 08:57:11 -0700 | [diff] [blame] | 262 | cd $WORKSPACE/cord-tester/src/test/cord-api/Tests/ |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 263 | rm -rf Log/ || true |
Kailash Khalasi | e9ad83c | 2018-08-07 11:22:36 -0700 | [diff] [blame] | 264 | pybot -d Log -T FabricConfig.txt || true |
| 265 | pybot -d Log -T HippieOSS.txt || true |
Suchitra Vemuri | 6555676 | 2018-08-22 13:52:38 -0700 | [diff] [blame] | 266 | sleep 5 |
Kailash Khalasi | e9ad83c | 2018-08-07 11:22:36 -0700 | [diff] [blame] | 267 | pybot -d Log -T OSSVolt.txt || true |
| 268 | pybot -d Log -T RealOLT_Test.txt || true |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 269 | """ |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 270 | } |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 271 | } |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 272 | stage('Subscriber Validation and Ping Tests') { |
Kailash Khalasi | 2bd5894 | 2018-08-28 09:10:20 -0700 | [diff] [blame] | 273 | timeout(30) { |
Kailash Khalasi | 4f2ee5f | 2018-08-28 08:57:11 -0700 | [diff] [blame] | 274 | sh """ |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 275 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Kailash Khalasi | 4f2ee5f | 2018-08-28 08:57:11 -0700 | [diff] [blame] | 276 | cd $WORKSPACE/cord-tester/src/test/cord-api/Tests/ |
Suchitra Vemuri | 6555676 | 2018-08-22 13:52:38 -0700 | [diff] [blame] | 277 | pybot -d Log -T HippieOSS_instances.txt || true |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 278 | pybot -d Log -T -v src_ip:${deployment_config.srcHost.ip} -v src_user:${deployment_config.srcHost.user} -v src_pass:${deployment_config.srcHost.pass} -v dst_user:${deployment_config.dstHost.user} -v dst_pass:${deployment_config.dstHost.pass} -v dst_ip:${deployment_config.dstHost.ip} -v dst_host_ip:${deployment_config.dstHost.hostIp} -v src_gateway:${deployment_config.srcHost.gateway} -v dst_gateway:${deployment_config.dstHost.gateway} -v init_state:awaiting-auth -v INITIAL_STATUS:FAIL -v ENABLE_STATUS:FAIL -v MACIP_STATUS:PASS Subscriber_StatusChecks.txt || true |
Suchitra Vemuri | 6555676 | 2018-08-22 13:52:38 -0700 | [diff] [blame] | 279 | """ |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 280 | } |
Suchitra Vemuri | 6555676 | 2018-08-22 13:52:38 -0700 | [diff] [blame] | 281 | } |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 282 | stage('Publish test results') { |
| 283 | sh returnStdout: true, script: """ |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 284 | if [ -d RobotLogs ]; then rm -r RobotLogs; fi; mkdir RobotLogs; |
| 285 | mkdir RobotLogs/TestDoc || true |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 286 | cp -r $WORKSPACE/cord-tester/src/test/robot/Log/* $WORKSPACE/RobotLogs || true |
Kailash Khalasi | 4f2ee5f | 2018-08-28 08:57:11 -0700 | [diff] [blame] | 287 | cp -r $WORKSPACE/cord-tester/src/test/cord-api/Tests/Log/* $WORKSPACE/RobotLogs || true |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 288 | """ |
| 289 | step([$class: 'RobotPublisher', |
| 290 | disableArchiveOutput: false, |
| 291 | logFileName: 'RobotLogs/log*.html', |
| 292 | otherFiles: '', |
| 293 | outputFileName: 'RobotLogs/output*.xml', |
| 294 | outputPath: '.', |
| 295 | passThreshold: 100, |
| 296 | reportFileName: 'RobotLogs/report*.html', |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 297 | unstableThreshold: 0 |
| 298 | ]) |
| 299 | } |
| 300 | currentBuild.result = 'SUCCESS' |
| 301 | } catch (err) { |
| 302 | currentBuild.result = 'FAILURE' |
| 303 | step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false]) |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 304 | } |
Luca Prete | e310515 | 2018-08-20 14:42:30 -0700 | [diff] [blame] | 305 | echo "RESULT: ${currentBuild.result}" |
Suchitra Vemuri | 5d95aa9 | 2018-07-24 17:22:16 -0700 | [diff] [blame] | 306 | } |
| 307 | } |