blob: 0c6b8332ac803397d9b630a2557576e916f04157 [file] [log] [blame]
Kailash Khalasif005fcb2018-10-02 12:52:03 -07001/* seba-in-a-box build+test */
2
3pipeline {
4
5 /* no label, executor is determined by JJB */
6 agent {
7 label "${params.executorNode}"
8 }
9
Kailasha2ee5fa2019-02-19 09:14:34 -080010 options {
11 timeout(time: 1, unit: 'HOURS')
12 }
13
Kailash Khalasif005fcb2018-10-02 12:52:03 -070014 stages {
15
16 stage ("Clean workspace") {
17 steps {
18 sh 'rm -rf *'
19 }
20 }
21
22 stage ('Checkout Automation-Tools Repo') {
23 steps {
24 sh '''
25 pushd $WORKSPACE
26 git clone https://gerrit.opencord.org/automation-tools
27 popd
28 '''
29 }
30 }
31
32 stage ('Reset Kubeadm') {
33 steps {
34 sh """
35 pushd $WORKSPACE/automation-tools/seba-in-a-box
36 make reset-kubeadm
37 popd
38 """
39 }
40 }
41
42 stage ('Install SEBA') {
43 steps {
44 sh """
45 pushd $WORKSPACE/automation-tools/seba-in-a-box
Kailash04b87952019-05-16 09:51:39 -070046 make ${params.Test_Tags} ${params.version}
Kailash Khalasif005fcb2018-10-02 12:52:03 -070047 popd
48 """
49 }
50 }
51
52 stage ('Run E2E Tests') {
53 steps {
54 sh """
55 pushd $WORKSPACE/automation-tools/seba-in-a-box
Andy Bavier5e92df62019-05-09 16:11:24 -070056 make ${params.Test_Target} ${params.Test_Tags} || true
Kailash Khalasif005fcb2018-10-02 12:52:03 -070057 popd
58 """
59 }
60 }
61
Kailash Khalasidaa056e2018-10-12 09:58:26 -070062 stage ('Display Kafka Events') {
63 steps {
64 sh """
65 pushd $WORKSPACE/automation-tools/seba-in-a-box
Andy Bavierabea9582019-07-08 09:49:49 -070066 CORD_KAFKA_IP=\$(kubectl get pod -l app=kafka -o json | jq -r '.items[0].status.podIP')
Kailash Khalasidaa056e2018-10-12 09:58:26 -070067 kafkacat -e -C -b \$CORD_KAFKA_IP -t onu.events -f 'Topic %t [%p] at offset %o: key %k: %s\n >0'
68 kafkacat -e -C -b \$CORD_KAFKA_IP -t authentication.events -f 'Topic %t [%p] at offset %o: key %k: %s\n >0'
69 kafkacat -e -C -b \$CORD_KAFKA_IP -t dhcp.events -f 'Topic %t [%p] at offset %o: key %k: %s\n >0'
70 popd
71 """
72 }
73 }
74
Kailash Khalasif005fcb2018-10-02 12:52:03 -070075 stage('Publish') {
76 steps {
77 sh """
78 if [ -d RobotLogs ]; then rm -r RobotLogs; fi; mkdir RobotLogs
79 cp -r $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/WorkflowValidations/*ml ./RobotLogs
80 """
81 step([$class: 'RobotPublisher',
82 disableArchiveOutput: false,
83 logFileName: 'RobotLogs/log*.html',
84 otherFiles: '',
85 outputFileName: 'RobotLogs/output*.xml',
86 outputPath: '.',
87 passThreshold: 100,
88 reportFileName: 'RobotLogs/report*.html',
89 unstableThreshold: 0]);
90 }
91 }
92
93 }
94
95 post {
96 always {
97 sh '''
Kailash842cd872019-03-13 13:56:38 -070098 kubectl describe pods > $WORKSPACE/kube_pods.log
99 kubectl describe pods -n voltha > $WORKSPACE/kube_voltha_pods.log
Kailash Khalasi2a1e24b2018-10-02 14:15:59 -0700100 sudo cp /var/log/containers/*.log $WORKSPACE/
101 sudo chown cord:cord $WORKSPACE/*log
Kailash Khalasif005fcb2018-10-02 12:52:03 -0700102 '''
Kailash Khalasi2a1e24b2018-10-02 14:15:59 -0700103 archiveArtifacts artifacts: '*.log'
Kailash Khalasif005fcb2018-10-02 12:52:03 -0700104 step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "andy@opennetworking.org, kailash@opennetworking.org", sendToIndividuals: false])
105 }
Kailash Khalasibb2042e2018-10-04 09:41:49 -0700106 failure {
107 sh '''
108 curl -X GET -u karaf:karaf http://127.0.0.1:30120/onos/v1/devices
109 curl -X GET -u karaf:karaf http://127.0.0.1:30120/onos/v1/devices/of:0000000000000001/ports
110 curl -X GET http://127.0.0.1:30125/api/v1/devices
111 curl -X GET http://127.0.0.1:30125/api/v1/logical_devices
112 '''
113 }
Kailash Khalasif005fcb2018-10-02 12:52:03 -0700114 }
115}