Kailash Khalasi | f005fcb | 2018-10-02 12:52:03 -0700 | [diff] [blame] | 1 | /* seba-in-a-box build+test */ |
| 2 | |
| 3 | pipeline { |
| 4 | |
| 5 | /* no label, executor is determined by JJB */ |
| 6 | agent { |
| 7 | label "${params.executorNode}" |
Kailash | f2fde62 | 2019-02-15 21:38:43 -0800 | [diff] [blame^] | 8 | options { |
| 9 | timeout(time: 1, unit: 'HOURS') |
| 10 | } |
Kailash Khalasi | f005fcb | 2018-10-02 12:52:03 -0700 | [diff] [blame] | 11 | } |
| 12 | |
Kailash Khalasi | f005fcb | 2018-10-02 12:52:03 -0700 | [diff] [blame] | 13 | stages { |
| 14 | |
| 15 | stage ("Clean workspace") { |
| 16 | steps { |
| 17 | sh 'rm -rf *' |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | stage ('Checkout Automation-Tools Repo') { |
| 22 | steps { |
| 23 | sh ''' |
| 24 | pushd $WORKSPACE |
| 25 | git clone https://gerrit.opencord.org/automation-tools |
| 26 | popd |
| 27 | ''' |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | stage ('Reset Kubeadm') { |
| 32 | steps { |
| 33 | sh """ |
| 34 | pushd $WORKSPACE/automation-tools/seba-in-a-box |
| 35 | make reset-kubeadm |
| 36 | popd |
| 37 | """ |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | stage ('Install SEBA') { |
| 42 | steps { |
| 43 | sh """ |
| 44 | pushd $WORKSPACE/automation-tools/seba-in-a-box |
Kailash | 4853bb0 | 2019-02-12 12:53:14 -0800 | [diff] [blame] | 45 | make ${params.version} |
Kailash Khalasi | f005fcb | 2018-10-02 12:52:03 -0700 | [diff] [blame] | 46 | popd |
| 47 | """ |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | stage ('Run E2E Tests') { |
| 52 | steps { |
| 53 | sh """ |
| 54 | pushd $WORKSPACE/automation-tools/seba-in-a-box |
Kailash Khalasi | d0c5ecf | 2018-10-19 13:52:37 -0700 | [diff] [blame] | 55 | make run-tests ${params.Test_Tags} || true |
Kailash Khalasi | f005fcb | 2018-10-02 12:52:03 -0700 | [diff] [blame] | 56 | popd |
| 57 | """ |
| 58 | } |
| 59 | } |
| 60 | |
Kailash Khalasi | daa056e | 2018-10-12 09:58:26 -0700 | [diff] [blame] | 61 | stage ('Display Kafka Events') { |
| 62 | steps { |
| 63 | sh """ |
| 64 | pushd $WORKSPACE/automation-tools/seba-in-a-box |
| 65 | CORD_KAFKA_IP=\$(kubectl exec cord-kafka-0 -- ip a | grep -oE "([0-9]{1,3}\\.){3}[0-9]{1,3}\\b" | grep 192) |
| 66 | kafkacat -e -C -b \$CORD_KAFKA_IP -t onu.events -f 'Topic %t [%p] at offset %o: key %k: %s\n >0' |
| 67 | kafkacat -e -C -b \$CORD_KAFKA_IP -t authentication.events -f 'Topic %t [%p] at offset %o: key %k: %s\n >0' |
| 68 | kafkacat -e -C -b \$CORD_KAFKA_IP -t dhcp.events -f 'Topic %t [%p] at offset %o: key %k: %s\n >0' |
| 69 | popd |
| 70 | """ |
| 71 | } |
| 72 | } |
| 73 | |
Kailash Khalasi | f005fcb | 2018-10-02 12:52:03 -0700 | [diff] [blame] | 74 | stage('Publish') { |
| 75 | steps { |
| 76 | sh """ |
| 77 | if [ -d RobotLogs ]; then rm -r RobotLogs; fi; mkdir RobotLogs |
| 78 | cp -r $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/WorkflowValidations/*ml ./RobotLogs |
| 79 | """ |
| 80 | step([$class: 'RobotPublisher', |
| 81 | disableArchiveOutput: false, |
| 82 | logFileName: 'RobotLogs/log*.html', |
| 83 | otherFiles: '', |
| 84 | outputFileName: 'RobotLogs/output*.xml', |
| 85 | outputPath: '.', |
| 86 | passThreshold: 100, |
| 87 | reportFileName: 'RobotLogs/report*.html', |
| 88 | unstableThreshold: 0]); |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | } |
| 93 | |
| 94 | post { |
| 95 | always { |
| 96 | sh ''' |
Kailash Khalasi | 2a1e24b | 2018-10-02 14:15:59 -0700 | [diff] [blame] | 97 | sudo cp /var/log/containers/*.log $WORKSPACE/ |
| 98 | sudo chown cord:cord $WORKSPACE/*log |
Kailash Khalasi | f005fcb | 2018-10-02 12:52:03 -0700 | [diff] [blame] | 99 | ''' |
Kailash Khalasi | 2a1e24b | 2018-10-02 14:15:59 -0700 | [diff] [blame] | 100 | archiveArtifacts artifacts: '*.log' |
Kailash Khalasi | f005fcb | 2018-10-02 12:52:03 -0700 | [diff] [blame] | 101 | step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "andy@opennetworking.org, kailash@opennetworking.org", sendToIndividuals: false]) |
| 102 | } |
Kailash Khalasi | bb2042e | 2018-10-04 09:41:49 -0700 | [diff] [blame] | 103 | failure { |
| 104 | sh ''' |
| 105 | curl -X GET -u karaf:karaf http://127.0.0.1:30120/onos/v1/devices |
| 106 | curl -X GET -u karaf:karaf http://127.0.0.1:30120/onos/v1/devices/of:0000000000000001/ports |
| 107 | curl -X GET http://127.0.0.1:30125/api/v1/devices |
| 108 | curl -X GET http://127.0.0.1:30125/api/v1/logical_devices |
| 109 | ''' |
| 110 | } |
Kailash Khalasi | f005fcb | 2018-10-02 12:52:03 -0700 | [diff] [blame] | 111 | } |
| 112 | } |