| // Copyright 2017-present Open Networking Foundation |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| node("intel-102") { |
| timeout (240) { |
| try { |
| stage("Lisitng the VM") { |
| timeout(1) { |
| waitUntil { |
| running_vms = sh returnStdout: true, script: """ |
| virsh list --all |
| """ |
| echo "Running VMs: ${running_vms}" |
| return true |
| } |
| } |
| timeout(1) { |
| waitUntil { |
| running_vms = sh returnStdout: true, script: """ |
| virsh list --all | grep "c3po-mme1\\|c3po-hss1\\|ngic-cp1\\|ngic-dp1\\|c3po-dbn1" | grep -i running | wc -l |
| """ |
| echo "Running VMs: ${running_vms}" |
| return running_vms.toInteger() >= 5 |
| } |
| } |
| } |
| stage("Connecting to ngic-cp1") { |
| sh returnStdout: true, script: """ |
| ssh ngic-cp1 'if pgrep -f [n]gic_controlplane; then pkill -f [n]gic_controlplane; fi' |
| ssh ngic-cp1 'cd /home/ngic-rtc/cp && (./run.sh > /dev/null 2>&1 &)' |
| sleep 1; |
| ssh ngic-cp1 'pgrep -f ngic_controlplane' |
| """ |
| } |
| stage("Connecting to ngic-dp1") { |
| sh returnStdout: true, script: """ |
| ssh ngic-dp1 'if pgrep -f [n]gic_dataplane; then pkill -f [n]gic_dataplane; fi' |
| ssh ngic-dp1 'cd /home/ngic-rtc/dp && (./run.sh > /dev/null 2>&1 &)' |
| sleep 10; |
| ssh ngic-dp1 'cd /home/ngic-rtc/kni_ifcfg && ./kni-SGIdevcfg.sh' |
| ssh ngic-dp1 'cd /home/ngic-rtc/kni_ifcfg && ./kni-S1Udevcfg.sh' |
| ssh ngic-dp1 'pgrep -f ngic_dataplane' |
| """ |
| } |
| stage("Connecting to c3po-mme1") { |
| sh returnStdout: true, script: """ |
| ssh c3po-mme1 'if pgrep -f [m]me-app; then pkill -f [m]me-app; fi' |
| ssh c3po-mme1 'if pgrep -f [s]1ap-app; then pkill -f [s]1ap-app; fi' |
| ssh c3po-mme1 'if pgrep -f [s]11-app; then pkill -f [s]11-app; fi' |
| ssh c3po-mme1 'if pgrep -f [s]6a-app; then pkill -f [s]6a-app; fi' |
| sleep 1; |
| ssh c3po-mme1 'cd /home/openmme/src/mme-app && export LD_LIBRARY_PATH=../common/ && (./mme-app > /dev/null 2>&1 &)' |
| ssh c3po-mme1 'cd /home/openmme/src/s1ap && export LD_LIBRARY_PATH=../common/ && (./s1ap-app > /dev/null 2>&1 &)' |
| ssh c3po-mme1 'cd /home/openmme/src/s11 && export LD_LIBRARY_PATH=../common/ && (./s11-app > /dev/null 2>&1 &)' |
| ssh c3po-mme1 'cd /home/openmme/src/s6a && export LD_LIBRARY_PATH=../common/ && (./s6a-app > /dev/null 2>&1 &)' |
| sleep 2; |
| ssh c3po-mme1 'pgrep mme-app && pgrep s1ap-app && pgrep s11-app && pgrep s6a-app' |
| """ |
| } |
| stage("Connecting to Polaris") { |
| timeout(10) { |
| waitUntil { |
| test_output = sh returnStdout: true, script: """ |
| 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' |
| ssh polaris 'cd /root/LTELoadTester && cat test-output.log' |
| """ |
| echo "Polaris log: ${test_output}" |
| return true |
| } |
| } |
| |
| sh returnStdout: true, script: """ |
| ssh polaris 'cd /root/LTELoadTester && grep -P -o "Test pass percentage.*?100%" test-output.log' |
| """ |
| } |
| currentBuild.result = 'SUCCESS' |
| } catch (err) { |
| currentBuild.result = 'FAILURE' |
| } |
| echo "RESULT: ${currentBuild.result}" |
| } |
| } |