blob: 06d40c92e472e9ad3e8f3d4098e82d449370232a [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}"
Kailashf2fde622019-02-15 21:38:43 -08008 options {
9 timeout(time: 1, unit: 'HOURS')
10 }
Kailash Khalasif005fcb2018-10-02 12:52:03 -070011 }
12
Kailash Khalasif005fcb2018-10-02 12:52:03 -070013 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
Kailash4853bb02019-02-12 12:53:14 -080045 make ${params.version}
Kailash Khalasif005fcb2018-10-02 12:52:03 -070046 popd
47 """
48 }
49 }
50
51 stage ('Run E2E Tests') {
52 steps {
53 sh """
54 pushd $WORKSPACE/automation-tools/seba-in-a-box
Kailash Khalasid0c5ecf2018-10-19 13:52:37 -070055 make run-tests ${params.Test_Tags} || true
Kailash Khalasif005fcb2018-10-02 12:52:03 -070056 popd
57 """
58 }
59 }
60
Kailash Khalasidaa056e2018-10-12 09:58:26 -070061 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 Khalasif005fcb2018-10-02 12:52:03 -070074 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 Khalasi2a1e24b2018-10-02 14:15:59 -070097 sudo cp /var/log/containers/*.log $WORKSPACE/
98 sudo chown cord:cord $WORKSPACE/*log
Kailash Khalasif005fcb2018-10-02 12:52:03 -070099 '''
Kailash Khalasi2a1e24b2018-10-02 14:15:59 -0700100 archiveArtifacts artifacts: '*.log'
Kailash Khalasif005fcb2018-10-02 12:52:03 -0700101 step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "andy@opennetworking.org, kailash@opennetworking.org", sendToIndividuals: false])
102 }
Kailash Khalasibb2042e2018-10-04 09:41:49 -0700103 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 Khalasif005fcb2018-10-02 12:52:03 -0700111 }
112}