Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
oai
openairinterface5G
Commits
44e1b6ae
Commit
44e1b6ae
authored
Apr 15, 2019
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/add-oai-ue-noS1-testing' into develop_integration_2019_w15
parents
335e894c
796bdaec
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1061 additions
and
487 deletions
+1061
-487
ci-scripts/Jenkinsfile-gitlab
ci-scripts/Jenkinsfile-gitlab
+79
-199
ci-scripts/Jenkinsfile-tmp-full-ran
ci-scripts/Jenkinsfile-tmp-full-ran
+376
-0
ci-scripts/main.py
ci-scripts/main.py
+483
-281
ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml
ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml
+116
-0
ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml
ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml
+1
-1
ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml
ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml
+3
-3
ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml
ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml
+3
-3
No files found.
ci-scripts/Jenkinsfile-gitlab
View file @
44e1b6ae
...
...
@@ -391,44 +391,13 @@ pipeline {
stage
(
"Test MONOLITHIC - FDD - Band 7 - B210"
)
{
steps
{
script
{
if
(
"MERGE"
.
equals
(
env
.
gitlabActionType
))
{
gitlabCommitStatus
(
name:
"Test-Mono-FDD-Band7"
)
{
build
job:
'eNB-CI-FDD-Band7-B210'
,
parameters:
[
string
(
name:
'eNB_Repository'
,
value:
String
.
valueOf
(
GIT_URL
)),
string
(
name:
'eNB_Branch'
,
value:
String
.
valueOf
(
env
.
gitlabSourceBranch
)),
string
(
name:
'eNB_CommitID'
,
value:
String
.
valueOf
(
env
.
gitlabMergeRequestLastCommit
)),
booleanParam
(
name:
'eNB_mergeRequest'
,
value:
true
),
string
(
name:
'eNB_TargetBranch'
,
value:
String
.
valueOf
(
env
.
gitlabTargetBranch
))
]
}
}
else
{
gitlabCommitStatus
(
name:
"Test-Mono-FDD-Band7"
)
{
build
job:
'eNB-CI-FDD-Band7-B210'
,
parameters:
[
string
(
name:
'eNB_Repository'
,
value:
String
.
valueOf
(
GIT_URL
)),
string
(
name:
'eNB_Branch'
,
value:
String
.
valueOf
(
GIT_BRANCH
)),
string
(
name:
'eNB_CommitID'
,
value:
String
.
valueOf
(
GIT_COMMIT
)),
booleanParam
(
name:
'eNB_mergeRequest'
,
value:
false
)
]
}
}
triggerSlaveJob
(
'eNB-CI-FDD-Band7-B210'
,
'Test-Mono-FDD-Band7'
)
}
}
post
{
// In case of any non-success, we are retrieving the HTML report of the last completed
// slave job. The only drop-back is that we may retrieve the HTML report of a previous build
always
{
script
{
if
(!
fileExists
(
'test_results-eNB-CI-FDD-Band7-B210.html'
))
{
copyArtifacts
(
projectName:
'eNB-CI-FDD-Band7-B210'
,
filter:
'test_results*.html'
,
selector:
lastCompleted
())
if
(
fileExists
(
'test_results-eNB-CI-FDD-Band7-B210.html'
))
{
sh
"sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-eNB-CI-FDD-Band7-B210.html"
archiveArtifacts
artifacts:
'test_results-eNB-CI-FDD-Band7-B210.html'
}
}
finalizeSlaveJob
(
'eNB-CI-FDD-Band7-B210'
)
}
}
failure
{
...
...
@@ -441,44 +410,13 @@ pipeline {
stage
(
"Test MONOLITHIC - TDD - Band 40 - B210"
)
{
steps
{
script
{
if
(
"MERGE"
.
equals
(
env
.
gitlabActionType
))
{
gitlabCommitStatus
(
name:
"Test-Mono-TDD-Band40"
)
{
build
job:
'eNB-CI-TDD-Band40-B210'
,
parameters:
[
string
(
name:
'eNB_Repository'
,
value:
String
.
valueOf
(
GIT_URL
)),
string
(
name:
'eNB_Branch'
,
value:
String
.
valueOf
(
env
.
gitlabSourceBranch
)),
string
(
name:
'eNB_CommitID'
,
value:
String
.
valueOf
(
env
.
gitlabMergeRequestLastCommit
)),
booleanParam
(
name:
'eNB_mergeRequest'
,
value:
true
),
string
(
name:
'eNB_TargetBranch'
,
value:
String
.
valueOf
(
env
.
gitlabTargetBranch
))
]
}
}
else
{
gitlabCommitStatus
(
name:
"Test-Mono-TDD-Band40"
)
{
build
job:
'eNB-CI-TDD-Band40-B210'
,
parameters:
[
string
(
name:
'eNB_Repository'
,
value:
String
.
valueOf
(
GIT_URL
)),
string
(
name:
'eNB_Branch'
,
value:
String
.
valueOf
(
GIT_BRANCH
)),
string
(
name:
'eNB_CommitID'
,
value:
String
.
valueOf
(
GIT_COMMIT
)),
booleanParam
(
name:
'eNB_mergeRequest'
,
value:
false
)
]
}
}
triggerSlaveJob
(
'eNB-CI-TDD-Band40-B210'
,
'Test-Mono-TDD-Band40'
)
}
}
post
{
// In case of any non-success, we are retrieving the HTML report of the last completed
// slave job. The only drop-back is that we may retrieve the HTML report of a previous build
always
{
script
{
if
(!
fileExists
(
'test_results-eNB-CI-TDD-Band40-B210.html'
))
{
copyArtifacts
(
projectName:
'eNB-CI-TDD-Band40-B210'
,
filter:
'test_results*.html'
,
selector:
lastCompleted
())
if
(
fileExists
(
'test_results-eNB-CI-TDD-Band40-B210.html'
))
{
sh
"sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-eNB-CI-TDD-Band40-B210.html"
archiveArtifacts
artifacts:
'test_results-eNB-CI-TDD-Band40-B210.html'
}
}
finalizeSlaveJob
(
'eNB-CI-TDD-Band40-B210'
)
}
}
failure
{
...
...
@@ -491,44 +429,13 @@ pipeline {
stage
(
"Test IF4p5 - FDD - Band 7 - B210"
)
{
steps
{
script
{
if
(
"MERGE"
.
equals
(
env
.
gitlabActionType
))
{
gitlabCommitStatus
(
name:
"Test-IF4p5-FDD-Band7"
)
{
build
job:
'eNB-CI-IF4p5-FDD-Band7-B210'
,
parameters:
[
string
(
name:
'eNB_Repository'
,
value:
String
.
valueOf
(
GIT_URL
)),
string
(
name:
'eNB_Branch'
,
value:
String
.
valueOf
(
env
.
gitlabSourceBranch
)),
string
(
name:
'eNB_CommitID'
,
value:
String
.
valueOf
(
env
.
gitlabMergeRequestLastCommit
)),
booleanParam
(
name:
'eNB_mergeRequest'
,
value:
true
),
string
(
name:
'eNB_TargetBranch'
,
value:
String
.
valueOf
(
env
.
gitlabTargetBranch
))
]
}
}
else
{
gitlabCommitStatus
(
name:
"Test-IF4p5-FDD-Band7"
)
{
build
job:
'eNB-CI-IF4p5-FDD-Band7-B210'
,
parameters:
[
string
(
name:
'eNB_Repository'
,
value:
String
.
valueOf
(
GIT_URL
)),
string
(
name:
'eNB_Branch'
,
value:
String
.
valueOf
(
GIT_BRANCH
)),
string
(
name:
'eNB_CommitID'
,
value:
String
.
valueOf
(
GIT_COMMIT
)),
booleanParam
(
name:
'eNB_mergeRequest'
,
value:
false
)
]
}
}
triggerSlaveJob
(
'eNB-CI-IF4p5-FDD-Band7-B210'
,
'Test-IF4p5-FDD-Band7'
)
}
}
post
{
// In case of any non-success, we are retrieving the HTML report of the last completed
// slave job. The only drop-back is that we may retrieve the HTML report of a previous build
always
{
script
{
if
(!
fileExists
(
'test_results-eNB-CI-IF4p5-FDD-Band7-B210.html'
))
{
copyArtifacts
(
projectName:
'eNB-CI-IF4p5-FDD-Band7-B210'
,
filter:
'test_results*.html'
,
selector:
lastCompleted
())
if
(
fileExists
(
'test_results-eNB-CI-IF4p5-FDD-Band7-B210.html'
))
{
sh
"sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-eNB-CI-IF4p5-FDD-Band7-B210.html"
archiveArtifacts
artifacts:
'test_results-eNB-CI-IF4p5-FDD-Band7-B210.html'
}
}
finalizeSlaveJob
(
'eNB-CI-IF4p5-FDD-Band7-B210'
)
}
}
failure
{
...
...
@@ -541,44 +448,13 @@ pipeline {
stage
(
"Test IF4p5 - TDD - Band 40 - B210"
)
{
steps
{
script
{
if
(
"MERGE"
.
equals
(
env
.
gitlabActionType
))
{
gitlabCommitStatus
(
name:
"Test-IF4p5-TDD-Band40"
)
{
build
job:
'eNB-CI-IF4p5-TDD-Band40-B210'
,
parameters:
[
string
(
name:
'eNB_Repository'
,
value:
String
.
valueOf
(
GIT_URL
)),
string
(
name:
'eNB_Branch'
,
value:
String
.
valueOf
(
env
.
gitlabSourceBranch
)),
string
(
name:
'eNB_CommitID'
,
value:
String
.
valueOf
(
env
.
gitlabMergeRequestLastCommit
)),
booleanParam
(
name:
'eNB_mergeRequest'
,
value:
true
),
string
(
name:
'eNB_TargetBranch'
,
value:
String
.
valueOf
(
env
.
gitlabTargetBranch
))
]
}
}
else
{
gitlabCommitStatus
(
name:
"Test-IF4p5-TDD-Band40"
)
{
build
job:
'eNB-CI-IF4p5-TDD-Band40-B210'
,
parameters:
[
string
(
name:
'eNB_Repository'
,
value:
String
.
valueOf
(
GIT_URL
)),
string
(
name:
'eNB_Branch'
,
value:
String
.
valueOf
(
GIT_BRANCH
)),
string
(
name:
'eNB_CommitID'
,
value:
String
.
valueOf
(
GIT_COMMIT
)),
booleanParam
(
name:
'eNB_mergeRequest'
,
value:
false
)
]
}
}
triggerSlaveJob
(
'eNB-CI-IF4p5-TDD-Band40-B210'
,
'Test-IF4p5-TDD-Band40'
)
}
}
post
{
// In case of any non-success, we are retrieving the HTML report of the last completed
// slave job. The only drop-back is that we may retrieve the HTML report of a previous build
always
{
script
{
if
(!
fileExists
(
'test_results-eNB-CI-IF4p5-TDD-Band40-B210.html'
))
{
copyArtifacts
(
projectName:
'eNB-CI-IF4p5-TDD-Band40-B210'
,
filter:
'test_results*.html'
,
selector:
lastCompleted
())
if
(
fileExists
(
'test_results-eNB-CI-IF4p5-TDD-Band40-B210.html'
))
{
sh
"sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-eNB-CI-IF4p5-TDD-Band40-B210.html"
archiveArtifacts
artifacts:
'test_results-eNB-CI-IF4p5-TDD-Band40-B210.html'
}
}
finalizeSlaveJob
(
'eNB-CI-IF4p5-TDD-Band40-B210'
)
}
}
failure
{
...
...
@@ -591,44 +467,13 @@ pipeline {
stage
(
"Test MONOLITHIC - FDD - Band 13 - B210"
)
{
steps
{
script
{
if
(
"MERGE"
.
equals
(
env
.
gitlabActionType
))
{
gitlabCommitStatus
(
name:
"Test-Mono-FDD-Band13"
)
{
build
job:
'eNB-CI-MONO-FDD-Band13-B210'
,
parameters:
[
string
(
name:
'eNB_Repository'
,
value:
String
.
valueOf
(
GIT_URL
)),
string
(
name:
'eNB_Branch'
,
value:
String
.
valueOf
(
env
.
gitlabSourceBranch
)),
string
(
name:
'eNB_CommitID'
,
value:
String
.
valueOf
(
env
.
gitlabMergeRequestLastCommit
)),
booleanParam
(
name:
'eNB_mergeRequest'
,
value:
true
),
string
(
name:
'eNB_TargetBranch'
,
value:
String
.
valueOf
(
env
.
gitlabTargetBranch
))
]
}
}
else
{
gitlabCommitStatus
(
name:
"Test-Mono-FDD-Band13"
)
{
build
job:
'eNB-CI-MONO-FDD-Band13-B210'
,
parameters:
[
string
(
name:
'eNB_Repository'
,
value:
String
.
valueOf
(
GIT_URL
)),
string
(
name:
'eNB_Branch'
,
value:
String
.
valueOf
(
GIT_BRANCH
)),
string
(
name:
'eNB_CommitID'
,
value:
String
.
valueOf
(
GIT_COMMIT
)),
booleanParam
(
name:
'eNB_mergeRequest'
,
value:
false
)
]
}
}
triggerSlaveJob
(
'eNB-CI-MONO-FDD-Band13-B210'
,
'Test-Mono-FDD-Band13'
)
}
}
post
{
// In case of any non-success, we are retrieving the HTML report of the last completed
// slave job. The only drop-back is that we may retrieve the HTML report of a previous build
always
{
script
{
if
(!
fileExists
(
'test_results-eNB-CI-MONO-FDD-Band13-B210.html'
))
{
copyArtifacts
(
projectName:
'eNB-CI-MONO-FDD-Band13-B210'
,
filter:
'test_results*.html'
,
selector:
lastCompleted
())
if
(
fileExists
(
'test_results-eNB-CI-MONO-FDD-Band13-B210.html'
))
{
sh
"sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-eNB-CI-MONO-FDD-Band13-B210.html"
archiveArtifacts
artifacts:
'test_results-eNB-CI-MONO-FDD-Band13-B210.html'
}
}
finalizeSlaveJob
(
'eNB-CI-MONO-FDD-Band13-B210'
)
}
}
failure
{
...
...
@@ -638,47 +483,19 @@ pipeline {
}
}
}
stage
(
"Test OAI UE
Sniffing
- FDD - Band 20 - B200"
)
{
stage
(
"Test OAI UE - FDD - Band
s
20
/7
- B200"
)
{
steps
{
script
{
if
(
"MERGE"
.
equals
(
env
.
gitlabActionType
))
{
//gitlabCommitStatus(name: "Test-OAI-UE-FDD-Band20") {
build
job:
'UE-CI-FDD-Band20-B200'
,
parameters:
[
string
(
name:
'eNB_Repository'
,
value:
String
.
valueOf
(
GIT_URL
)),
string
(
name:
'eNB_Branch'
,
value:
String
.
valueOf
(
env
.
gitlabSourceBranch
)),
string
(
name:
'eNB_CommitID'
,
value:
String
.
valueOf
(
env
.
gitlabMergeRequestLastCommit
)),
booleanParam
(
name:
'eNB_mergeRequest'
,
value:
true
),
string
(
name:
'eNB_TargetBranch'
,
value:
String
.
valueOf
(
env
.
gitlabTargetBranch
))
]
//}
}
else
{
//gitlabCommitStatus(name: "Test-OAI-UE-FDD-Band20") {
build
job:
'UE-CI-FDD-Band20-B200'
,
parameters:
[
string
(
name:
'eNB_Repository'
,
value:
String
.
valueOf
(
GIT_URL
)),
string
(
name:
'eNB_Branch'
,
value:
String
.
valueOf
(
GIT_BRANCH
)),
string
(
name:
'eNB_CommitID'
,
value:
String
.
valueOf
(
GIT_COMMIT
)),
booleanParam
(
name:
'eNB_mergeRequest'
,
value:
false
)
]
//}
}
triggerSlaveJobNoGitLab
(
'UE-CI-FDD-Band20-B200'
)
// calling a second job sequentially
triggerSlaveJob
(
'eNB-UE-CI-MONO-FDD-Band7-B200'
,
'Test-eNB-OAI-UE-FDD-Band7'
)
}
}
post
{
// In case of any non-success, we are retrieving the HTML report of the last completed
// slave job. The only drop-back is that we may retrieve the HTML report of a previous build
always
{
script
{
if
(!
fileExists
(
'test_results-UE-CI-FDD-Band20-B200.html'
))
{
copyArtifacts
(
projectName:
'UE-CI-FDD-Band20-B200'
,
filter:
'test_results*.html'
,
selector:
lastCompleted
())
if
(
fileExists
(
'test_results-UE-CI-FDD-Band20-B200.html'
))
{
sh
"sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-UE-CI-FDD-Band20-B200.html"
archiveArtifacts
artifacts:
'test_results-UE-CI-FDD-Band20-B200.html'
}
}
finalizeSlaveJob
(
'UE-CI-FDD-Band20-B200'
)
finalizeSlaveJob
(
'eNB-UE-CI-MONO-FDD-Band7-B200'
)
}
}
failure
{
...
...
@@ -766,3 +583,66 @@ OAI CI Team''',
}
}
}
// ---- Slave Job functions
def
triggerSlaveJob
(
jobName
,
gitlabStatusName
)
{
if
(
"MERGE"
.
equals
(
env
.
gitlabActionType
))
{
gitlabCommitStatus
(
name:
gitlabStatusName
)
{
build
job:
jobName
,
parameters:
[
string
(
name:
'eNB_Repository'
,
value:
String
.
valueOf
(
GIT_URL
)),
string
(
name:
'eNB_Branch'
,
value:
String
.
valueOf
(
env
.
gitlabSourceBranch
)),
string
(
name:
'eNB_CommitID'
,
value:
String
.
valueOf
(
env
.
gitlabMergeRequestLastCommit
)),
booleanParam
(
name:
'eNB_mergeRequest'
,
value:
true
),
string
(
name:
'eNB_TargetBranch'
,
value:
String
.
valueOf
(
env
.
gitlabTargetBranch
))
]
}
}
else
{
gitlabCommitStatus
(
name:
gitlabStatusName
)
{
build
job:
jobName
,
parameters:
[
string
(
name:
'eNB_Repository'
,
value:
String
.
valueOf
(
GIT_URL
)),
string
(
name:
'eNB_Branch'
,
value:
String
.
valueOf
(
GIT_BRANCH
)),
string
(
name:
'eNB_CommitID'
,
value:
String
.
valueOf
(
GIT_COMMIT
)),
booleanParam
(
name:
'eNB_mergeRequest'
,
value:
false
)
]
}
}
}
def
triggerSlaveJobNoGitLab
(
jobName
)
{
if
(
"MERGE"
.
equals
(
env
.
gitlabActionType
))
{
build
job:
jobName
,
parameters:
[
string
(
name:
'eNB_Repository'
,
value:
String
.
valueOf
(
GIT_URL
)),
string
(
name:
'eNB_Branch'
,
value:
String
.
valueOf
(
env
.
gitlabSourceBranch
)),
string
(
name:
'eNB_CommitID'
,
value:
String
.
valueOf
(
env
.
gitlabMergeRequestLastCommit
)),
booleanParam
(
name:
'eNB_mergeRequest'
,
value:
true
),
string
(
name:
'eNB_TargetBranch'
,
value:
String
.
valueOf
(
env
.
gitlabTargetBranch
))
]
}
else
{
build
job:
jobName
,
parameters:
[
string
(
name:
'eNB_Repository'
,
value:
String
.
valueOf
(
GIT_URL
)),
string
(
name:
'eNB_Branch'
,
value:
String
.
valueOf
(
GIT_BRANCH
)),
string
(
name:
'eNB_CommitID'
,
value:
String
.
valueOf
(
GIT_COMMIT
)),
booleanParam
(
name:
'eNB_mergeRequest'
,
value:
false
)
]
}
}
def
finalizeSlaveJob
(
jobName
)
{
// In case of any non-success, we are retrieving the HTML report of the last completed
// slave job. The only drop-back is that we may retrieve the HTML report of a previous build
fileName
=
"test_results-${jobName}.html"
if
(!
fileExists
(
fileName
))
{
copyArtifacts
(
projectName:
jobName
,
filter:
'test_results*.html'
,
selector:
lastCompleted
())
if
(
fileExists
(
fileName
))
{
sh
"sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' ${fileName}"
archiveArtifacts
artifacts:
fileName
}
}
}
ci-scripts/Jenkinsfile-tmp-full-ran
0 → 100644
View file @
44e1b6ae
#
!
/bin/
groovy
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (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.openairinterface.org/?page_id=698
*
* 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.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
// Template Jenkins Declarative Pipeline script to run Test w/ RF HW
// Location of the python executor node shall be in the same subnet as the others servers
def
pythonExecutor
=
params
.
pythonExecutor
// Location of the test XML file to be run
def
testXMLFile
=
params
.
pythonTestXmlFile
def
mainPythonAllXmlFiles
=
""
def
buildStageStatus
=
true
// Name of the test stage
def
testStageName
=
params
.
pipelineTestStageName
// Name of the phone resource
def
ciSmartPhoneResource
=
params
.
smartphonesResource
// Name of the phone resource
def
oaiUEResource
=
params
.
oaiUEResource
// Terminate Status
def
termENB
=
0
def
termOAIUE
=
1
def
termStatusArray
=
new
Boolean
[
termOAIUE
+
1
]
termStatusArray
[
termENB
]
=
false
termStatusArray
[
termOAIUE
]
=
false
// Global Parameters. Normally they should be populated when the master job
// triggers the slave job with parameters
def
eNB_Repository
def
eNB_Branch
def
eNB_CommitID
def
eNB_AllowMergeRequestProcess
=
false
def
eNB_TargetBranch
pipeline
{
agent
{
label
pythonExecutor
}
options
{
disableConcurrentBuilds
()
ansiColor
(
'xterm'
)
lock
(
extra:
[[
resource:
ciSmartPhoneResource
]],
resource:
ciSmartPhoneResource
)
}
stages
{
stage
(
"Verify Parameters"
)
{
steps
{
script
{
echo
'\u2705 \u001B[32mVerify Parameters\u001B[0m'
def
allParametersPresent
=
true
// It is already to late to check it
if
(
params
.
pythonExecutor
!=
null
)
{
echo
"eNB CI executor node : ${pythonExecutor}"
}
// If not present picking a default XML file
if
(
params
.
pythonTestXmlFile
==
null
)
{
// picking default
testXMLFile
=
'xml_files/enb_usrpB210_band7_50PRB.xml'
echo
"Test XML file(default): ${testXMLFile}"
mainPythonAllXmlFiles
+=
"--XMLTestFile="
+
testXMLFile
+
" "
}
else
{
String
[]
myXmlTestSuite
=
testXMLFile
.
split
(
"\\r?\\n"
)
for
(
xmlFile
in
myXmlTestSuite
)
{
if
(
fileExists
(
"ci-scripts/"
+
xmlFile
))
{
mainPythonAllXmlFiles
+=
"--XMLTestFile="
+
xmlFile
+
" "
echo
"Test XML file : ${xmlFile}"
}
}
}
// If not present picking a default Stage Name
if
(
params
.
pipelineTestStageName
==
null
)
{
// picking default
testStageName
=
'Template Test Stage'
}
if
(
params
.
smartphonesResource
==
null
)
{
allParametersPresent
=
false
}
if
(
params
.
oaiUEResource
==
null
)
{
allParametersPresent
=
false
}
if
(
params
.
eNB_IPAddress
==
null
)
{
allParametersPresent
=
false
}
if
(
params
.
eNB_SourceCodePath
==
null
)
{
allParametersPresent
=
false
}
if
(
params
.
eNB_Credentials
==
null
)
{
allParametersPresent
=
false
}
if
(
params
.
UE_IPAddress
==
null
)
{
allParametersPresent
=
false
}
if
(
params
.
UE_SourceCodePath
==
null
)
{
allParametersPresent
=
false
}
if
(
params
.
UE_Credentials
==
null
)
{
allParametersPresent
=
false
}
// the following 4 parameters should be pushed by the master trigger
// if not present, take the job GIT variables (used for developing)
if
(
params
.
eNB_Repository
==
null
)
{
eNB_Repository
=
env
.
GIT_URL
}
else
{
eNB_Repository
=
params
.
eNB_Repository
}
echo
"eNB_Repository : ${eNB_Repository}"
if
(
params
.
eNB_Branch
==
null
)
{
eNB_Branch
=
env
.
GIT_BRANCH
}
else
{
eNB_Branch
=
params
.
eNB_Branch
}
echo
"eNB_Branch : ${eNB_Branch}"
if
(
params
.
eNB_CommitID
==
null
)
{
eNB_CommitID
=
env
.
GIT_COMMIT
}
else
{
eNB_CommitID
=
params
.
eNB_CommitID
}
echo
"eNB_CommitID : ${eNB_CommitID}"
if
(
params
.
eNB_mergeRequest
!=
null
)
{
eNB_AllowMergeRequestProcess
=
params
.
eNB_mergeRequest
if
(
eNB_AllowMergeRequestProcess
)
{
if
(
params
.
eNB_TargetBranch
!=
null
)
{
eNB_TargetBranch
=
params
.
eNB_TargetBranch
}
else
{
eNB_TargetBranch
=
'develop'
}
echo
"eNB_TargetBranch : ${eNB_TargetBranch}"
}
}
if
(
params
.
EPC_IPAddress
==
null
)
{
allParametersPresent
=
false
}
if
(
params
.
EPC_Type
==
null
)
{
allParametersPresent
=
false
}
if
(
params
.
EPC_SourceCodePath
==
null
)
{
allParametersPresent
=
false
}
if
(
params
.
EPC_Credentials
==
null
)
{
allParametersPresent
=
false
}
if
(
params
.
ADB_IPAddress
==
null
)
{
allParametersPresent
=
false
}
if
(
params
.
ADB_Credentials
==
null
)
{
allParametersPresent
=
false
}
if
(
allParametersPresent
)
{
echo
"All parameters are present"
if
(
eNB_AllowMergeRequestProcess
)
{
sh
"git fetch"
sh
"./ci-scripts/doGitLabMerge.sh --src-branch ${eNB_Branch} --src-commit ${eNB_CommitID} --target-branch ${eNB_TargetBranch} --target-commit latest"
}
else
{
sh
"git fetch"
sh
"git checkout -f ${eNB_CommitID}"
}
}
else
{
echo
"Some parameters are missing"
sh
"./ci-scripts/fail.sh"
}
}
}
}
stage
(
"Build and Test"
)
{
steps
{
script
{
dir
(
'ci-scripts'
)
{
echo
"\u2705 \u001B[32m${testStageName}\u001B[0m"
withCredentials
([
[
$class
:
'UsernamePasswordMultiBinding'
,
credentialsId:
"${params.eNB_Credentials}"
,
usernameVariable:
'eNB_Username'
,
passwordVariable:
'eNB_Password'
],
[
$class
:
'UsernamePasswordMultiBinding'
,
credentialsId:
"${params.UE_Credentials}"
,
usernameVariable:
'UE_Username'
,
passwordVariable:
'UE_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=InitiateHtml --eNBRepository=${eNB_Repository} --eNBBranch=${eNB_Branch} --eNBCommitID=${eNB_CommitID} --eNB_AllowMerge=${eNB_AllowMergeRequestProcess} --eNBTargetBranch=${eNB_TargetBranch} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} ${mainPythonAllXmlFiles}"
String
[]
myXmlTestSuite
=
testXMLFile
.
split
(
"\\r?\\n"
)
for
(
xmlFile
in
myXmlTestSuite
)
{
if
(
fileExists
(
xmlFile
))
{
try
{
sh
"python3 main.py --mode=TesteNB --eNBRepository=${eNB_Repository} --eNBBranch=${eNB_Branch} --eNBCommitID=${eNB_CommitID} --eNB_AllowMerge=${eNB_AllowMergeRequestProcess} --eNBTargetBranch=${eNB_TargetBranch} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --UEIPAddress=${params.UE_IPAddress} --UEUserName=${UE_Username} --UEPassword=${UE_Password} --UESourceCodePath=${params.UE_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=${xmlFile}"
}
catch
(
Exception
e
)
{
currentBuild
.
result
=
'FAILURE'
buildStageStatus
=
false
}
}
}
sh
"python3 main.py --mode=FinalizeHtml --finalStatus=${buildStageStatus} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --UEIPAddress=${params.UE_IPAddress} --UEUserName=${UE_Username} --UEPassword=${UE_Password}"
}
}
}
}
}
stage
(
"Terminate"
)
{
parallel
{
stage
(
'Terminate eNB'
)
{
steps
{
echo
'\u2705 \u001B[32mTerminate eNB\u001B[0m'
withCredentials
([
[
$class
:
'UsernamePasswordMultiBinding'
,
credentialsId:
"${params.eNB_Credentials}"
,
usernameVariable:
'eNB_Username'
,
passwordVariable:
'eNB_Password'
]
])
{
sh
"python3 ci-scripts/main.py --mode=TerminateeNB --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password}"
}
}
post
{
success
{
script
{
termStatusArray
[
termENB
]
=
true
}
}
}
}
stage
(
'Terminate OAI-UE'
)
{
steps
{
echo
'\u2705 \u001B[32mTerminate OAI-UE\u001B[0m'
withCredentials
([
[
$class
:
'UsernamePasswordMultiBinding'
,
credentialsId:
"${params.UE_Credentials}"
,
usernameVariable:
'UE_Username'
,
passwordVariable:
'UE_Password'
]
])
{
sh
"python3 ci-scripts/main.py --mode=TerminateOAIUE --UEIPAddress=${params.UE_IPAddress} --UEUserName=${UE_Username} --UEPassword=${UE_Password}"
}
}
post
{
success
{
script
{
termStatusArray
[
termUE
]
=
true
}