blob: b2ec7677803745c0aa4267cecd326f0bd7747ecb [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") {
Ganeshbabue1611ac2019-02-14 11:36:51 +000015 timeout (240) {
Luca Prete19723d92019-02-07 10:05:29 -080016 try {
Luca Prete19723d92019-02-07 10:05:29 -080017 stage("Lisitng 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") {
38 sh returnStdout: true, script: """
Ganeshbabue1611ac2019-02-14 11:36:51 +000039 ssh ngic-cp1 'if pgrep -f [n]gic_controlplane; then pkill -f [n]gic_controlplane; fi'
40 ssh ngic-cp1 'cd /home/ngic-rtc/cp && (./run.sh > /dev/null 2>&1 &)'
41 sleep 1;
42 ssh ngic-cp1 'pgrep -f ngic_controlplane'
Luca Prete19723d92019-02-07 10:05:29 -080043 """
44 }
Ganeshbabue1611ac2019-02-14 11:36:51 +000045 stage("Connecting to ngic-dp1") {
Luca Prete19723d92019-02-07 10:05:29 -080046 sh returnStdout: true, script: """
Ganeshbabue1611ac2019-02-14 11:36:51 +000047 ssh ngic-dp1 'if pgrep -f [n]gic_dataplane; then pkill -f [n]gic_dataplane; fi'
48 ssh ngic-dp1 'cd /home/ngic-rtc/dp && (./run.sh > /dev/null 2>&1 &)'
49 sleep 10;
50 ssh ngic-dp1 'cd /home/ngic-rtc/kni_ifcfg && ./kni-SGIdevcfg.sh'
51 ssh ngic-dp1 'cd /home/ngic-rtc/kni_ifcfg && ./kni-S1Udevcfg.sh'
52 ssh ngic-dp1 'pgrep -f ngic_dataplane'
Luca Prete19723d92019-02-07 10:05:29 -080053 """
54 }
55 stage("Connecting to c3po-mme1") {
56 sh returnStdout: true, script: """
Ganeshbabue1611ac2019-02-14 11:36:51 +000057 ssh c3po-mme1 'if pgrep -f [m]me-app; then pkill -f [m]me-app; fi'
58 ssh c3po-mme1 'if pgrep -f [s]1ap-app; then pkill -f [s]1ap-app; fi'
59 ssh c3po-mme1 'if pgrep -f [s]11-app; then pkill -f [s]11-app; fi'
60 ssh c3po-mme1 'if pgrep -f [s]6a-app; then pkill -f [s]6a-app; fi'
61 sleep 1;
62 ssh c3po-mme1 'cd /home/openmme/src/mme-app && export LD_LIBRARY_PATH=../common/ && (./mme-app > /dev/null 2>&1 &)'
63 ssh c3po-mme1 'cd /home/openmme/src/s1ap && export LD_LIBRARY_PATH=../common/ && (./s1ap-app > /dev/null 2>&1 &)'
64 ssh c3po-mme1 'cd /home/openmme/src/s11 && export LD_LIBRARY_PATH=../common/ && (./s11-app > /dev/null 2>&1 &)'
65 ssh c3po-mme1 'cd /home/openmme/src/s6a && export LD_LIBRARY_PATH=../common/ && (./s6a-app > /dev/null 2>&1 &)'
66 sleep 2;
67 ssh c3po-mme1 'pgrep mme-app && pgrep s1ap-app && pgrep s11-app && pgrep s6a-app'
Luca Prete19723d92019-02-07 10:05:29 -080068 """
69 }
70 stage("Connecting to Polaris") {
Luca Prete19723d92019-02-07 10:05:29 -080071 timeout(10) {
72 waitUntil {
73 test_output = sh returnStdout: true, script: """
Ganeshbabue1611ac2019-02-14 11:36:51 +000074 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'
75 ssh polaris 'cd /root/LTELoadTester && cat test-output.log'
Luca Prete19723d92019-02-07 10:05:29 -080076 """
Ganeshbabue1611ac2019-02-14 11:36:51 +000077 echo "Polaris log: ${test_output}"
78 return true
Luca Prete19723d92019-02-07 10:05:29 -080079 }
80 }
Ganeshbabue1611ac2019-02-14 11:36:51 +000081
82 sh returnStdout: true, script: """
83 ssh polaris 'cd /root/LTELoadTester && grep -P -o "Test pass percentage.*?100%" test-output.log'
84 """
Luca Prete19723d92019-02-07 10:05:29 -080085 }
86 currentBuild.result = 'SUCCESS'
87 } catch (err) {
88 currentBuild.result = 'FAILURE'
Luca Prete271bf5a2019-01-23 14:50:01 -080089 }
Luca Prete19723d92019-02-07 10:05:29 -080090 echo "RESULT: ${currentBuild.result}"
91 }
Luca Prete271bf5a2019-01-23 14:50:01 -080092}