blob: 72118eb4ac39429ee86cad9f26e1b3eec8f4d5cb [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
Kailash4853bb02019-02-12 12:53:14 -080046 make ${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
Kailash Khalasid0c5ecf2018-10-19 13:52:37 -070056 make run-tests ${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
66 CORD_KAFKA_IP=\$(kubectl exec cord-kafka-0 -- ip a | grep -oE "([0-9]{1,3}\\.){3}[0-9]{1,3}\\b" | grep 192)
67 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 '''
Kailash Khalasi2a1e24b2018-10-02 14:15:59 -070098 sudo cp /var/log/containers/*.log $WORKSPACE/
99 sudo chown cord:cord $WORKSPACE/*log
Kailash Khalasif005fcb2018-10-02 12:52:03 -0700100 '''
Kailash Khalasi2a1e24b2018-10-02 14:15:59 -0700101 archiveArtifacts artifacts: '*.log'
Kailash Khalasif005fcb2018-10-02 12:52:03 -0700102 step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "andy@opennetworking.org, kailash@opennetworking.org", sendToIndividuals: false])
103 }
Kailash Khalasibb2042e2018-10-04 09:41:49 -0700104 failure {
105 sh '''
106 curl -X GET -u karaf:karaf http://127.0.0.1:30120/onos/v1/devices
107 curl -X GET -u karaf:karaf http://127.0.0.1:30120/onos/v1/devices/of:0000000000000001/ports
108 curl -X GET http://127.0.0.1:30125/api/v1/devices
109 curl -X GET http://127.0.0.1:30125/api/v1/logical_devices
110 '''
111 }
Kailash Khalasif005fcb2018-10-02 12:52:03 -0700112 }
113}