Commit af2877cf authored by Raphael Defosseux's avatar Raphael Defosseux
Browse files

CI : Improvements to COTS-UE bench scripts


  -- Jenkins Pipeline script:
     -- Moved the node to a proper subnetwork
     -- Added ansiColor option
  -- XML testsuite file can now be an option to the main.py python script
     -- Added some examples testsuite templates
  -- main.py python file
     -- Added an option when opening an SSH session: taking care of clients with copied SSH keys
        in that case, verifing that we are on the correct host
     -- BuildeNB method is closer from Fujitsu's original one
        improvement on flexibility for code source path naming
        better clean-up of workspace
     -- LTEBOX EPC (init / termination / logCollection) methods improvements w/ a /tmp path
     -- Checking of processes (EPC / eNB) is parallelized
        also handles LTEBOX EPX vs OAI CN
     -- UE methods added: attach, detach, reboot, ping
        With complete parallelism for multiple UEs
        iperf added but not tested
Signed-off-by: Raphael Defosseux's avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent 6b383347
//
// Comments
pipeline {
// The node should be selected with a 'label' parameter
// trying to use NodeLabel plugin to pass it, currently failing to do so
agent {
label 'bellatrix'
label 'starsky'
}
options {
disableConcurrentBuilds()
timestamps()
// When performing commit status updates and merge requests comments
// the connection name SHALL be here.
// So please use the same connection name and use proper credentials
gitLabConnection('OAI GitLab')
ansiColor('xterm')
}
// the following parameter options are commented out so it shows the ones
// that you SHALL have to run the job.
......@@ -86,7 +84,7 @@ pipeline {
}
}
}
stage ("Build on eNB server") {
stage ("Build eNB") {
steps {
script {
dir ('ci-scripts') {
......@@ -96,7 +94,47 @@ pipeline {
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'],
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ADB_Credentials}", usernameVariable: 'ADB_Username', passwordVariable: 'ADB_Password']
]) {
sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --eNBRepository=${GIT_URL} --eNBBranch=${GIT_BRANCH} --eNBCommitID=${GIT_COMMIT} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password}"
sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --eNBRepository=${GIT_URL} --eNBBranch=${GIT_BRANCH} --eNBCommitID=${GIT_COMMIT} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} --XMLTestFile=xml_files/build_enb_usrp_start_epc.xml"
}
} catch (Exception e) {
sh "./ci-scripts/fail.sh"
currentBuild.result = 'FAILURE'
}
}
}
}
}
stage ("Test eNB - Band 7 - USRP210 - 5MHz") {
steps {
script {
dir ('ci-scripts') {
try {
withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'],
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'],
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ADB_Credentials}", usernameVariable: 'ADB_Username', passwordVariable: 'ADB_Password']
]) {
sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --eNBRepository=${GIT_URL} --eNBBranch=${GIT_BRANCH} --eNBCommitID=${GIT_COMMIT} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} --XMLTestFile=xml_files/enb_usrpB210_band7_50PRB.xml"
}
} catch (Exception e) {
//sh "./ci-scripts/fail.sh"
currentBuild.result = 'FAILURE'
}
}
}
}
}
stage ("Terminate All") {
steps {
script {
dir ('ci-scripts') {
try {
withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'],
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'],
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ADB_Credentials}", usernameVariable: 'ADB_Username', passwordVariable: 'ADB_Password']
]) {
sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --eNBRepository=${GIT_URL} --eNBBranch=${GIT_BRANCH} --eNBCommitID=${GIT_COMMIT} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} --XMLTestFile=xml_files/terminate_epc.xml"
}
} catch (Exception e) {
//sh "./ci-scripts/fail.sh"
......@@ -149,33 +187,29 @@ pipeline {
sh "python3 main.py --mode=LogCollectSPGW --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type} "
sh "python3 main.py --mode=LogCollectMME --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type} "
sh "python3 main.py --mode=LogCollectHSS --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type} "
if ("OAI".equals(params.EPC_Type)) {
sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/spgw.log.zip ./spgw.log.${env.BUILD_ID}.zip || true"
sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/mme.log.zip ./mme.log.${env.BUILD_ID}.zip || true"
sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/hss.log.zip ./hss.log.${env.BUILD_ID}.zip || true"
sh "sshpass -p \'${EPC_Password}\' ssh -t -t -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress} 'cd ${EPC_SourceCodePath}; cd scripts; if [ -e spgw.log.zip ]; then rm spgw.log.zip; fi;'"
sh "sshpass -p \'${EPC_Password}\' ssh -t -t -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress} 'cd ${EPC_SourceCodePath}; cd scripts; if [ -e mme.log.zip ]; then rm mme.log.zip; fi;'"
sh "sshpass -p \'${EPC_Password}\' ssh -t -t -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress} 'cd ${EPC_SourceCodePath}; cd scripts; if [ -e hss.log.zip ]; then rm hss.log.zip; fi;'"
} else {
sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:/home/${EPC_Username}/spgw.log.zip ./spgw.log.${env.BUILD_ID}.zip || true"
sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:/home/${EPC_Username}/mme.log.zip ./mme.log.${env.BUILD_ID}.zip || true"
sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:/home/${EPC_Username}/hss.log.zip ./hss.log.${env.BUILD_ID}.zip || true"
sh "sshpass -p \'${EPC_Password}\' ssh -t -t -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress} 'cd /home/${EPC_Username}; if [ -e spgw.log.zip ]; then rm spgw.log.zip; fi;'"
sh "sshpass -p \'${EPC_Password}\' ssh -t -t -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress} 'cd /home/${EPC_Username}; if [ -e mme.log.zip ]; then rm mme.log.zip; fi;'"
sh "sshpass -p \'${EPC_Password}\' ssh -t -t -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress} 'cd /home/${EPC_Username}; if [ -e hss.log.zip ]; then rm hss.log.zip; fi;'"
}
if(fileExists("spgw.log.${env.BUILD_ID}.zip")) {
sh "python3 main.py --mode=LogCollectPing --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type} "
sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/*.log.zip . || true"
if(fileExists("spgw.log.zip")) {
sh "mv spgw.log.zip ./spgw.log.${env.BUILD_ID}.zip"
archiveArtifacts "spgw.log.${env.BUILD_ID}.zip"
sh "rm spgw.log.${env.BUILD_ID}.zip"
}
if(fileExists("mme.log.${env.BUILD_ID}.zip")) {
if(fileExists("mme.log.zip")) {
sh "mv mme.log.zip ./mme.log.${env.BUILD_ID}.zip"
archiveArtifacts "mme.log.${env.BUILD_ID}.zip"
sh "rm mme.log.${env.BUILD_ID}.zip"
}
if(fileExists("hss.log.${env.BUILD_ID}.zip")) {
if(fileExists("hss.log.zip")) {
sh "mv hss.log.zip ./hss.log.${env.BUILD_ID}.zip"
archiveArtifacts "hss.log.${env.BUILD_ID}.zip"
sh "rm hss.log.${env.BUILD_ID}.zip"
}
if(fileExists("ping.log.zip")) {
sh "mv ping.log.zip ./ping.log.${env.BUILD_ID}.zip"
archiveArtifacts "ping.log.${env.BUILD_ID}.zip"
sh "rm ping.log.${env.BUILD_ID}.zip"
}
}
}
}
......@@ -200,5 +234,22 @@ pipeline {
}
*/
}
failure {
script {
dir ('ci-scripts') {
try {
withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'],
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'],
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ADB_Credentials}", usernameVariable: 'ADB_Username', passwordVariable: 'ADB_Password']
]) {
sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --eNBRepository=${GIT_URL} --eNBBranch=${GIT_BRANCH} --eNBCommitID=${GIT_COMMIT} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} --XMLTestFile=xml_files/terminate_epc.xml"
}
} catch (Exception e) {
echo "could not properly terminate everything"
}
}
}
}
}
}
This diff is collapsed.
<testCaseList>
<TestCaseRequestedList>010101 050101 060101 070101 030101 030201 050201 060201 070201</TestCaseRequestedList>
<TestCaseRequestedList>010101 050101 060101 070101</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="010101">
......@@ -8,45 +8,19 @@
<Build_eNB_args>-w USRP -x -c --eNB</Build_eNB_args>
</testCase>
<testCase id="030101">
<class>Initialize_eNB</class>
<desc>Initialize eNB (FDD/Band1/5MHz/info)</desc>
<Initialize_eNB_args>enb.band7.tm1.50PRB.usrpb210.conf</Initialize_eNB_args>
</testCase>
<testCase id="030201">
<class>Terminate_eNB</class>
<desc>Terminate eNB</desc>
</testCase>
<testCase id="050101">
<class>Initialize_HSS</class>
<desc>Initialize HSS</desc>
</testCase>
<testCase id="050201">
<class>Terminate_HSS</class>
<desc>Terminate HSS</desc>
</testCase>
<testCase id="060101">
<class>Initialize_MME</class>
<desc>Initialize MME</desc>
</testCase>
<testCase id="060201">
<class>Terminate_MME</class>
<desc>Terminate MME</desc>
</testCase>
<testCase id="070101">
<class>Initialize_SPGW</class>
<desc>Initialize SPGW</desc>
</testCase>
<testCase id="070201">
<class>Terminate_SPGW</class>
<desc>Terminate SPGW</desc>
</testCase>
</testCaseList>
<testCaseList>
<TestCaseRequestedList>030101 040101 040301 040501 040401 040201 030201</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="030101">
<class>Initialize_eNB</class>
<desc>Initialize eNB (FDD/Band1/5MHz/info)</desc>
<Initialize_eNB_args>enb.band7.tm1.50PRB.usrpb210.conf</Initialize_eNB_args>
</testCase>
<testCase id="030201">
<class>Terminate_eNB</class>
<desc>Terminate eNB</desc>
</testCase>
<testCase id="040101">
<class>Initialize_UE</class>
<desc>Initialize UE</desc>
</testCase>
<testCase id="040201">
<class>Terminate_UE</class>
<desc>Terminate UE</desc>
</testCase>
<testCase id="040301">
<class>Attach_UE</class>
<desc>Attach UE</desc>
</testCase>
<testCase id="040401">
<class>Detach_UE</class>
<desc>Detach UE</desc>
</testCase>
<testCase id="040501">
<class>Ping</class>
<desc>ping (20 sec)</desc>
<ping_args>-c 20</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
</testCaseList>
<testCaseList>
<TestCaseRequestedList>030201 050201 070201 060201</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="030201">
<class>Terminate_eNB</class>
<desc>Terminate eNB</desc>
</testCase>
<testCase id="050201">
<class>Terminate_HSS</class>
<desc>Terminate HSS</desc>
</testCase>
<testCase id="060201">
<class>Terminate_MME</class>
<desc>Terminate MME</desc>
</testCase>
<testCase id="070201">
<class>Terminate_SPGW</class>
<desc>Terminate SPGW</desc>
</testCase>
</testCaseList>
<testCaseList>
<TestCaseRequestedList>010101 050101 060101 070101 030101 030201 050201 070201 060201</TestCaseRequestedList>
<TestCaseExclusionList>010102 030102 030103 030104 030105 030106</TestCaseExclusionList>
<!-- eNB class command references -->
<testCase id="010101">
<class>Build_eNB</class>
<desc>Build eNB (USRP)</desc>
<Build_eNB_args>-w USRP -x -c --eNB</Build_eNB_args>
</testCase>
<testCase id="010102">
<class>Build_eNB</class>
<desc>Build eNB (USRP)</desc>
<Build_eNB_args>-w BLADERF -x -c --eNB</Build_eNB_args>
</testCase>
<testCase id="030101">
<class>Initialize_eNB</class>
<desc>Initialize eNB (FDD/Band1/5MHz/info)</desc>
<Initialize_eNB_args>enb.band7.tm1.50PRB.usrpb210.conf</Initialize_eNB_args>
</testCase>
<testCase id="030102">
<class>Initialize_eNB</class>
<desc>Initialize eNB (FDD/Band1/10MHz/info)</desc>
<Initialize_eNB_args>10M.band1.FDD.info.conf</Initialize_eNB_args>
</testCase>
<testCase id="030103">
<class>Initialize_eNB</class>
<desc>Initialize eNB (FDD/Band1/20MHz/info)</desc>
<Initialize_eNB_args>20M.band1.FDD.info.conf</Initialize_eNB_args>
</testCase>
<testCase id="030104">
<class>Initialize_eNB</class>
<desc>Initialize eNB (TDD/Band38/5MHz/info)</desc>
<Initialize_eNB_args>5M.band38.TDD.info.conf</Initialize_eNB_args>
</testCase>
<testCase id="030105">
<class>Initialize_eNB</class>
<desc>Initialize eNB (TDD/Band38/10MHz/info)</desc>
<Initialize_eNB_args>10M.band38.TDD.info.conf</Initialize_eNB_args>
</testCase>
<testCase id="030106">
<class>Initialize_eNB</class>
<desc>Initialize eNB (TDD/Band38/20MHz/info)</desc>
<Initialize_eNB_args>20M.band38.TDD.info.conf</Initialize_eNB_args>
</testCase>
<testCase id="030201">
<class>Terminate_eNB</class>
<desc>Terminate eNB</desc>
</testCase>
<!-- UE class command references -->
<testCase id="040101">
<class>Initialize_UE</class>
<desc>Initialize UE</desc>
</testCase>
<testCase id="040201">
<class>Terminate_UE</class>
<desc>Terminate UE</desc>
</testCase>
<testCase id="040301">
<class>Attach_UE</class>
<desc>Attach UE</desc>
</testCase>
<testCase id="040401">
<class>Detach_UE</class>
<desc>Detach UE</desc>
</testCase>
<testCase id="040701">
<class>Reboot_UE</class>
<desc>Reboot UE</desc>
</testCase>
<!-- EPC class command references -->
<testCase id="050101">
<class>Initialize_HSS</class>
<desc>Initialize HSS</desc>
</testCase>
<testCase id="050201">
<class>Terminate_HSS</class>
<desc>Terminate HSS</desc>
</testCase>
<testCase id="060101">
<class>Initialize_MME</class>
<desc>Initialize MME</desc>
</testCase>
<testCase id="060201">
<class>Terminate_MME</class>
<desc>Terminate MME</desc>
</testCase>
<testCase id="070101">
<class>Initialize_SPGW</class>
<desc>Initialize SPGW</desc>
</testCase>
<testCase id="070201">
<class>Terminate_SPGW</class>
<desc>Terminate SPGW</desc>
</testCase>
</testCaseList>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment