Luca Prete | 271bf5a | 2019-01-23 14:50:01 -0800 | [diff] [blame] | 1 | // 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 Prete | 19723d9 | 2019-02-07 10:05:29 -0800 | [diff] [blame] | 14 | node("intel-102") { |
Ganeshbabu | e1611ac | 2019-02-14 11:36:51 +0000 | [diff] [blame^] | 15 | timeout (240) { |
Luca Prete | 19723d9 | 2019-02-07 10:05:29 -0800 | [diff] [blame] | 16 | try { |
Luca Prete | 19723d9 | 2019-02-07 10:05:29 -0800 | [diff] [blame] | 17 | stage("Lisitng the VM") { |
Luca Prete | 19723d9 | 2019-02-07 10:05:29 -0800 | [diff] [blame] | 18 | timeout(1) { |
| 19 | waitUntil { |
| 20 | running_vms = sh returnStdout: true, script: """ |
Ganeshbabu | e1611ac | 2019-02-14 11:36:51 +0000 | [diff] [blame^] | 21 | virsh list --all |
Luca Prete | 19723d9 | 2019-02-07 10:05:29 -0800 | [diff] [blame] | 22 | """ |
Ganeshbabu | e1611ac | 2019-02-14 11:36:51 +0000 | [diff] [blame^] | 23 | 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 Prete | 19723d9 | 2019-02-07 10:05:29 -0800 | [diff] [blame] | 33 | return running_vms.toInteger() >= 5 |
| 34 | } |
Luca Prete | 271bf5a | 2019-01-23 14:50:01 -0800 | [diff] [blame] | 35 | } |
Luca Prete | 19723d9 | 2019-02-07 10:05:29 -0800 | [diff] [blame] | 36 | } |
Luca Prete | 19723d9 | 2019-02-07 10:05:29 -0800 | [diff] [blame] | 37 | stage("Connecting to ngic-cp1") { |
| 38 | sh returnStdout: true, script: """ |
Ganeshbabu | e1611ac | 2019-02-14 11:36:51 +0000 | [diff] [blame^] | 39 | 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 Prete | 19723d9 | 2019-02-07 10:05:29 -0800 | [diff] [blame] | 43 | """ |
| 44 | } |
Ganeshbabu | e1611ac | 2019-02-14 11:36:51 +0000 | [diff] [blame^] | 45 | stage("Connecting to ngic-dp1") { |
Luca Prete | 19723d9 | 2019-02-07 10:05:29 -0800 | [diff] [blame] | 46 | sh returnStdout: true, script: """ |
Ganeshbabu | e1611ac | 2019-02-14 11:36:51 +0000 | [diff] [blame^] | 47 | 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 Prete | 19723d9 | 2019-02-07 10:05:29 -0800 | [diff] [blame] | 53 | """ |
| 54 | } |
| 55 | stage("Connecting to c3po-mme1") { |
| 56 | sh returnStdout: true, script: """ |
Ganeshbabu | e1611ac | 2019-02-14 11:36:51 +0000 | [diff] [blame^] | 57 | 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 Prete | 19723d9 | 2019-02-07 10:05:29 -0800 | [diff] [blame] | 68 | """ |
| 69 | } |
| 70 | stage("Connecting to Polaris") { |
Luca Prete | 19723d9 | 2019-02-07 10:05:29 -0800 | [diff] [blame] | 71 | timeout(10) { |
| 72 | waitUntil { |
| 73 | test_output = sh returnStdout: true, script: """ |
Ganeshbabu | e1611ac | 2019-02-14 11:36:51 +0000 | [diff] [blame^] | 74 | 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 Prete | 19723d9 | 2019-02-07 10:05:29 -0800 | [diff] [blame] | 76 | """ |
Ganeshbabu | e1611ac | 2019-02-14 11:36:51 +0000 | [diff] [blame^] | 77 | echo "Polaris log: ${test_output}" |
| 78 | return true |
Luca Prete | 19723d9 | 2019-02-07 10:05:29 -0800 | [diff] [blame] | 79 | } |
| 80 | } |
Ganeshbabu | e1611ac | 2019-02-14 11:36:51 +0000 | [diff] [blame^] | 81 | |
| 82 | sh returnStdout: true, script: """ |
| 83 | ssh polaris 'cd /root/LTELoadTester && grep -P -o "Test pass percentage.*?100%" test-output.log' |
| 84 | """ |
Luca Prete | 19723d9 | 2019-02-07 10:05:29 -0800 | [diff] [blame] | 85 | } |
| 86 | currentBuild.result = 'SUCCESS' |
| 87 | } catch (err) { |
| 88 | currentBuild.result = 'FAILURE' |
Luca Prete | 271bf5a | 2019-01-23 14:50:01 -0800 | [diff] [blame] | 89 | } |
Luca Prete | 19723d9 | 2019-02-07 10:05:29 -0800 | [diff] [blame] | 90 | echo "RESULT: ${currentBuild.result}" |
| 91 | } |
Luca Prete | 271bf5a | 2019-01-23 14:50:01 -0800 | [diff] [blame] | 92 | } |