blob: f433bff19f0c6031613a672ca07bd925878422d4 [file] [log] [blame]
Luca Prete271bf5a2019-01-23 14:50:01 -08001// 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.
Luca Prete19723d92019-02-07 10:05:29 -080014node("intel-102") {
michele.pezzuttiec84ec52019-02-18 10:51:52 +010015 timeout (120) {
Luca Prete19723d92019-02-07 10:05:29 -080016 try {
michele.pezzuttiec84ec52019-02-18 10:51:52 +010017 stage("Listing the VM") {
Luca Prete19723d92019-02-07 10:05:29 -080018 timeout(1) {
19 waitUntil {
20 running_vms = sh returnStdout: true, script: """
Ganeshbabue1611ac2019-02-14 11:36:51 +000021 virsh list --all
Luca Prete19723d92019-02-07 10:05:29 -080022 """
Ganeshbabue1611ac2019-02-14 11:36:51 +000023 echo "Running VMs: ${running_vms}"
24 return true
25 }
26 }
27 timeout(1) {
28 waitUntil {
29 running_vms = sh returnStdout: true, script: """
30 virsh list --all | grep "c3po-mme1\\|c3po-hss1\\|ngic-cp1\\|ngic-dp1\\|c3po-dbn1" | grep -i running | wc -l
31 """
32 echo "Running VMs: ${running_vms}"
Luca Prete19723d92019-02-07 10:05:29 -080033 return running_vms.toInteger() >= 5
34 }
Luca Prete271bf5a2019-01-23 14:50:01 -080035 }
Luca Prete19723d92019-02-07 10:05:29 -080036 }
Luca Prete19723d92019-02-07 10:05:29 -080037 stage("Connecting to ngic-cp1") {
michele.pezzuttiec84ec52019-02-18 10:51:52 +010038// ssh ngic-cp1 'sh test.sh'
39 timeout(10) {
40 waitUntil {
41 ngic_cp1_output = sh returnStdout: true, script: """
42 ssh ngic-cp1 'if pgrep -f [n]gic_controlplane; then pkill -f [n]gic_controlplane; fi'
43 ssh ngic-cp1 'cd /home/ngic-rtc/cp && (./run.sh 2>/var/log/cicd_cp1.stderr 1>/var/log/cicd_cp1.stdout &)'
44 sleep 1;
45 ssh ngic-cp1 'pgrep -fl [n]gic_controlplane || (cat /var/log/cicd_cp1.stderr && cat /var/log/cicd_cp1.stdout && exit 1)'
46 """
47 echo "${ngic_cp1_output}"
48 return true
49 }
50 }
Luca Prete19723d92019-02-07 10:05:29 -080051 sh returnStdout: true, script: """
michele.pezzuttiec84ec52019-02-18 10:51:52 +010052 ssh ngic-cp1 'pgrep -fl [n]gic_controlplane'
Luca Prete19723d92019-02-07 10:05:29 -080053 """
54 }
Ganeshbabue1611ac2019-02-14 11:36:51 +000055 stage("Connecting to ngic-dp1") {
michele.pezzuttiec84ec52019-02-18 10:51:52 +010056 timeout(10) {
57 waitUntil {
58 ngic_dp1_output = sh returnStdout: true, script: """
59 ssh ngic-dp1 'if pgrep -f [n]gic_dataplane; then pkill -f [n]gic_dataplane; fi'
60 ssh ngic-dp1 'cd /home/ngic-rtc/dp && (./run.sh 2>/var/log/cicd_dp1.stderr 1>/var/log/cicd_dp1.stdout &)'
61 sleep 10;
62 ssh ngic-dp1 'cd /home/ngic-rtc/kni_ifcfg && ./kni-SGIdevcfg.sh'
63 ssh ngic-dp1 'cd /home/ngic-rtc/kni_ifcfg && ./kni-S1Udevcfg.sh'
64 ssh ngic-dp1 'pgrep -fl [n]gic_dataplane || (cat /var/log/cicd_dp1.stderr && cat /var/log/cicd_dp1.stdout && exit 1)'
65 """
66 echo "${ngic_dp1_output}"
67 return true
68 }
69 }
Luca Prete19723d92019-02-07 10:05:29 -080070 sh returnStdout: true, script: """
michele.pezzuttiec84ec52019-02-18 10:51:52 +010071 ssh ngic-dp1 'pgrep -fl [n]gic_dataplane'
72 """
73 }
74 stage("Connecting to c3po-hss1") {
75 timeout(10) {
76 waitUntil {
77 c3po_hss1_output = sh returnStdout: true, script: """
78 ssh c3po-hss1 'if pgrep -f [h]ss; then pkill -f [h]ss; fi'
79 ssh c3po-hss1 'cd /home/c3po/hss && (./bin/hss -j conf/hss.json 2>/var/log/cicd_hss1.stderr 1>/var/log/cicd_hss1.stdout &)'
80 sleep 2;
81 ssh c3po-hss1 'pgrep -fl [h]ss || (cat /var/log/cicd_hss1.stderr && cat /var/log/cicd_hss1.stdout && exit 1)'
82 """
83 echo "${c3po_hss1_output}"
84 return true
85 }
86 }
87 sh returnStdout: true, script: """
88 ssh c3po-hss1 'pgrep -fl [h]ss'
Luca Prete19723d92019-02-07 10:05:29 -080089 """
90 }
91 stage("Connecting to c3po-mme1") {
michele.pezzuttiec84ec52019-02-18 10:51:52 +010092 timeout(10) {
93 waitUntil {
94 c3po_mme1_output = sh returnStdout: true, script: """
95 ssh c3po-mme1 'if pgrep -f [m]me-app; then pkill -f [m]me-app; fi'
96 ssh c3po-mme1 'if pgrep -f [s]1ap-app; then pkill -f [s]1ap-app; fi'
97 ssh c3po-mme1 'if pgrep -f [s]11-app; then pkill -f [s]11-app; fi'
98 ssh c3po-mme1 'if pgrep -f [s]6a-app; then pkill -f [s]6a-app; fi'
99 sleep 1;
100 ssh c3po-mme1 'cd /home/openmme/src/mme-app && export LD_LIBRARY_PATH=../common/ && (./mme-app 2>/var/log/cicd_mme_mme_app.stderr 1>/var/log/cicd_mme_mme_app.stdout &)'
101 ssh c3po-mme1 'cd /home/openmme/src/s1ap && export LD_LIBRARY_PATH=../common/ && (./s1ap-app 2>/var/log/cicd_mme_s1ap_app.stderr 1>/var/log/cicd_mme_s1ap_app.stdout &)'
102 ssh c3po-mme1 'cd /home/openmme/src/s11 && export LD_LIBRARY_PATH=../common/ && (./s11-app 2>/var/log/cicd_mme_s11_app.stderr 1>/var/log/cicd_mme_s11_app.stdout &)'
103 ssh c3po-mme1 'cd /home/openmme/src/s6a && export LD_LIBRARY_PATH=../common/ && (./s6a-app 2>/var/log/cicd_mme_s6a_app.stderr 1>/var/log/cicd_mme_s6a_app.stdout &)'
104 sleep 2;
105 ssh c3po-mme1 'pgrep -fl [m]me-app || (cat /var/log/cicd_mme_mme_app.stderr && cat /var/log/cicd_mme_mme_app.stdout && exit 1)'
106 ssh c3po-mme1 'pgrep -fl [s]1ap-app || (cat /var/log/cicd_mme_s1ap_app.stderr && cat /var/log/cicd_mme_s1ap_app.stdout && exit 1)'
107 ssh c3po-mme1 'pgrep -fl [s]11-app || (cat /var/log/cicd_mme_s11_app.stderr && cat /var/log/cicd_mme_s11_app.stdout && exit 1)'
108 ssh c3po-mme1 'pgrep -fl [s]6a-app || (cat /var/log/cicd_mme_s6a_app.stderr && cat /var/log/cicd_mme_s6a_app.stdout && exit 1)'
109 """
110 echo "${c3po_mme1_output}"
111 return true
112 }
113 sh returnStdout: true, script: """
114 ssh c3po-mme1 'pgrep -f [m]me-app && pgrep -f [s]1ap-app && pgrep -f [s]11-app && pgrep -fl [s]6a-app '
115 """
116 }
Luca Prete19723d92019-02-07 10:05:29 -0800117 }
118 stage("Connecting to Polaris") {
Luca Prete19723d92019-02-07 10:05:29 -0800119 timeout(10) {
120 waitUntil {
121 test_output = sh returnStdout: true, script: """
Ganeshbabue1611ac2019-02-14 11:36:51 +0000122 ssh polaris 'cd /root/LTELoadTester && nettest -emulator 127.0.0.1:5678:enb,127.0.0.1:6789:ipte Attach-Detach-wdata.tcl > test-output.log'
123 ssh polaris 'cd /root/LTELoadTester && cat test-output.log'
Luca Prete19723d92019-02-07 10:05:29 -0800124 """
Ganeshbabue1611ac2019-02-14 11:36:51 +0000125 echo "Polaris log: ${test_output}"
126 return true
Luca Prete19723d92019-02-07 10:05:29 -0800127 }
128 }
Ganeshbabue1611ac2019-02-14 11:36:51 +0000129 sh returnStdout: true, script: """
130 ssh polaris 'cd /root/LTELoadTester && grep -P -o "Test pass percentage.*?100%" test-output.log'
131 """
Luca Prete19723d92019-02-07 10:05:29 -0800132 }
michele.pezzuttiec84ec52019-02-18 10:51:52 +0100133 /*
134 stage("Kill apps") {
135 sh returnStdout: true, script: """
136 ssh ngic-cp1 'if pgrep -f [n]gic_controlplane; then pkill -f [n]gic_controlplane; fi'
137 ssh ngic-dp1 'if pgrep -f [n]gic_dataplane; then pkill -f [n]gic_dataplane; fi'
138 ssh c3po-hss1 'if pgrep -f [h]ss; then pkill -f [h]ss; fi'
139 ssh c3po-mme1 'if pgrep -f [m]me-app; then pkill -f [m]me-app; fi'
140 ssh c3po-mme1 'if pgrep -f [s]1ap-app; then pkill -f [s]1ap-app; fi'
141 ssh c3po-mme1 'if pgrep -f [s]11-app; then pkill -f [s]11-app; fi'
142 ssh c3po-mme1 'if pgrep -f [s]6a-app; then pkill -f [s]6a-app; fi'
143 """
144 }
145 */
Luca Prete19723d92019-02-07 10:05:29 -0800146 currentBuild.result = 'SUCCESS'
147 } catch (err) {
148 currentBuild.result = 'FAILURE'
Luca Prete271bf5a2019-01-23 14:50:01 -0800149 }
Luca Prete19723d92019-02-07 10:05:29 -0800150 echo "RESULT: ${currentBuild.result}"
151 }
Luca Prete271bf5a2019-01-23 14:50:01 -0800152}