Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michael Black
OpenXG UE
Commits
4bb2b8a2
Commit
4bb2b8a2
authored
Nov 08, 2018
by
Guy De Souza
Browse files
Options
Browse Files
Download
Plain Diff
Merge with develop-nr
parents
ae96e3dc
428fff04
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
2036 additions
and
2526 deletions
+2036
-2526
ci-scripts/Jenkinsfile-gitlab
ci-scripts/Jenkinsfile-gitlab
+24
-24
ci-scripts/buildOnVM.sh
ci-scripts/buildOnVM.sh
+101
-400
ci-scripts/createVM.sh
ci-scripts/createVM.sh
+21
-165
ci-scripts/destroyAllRunningVM.sh
ci-scripts/destroyAllRunningVM.sh
+24
-62
ci-scripts/oai-ci-vm-tool
ci-scripts/oai-ci-vm-tool
+573
-0
ci-scripts/reportBuildLocally.sh
ci-scripts/reportBuildLocally.sh
+239
-376
ci-scripts/reportTestLocally.sh
ci-scripts/reportTestLocally.sh
+325
-461
ci-scripts/runTestOnVM.sh
ci-scripts/runTestOnVM.sh
+524
-658
ci-scripts/waitBuildOnVM.sh
ci-scripts/waitBuildOnVM.sh
+95
-331
cmake_targets/autotests/test_case_list.xml
cmake_targets/autotests/test_case_list.xml
+1
-1
openair1/PHY/INIT/nr_init.c
openair1/PHY/INIT/nr_init.c
+2
-2
openair1/PHY/INIT/nr_init_ue.c
openair1/PHY/INIT/nr_init_ue.c
+1
-1
openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
+1
-1
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
+4
-4
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+48
-25
openair1/SIMULATION/NR_PHY/pbchsim.c
openair1/SIMULATION/NR_PHY/pbchsim.c
+9
-2
targets/RT/USER/nr-ue.c
targets/RT/USER/nr-ue.c
+44
-13
No files found.
ci-scripts/Jenkinsfile-gitlab
View file @
4bb2b8a2
...
@@ -118,7 +118,7 @@ pipeline {
...
@@ -118,7 +118,7 @@ pipeline {
stage
(
"Start VM -- basic-sim"
)
{
stage
(
"Start VM -- basic-sim"
)
{
steps
{
steps
{
timeout
(
time:
5
,
unit:
'MINUTES'
)
{
timeout
(
time:
5
,
unit:
'MINUTES'
)
{
sh
"./ci-scripts/
buildOnVM.sh
--workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
sh
"./ci-scripts/
oai-ci-vm-tool build
--workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
}
}
}
}
}
}
...
@@ -126,7 +126,7 @@ pipeline {
...
@@ -126,7 +126,7 @@ pipeline {
stage
(
"Start VM -- gnb-usrp"
)
{
stage
(
"Start VM -- gnb-usrp"
)
{
steps
{
steps
{
timeout
(
time:
5
,
unit:
'MINUTES'
)
{
timeout
(
time:
5
,
unit:
'MINUTES'
)
{
sh
"./ci-scripts/
buildOnVM.sh
--workspace $WORKSPACE --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
sh
"./ci-scripts/
oai-ci-vm-tool build
--workspace $WORKSPACE --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
}
}
}
}
}
}
...
@@ -134,7 +134,7 @@ pipeline {
...
@@ -134,7 +134,7 @@ pipeline {
stage
(
"Start VM -- nu-ue-usrp"
)
{
stage
(
"Start VM -- nu-ue-usrp"
)
{
steps
{
steps
{
timeout
(
time:
5
,
unit:
'MINUTES'
)
{
timeout
(
time:
5
,
unit:
'MINUTES'
)
{
sh
"./ci-scripts/
buildOnVM.sh
--workspace $WORKSPACE --variant nu-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
sh
"./ci-scripts/
oai-ci-vm-tool build
--workspace $WORKSPACE --variant nu-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
}
}
}
}
}
}
...
@@ -142,7 +142,7 @@ pipeline {
...
@@ -142,7 +142,7 @@ pipeline {
stage
(
"Start VM -- enb-usrp"
)
{
stage
(
"Start VM -- enb-usrp"
)
{
steps
{
steps
{
timeout
(
time:
5
,
unit:
'MINUTES'
)
{
timeout
(
time:
5
,
unit:
'MINUTES'
)
{
sh
"./ci-scripts/
buildOnVM.sh
--workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
sh
"./ci-scripts/
oai-ci-vm-tool build
--workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
}
}
}
}
}
}
...
@@ -150,7 +150,7 @@ pipeline {
...
@@ -150,7 +150,7 @@ pipeline {
stage
(
"Start VM -- enb-ethernet"
)
{
stage
(
"Start VM -- enb-ethernet"
)
{
steps
{
steps
{
timeout
(
time:
5
,
unit:
'MINUTES'
)
{
timeout
(
time:
5
,
unit:
'MINUTES'
)
{
sh
"./ci-scripts/
buildOnVM.sh
--workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
sh
"./ci-scripts/
oai-ci-vm-tool build
--workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
}
}
}
}
}
}
...
@@ -158,7 +158,7 @@ pipeline {
...
@@ -158,7 +158,7 @@ pipeline {
stage
(
"Start VM -- ue-ethernet"
)
{
stage
(
"Start VM -- ue-ethernet"
)
{
steps
{
steps
{
timeout
(
time:
5
,
unit:
'MINUTES'
)
{
timeout
(
time:
5
,
unit:
'MINUTES'
)
{
sh
"./ci-scripts/
buildOnVM.sh
--workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
sh
"./ci-scripts/
oai-ci-vm-tool build
--workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
}
}
}
}
}
}
...
@@ -166,7 +166,7 @@ pipeline {
...
@@ -166,7 +166,7 @@ pipeline {
stage
(
"Start VM -- phy-sim"
)
{
stage
(
"Start VM -- phy-sim"
)
{
steps
{
steps
{
timeout
(
time:
5
,
unit:
'MINUTES'
)
{
timeout
(
time:
5
,
unit:
'MINUTES'
)
{
sh
"./ci-scripts/
buildOnVM.sh
--workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
sh
"./ci-scripts/
oai-ci-vm-tool build
--workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
}
}
}
}
}
}
...
@@ -174,7 +174,7 @@ pipeline {
...
@@ -174,7 +174,7 @@ pipeline {
stage
(
"Start VM -- cppcheck"
)
{
stage
(
"Start VM -- cppcheck"
)
{
steps
{
steps
{
timeout
(
time:
5
,
unit:
'MINUTES'
)
{
timeout
(
time:
5
,
unit:
'MINUTES'
)
{
sh
"./ci-scripts/
buildOnVM.sh
--workspace $WORKSPACE --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
sh
"./ci-scripts/
oai-ci-vm-tool build
--workspace $WORKSPACE --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
}
}
}
}
}
}
...
@@ -185,7 +185,7 @@ pipeline {
...
@@ -185,7 +185,7 @@ pipeline {
steps
{
steps
{
gitlabCommitStatus
(
name:
"Analysis with cppcheck"
)
{
gitlabCommitStatus
(
name:
"Analysis with cppcheck"
)
{
timeout
(
time:
20
,
unit:
'MINUTES'
)
{
timeout
(
time:
20
,
unit:
'MINUTES'
)
{
sh
"./ci-scripts/
waitBuildOnVM.sh
--workspace $WORKSPACE --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
sh
"./ci-scripts/
oai-ci-vm-tool wait
--workspace $WORKSPACE --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
}
}
}
}
...
@@ -194,7 +194,7 @@ pipeline {
...
@@ -194,7 +194,7 @@ pipeline {
steps
{
steps
{
gitlabCommitStatus
(
name:
"Build eNb-USRP"
)
{
gitlabCommitStatus
(
name:
"Build eNb-USRP"
)
{
timeout
(
time:
20
,
unit:
'MINUTES'
)
{
timeout
(
time:
20
,
unit:
'MINUTES'
)
{
sh
"./ci-scripts/
waitBuildOnVM.sh
--workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
sh
"./ci-scripts/
oai-ci-vm-tool wait
--workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
}
}
}
}
...
@@ -203,7 +203,7 @@ pipeline {
...
@@ -203,7 +203,7 @@ pipeline {
steps
{
steps
{
gitlabCommitStatus
(
name:
"Build basic-sim"
)
{
gitlabCommitStatus
(
name:
"Build basic-sim"
)
{
timeout
(
time:
20
,
unit:
'MINUTES'
)
{
timeout
(
time:
20
,
unit:
'MINUTES'
)
{
sh
"./ci-scripts/
waitBuildOnVM.sh
--workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
sh
"./ci-scripts/
oai-ci-vm-tool wait
--workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
}
}
}
}
}
}
...
@@ -212,7 +212,7 @@ pipeline {
...
@@ -212,7 +212,7 @@ pipeline {
steps
{
steps
{
gitlabCommitStatus
(
name:
"Build eNb-ethernet"
)
{
gitlabCommitStatus
(
name:
"Build eNb-ethernet"
)
{
timeout
(
time:
20
,
unit:
'MINUTES'
)
{
timeout
(
time:
20
,
unit:
'MINUTES'
)
{
sh
"./ci-scripts/
waitBuildOnVM.sh
--workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
sh
"./ci-scripts/
oai-ci-vm-tool wait
--workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
}
}
}
}
}
}
...
@@ -221,7 +221,7 @@ pipeline {
...
@@ -221,7 +221,7 @@ pipeline {
steps
{
steps
{
gitlabCommitStatus
(
name:
"Build UE-ethernet"
)
{
gitlabCommitStatus
(
name:
"Build UE-ethernet"
)
{
timeout
(
time:
20
,
unit:
'MINUTES'
)
{
timeout
(
time:
20
,
unit:
'MINUTES'
)
{
sh
"./ci-scripts/
waitBuildOnVM.sh
--workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
sh
"./ci-scripts/
oai-ci-vm-tool wait
--workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
}
}
}
}
}
}
...
@@ -230,7 +230,7 @@ pipeline {
...
@@ -230,7 +230,7 @@ pipeline {
steps
{
steps
{
gitlabCommitStatus
(
name:
"Build gNb-usrp"
)
{
gitlabCommitStatus
(
name:
"Build gNb-usrp"
)
{
timeout
(
time:
20
,
unit:
'MINUTES'
)
{
timeout
(
time:
20
,
unit:
'MINUTES'
)
{
sh
"./ci-scripts/
waitBuildOnVM.sh
--workspace $WORKSPACE --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
sh
"./ci-scripts/
oai-ci-vm-tool wait
--workspace $WORKSPACE --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
}
}
}
}
...
@@ -239,7 +239,7 @@ pipeline {
...
@@ -239,7 +239,7 @@ pipeline {
steps
{
steps
{
gitlabCommitStatus
(
name:
"Build nr-UE-usrp"
)
{
gitlabCommitStatus
(
name:
"Build nr-UE-usrp"
)
{
timeout
(
time:
20
,
unit:
'MINUTES'
)
{
timeout
(
time:
20
,
unit:
'MINUTES'
)
{
sh
"./ci-scripts/
waitBuildOnVM.sh
--workspace $WORKSPACE --variant nu-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
sh
"./ci-scripts/
oai-ci-vm-tool wait
--workspace $WORKSPACE --variant nu-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
}
}
}
}
...
@@ -248,7 +248,7 @@ pipeline {
...
@@ -248,7 +248,7 @@ pipeline {
steps
{
steps
{
gitlabCommitStatus
(
name:
"Build phy-sim"
)
{
gitlabCommitStatus
(
name:
"Build phy-sim"
)
{
timeout
(
time:
20
,
unit:
'MINUTES'
)
{
timeout
(
time:
20
,
unit:
'MINUTES'
)
{
sh
"./ci-scripts/
waitBuildOnVM.sh
--workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
sh
"./ci-scripts/
oai-ci-vm-tool wait
--workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
}
}
}
}
}
}
...
@@ -286,7 +286,7 @@ pipeline {
...
@@ -286,7 +286,7 @@ pipeline {
archiveArtifacts
artifacts:
'archives/vm_build_logs.zip'
archiveArtifacts
artifacts:
'archives/vm_build_logs.zip'
}
}
if
(
"MERGE"
.
equals
(
env
.
gitlabActionType
))
{
if
(
"MERGE"
.
equals
(
env
.
gitlabActionType
))
{
sh
"./ci-scripts/
reportBuildLocally.sh
--git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger merge-request --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
sh
"./ci-scripts/
oai-ci-vm-tool report-build --workspace $WORKSPACE
--git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger merge-request --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
sh
"./ci-scripts/checkAddedWarnings.sh --src-branch ${env.gitlabSourceBranch} --target-branch ${env.gitlabTargetBranch}"
sh
"./ci-scripts/checkAddedWarnings.sh --src-branch ${env.gitlabSourceBranch} --target-branch ${env.gitlabTargetBranch}"
def
res
=
readFile
(
'./oai_warning_files.txt'
).
trim
();
def
res
=
readFile
(
'./oai_warning_files.txt'
).
trim
();
if
(
"0"
.
equals
(
res
))
{
if
(
"0"
.
equals
(
res
))
{
...
@@ -297,7 +297,7 @@ pipeline {
...
@@ -297,7 +297,7 @@ pipeline {
addGitLabMRComment
comment:
message
addGitLabMRComment
comment:
message
}
}
}
else
{
}
else
{
sh
"./ci-scripts/
reportBuildLocally.sh
--git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger push --branch ${GIT_BRANCH} --commit ${GIT_COMMIT}"
sh
"./ci-scripts/
oai-ci-vm-tool report-build --workspace $WORKSPACE
--git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger push --branch ${GIT_BRANCH} --commit ${GIT_COMMIT}"
}
}
if
(
fileExists
(
'build_results.html'
))
{
if
(
fileExists
(
'build_results.html'
))
{
sh
"sed -i -e 's#Build-ID: ${BUILD_ID}#Build-ID: <a href=\"${BUILD_URL}\">${BUILD_ID}</a>#' -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' build_results.html"
sh
"sed -i -e 's#Build-ID: ${BUILD_ID}#Build-ID: <a href=\"${BUILD_URL}\">${BUILD_ID}</a>#' -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' build_results.html"
...
@@ -314,7 +314,7 @@ pipeline {
...
@@ -314,7 +314,7 @@ pipeline {
steps
{
steps
{
gitlabCommitStatus
(
name:
"Test phy-sim"
)
{
gitlabCommitStatus
(
name:
"Test phy-sim"
)
{
timeout
(
time:
45
,
unit:
'MINUTES'
)
{
timeout
(
time:
45
,
unit:
'MINUTES'
)
{
sh
"./ci-scripts/
runTestOnVM.sh
--workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
sh
"./ci-scripts/
oai-ci-vm-tool test
--workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
}
}
}
}
...
@@ -323,7 +323,7 @@ pipeline {
...
@@ -323,7 +323,7 @@ pipeline {
steps
{
steps
{
gitlabCommitStatus
(
name:
"Test basic-sim"
)
{
gitlabCommitStatus
(
name:
"Test basic-sim"
)
{
timeout
(
time:
20
,
unit:
'MINUTES'
)
{
timeout
(
time:
20
,
unit:
'MINUTES'
)
{
sh
"./ci-scripts/
runTestOnVM.sh --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive
"
sh
"./ci-scripts/
oai-ci-vm-tool test --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}
"
}
}
}
}
}
}
...
@@ -518,9 +518,9 @@ pipeline {
...
@@ -518,9 +518,9 @@ pipeline {
if
(
fileExists
(
'archives/vm_tests_logs.zip'
))
{
if
(
fileExists
(
'archives/vm_tests_logs.zip'
))
{
archiveArtifacts
artifacts:
'archives/vm_tests_logs.zip'
archiveArtifacts
artifacts:
'archives/vm_tests_logs.zip'
if
(
"MERGE"
.
equals
(
env
.
gitlabActionType
))
{
if
(
"MERGE"
.
equals
(
env
.
gitlabActionType
))
{
sh
"./ci-scripts/
reportTestLocally.sh
--git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger merge-request --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
sh
"./ci-scripts/
oai-ci-vm-tool report-test --workspace $WORKSPACE
--git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger merge-request --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
}
else
{
}
else
{
sh
"./ci-scripts/
reportTestLocally.sh
--git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger push --branch ${GIT_BRANCH} --commit ${GIT_COMMIT}"
sh
"./ci-scripts/
oai-ci-vm-tool report-test --workspace $WORKSPACE
--git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger push --branch ${GIT_BRANCH} --commit ${GIT_COMMIT}"
}
}
if
(
fileExists
(
'test_simulator_results.html'
))
{
if
(
fileExists
(
'test_simulator_results.html'
))
{
sh
"sed -i -e 's#Build-ID: ${BUILD_ID}#Build-ID: <a href=\"${BUILD_URL}\">${BUILD_ID}</a>#' -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_simulator_results.html"
sh
"sed -i -e 's#Build-ID: ${BUILD_ID}#Build-ID: <a href=\"${BUILD_URL}\">${BUILD_ID}</a>#' -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_simulator_results.html"
...
@@ -533,7 +533,7 @@ pipeline {
...
@@ -533,7 +533,7 @@ pipeline {
}
}
stage
(
"Destroy all Virtual Machines"
)
{
stage
(
"Destroy all Virtual Machines"
)
{
steps
{
steps
{
sh
"./ci-scripts/
destroyAllRunningVM.sh
--job-name ${JOB_NAME} --build-id ${BUILD_ID}"
sh
"./ci-scripts/
oai-ci-vm-tool destroy
--job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
}
}
}
}
...
@@ -541,7 +541,7 @@ pipeline {
...
@@ -541,7 +541,7 @@ pipeline {
always
{
always
{
script
{
script
{
// Stage destroy may not be run if error in previous stage
// Stage destroy may not be run if error in previous stage
sh
"./ci-scripts/
destroyAllRunningVM.sh
--job-name ${JOB_NAME} --build-id ${BUILD_ID}"
sh
"./ci-scripts/
oai-ci-vm-tool destroy
--job-name ${JOB_NAME} --build-id ${BUILD_ID}"
emailext
attachmentsPattern:
'*results*.html'
,
emailext
attachmentsPattern:
'*results*.html'
,
body:
'''Hi,
body:
'''Hi,
Here are attached HTML report files for $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!
Here are attached HTML report files for $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!
...
...
ci-scripts/buildOnVM.sh
View file @
4bb2b8a2
...
@@ -20,8 +20,8 @@
...
@@ -20,8 +20,8 @@
# * contact@openairinterface.org
# * contact@openairinterface.org
# */
# */
function
usage
{
function
build_
usage
{
echo
"OAI
VM Build Check
script"
echo
"OAI
CI VM
script"
echo
" Original Author: Raphael Defosseux"
echo
" Original Author: Raphael Defosseux"
echo
" Requirements:"
echo
" Requirements:"
echo
" -- uvtool uvtool-libvirt apt-cacher"
echo
" -- uvtool uvtool-libvirt apt-cacher"
...
@@ -31,9 +31,9 @@ function usage {
...
@@ -31,9 +31,9 @@ function usage {
echo
""
echo
""
echo
"Usage:"
echo
"Usage:"
echo
"------"
echo
"------"
echo
"
buildOnVM.sh
[OPTIONS]"
echo
"
oai-ci-vm-tool build
[OPTIONS]"
echo
""
echo
""
echo
"Options:"
echo
"
Mandatory
Options:"
echo
"--------"
echo
"--------"
echo
" --job-name #### OR -jn ####"
echo
" --job-name #### OR -jn ####"
echo
" Specify the name of the Jenkins job."
echo
" Specify the name of the Jenkins job."
...
@@ -44,14 +44,9 @@ function usage {
...
@@ -44,14 +44,9 @@ function usage {
echo
" --workspace #### OR -ws ####"
echo
" --workspace #### OR -ws ####"
echo
" Specify the workspace."
echo
" Specify the workspace."
echo
""
echo
""
echo
" --variant enb-usrp OR -v1"
echo
"Options:"
echo
" --variant basic-sim OR -v2"
echo
"--------"
echo
" --variant phy-sim OR -v3"
variant_usage
echo
" --variant cppcheck OR -v4"
echo
" --variant gnb-usrp OR -v5"
echo
" --variant nu-ue-usrp OR -v6"
echo
" --variant enb-ethernet OR -v7"
echo
" --variant ue-ethernet OR -v8"
echo
" Specify the variant to build."
echo
" Specify the variant to build."
echo
""
echo
""
echo
" --keep-vm-alive OR -k"
echo
" --keep-vm-alive OR -k"
...
@@ -65,414 +60,120 @@ function usage {
...
@@ -65,414 +60,120 @@ function usage {
echo
""
echo
""
}
}
function
variant_usage
{
function
build_on_vm
{
echo
"OAI VM Build Check script"
if
[
!
-f
$JENKINS_WKSP
/localZip.zip
]
echo
" Original Author: Raphael Defosseux"
then
echo
""
echo
"Missing localZip.zip file!"
echo
" --variant enb-usrp OR -v1"
STATUS
=
1
echo
" --variant basic-sim OR -v2"
return
echo
" --variant phy-sim OR -v3"
fi
echo
" --variant cppcheck OR -v4"
if
[
!
-f
/etc/apt/apt.conf.d/01proxy
]
echo
" --variant gnb-usrp OR -v5"
then
echo
" --variant nu-ue-usrp OR -v6"
echo
"Missing /etc/apt/apt.conf.d/01proxy file!"
echo
" --variant enb-ethernet OR -v7"
echo
"Is apt-cacher installed and configured?"
echo
" --variant ue-ethernet OR -v8"
STATUS
=
1
echo
""
return
}
fi
if
[
$#
-lt
1
]
||
[
$#
-gt
9
]
then
echo
"Syntax Error: not the correct number of arguments"
echo
""
usage
exit
1
fi
VM_TEMPLATE
=
ci-
JOB_NAME
=
XX
BUILD_ID
=
XX
VM_NAME
=
ci-enb-usrp
VM_MEMORY
=
2048
VM_CPU
=
4
ARCHIVES_LOC
=
enb_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--eNB -w USRP"
KEEP_VM_ALIVE
=
0
DAEMON
=
0
while
[[
$#
-gt
0
]]
do
key
=
"
$1
"
case
$key
in
-h
|
--help
)
shift
usage
exit
0
;;
-jn
|
--job-name
)
JOB_NAME
=
"
$2
"
shift
shift
;;
-id
|
--build-id
)
BUILD_ID
=
"
$2
"
shift
shift
;;
-ws
|
--workspace
)
JENKINS_WKSP
=
"
$2
"
shift
shift
;;
-k
|
--keep-vm-alive
)
KEEP_VM_ALIVE
=
1
shift
;;
-D
|
--daemon
)
DAEMON
=
1
shift
;;
-v1
)
VM_NAME
=
ci-enb-usrp
ARCHIVES_LOC
=
enb_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--eNB -w USRP --mu"
shift
;;
-v2
)
VM_NAME
=
ci-basic-sim
ARCHIVES_LOC
=
basic_sim
LOG_PATTERN
=
basic_simulator
NB_PATTERN_FILES
=
2
BUILD_OPTIONS
=
"--basic-simulator"
VM_MEMORY
=
8192
VM_CPU
=
4
shift
;;
-v3
)
VM_NAME
=
ci-phy-sim
ARCHIVES_LOC
=
phy_sim
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--phy_simulators"
shift
;;
-v4
)
VM_NAME
=
ci-cppcheck
VM_MEMORY
=
8192
ARCHIVES_LOC
=
cppcheck
LOG_PATTERN
=
cppcheck.xml
NB_PATTERN_FILES
=
1
BUILD_OPTIONS
=
"--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c"
shift
;;
-v5
)
VM_NAME
=
ci-gnb-usrp
ARCHIVES_LOC
=
gnb_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--gNB -w USRP"
shift
;;
-v6
)
VM_NAME
=
ci-ue-nr-usrp
ARCHIVES_LOC
=
nrue_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--nrUE -w USRP"
shift
;;
-v7
)
VM_NAME
=
ci-enb-ethernet
ARCHIVES_LOC
=
enb_eth
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--eNB -t ETHERNET --noS1"
shift
;;
-v8
)
VM_NAME
=
ci-ue-ethernet
ARCHIVES_LOC
=
ue_eth
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--UE -t ETHERNET --noS1"
shift
;;
--variant
)
variant
=
"
$2
"
case
$variant
in
enb-usrp
)
VM_NAME
=
ci-enb-usrp
ARCHIVES_LOC
=
enb_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--eNB -w USRP --mu"
;;
basic-sim
)
VM_NAME
=
ci-basic-sim
ARCHIVES_LOC
=
basic_sim
LOG_PATTERN
=
basic_simulator
NB_PATTERN_FILES
=
2
BUILD_OPTIONS
=
"--basic-simulator"
VM_MEMORY
=
8192
VM_CPU
=
4
;;
phy-sim
)
VM_NAME
=
ci-phy-sim
ARCHIVES_LOC
=
phy_sim
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--phy_simulators"
;;
cppcheck
)
VM_NAME
=
ci-cppcheck
VM_MEMORY
=
8192
ARCHIVES_LOC
=
cppcheck
LOG_PATTERN
=
cppcheck.xml
NB_PATTERN_FILES
=
1
BUILD_OPTIONS
=
"--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c"
;;
gnb-usrp
)
VM_NAME
=
ci-gnb-usrp
ARCHIVES_LOC
=
gnb_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--gNB -w USRP"
;;
nu-ue-usrp
)
VM_NAME
=
ci-ue-nr-usrp
ARCHIVES_LOC
=
nrue_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--nrUE -w USRP"
;;
enb-ethernet
)
VM_NAME
=
ci-enb-ethernet
ARCHIVES_LOC
=
enb_eth
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--eNB -t ETHERNET --noS1"
;;
ue-ethernet
)
VM_NAME
=
ci-ue-ethernet
ARCHIVES_LOC
=
ue_eth
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--UE -t ETHERNET --noS1"
;;
*
)
echo
""
echo
"Syntax Error: Invalid Variant option ->
$variant
"
echo
""
variant_usage
exit
1
esac
shift
shift
;;
*
)
echo
"Syntax Error: unknown option:
$key
"
echo
""
usage
exit
1
esac
done
if
[
!
-f
$JENKINS_WKSP
/localZip.zip
]
then
echo
"Missing localZip.zip file!"
exit
1
fi
if
[
!
-f
/etc/apt/apt.conf.d/01proxy
]
then
echo
"Missing /etc/apt/apt.conf.d/01proxy file!"
echo
"Is apt-cacher installed and configured?"
exit
1
fi
if
[
"
$JOB_NAME
"
==
"XX"
]
||
[
"
$BUILD_ID
"
==
"XX"
]
then
VM_TEMPLATE
=
ci-
else
VM_TEMPLATE
=
${
JOB_NAME
}
-b
${
BUILD_ID
}
-
fi
VM_NAME
=
`
echo
$VM_NAME
|
sed
-e
"s#ci-#
$VM_TEMPLATE
#"
`
VM_CMDS
=
${
VM_NAME
}
_cmds.txt
ARCHIVES_LOC
=
${
JENKINS_WKSP
}
/archives/
${
ARCHIVES_LOC
}
echo
"VM_NAME =
$VM_NAME
"
echo
"VM_CMD_FILE =
$VM_CMDS
"
echo
"JENKINS_WKSP =
$JENKINS_WKSP
"
echo
"ARCHIVES_LOC =
$ARCHIVES_LOC
"
echo
"BUILD_OPTIONS =
$BUILD_OPTIONS
"
IS_VM_ALIVE
=
`
uvt-kvm list |
grep
-c
$VM_NAME
`
if
[
$IS_VM_ALIVE
-eq
0
]
then
echo
"############################################################"
echo
"############################################################"
echo
"
Creating VM (
$VM_NAME
) on Ubuntu Cloud Image base
"
echo
"
OAI CI VM script
"
echo
"############################################################"
echo
"############################################################"
uvt-kvm create
$VM_NAME
release
=
xenial
--memory
$VM_MEMORY
--cpu
$VM_CPU
--unsafe-caching
--template
ci-scripts/template-host.xml
fi
echo
"Waiting for VM to be started"
uvt-kvm
wait
$VM_NAME
--insecure
VM_IP_ADDR
=
`
uvt-kvm ip
$VM_NAME
`
echo
"VM_NAME =
$VM_NAME
"
echo
"
$VM_NAME
has for IP addr =
$VM_IP_ADDR
"
echo
"VM_CMD_FILE =
$VM_CMDS
"
echo
"JENKINS_WKSP =
$JENKINS_WKSP
"
echo
"ARCHIVES_LOC =
$ARCHIVES_LOC
"
echo
"BUILD_OPTIONS =
$BUILD_OPTIONS
"
echo
"############################################################"
IS_VM_ALIVE
=
`
uvt-kvm list |
grep
-c
$VM_NAME
`
echo
"Copying GIT repo into VM (
$VM_NAME
)"
echo
"############################################################"
scp
-o
StrictHostKeyChecking
=
no localZip.zip ubuntu@
$VM_IP_ADDR
:/home/ubuntu
scp
-o
StrictHostKeyChecking
=
no /etc/apt/apt.conf.d/01proxy ubuntu@
$VM_IP_ADDR
:/home/ubuntu
echo
"############################################################"
if
[
$IS_VM_ALIVE
-eq
0
]
echo
"Running install and build script on VM (
$VM_NAME
)"
echo
"############################################################"
echo
"sudo cp 01proxy /etc/apt/apt.conf.d/"
>
$VM_CMDS
echo
"touch /home/ubuntu/.hushlogin"
>>
$VM_CMDS
if
[[
"
$VM_NAME
"
==
*
"-cppcheck"
*
]]
then
if
[
$DAEMON
-eq
0
]
then
echo
"echo
\"
sudo apt-get --yes --quiet install zip cppcheck
\"
"
>>
$VM_CMDS
echo
"sudo apt-get update > zip-install.txt 2>&1"
>>
$VM_CMDS
echo
"sudo apt-get --yes install zip cppcheck >> zip-install.txt 2>&1"
>>
$VM_CMDS
else
echo
"echo
\"
sudo apt-get --yes --quiet install zip daemon cppcheck
\"
"
>>
$VM_CMDS
echo
"sudo apt-get update > zip-install.txt 2>&1"
>>
$VM_CMDS
echo
"sudo apt-get --yes install zip daemon cppcheck >> zip-install.txt 2>&1"
>>
$VM_CMDS
fi
else
if
[
$DAEMON
-eq
0
]
then
then
echo
"echo
\"
sudo apt-get --yes --quiet install zip subversion libboost-dev
\"
"
>>
$VM_CMDS
echo
"VM_MEMORY =
$VM_MEMORY
MBytes"
echo
"sudo apt-get update > zip-install.txt 2>&1"
>>
$VM_CMDS
echo
"VM_CPU =
$VM_CPU
"
echo
"sudo apt-get --yes install zip subversion libboost-dev >> zip-install.txt 2>&1"
>>
$VM_CMDS
echo
"############################################################"
else
echo
"Creating VM (
$VM_NAME
) on Ubuntu Cloud Image base"
echo
"echo
\"
sudo apt-get --yes --quiet install zip daemon subversion libboost-dev
\"
"
>>
$VM_CMDS
echo
"############################################################"
echo
"sudo apt-get update > zip-install.txt 2>&1"
>>
$VM_CMDS
uvt-kvm create
$VM_NAME
release
=
xenial
--memory
$VM_MEMORY
--cpu
$VM_CPU
--unsafe-caching
--template
ci-scripts/template-host.xml
echo
"sudo apt-get --yes install zip daemon subversion libboost-dev >> zip-install.txt 2>&1"
>>
$VM_CMDS
fi
fi
echo
"mkdir tmp"
>>
$VM_CMDS
echo
"cd tmp"
>>
$VM_CMDS
echo
"echo
\"
unzip -qq -DD ../localZip.zip
\"
"
>>
$VM_CMDS
echo
"unzip -qq -DD ../localZip.zip"
>>
$VM_CMDS
if
[[
"
$VM_NAME
"
==
*
"-cppcheck"
*
]]
then
echo
"mkdir cmake_targets/log"
>>
$VM_CMDS
echo
"chmod 777 cmake_targets/log"
>>
$VM_CMDS
echo
"cp /home/ubuntu/zip-install.txt cmake_targets/log"
>>
$VM_CMDS
echo
"echo
\"
cppcheck
$BUILD_OPTIONS
.
\"
"
>>
$VM_CMDS
if
[
$DAEMON
-eq
0
]
then
echo
"cppcheck
$BUILD_OPTIONS
. 2> cmake_targets/log/cppcheck.xml 1> cmake_targets/log/cppcheck_build.txt"
>>
$VM_CMDS
else
echo
"echo
\"
cppcheck
$BUILD_OPTIONS
.
\"
> ./my-vm-build.sh"
>>
$VM_CMDS
echo
"chmod 775 ./my-vm-build.sh "
>>
$VM_CMDS
echo
"sudo -E daemon --inherit --unsafe --name=build_daemon --chdir=/home/ubuntu/tmp -O /home/ubuntu/tmp/cmake_targets/log/cppcheck_build.txt -E /home/ubuntu/tmp/cmake_targets/log/cppcheck.xml ./my-vm-build.sh"
>>
$VM_CMDS
fi
else
echo
"echo
\"
source oaienv
\"
"
>>
$VM_CMDS
echo
"source oaienv"
>>
$VM_CMDS
echo
"cd cmake_targets/"
>>
$VM_CMDS
echo
"mkdir log"
>>
$VM_CMDS
echo
"chmod 777 log"
>>
$VM_CMDS
echo
"cp /home/ubuntu/zip-install.txt log"
>>
$VM_CMDS
if
[
$DAEMON
-eq
0
]
then
echo
"echo
\"
./build_oai -I
$BUILD_OPTIONS
\"
"
>>
$VM_CMDS
echo
"./build_oai -I
$BUILD_OPTIONS
> log/install-build.txt 2>&1"
>>
$VM_CMDS
else
echo
"echo
\"
./build_oai -I
$BUILD_OPTIONS
\"
> ./my-vm-build.sh"
>>
$VM_CMDS
echo
"chmod 775 ./my-vm-build.sh "
>>
$VM_CMDS
echo
"echo
\"
sudo -E daemon --inherit --unsafe --name=build_daemon --chdir=/home/ubuntu/tmp/cmake_targets -o /home/ubuntu/tmp/cmake_targets/log/install-build.txt ./my-vm-build.sh
\"
"
>>
$VM_CMDS
echo
"sudo -E daemon --inherit --unsafe --name=build_daemon --chdir=/home/ubuntu/tmp/cmake_targets -o /home/ubuntu/tmp/cmake_targets/log/install-build.txt ./my-vm-build.sh"
>>
$VM_CMDS
fi
fi
fi
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
<
$VM_CMDS
if
[
$DAEMON
-eq
1
]
then
rm
-f
$VM_CMDS
echo
"STATUS is OK"
exit
0
fi
echo
"############################################################"
echo
"Creating a tmp folder to store results and artifacts"
echo
"############################################################"
if
[
!
-d
$JENKINS_WKSP
/archives
]
then
mkdir
$JENKINS_WKSP
/archives
fi
if
[
!
-d
$ARCHIVES_LOC
]
echo
"Waiting for VM to be started"
then
uvt-kvm
wait
$VM_NAME
--insecure
mkdir
$ARCHIVES_LOC
fi
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
*
.txt
$ARCHIVES_LOC
VM_IP_ADDR
=
`
uvt-kvm ip
$VM_NAME
`
if
[[
"
$VM_NAME
"
==
*
"-cppcheck"
*
]]
echo
"
$VM_NAME
has for IP addr =
$VM_IP_ADDR
"
then
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
*
.xml
$ARCHIVES_LOC
fi
if
[
$KEEP_VM_ALIVE
-eq
0
]
then
echo
"############################################################"
echo
"############################################################"
echo
"
Destroying VM"
echo
"
Copying GIT repo into VM (
$VM_NAME
)"
echo
"############################################################"
echo
"############################################################"
uvt-kvm destroy
$VM_NAME
scp
-o
StrictHostKeyChecking
=
no
$JENKINS_WKSP
/localZip.zip ubuntu@
$VM_IP_ADDR
:/home/ubuntu
ssh-keygen
-R
$VM_IP_ADDR
scp
-o
StrictHostKeyChecking
=
no /etc/apt/apt.conf.d/01proxy ubuntu@
$VM_IP_ADDR
:/home/ubuntu
fi
rm
-f
$VM_CMDS
echo
"############################################################"
echo
"Checking build status"
echo
"############################################################"
LOG_FILES
=
`
ls
$ARCHIVES_LOC
/
*
.txt
$ARCHIVES_LOC
/
*
.xml
`
echo
"############################################################"
STATUS
=
0
echo
"Running install and build script on VM (
$VM_NAME
)"
NB_FOUND_FILES
=
0
echo
"############################################################"
echo
"sudo cp 01proxy /etc/apt/apt.conf.d/"
>
$VM_CMDS
for
FULLFILE
in
$LOG_FILES
echo
"touch /home/ubuntu/.hushlogin"
>>
$VM_CMDS
do
if
[[
"
$VM_NAME
"
==
*
"-cppcheck"
*
]]
if
[[
$FULLFILE
==
*
"
$LOG_PATTERN
"
*
]]
then
then
filename
=
$(
basename
--
"
$FULLFILE
"
)
if
[
$DAEMON
-eq
0
]
if
[
"
$LOG_PATTERN
"
==
".Rel15.txt"
]
then
then
PASS_PATTERN
=
`
echo
$filename
|
sed
-e
"s#
$LOG_PATTERN
##"
`
echo
"echo
\"
sudo apt-get --yes --quiet install zip cppcheck
\"
"
>>
$VM_CMDS
echo
"sudo apt-get update > zip-install.txt 2>&1"
>>
$VM_CMDS
echo
"sudo apt-get --yes install zip cppcheck >> zip-install.txt 2>&1"
>>
$VM_CMDS
else
echo
"echo
\"
sudo apt-get --yes --quiet install zip daemon cppcheck
\"
"
>>
$VM_CMDS
echo
"sudo apt-get update > zip-install.txt 2>&1"
>>
$VM_CMDS
echo
"sudo apt-get --yes install zip daemon cppcheck >> zip-install.txt 2>&1"
>>
$VM_CMDS
fi
fi
if
[
"
$LOG_PATTERN
"
==
"basic_simulator"
]
else
if
[
$DAEMON
-eq
0
]
then
then
PASS_PATTERN
=
"lte-"
echo
"echo
\"
sudo apt-get --yes --quiet install zip subversion libboost-dev
\"
"
>>
$VM_CMDS
echo
"sudo apt-get update > zip-install.txt 2>&1"
>>
$VM_CMDS
echo
"sudo apt-get --yes install zip subversion libboost-dev >> zip-install.txt 2>&1"
>>
$VM_CMDS
else
echo
"echo
\"
sudo apt-get --yes --quiet install zip daemon subversion libboost-dev
\"
"
>>
$VM_CMDS
echo
"sudo apt-get update > zip-install.txt 2>&1"
>>
$VM_CMDS
echo
"sudo apt-get --yes install zip daemon subversion libboost-dev >> zip-install.txt 2>&1"
>>
$VM_CMDS
fi
fi
if
[
"
$LOG_PATTERN
"
==
"cppcheck.xml"
]
fi
echo
"mkdir tmp"
>>
$VM_CMDS
echo
"cd tmp"
>>
$VM_CMDS
echo
"echo
\"
unzip -qq -DD ../localZip.zip
\"
"
>>
$VM_CMDS
echo
"unzip -qq -DD ../localZip.zip"
>>
$VM_CMDS
if
[[
"
$VM_NAME
"
==
*
"-cppcheck"
*
]]
then
echo
"mkdir cmake_targets/log"
>>
$VM_CMDS
echo
"chmod 777 cmake_targets/log"
>>
$VM_CMDS
echo
"cp /home/ubuntu/zip-install.txt cmake_targets/log"
>>
$VM_CMDS
echo
"echo
\"
cppcheck
$BUILD_OPTIONS
.
\"
"
>>
$VM_CMDS
if
[
$DAEMON
-eq
0
]
then
then
PASS_PATTERN
=
"results version"
echo
"cppcheck
$BUILD_OPTIONS
. 2> cmake_targets/log/cppcheck.xml 1> cmake_targets/log/cppcheck_build.txt"
>>
$VM_CMDS
LOCAL_STAT
=
`
egrep
-c
"
$PASS_PATTERN
"
$FULLFILE
`
else
else
LOCAL_STAT
=
`
egrep
-c
"Built target
$PASS_PATTERN
"
$FULLFILE
`
echo
"echo
\"
cppcheck
$BUILD_OPTIONS
.
\"
> ./my-vm-build.sh"
>>
$VM_CMDS
echo
"chmod 775 ./my-vm-build.sh "
>>
$VM_CMDS
echo
"sudo -E daemon --inherit --unsafe --name=build_daemon --chdir=/home/ubuntu/tmp -O /home/ubuntu/tmp/cmake_targets/log/cppcheck_build.txt -E /home/ubuntu/tmp/cmake_targets/log/cppcheck.xml ./my-vm-build.sh"
>>
$VM_CMDS
fi
else
echo
"echo
\"
source oaienv
\"
"
>>
$VM_CMDS
echo
"source oaienv"
>>
$VM_CMDS
echo
"cd cmake_targets/"
>>
$VM_CMDS
echo
"mkdir log"
>>
$VM_CMDS
echo
"chmod 777 log"
>>
$VM_CMDS
echo
"cp /home/ubuntu/zip-install.txt log"
>>
$VM_CMDS
if
[
$DAEMON
-eq
0
]
then
echo
"echo
\"
./build_oai -I
$BUILD_OPTIONS
\"
"
>>
$VM_CMDS
echo
"./build_oai -I
$BUILD_OPTIONS
> log/install-build.txt 2>&1"
>>
$VM_CMDS
else
echo
"echo
\"
./build_oai -I
$BUILD_OPTIONS
\"
> ./my-vm-build.sh"
>>
$VM_CMDS
echo
"chmod 775 ./my-vm-build.sh "
>>
$VM_CMDS
echo
"echo
\"
sudo -E daemon --inherit --unsafe --name=build_daemon --chdir=/home/ubuntu/tmp/cmake_targets -o /home/ubuntu/tmp/cmake_targets/log/install-build.txt ./my-vm-build.sh
\"
"
>>
$VM_CMDS
echo
"sudo -E daemon --inherit --unsafe --name=build_daemon --chdir=/home/ubuntu/tmp/cmake_targets -o /home/ubuntu/tmp/cmake_targets/log/install-build.txt ./my-vm-build.sh"
>>
$VM_CMDS
fi
fi
if
[
$LOCAL_STAT
-eq
0
]
;
then
STATUS
=
-1
;
fi
NB_FOUND_FILES
=
$((
NB_FOUND_FILES
+
1
))
fi
fi
done
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
<
$VM_CMDS
rm
-f
$VM_CMDS
if
[
$NB_PATTERN_FILES
-ne
$NB_FOUND_FILES
]
;
then
STATUS
=
-1
;
fi
}
if
[
$STATUS
-eq
0
]
then
echo
"STATUS seems OK"
else
echo
"STATUS failed?"
fi
exit
$STATUS
ci-scripts/createVM.sh
View file @
4bb2b8a2
...
@@ -20,8 +20,8 @@
...
@@ -20,8 +20,8 @@
# * contact@openairinterface.org
# * contact@openairinterface.org
# */
# */
function
usage
{
function
create_
usage
{
echo
"OAI
VM Creation
script"
echo
"OAI
CI VM
script"
echo
" Original Author: Raphael Defosseux"
echo
" Original Author: Raphael Defosseux"
echo
" Requirements:"
echo
" Requirements:"
echo
" -- uvtool uvtool-libvirt apt-cacher"
echo
" -- uvtool uvtool-libvirt apt-cacher"
...
@@ -31,9 +31,9 @@ function usage {
...
@@ -31,9 +31,9 @@ function usage {
echo
""
echo
""
echo
"Usage:"
echo
"Usage:"
echo
"------"
echo
"------"
echo
"
createVM.sh
[OPTIONS]"
echo
"
oai-ci-vm-tool create
[OPTIONS]"
echo
""
echo
""
echo
"Options:"
echo
"
Mandatory
Options:"
echo
"--------"
echo
"--------"
echo
" --job-name #### OR -jn ####"
echo
" --job-name #### OR -jn ####"
echo
" Specify the name of the Jenkins job."
echo
" Specify the name of the Jenkins job."
...
@@ -41,14 +41,7 @@ function usage {
...
@@ -41,14 +41,7 @@ function usage {
echo
" --build-id #### OR -id ####"
echo
" --build-id #### OR -id ####"
echo
" Specify the build ID of the Jenkins job."
echo
" Specify the build ID of the Jenkins job."
echo
""
echo
""
echo
" --variant enb-usrp OR -v1"
variant_usage
echo
" --variant basic-sim OR -v2"
echo
" --variant phy-sim OR -v3"
echo
" --variant cppcheck OR -v4"
echo
" --variant gnb-usrp OR -v5"
echo
" --variant nu-ue-usrp OR -v6"
echo
" --variant enb-ethernet OR -v7"
echo
" --variant ue-ethernet OR -v8"
echo
" Specify the variant to build."
echo
" Specify the variant to build."
echo
""
echo
""
echo
" --help OR -h"
echo
" --help OR -h"
...
@@ -56,158 +49,21 @@ function usage {
...
@@ -56,158 +49,21 @@ function usage {
echo
""
echo
""
}
}
function
variant_usage
{
function
create_vm
{
echo
"OAI VM Build Check script"
echo
"############################################################"
echo
" Original Author: Raphael Defosseux"
echo
"OAI CI VM script"
echo
""
echo
"############################################################"
echo
" --variant enb-usrp OR -v1"
echo
"VM_NAME =
$VM_NAME
"
echo
" --variant basic-sim OR -v2"
echo
"VM_MEMORY =
$VM_MEMORY
MBytes"
echo
" --variant phy-sim OR -v3"
echo
"VM_CPU =
$VM_CPU
"
echo
" --variant cppcheck OR -v4"
echo
" --variant gnb-usrp OR -v5"
echo
" --variant nu-ue-usrp OR -v6"
echo
" --variant enb-ethernet OR -v7"
echo
" --variant ue-ethernet OR -v8"
echo
""
}
if
[
$#
-lt
1
]
||
[
$#
-gt
6
]
then
echo
"Syntax Error: not the correct number of arguments"
echo
""
usage
exit
1
fi
VM_TEMPLATE
=
ci-
JOB_NAME
=
XX
BUILD_ID
=
XX
VM_NAME
=
ci-enb-usrp
VM_MEMORY
=
2048
VM_CPU
=
4
while
[[
$#
-gt
0
]]
echo
"############################################################"
do
echo
"Creating VM (
$VM_NAME
) on Ubuntu Cloud Image base"
key
=
"
$1
"
echo
"############################################################"
uvt-kvm create
$VM_NAME
release
=
xenial
--memory
$VM_MEMORY
--cpu
$VM_CPU
--unsafe-caching
--template
ci-scripts/template-host.xml
echo
"Waiting for VM to be started"
uvt-kvm
wait
$VM_NAME
--insecure
case
$key
in
VM_IP_ADDR
=
`
uvt-kvm ip
$VM_NAME
`
-h
|
--help
)
echo
"
$VM_NAME
has for IP addr =
$VM_IP_ADDR
"
shift
}
usage
exit
0
;;
-jn
|
--job-name
)
JOB_NAME
=
"
$2
"
shift
shift
;;
-id
|
--build-id
)
BUILD_ID
=
"
$2
"
shift
shift
;;
-v1
)
VM_NAME
=
ci-enb-usrp
shift
;;
-v2
)
VM_NAME
=
ci-basic-sim
VM_MEMORY
=
8192
shift
;;
-v3
)
VM_NAME
=
ci-phy-sim
shift
;;
-v4
)
VM_NAME
=
ci-cppcheck
VM_MEMORY
=
8192
shift
;;
-v5
)
VM_NAME
=
ci-gnb-usrp
shift
;;
-v6
)
VM_NAME
=
ci-ue-nr-usrp
shift
;;
-v7
)
VM_NAME
=
ci-enb-ethernet
shift
;;
-v8
)
VM_NAME
=
ci-ue-ethernet
shift
;;
--variant
)
variant
=
"
$2
"
case
$variant
in
enb-usrp
)
VM_NAME
=
ci-enb-usrp
;;
basic-sim
)
VM_NAME
=
ci-basic-sim
VM_MEMORY
=
8192
;;
phy-sim
)
VM_NAME
=
ci-phy-sim
;;
cppcheck
)
VM_NAME
=
ci-cppcheck
VM_MEMORY
=
8192
;;
gnb-usrp
)
VM_NAME
=
ci-gnb-usrp
;;
nu-ue-usrp
)
VM_NAME
=
ci-ue-nr-usrp
;;
enb-ethernet
)
VM_NAME
=
ci-enb-ethernet
;;
ue-ethernet
)
VM_NAME
=
ci-ue-ethernet
;;
*
)
echo
""
echo
"Syntax Error: Invalid Variant option ->
$variant
"
echo
""
variant_usage
exit
1
esac
shift
shift
;;
*
)
echo
"Syntax Error: unknown option:
$key
"
echo
""
usage
exit
1
esac
done
if
[
"
$JOB_NAME
"
==
"XX"
]
||
[
"
$BUILD_ID
"
==
"XX"
]
then
VM_TEMPLATE
=
ci-
else
VM_TEMPLATE
=
${
JOB_NAME
}
-b
${
BUILD_ID
}
-
fi
VM_NAME
=
`
echo
$VM_NAME
|
sed
-e
"s#ci-#
$VM_TEMPLATE
#"
`
VM_CMDS
=
${
VM_NAME
}
_cmds.txt
echo
"VM_NAME =
$VM_NAME
"
echo
"VM_MEMORY =
$VM_MEMORY
MBytes"
echo
"VM_CPU =
$VM_CPU
"
echo
"############################################################"
echo
"Creating VM (
$VM_NAME
) on Ubuntu Cloud Image base"
echo
"############################################################"
uvt-kvm create
$VM_NAME
release
=
xenial
--memory
$VM_MEMORY
--cpu
$VM_CPU
--unsafe-caching
--template
ci-scripts/template-host.xml
echo
"Waiting for VM to be started"
uvt-kvm
wait
$VM_NAME
--insecure
VM_IP_ADDR
=
`
uvt-kvm ip
$VM_NAME
`
echo
"
$VM_NAME
has for IP addr =
$VM_IP_ADDR
"
exit
0
ci-scripts/destroyAllRunningVM.sh
View file @
4bb2b8a2
...
@@ -20,15 +20,17 @@
...
@@ -20,15 +20,17 @@
# * contact@openairinterface.org
# * contact@openairinterface.org
# */
# */
function
usage
{
function
destroy_
usage
{
echo
"OAI
VM Destroy
script"
echo
"OAI
CI VM
script"
echo
" Original Author: Raphael Defosseux"
echo
" Original Author: Raphael Defosseux"
echo
" Requirements:"
echo
" -- uvtool uvtool-libvirt apt-cacher"
echo
""
echo
""
echo
"Usage:"
echo
"Usage:"
echo
"------"
echo
"------"
echo
"
destroyAllRunningVM.sh
[OPTIONS]"
echo
"
oai-ci-vm-tool destroy
[OPTIONS]"
echo
""
echo
""
echo
"Options:"
echo
"
Mandatory
Options:"
echo
"--------"
echo
"--------"
echo
" --job-name #### OR -jn ####"
echo
" --job-name #### OR -jn ####"
echo
" Specify the name of the Jenkins job."
echo
" Specify the name of the Jenkins job."
...
@@ -36,66 +38,26 @@ function usage {
...
@@ -36,66 +38,26 @@ function usage {
echo
" --build-id #### OR -id ####"
echo
" --build-id #### OR -id ####"
echo
" Specify the build ID of the Jenkins job."
echo
" Specify the build ID of the Jenkins job."
echo
""
echo
""
echo
"Options:"
echo
"--------"
echo
" --help OR -h"
echo
" --help OR -h"
echo
" Print this help message."
echo
" Print this help message."
echo
""
echo
""
}
}
if
[
$#
-gt
4
]
function
destroy_vm
{
then
echo
"############################################################"
echo
"Syntax Error: not the correct number of arguments"
echo
"OAI CI VM script"
echo
""
echo
"############################################################"
usage
echo
"VM_TEMPLATE =
$VM_TEMPLATE
"
exit
1
fi
LIST_CI_VM
=
`
uvt-kvm list |
grep
$VM_TEMPLATE
`
VM_TEMPLATE
=
ci-
for
CI_VM
in
$LIST_CI_VM
JOB_NAME
=
XX
do
BUILD_ID
=
XX
VM_IP_ADDR
=
`
uvt-kvm ip
$CI_VM
`
echo
"VM to destroy:
$CI_VM
-- IP
$VM_IP_ADDR
"
while
[[
$#
-gt
0
]]
uvt-kvm destroy
$CI_VM
do
ssh-keygen
-R
$VM_IP_ADDR
key
=
"
$1
"
done
case
$key
in
}
-h
|
--help
)
shift
usage
exit
0
;;
-jn
|
--job-name
)
JOB_NAME
=
"
$2
"
shift
shift
;;
-id
|
--build-id
)
BUILD_ID
=
"
$2
"
shift
shift
;;
*
)
echo
"Syntax Error: unknown option:
$key
"
echo
""
usage
exit
1
esac
done
if
[
"
$JOB_NAME
"
==
"XX"
]
||
[
"
$BUILD_ID
"
==
"XX"
]
then
VM_TEMPLATE
=
ci-
else
VM_TEMPLATE
=
${
JOB_NAME
}
-b
${
BUILD_ID
}
-
fi
LIST_CI_VM
=
`
uvt-kvm list |
grep
$VM_TEMPLATE
`
for
CI_VM
in
$LIST_CI_VM
do
VM_IP_ADDR
=
`
uvt-kvm ip
$CI_VM
`
echo
"VM to destroy:
$CI_VM
-- IP
$VM_IP_ADDR
"
uvt-kvm destroy
$CI_VM
ssh-keygen
-R
$VM_IP_ADDR
done
exit
0
ci-scripts/oai-ci-vm-tool
0 → 100755
View file @
4bb2b8a2
#!/bin/bash
#/*
# * 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
# */
function
top_usage
{
echo
"OAI CI VM script"
echo
" Original Author: Raphael Defosseux"
echo
" Requirements:"
echo
" -- uvtool uvtool-libvirt apt-cacher"
echo
" -- xenial image already synced"
echo
""
echo
"Usage:"
echo
"------"
echo
" oai-ci-vm-tool (-h|--help) {create,destroy,build,wait,test,report-build,report-test} ..."
echo
""
}
function
variant_usage
{
echo
" --variant enb-usrp OR -v1"
echo
" --variant basic-sim OR -v2"
echo
" --variant phy-sim OR -v3"
echo
" --variant cppcheck OR -v4"
echo
" --variant gnb-usrp OR -v5"
echo
" --variant nu-ue-usrp OR -v6"
echo
" --variant enb-ethernet OR -v7"
echo
" --variant ue-ethernet OR -v8"
}
MY_DIR
=
$(
dirname
$(
readlink
-f
$0
))
.
$MY_DIR
/createVM.sh
.
$MY_DIR
/buildOnVM.sh
.
$MY_DIR
/waitBuildOnVM.sh
.
$MY_DIR
/destroyAllRunningVM.sh
.
$MY_DIR
/runTestOnVM.sh
.
$MY_DIR
/reportBuildLocally.sh
.
$MY_DIR
/reportTestLocally.sh
if
[
$#
-lt
1
]
then
echo
"Syntax Error: too few arguments"
echo
""
top_usage
exit
1
fi
VM_TEMPLATE
=
ci-
JOB_NAME
=
XX
BUILD_ID
=
XX
VM_NAME
=
ci-enb-usrp
VM_MEMORY
=
2048
VM_CPU
=
4
ARCHIVES_LOC
=
enb_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--eNB -w USRP"
KEEP_VM_ALIVE
=
0
RUN_OPTIONS
=
"none"
DAEMON
=
0
MR_TRIG
=
0
PU_TRIG
=
0
HELP_CMD
=
0
CREATE_CMD
=
0
BUILD_CMD
=
0
WAIT_CMD
=
0
DESTROY_CMD
=
0
TEST_CMD
=
0
REPORT_BUILD_CMD
=
0
REPORT_TEST_CMD
=
0
NBARGS
=
0
while
[[
$#
-gt
0
]]
do
key
=
"
$1
"
case
$key
in
-h
|
--help
)
HELP_CMD
=
1
shift
;;
create
)
CREATE_CMD
=
1
# It is implied to keep the VM when creating it
KEEP_VM_ALIVE
=
1
shift
;;
build
)
BUILD_CMD
=
1
shift
;;
wait
)
WAIT_CMD
=
1
shift
;;
test
)
TEST_CMD
=
1
shift
;;
destroy
)
DESTROY_CMD
=
1
shift
;;
report-build
)
REPORT_BUILD_CMD
=
1
shift
;;
report-test
)
REPORT_TEST_CMD
=
1
shift
;;
-jn
|
--job-name
)
JOB_NAME
=
"
$2
"
NBARGS
=
$[$NBARGS
+1]
shift
shift
;;
-id
|
--build-id
)
BUILD_ID
=
"
$2
"
NBARGS
=
$[$NBARGS
+2]
shift
shift
;;
-ws
|
--workspace
)
JENKINS_WKSP
=
"
$2
"
NBARGS
=
$[$NBARGS
+4]
shift
shift
;;
-k
|
--keep-vm-alive
)
KEEP_VM_ALIVE
=
1
NBARGS
=
$[$NBARGS
+8]
shift
;;
-D
|
--daemon
)
DAEMON
=
1
NBARGS
=
$[$NBARGS
+16]
shift
;;
-gu
|
--git-url
)
GIT_URL
=
"
$2
"
NBARGS
=
$[$NBARGS
+32]
shift
shift
;;
--trigger
)
TRIG
=
"
$2
"
case
$TRIG
in
merge-request
)
MR_TRIG
=
1
;;
push
)
PU_TRIG
=
1
;;
*
)
echo
""
echo
"Syntax Error: Invalid Trigger option ->
$TRIG
"
echo
""
trigger_usage
exit
;;
esac
NBARGS
=
$[$NBARGS
+64]
shift
shift
;;
-mr
)
MR_TRIG
=
1
NBARGS
=
$[$NBARGS
+64]
shift
;;
-pu
)
PU_TRIG
=
1
NBARGS
=
$[$NBARGS
+64]
shift
;;
-sb
|
--src-branch
)
SOURCE_BRANCH
=
"
$2
"
NBARGS
=
$[$NBARGS
+1024]
shift
shift
;;
-sc
|
--src-commit
)
SOURCE_COMMIT_ID
=
"
$2
"
NBARGS
=
$[$NBARGS
+2048]
shift
shift
;;
-tb
|
--target-branch
)
TARGET_BRANCH
=
"
$2
"
NBARGS
=
$[$NBARGS
+4096]
shift
shift
;;
-tc
|
--target-commit
)
TARGET_COMMIT_ID
=
"
$2
"
NBARGS
=
$[$NBARGS
+8192]
shift
shift
;;
-br
|
--branch
)
SOURCE_BRANCH
=
"
$2
"
NBARGS
=
$[$NBARGS
+16384]
shift
shift
;;
-co
|
--commit
)
SOURCE_COMMIT_ID
=
"
$2
"
NBARGS
=
$[$NBARGS
+32768]
shift
shift
;;
-v1
)
VM_NAME
=
ci-enb-usrp
ARCHIVES_LOC
=
enb_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--eNB -w USRP --mu"
NBARGS
=
$[$NBARGS
+256]
shift
;;
-v2
)
VM_NAME
=
ci-basic-sim
ARCHIVES_LOC
=
basic_sim
LOG_PATTERN
=
basic_simulator
NB_PATTERN_FILES
=
2
BUILD_OPTIONS
=
"--basic-simulator"
VM_MEMORY
=
8192
VM_CPU
=
4
RUN_OPTIONS
=
"complex"
NBARGS
=
$[$NBARGS
+256]
shift
;;
-v3
)
VM_NAME
=
ci-phy-sim
ARCHIVES_LOC
=
phy_sim
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--phy_simulators"
RUN_OPTIONS
=
"./run_exec_autotests.bash -g
\"
01510*
\"
-q -np -b"
NBARGS
=
$[$NBARGS
+256]
shift
;;
-v4
)
VM_NAME
=
ci-cppcheck
VM_MEMORY
=
8192
ARCHIVES_LOC
=
cppcheck
LOG_PATTERN
=
cppcheck.xml
NB_PATTERN_FILES
=
1
BUILD_OPTIONS
=
"--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c"
NBARGS
=
$[$NBARGS
+256]
shift
;;
-v5
)
VM_NAME
=
ci-gnb-usrp
ARCHIVES_LOC
=
gnb_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--gNB -w USRP"
NBARGS
=
$[$NBARGS
+256]
shift
;;
-v6
)
VM_NAME
=
ci-ue-nr-usrp
ARCHIVES_LOC
=
nrue_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--nrUE -w USRP"
NBARGS
=
$[$NBARGS
+256]
shift
;;
-v7
)
VM_NAME
=
ci-enb-ethernet
ARCHIVES_LOC
=
enb_eth
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--eNB -t ETHERNET --noS1"
NBARGS
=
$[$NBARGS
+256]
shift
;;
-v8
)
VM_NAME
=
ci-ue-ethernet
ARCHIVES_LOC
=
ue_eth
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--UE -t ETHERNET --noS1"
NBARGS
=
$[$NBARGS
+256]
shift
;;
--variant
)
variant
=
"
$2
"
case
$variant
in
enb-usrp
)
VM_NAME
=
ci-enb-usrp
ARCHIVES_LOC
=
enb_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--eNB -w USRP --mu"
NBARGS
=
$[$NBARGS
+256]
;;
basic-sim
)
VM_NAME
=
ci-basic-sim
ARCHIVES_LOC
=
basic_sim
LOG_PATTERN
=
basic_simulator
NB_PATTERN_FILES
=
2
BUILD_OPTIONS
=
"--basic-simulator"
VM_MEMORY
=
8192
VM_CPU
=
4
RUN_OPTIONS
=
"complex"
NBARGS
=
$[$NBARGS
+256]
;;
phy-sim
)
VM_NAME
=
ci-phy-sim
ARCHIVES_LOC
=
phy_sim
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--phy_simulators"
RUN_OPTIONS
=
"./run_exec_autotests.bash -g
\"
01510*
\"
-q -np -b"
NBARGS
=
$[$NBARGS
+256]
;;
cppcheck
)
VM_NAME
=
ci-cppcheck
VM_MEMORY
=
8192
ARCHIVES_LOC
=
cppcheck
LOG_PATTERN
=
cppcheck.xml
NB_PATTERN_FILES
=
1
BUILD_OPTIONS
=
"--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c"
NBARGS
=
$[$NBARGS
+256]
;;
gnb-usrp
)
VM_NAME
=
ci-gnb-usrp
ARCHIVES_LOC
=
gnb_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--gNB -w USRP"
NBARGS
=
$[$NBARGS
+256]
;;
nu-ue-usrp
)
VM_NAME
=
ci-ue-nr-usrp
ARCHIVES_LOC
=
nrue_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--nrUE -w USRP"
NBARGS
=
$[$NBARGS
+256]
;;
enb-ethernet
)
VM_NAME
=
ci-enb-ethernet
ARCHIVES_LOC
=
enb_eth
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--eNB -t ETHERNET --noS1"
NBARGS
=
$[$NBARGS
+256]
;;
ue-ethernet
)
VM_NAME
=
ci-ue-ethernet
ARCHIVES_LOC
=
ue_eth
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--UE -t ETHERNET --noS1"
NBARGS
=
$[$NBARGS
+256]
;;
*
)
echo
""
echo
"Syntax Error: Invalid Variant option ->
$variant
"
echo
""
variant_usage
exit
1
esac
shift
shift
;;
*
)
echo
"Syntax Error: unknown option:
$key
"
echo
""
top_usage
exit
1
esac
done
MANY_CMDS
=
$[$CREATE_CMD
+
$BUILD_CMD
+
$WAIT_CMD
+
$DESTROY_CMD
+
$TEST_CMD
+
$REPORT_BUILD_CMD
+
$REPORT_TEST_CMD
]
if
[
$MANY_CMDS
-gt
1
]
then
echo
"Syntax Error: too many commands"
top_usage
exit
1
fi
if
[
$HELP_CMD
-eq
1
]
then
if
[
$MANY_CMDS
-eq
0
]
then
top_usage
exit
0
fi
if
[
$CREATE_CMD
-eq
1
]
then
create_usage
exit
0
fi
if
[
$BUILD_CMD
-eq
1
]
then
build_usage
exit
0
fi
if
[
$WAIT_CMD
-eq
1
]
then
wait_usage
exit
0
fi
if
[
$TEST_CMD
-eq
1
]
then
run_test_usage
exit
0
fi
if
[
$DESTROY_CMD
-eq
1
]
then
destroy_usage
exit
0
fi
if
[
$REPORT_BUILD_CMD
-eq
1
]
then
report_build_usage
exit
0
fi
if
[
$REPORT_TEST_CMD
-eq
1
]
then
report_test_usage
exit
0
fi
else
if
[
$MANY_CMDS
-eq
0
]
then
echo
"Syntax Error: no command"
top_usage
exit
1
fi
# For create, mandatory options: jn, id. Optional: variant
if
[
$CREATE_CMD
-eq
1
]
&&
[
$NBARGS
-ne
3
]
&&
[
$NBARGS
-ne
259
]
then
echo
"Syntax Error: unsupported option(s) for create command"
create_usage
exit
1
fi
# For build, mandatory options: jn, id, ws. Optional: variant, k, D
if
[
$BUILD_CMD
-eq
1
]
&&
[
$NBARGS
-ne
7
]
&&
[
$NBARGS
-ne
263
]
&&
[
$NBARGS
-ne
15
]
&&
[
$NBARGS
-ne
271
]
&&
[
$NBARGS
-ne
23
]
&&
[
$NBARGS
-ne
279
]
&&
[
$NBARGS
-ne
31
]
&&
[
$NBARGS
-ne
287
]
then
echo
"Syntax Error: unsupported option(s) for build command"
build_usage
exit
1
fi
# For wait, mandatory options: jn, id, ws. Optional: variant, k
if
[
$WAIT_CMD
-eq
1
]
&&
[
$NBARGS
-ne
7
]
&&
[
$NBARGS
-ne
263
]
&&
[
$NBARGS
-ne
15
]
&&
[
$NBARGS
-ne
271
]
then
echo
"Syntax Error: unsupported option(s) for wait command"
wait_usage
exit
1
fi
# For test, mandatory options: jn, id, ws. Optional: variant, k
if
[
$TEST_CMD
-eq
1
]
&&
[
$NBARGS
-ne
7
]
&&
[
$NBARGS
-ne
263
]
&&
[
$NBARGS
-ne
15
]
&&
[
$NBARGS
-ne
271
]
then
echo
"Syntax Error: unsupported option(s) for test command"
run_test_usage
exit
1
fi
# For destroy, mandatory options: jn, id.
if
[
$DESTROY_CMD
-eq
1
]
&&
[
$NBARGS
-ne
3
]
then
echo
"Syntax Error: unsupported option(s) for destroy command"
destroy_usage
exit
1
fi
# For report-build, mandatory options: jn, id, ws, gu, pu, br,co.
# or: jn, id, ws, gu, mr, sb, sc, tb, tc.
if
[
$REPORT_BUILD_CMD
-eq
1
]
&&
[
$NBARGS
-ne
15463
]
&&
[
$NBARGS
-ne
49255
]
then
echo
"Syntax Error: unsupported option(s) for report-build command"
report_build_usage
exit
1
fi
# For report-test, mandatory options: jn, id, ws, gu, pu, br,co.
# or: jn, id, ws, gu, mr, sb, sc, tb, tc.
if
[
$REPORT_TEST_CMD
-eq
1
]
&&
[
$NBARGS
-ne
15463
]
&&
[
$NBARGS
-ne
49255
]
then
echo
"Syntax Error: unsupported option(s) for report-test command"
report_test_usage
exit
1
fi
fi
# Checking uvt-kvm is installed
UVT_KVM_PATH
=
`
which uvt-kvm |
grep
-c
uvt-kvm
`
if
[
$UVT_KVM_PATH
-eq
0
]
then
echo
"Error: uvt-kvm is not installed"
top_usage
exit
1
fi
if
[
"
$JOB_NAME
"
==
"XX"
]
||
[
"
$BUILD_ID
"
==
"XX"
]
then
VM_TEMPLATE
=
ci-
else
VM_TEMPLATE
=
${
JOB_NAME
}
-b
${
BUILD_ID
}
-
fi
VM_NAME
=
`
echo
$VM_NAME
|
sed
-e
"s#ci-#
$VM_TEMPLATE
#"
`
VM_CMDS
=
${
VM_NAME
}
_cmds.txt
ARCHIVES_LOC
=
${
JENKINS_WKSP
}
/archives/
${
ARCHIVES_LOC
}
STATUS
=
0
if
[
$CREATE_CMD
-eq
1
]
then
create_vm
fi
if
[
$BUILD_CMD
-eq
1
]
then
build_on_vm
if
[
$DAEMON
-eq
0
]
&&
[
$STATUS
-eq
0
]
then
check_on_vm_build
fi
fi
if
[
$WAIT_CMD
-eq
1
]
then
wait_on_vm_build
if
[
$STATUS
-eq
0
]
then
check_on_vm_build
fi
fi
if
[
$TEST_CMD
-eq
1
]
then
ARCHIVES_LOC
=
${
ARCHIVES_LOC
}
/test
run_test_on_vm
fi
if
[
$DESTROY_CMD
-eq
1
]
then
destroy_vm
fi
if
[
$REPORT_BUILD_CMD
-eq
1
]
then
report_build
fi
if
[
$REPORT_TEST_CMD
-eq
1
]
then
report_test
fi
# Did command pass or fail?
if
[
$STATUS
-eq
0
]
then
echo
"STATUS seems OK"
else
echo
"STATUS failed?"
fi
exit
$STATUS
ci-scripts/reportBuildLocally.sh
View file @
4bb2b8a2
...
@@ -20,14 +20,13 @@
...
@@ -20,14 +20,13 @@
# * contact@openairinterface.org
# * contact@openairinterface.org
# */
# */
function
usage
{
function
report_build_
usage
{
echo
"OAI
Local Build Report
script"
echo
"OAI
CI VM
script"
echo
" Original Author: Raphael Defosseux"
echo
" Original Author: Raphael Defosseux"
echo
""
echo
""
echo
"Usage:"
echo
"Usage:"
echo
"------"
echo
"------"
echo
""
echo
" oai-ci-vm-tool report-build [OPTIONS]"
echo
" reportBuildLocally.sh [OPTIONS]"
echo
""
echo
""
echo
"Options:"
echo
"Options:"
echo
"--------"
echo
"--------"
...
@@ -47,6 +46,9 @@ function usage {
...
@@ -47,6 +46,9 @@ function usage {
echo
" --build-id #### OR -id ####"
echo
" --build-id #### OR -id ####"
echo
" Specify the build ID of the Jenkins job."
echo
" Specify the build ID of the Jenkins job."
echo
""
echo
""
echo
" --workspace #### OR -ws ####"
echo
" Specify the workspace."
echo
""
echo
" --trigger merge-request OR -mr"
echo
" --trigger merge-request OR -mr"
echo
" --trigger push OR -pu"
echo
" --trigger push OR -pu"
echo
" Specify trigger action of the Jenkins job. Either a merge-request event or a push event."
echo
" Specify trigger action of the Jenkins job. Either a merge-request event or a push event."
...
@@ -79,7 +81,7 @@ function usage {
...
@@ -79,7 +81,7 @@ function usage {
}
}
function
trigger_usage
{
function
trigger_usage
{
echo
"OAI
Local Build Report
script"
echo
"OAI
CI VM
script"
echo
" Original Author: Raphael Defosseux"
echo
" Original Author: Raphael Defosseux"
echo
""
echo
""
echo
" --trigger merge-request OR -mr"
echo
" --trigger merge-request OR -mr"
...
@@ -153,8 +155,8 @@ function summary_table_row {
...
@@ -153,8 +155,8 @@ function summary_table_row {
echo
" <td bgcolor =
\"
lightcyan
\"
>
$1
</th>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>
$1
</th>"
>>
./build_results.html
if
[
-f
$2
]
if
[
-f
$2
]
then
then
STATUS
=
`
egrep
-c
"
$3
"
$2
`
BUILD_
STATUS
=
`
egrep
-c
"
$3
"
$2
`
if
[
$STATUS
-eq
1
]
if
[
$
BUILD_
STATUS
-eq
1
]
then
then
echo
" <td bgcolor =
\"
green
\"
>OK</th>"
>>
./build_results.html
echo
" <td bgcolor =
\"
green
\"
>OK</th>"
>>
./build_results.html
else
else
...
@@ -263,384 +265,245 @@ function sca_summary_table_footer {
...
@@ -263,384 +265,245 @@ function sca_summary_table_footer {
echo
" <p style=
\"
margin-left: 30px
\"
>Graphical Interface tool : <strong><code>cppcheck-gui -l cppcheck/cppcheck.xml</code></strong></p>"
>>
./build_results.html
echo
" <p style=
\"
margin-left: 30px
\"
>Graphical Interface tool : <strong><code>cppcheck-gui -l cppcheck/cppcheck.xml</code></strong></p>"
>>
./build_results.html
}
}
jb_checker
=
0
function
report_build
{
mr_checker
=
0
echo
"############################################################"
pu_checker
=
0
echo
"OAI CI VM script"
MR_TRIG
=
0
echo
"############################################################"
PU_TRIG
=
0
while
[[
$#
-gt
0
]]
echo
"JENKINS_WKSP =
$JENKINS_WKSP
"
do
key
=
"
$1
"
cd
${
JENKINS_WKSP
}
echo
"<!DOCTYPE html>"
>
./build_results.html
case
$key
in
echo
"<html class=
\"
no-js
\"
lang=
\"
en-US
\"
>"
>>
./build_results.html
-h
|
--help
)
echo
"<head>"
>>
./build_results.html
shift
echo
" <title>Build Results for
$JOB_NAME
job build #
$BUILD_ID
</title>"
>>
./build_results.html
usage
echo
" <base href =
\"
http://www.openairinterface.org/
\"
/>"
>>
./build_results.html
exit
0
echo
"</head>"
>>
./build_results.html
;;
echo
"<body>"
>>
./build_results.html
-gu
|
--git-url
)
echo
" <table style=
\"
border-collapse: collapse; border: none;
\"
>"
>>
./build_results.html
GIT_URL
=
"
$2
"
echo
" <tr style=
\"
border-collapse: collapse; border: none;
\"
>"
>>
./build_results.html
let
"jb_checker|=0x1"
echo
" <td style=
\"
border-collapse: collapse; border: none;
\"
>"
>>
./build_results.html
shift
echo
" <a href=
\"
http://www.openairinterface.org/
\"
>"
>>
./build_results.html
shift
echo
" <img src=
\"
/wp-content/uploads/2016/03/cropped-oai_final_logo2.png
\"
alt=
\"\"
border=
\"
none
\"
height=50 width=150>"
>>
./build_results.html
;;
echo
" </img>"
>>
./build_results.html
-jn
|
--job-name
)
echo
" </a>"
>>
./build_results.html
JOB_NAME
=
"
$2
"
echo
" </td>"
>>
./build_results.html
let
"jb_checker|=0x2"
echo
" <td style=
\"
border-collapse: collapse; border: none; vertical-align: center;
\"
>"
>>
./build_results.html
shift
echo
" <b><font size =
\"
6
\"
>Job Summary -- Job:
$JOB_NAME
-- Build-ID:
$BUILD_ID
</font></b>"
>>
./build_results.html
shift
echo
" </td>"
>>
./build_results.html
;;
echo
" </tr>"
>>
./build_results.html
-id
|
--build-id
)
echo
" </table>"
>>
./build_results.html
BUILD_ID
=
"
$2
"
echo
" <br>"
>>
./build_results.html
let
"jb_checker|=0x4"
echo
" <table border =
\"
1
\"
>"
>>
./build_results.html
shift
shift
;;
--trigger
)
TRIG
=
"
$2
"
case
$TRIG
in
merge-request
)
MR_TRIG
=
1
;;
push
)
PU_TRIG
=
1
;;
*
)
echo
""
echo
"Syntax Error: Invalid Trigger option ->
$TRIG
"
echo
""
trigger_usage
exit
;;
esac
let
"jb_checker|=0x8"
shift
shift
;;
-mr
)
MR_TRIG
=
1
let
"jb_checker|=0x8"
shift
;;
-pu
)
PU_TRIG
=
1
let
"jb_checker|=0x8"
shift
;;
-sb
|
--src-branch
)
SOURCE_BRANCH
=
"
$2
"
let
"mr_checker|=0x1"
shift
shift
;;
-sc
|
--src-commit
)
SOURCE_COMMIT_ID
=
"
$2
"
let
"mr_checker|=0x2"
shift
shift
;;
-tb
|
--target-branch
)
TARGET_BRANCH
=
"
$2
"
let
"mr_checker|=0x4"
shift
shift
;;
-tc
|
--target-commit
)
TARGET_COMMIT_ID
=
"
$2
"
let
"mr_checker|=0x8"
shift
shift
;;
-br
|
--branch
)
SOURCE_BRANCH
=
"
$2
"
let
"pu_checker|=0x1"
shift
shift
;;
-co
|
--commit
)
SOURCE_COMMIT_ID
=
"
$2
"
let
"pu_checker|=0x2"
shift
shift
;;
*
)
echo
"Syntax Error: unknown option:
$key
"
echo
""
usage
exit
1
;;
esac
done
if
[
$jb_checker
-ne
15
]
then
echo
""
echo
"Syntax Error: missing job information."
# TODO : list missing info
echo
""
exit
1
fi
if
[
$PU_TRIG
-eq
1
]
&&
[
$MR_TRIG
-eq
1
]
then
echo
""
echo
"Syntax Error: trigger action incoherent."
echo
""
trigger_usage
exit
1
fi
if
[
$PU_TRIG
-eq
1
]
then
if
[
$pu_checker
-ne
3
]
then
echo
""
echo
"Syntax Error: missing push information."
# TODO : list missing info
echo
""
exit
1
fi
fi
if
[
$MR_TRIG
-eq
1
]
then
if
[
$mr_checker
-ne
15
]
then
echo
""
echo
"Syntax Error: missing merge-request information."
# TODO : list missing info
echo
""
exit
1
fi
fi
echo
"<!DOCTYPE html>"
>
./build_results.html
echo
"<html class=
\"
no-js
\"
lang=
\"
en-US
\"
>"
>>
./build_results.html
echo
"<head>"
>>
./build_results.html
echo
" <title>Build Results for
$JOB_NAME
job build #
$BUILD_ID
</title>"
>>
./build_results.html
echo
" <base href =
\"
http://www.openairinterface.org/
\"
/>"
>>
./build_results.html
echo
"</head>"
>>
./build_results.html
echo
"<body>"
>>
./build_results.html
echo
" <table style=
\"
border-collapse: collapse; border: none;
\"
>"
>>
./build_results.html
echo
" <tr style=
\"
border-collapse: collapse; border: none;
\"
>"
>>
./build_results.html
echo
" <td style=
\"
border-collapse: collapse; border: none;
\"
>"
>>
./build_results.html
echo
" <a href=
\"
http://www.openairinterface.org/
\"
>"
>>
./build_results.html
echo
" <img src=
\"
/wp-content/uploads/2016/03/cropped-oai_final_logo2.png
\"
alt=
\"\"
border=
\"
none
\"
height=50 width=150>"
>>
./build_results.html
echo
" </img>"
>>
./build_results.html
echo
" </a>"
>>
./build_results.html
echo
" </td>"
>>
./build_results.html
echo
" <td style=
\"
border-collapse: collapse; border: none; vertical-align: center;
\"
>"
>>
./build_results.html
echo
" <b><font size =
\"
6
\"
>Job Summary -- Job:
$JOB_NAME
-- Build-ID:
$BUILD_ID
</font></b>"
>>
./build_results.html
echo
" </td>"
>>
./build_results.html
echo
" </tr>"
>>
./build_results.html
echo
" </table>"
>>
./build_results.html
echo
" <br>"
>>
./build_results.html
echo
" <table border =
\"
1
\"
>"
>>
./build_results.html
echo
" <tr>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Build Start Time (UTC)</td>"
>>
./build_results.html
echo
" <td>TEMPLATE_BUILD_TIME</td>"
>>
./build_results.html
echo
" </tr>"
>>
./build_results.html
echo
" <tr>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>GIT Repository</td>"
>>
./build_results.html
echo
" <td>
$GIT_URL
</td>"
>>
./build_results.html
echo
" </tr>"
>>
./build_results.html
echo
" <tr>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Job Trigger</td>"
>>
./build_results.html
if
[
$PU_TRIG
-eq
1
]
;
then
echo
" <td>Push Event</td>"
>>
./build_results.html
;
fi
if
[
$MR_TRIG
-eq
1
]
;
then
echo
" <td>Merge-Request</td>"
>>
./build_results.html
;
fi
echo
" </tr>"
>>
./build_results.html
if
[
$PU_TRIG
-eq
1
]
then
echo
" <tr>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Branch</td>"
>>
./build_results.html
echo
" <td>
$SOURCE_BRANCH
</td>"
>>
./build_results.html
echo
" </tr>"
>>
./build_results.html
echo
" <tr>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Commit ID</td>"
>>
./build_results.html
echo
" <td>
$SOURCE_COMMIT_ID
</td>"
>>
./build_results.html
echo
" </tr>"
>>
./build_results.html
fi
if
[
$MR_TRIG
-eq
1
]
then
echo
" <tr>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Source Branch</td>"
>>
./build_results.html
echo
" <td>
$SOURCE_BRANCH
</td>"
>>
./build_results.html
echo
" </tr>"
>>
./build_results.html
echo
" <tr>"
>>
./build_results.html
echo
" <tr>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>
Source Commit ID
</td>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>
Build Start Time (UTC)
</td>"
>>
./build_results.html
echo
" <td>
$SOURCE_COMMIT_ID
</td>"
>>
./build_results.html
echo
" <td>
TEMPLATE_BUILD_TIME
</td>"
>>
./build_results.html
echo
" </tr>"
>>
./build_results.html
echo
" </tr>"
>>
./build_results.html
echo
" <tr>"
>>
./build_results.html
echo
" <tr>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>
Target Branch
</td>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>
GIT Repository
</td>"
>>
./build_results.html
echo
" <td>
$
TARGET_BRANCH
</td>"
>>
./build_results.html
echo
" <td>
$
GIT_URL
</td>"
>>
./build_results.html
echo
" </tr>"
>>
./build_results.html
echo
" </tr>"
>>
./build_results.html
echo
" <tr>"
>>
./build_results.html
echo
" <tr>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Target Commit ID</td>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Job Trigger</td>"
>>
./build_results.html
echo
" <td>
$TARGET_COMMIT_ID
</td>"
>>
./build_results.html
if
[
$PU_TRIG
-eq
1
]
;
then
echo
" <td>Push Event</td>"
>>
./build_results.html
;
fi
if
[
$MR_TRIG
-eq
1
]
;
then
echo
" <td>Merge-Request</td>"
>>
./build_results.html
;
fi
echo
" </tr>"
>>
./build_results.html
echo
" </tr>"
>>
./build_results.html
fi
if
[
$PU_TRIG
-eq
1
]
echo
" </table>"
>>
./build_results.html
then
echo
" <h2>Build Summary</h2>"
>>
./build_results.html
echo
" <tr>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Branch</td>"
>>
./build_results.html
if
[
-f
./oai_rules_result.txt
]
echo
" <td>
$SOURCE_BRANCH
</td>"
>>
./build_results.html
then
echo
" <h3>OAI Coding / Formatting Guidelines Check</h3>"
>>
./build_results.html
echo
" <table border = "
1
">"
>>
./build_results.html
echo
" <tr>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Result:</td>"
>>
./build_results.html
NB_FILES
=
`
cat
./oai_rules_result.txt
`
if
[
$NB_FILES
=
"0"
]
then
if
[
$PU_TRIG
-eq
1
]
;
then
echo
" <td bgcolor =
\"
green
\"
>All files in repository follow OAI rules. </td>"
>>
./build_results.html
;
fi
if
[
$MR_TRIG
-eq
1
]
;
then
echo
" <td bgcolor =
\"
green
\"
>All modified files in Merge-Request follow OAI rules.</td>"
>>
./build_results.html
;
fi
echo
" </tr>"
>>
./build_results.html
echo
" </tr>"
>>
./build_results.html
echo
" </table>"
>>
./build_results.html
echo
" <tr>"
>>
./build_results.html
else
echo
" <td bgcolor =
\"
lightcyan
\"
>Commit ID</td>"
>>
./build_results.html
if
[
$PU_TRIG
-eq
1
]
;
then
echo
" <td bgcolor =
\"
orange
\"
>
$NB_FILES
files in repository DO NOT follow OAI rules. </td>"
>>
./build_results.html
;
fi
echo
" <td>
$SOURCE_COMMIT_ID
</td>"
>>
./build_results.html
if
[
$MR_TRIG
-eq
1
]
;
then
echo
" <td bgcolor =
\"
orange
\"
>
$NB_FILES
modified files in Merge-Request DO NOT follow OAI rules.</td>"
>>
./build_results.html
;
fi
echo
" </tr>"
>>
./build_results.html
echo
" </tr>"
>>
./build_results.html
if
[
-f
./oai_rules_result_list.txt
]
fi
then
if
[
$MR_TRIG
-eq
1
]
awk
'{print " <tr><td></td><td>"$1"</td></tr>"}'
./oai_rules_result_list.txt
>>
./build_results.html
then
echo
" <tr>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Source Branch</td>"
>>
./build_results.html
echo
" <td>
$SOURCE_BRANCH
</td>"
>>
./build_results.html
echo
" </tr>"
>>
./build_results.html
echo
" <tr>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Source Commit ID</td>"
>>
./build_results.html
echo
" <td>
$SOURCE_COMMIT_ID
</td>"
>>
./build_results.html
echo
" </tr>"
>>
./build_results.html
echo
" <tr>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Target Branch</td>"
>>
./build_results.html
echo
" <td>
$TARGET_BRANCH
</td>"
>>
./build_results.html
echo
" </tr>"
>>
./build_results.html
echo
" <tr>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Target Commit ID</td>"
>>
./build_results.html
echo
" <td>
$TARGET_COMMIT_ID
</td>"
>>
./build_results.html
echo
" </tr>"
>>
./build_results.html
fi
echo
" </table>"
>>
./build_results.html
echo
" <h2>Build Summary</h2>"
>>
./build_results.html
if
[
-f
./oai_rules_result.txt
]
then
echo
" <h3>OAI Coding / Formatting Guidelines Check</h3>"
>>
./build_results.html
echo
" <table border = "
1
">"
>>
./build_results.html
echo
" <tr>"
>>
./build_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Result:</td>"
>>
./build_results.html
NB_FILES
=
`
cat
./oai_rules_result.txt
`
if
[
$NB_FILES
=
"0"
]
then
if
[
$PU_TRIG
-eq
1
]
;
then
echo
" <td bgcolor =
\"
green
\"
>All files in repository follow OAI rules. </td>"
>>
./build_results.html
;
fi
if
[
$MR_TRIG
-eq
1
]
;
then
echo
" <td bgcolor =
\"
green
\"
>All modified files in Merge-Request follow OAI rules.</td>"
>>
./build_results.html
;
fi
echo
" </tr>"
>>
./build_results.html
echo
" </table>"
>>
./build_results.html
else
if
[
$PU_TRIG
-eq
1
]
;
then
echo
" <td bgcolor =
\"
orange
\"
>
$NB_FILES
files in repository DO NOT follow OAI rules. </td>"
>>
./build_results.html
;
fi
if
[
$MR_TRIG
-eq
1
]
;
then
echo
" <td bgcolor =
\"
orange
\"
>
$NB_FILES
modified files in Merge-Request DO NOT follow OAI rules.</td>"
>>
./build_results.html
;
fi
echo
" </tr>"
>>
./build_results.html
if
[
-f
./oai_rules_result_list.txt
]
then
awk
'{print " <tr><td></td><td>"$1"</td></tr>"}'
./oai_rules_result_list.txt
>>
./build_results.html
fi
echo
" </table>"
>>
./build_results.html
echo
" <p>Please apply the following command to this(ese) file(s): </p>"
>>
./build_results.html
echo
" <p style=
\"
margin-left: 30px
\"
><strong><code>astyle --options=ci-scripts/astyle-options.txt filename(s)</code></strong></p>"
>>
./build_results.html
fi
fi
echo
" </table>"
>>
./build_results.html
echo
" <p>Please apply the following command to this(ese) file(s): </p>"
>>
./build_results.html
echo
" <p style=
\"
margin-left: 30px
\"
><strong><code>astyle --options=ci-scripts/astyle-options.txt filename(s)</code></strong></p>"
>>
./build_results.html
fi
fi
fi
echo
" <h2>Ubuntu 16.04 LTS -- Summary</h2>"
>>
./build_results.html
echo
" <h2>Ubuntu 16.04 LTS -- Summary</h2>"
>>
./build_results.html
sca_summary_table_header
"OAI Static Code Analysis with CPPCHECK"
sca_summary_table_header
"OAI Static Code Analysis with CPPCHECK"
sca_summary_table_row ./archives/cppcheck/cppcheck.xml
"Uninitialized variable"
uninitvar
sca_summary_table_row ./archives/cppcheck/cppcheck.xml
"Uninitialized variable"
uninitvar
sca_summary_table_row ./archives/cppcheck/cppcheck.xml
"Uninitialized struct member"
uninitStructMember
sca_summary_table_row ./archives/cppcheck/cppcheck.xml
"Uninitialized struct member"
uninitStructMember
sca_summary_table_row ./archives/cppcheck/cppcheck.xml
"Memory leak"
memleak
sca_summary_table_row ./archives/cppcheck/cppcheck.xml
"Memory leak"
memleak
sca_summary_table_row ./archives/cppcheck/cppcheck.xml
"Memory is freed twice"
doubleFree
sca_summary_table_row ./archives/cppcheck/cppcheck.xml
"Memory is freed twice"
doubleFree
sca_summary_table_row ./archives/cppcheck/cppcheck.xml
"Resource leak"
resourceLeak
sca_summary_table_row ./archives/cppcheck/cppcheck.xml
"Resource leak"
resourceLeak
sca_summary_table_row ./archives/cppcheck/cppcheck.xml
"Possible null pointer dereference"
nullPointer
sca_summary_table_row ./archives/cppcheck/cppcheck.xml
"Possible null pointer dereference"
nullPointer
sca_summary_table_row ./archives/cppcheck/cppcheck.xml
"Array access out of bounds"
arrayIndexOutOfBounds
sca_summary_table_row ./archives/cppcheck/cppcheck.xml
"Array access out of bounds"
arrayIndexOutOfBounds
sca_summary_table_row ./archives/cppcheck/cppcheck.xml
"Buffer is accessed out of bounds"
bufferAccessOutOfBounds
sca_summary_table_row ./archives/cppcheck/cppcheck.xml
"Buffer is accessed out of bounds"
bufferAccessOutOfBounds
sca_summary_table_row ./archives/cppcheck/cppcheck.xml
"Expression depends on order of evaluation of side effects"
unknownEvaluationOrder
sca_summary_table_row ./archives/cppcheck/cppcheck.xml
"Expression depends on order of evaluation of side effects"
unknownEvaluationOrder
sca_summary_table_footer ./archives/cppcheck/cppcheck.xml
sca_summary_table_footer ./archives/cppcheck/cppcheck.xml
summary_table_header
"OAI Build eNB -- USRP option"
summary_table_header
"OAI Build eNB -- USRP option"
summary_table_row
"LTE SoftModem - Release 15"
./archives/enb_usrp/lte-softmodem.Rel15.txt
"Built target lte-softmodem"
./enb_usrp_row1.html
summary_table_row
"LTE SoftModem - Release 15"
./archives/enb_usrp/lte-softmodem.Rel15.txt
"Built target lte-softmodem"
./enb_usrp_row1.html
summary_table_row
"Coding - Release 15"
./archives/enb_usrp/coding.Rel15.txt
"Built target coding"
./enb_usrp_row2.html
summary_table_row
"Coding - Release 15"
./archives/enb_usrp/coding.Rel15.txt
"Built target coding"
./enb_usrp_row2.html
summary_table_row
"OAI USRP device if - Release 15"
./archives/enb_usrp/oai_usrpdevif.Rel15.txt
"Built target oai_usrpdevif"
./enb_usrp_row3.html
summary_table_row
"OAI USRP device if - Release 15"
./archives/enb_usrp/oai_usrpdevif.Rel15.txt
"Built target oai_usrpdevif"
./enb_usrp_row3.html
summary_table_row
"Parameters Lib Config - Release 15"
./archives/enb_usrp/params_libconfig.Rel15.txt
"Built target params_libconfig"
./enb_usrp_row4.html
summary_table_row
"Parameters Lib Config - Release 15"
./archives/enb_usrp/params_libconfig.Rel15.txt
"Built target params_libconfig"
./enb_usrp_row4.html
summary_table_footer
summary_table_header
"OAI Build basic simulator option"
summary_table_row
"Basic Simulator eNb - Release 15"
./archives/basic_sim/basic_simulator_enb.txt
"Built target lte-softmodem"
./basic_sim_row1.html
summary_table_row
"Basic Simulator UE - Release 15"
./archives/basic_sim/basic_simulator_ue.txt
"Built target lte-uesoftmodem"
./basic_sim_row2.html
summary_table_row
"Conf 2 UE data - Release 15"
./archives/basic_sim/conf2uedata.Rel15.txt
"Built target conf2uedata"
./basic_sim_row3.html
summary_table_footer
summary_table_header
"OAI Build Physical simulators option"
summary_table_row
"DL Simulator - Release 15"
./archives/phy_sim/dlsim.Rel15.txt
"Built target dlsim"
./phy_sim_row1.html
summary_table_row
"UL Simulator - Release 15"
./archives/phy_sim/ulsim.Rel15.txt
"Built target ulsim"
./phy_sim_row2.html
summary_table_row
"Coding - Release 15"
./archives/phy_sim/coding.Rel15.txt
"Built target coding"
./phy_sim_row3.html
if
[
-f
./archives/phy_sim/ldpctest.Rel15.txt
]
then
summary_table_row
"LDPC Test - Release 15"
./archives/phy_sim/ldpctest.Rel15.txt
"Built target ldpctest"
./phy_sim_row4.html
fi
if
[
-f
./archives/phy_sim/polartest.Rel15.txt
]
then
summary_table_row
"Polar Test - Release 15"
./archives/phy_sim/polartest.Rel15.txt
"Built target polartest"
./phy_sim_row5.html
fi
if
[
-f
./archives/phy_sim/nr_pbchsim.Rel15.txt
]
then
summary_table_row
"PBCH Test - Release 15"
./archives/phy_sim/nr_pbchsim.Rel15.txt
"Built target nr_pbchsim"
./phy_sim_row6.html
fi
summary_table_footer
if
[
-f
archives/gnb_usrp/nr-softmodem.Rel15.txt
]
then
summary_table_header
"OAI Build gNB -- USRP option"
summary_table_row
"LTE SoftModem - Release 15"
./archives/gnb_usrp/nr-softmodem.Rel15.txt
"Built target nr-softmodem"
./gnb_usrp_row1.html
summary_table_row
"Coding - Release 15"
./archives/gnb_usrp/coding.Rel15.txt
"Built target coding"
./gnb_usrp_row2.html
summary_table_row
"OAI USRP device if - Release 15"
./archives/gnb_usrp/oai_usrpdevif.Rel15.txt
"Built target oai_usrpdevif"
./gnb_usrp_row3.html
summary_table_row
"Parameters Lib Config - Release 15"
./archives/gnb_usrp/params_libconfig.Rel15.txt
"Built target params_libconfig"
./gnb_usrp_row4.html
summary_table_footer
summary_table_footer
fi
summary_table_header
"OAI Build basic simulator option"
if
[
-f
archives/nrue_usrp/nr-uesoftmodem.Rel15.txt
]
summary_table_row
"Basic Simulator eNb - Release 15"
./archives/basic_sim/basic_simulator_enb.txt
"Built target lte-softmodem"
./basic_sim_row1.html
then
summary_table_row
"Basic Simulator UE - Release 15"
./archives/basic_sim/basic_simulator_ue.txt
"Built target lte-uesoftmodem"
./basic_sim_row2.html
summary_table_header
"OAI Build 5G NR UE -- USRP option"
summary_table_row
"Conf 2 UE data - Release 15"
./archives/basic_sim/conf2uedata.Rel15.txt
"Built target conf2uedata"
./basic_sim_row3.html
summary_table_row
"UE SoftModem - Release 15"
./archives/nrue_usrp/nr-uesoftmodem.Rel15.txt
"Built target nr-uesoftmodem"
./nrue_usrp_row1.html
summary_table_row
"Coding - Release 15"
./archives/nrue_usrp/coding.Rel15.txt
"Built target coding"
./nrue_usrp_row2.html
summary_table_row
"OAI USRP device if - Release 15"
./archives/nrue_usrp/oai_usrpdevif.Rel15.txt
"Built target oai_usrpdevif"
./nrue_usrp_row3.html
summary_table_row
"Parameters Lib Config - Release 15"
./archives/nrue_usrp/params_libconfig.Rel15.txt
"Built target params_libconfig"
./nrue_usrp_row4.html
summary_table_footer
summary_table_footer
fi
summary_table_header
"OAI Build Physical simulators option"
summary_table_header
"OAI Build eNB -- ETHERNET transport option"
summary_table_row
"DL Simulator - Release 15"
./archives/phy_sim/dlsim.Rel15.txt
"Built target dlsim"
./phy_sim_row1.html
summary_table_row
"LTE SoftModem w/o S1 - Release 15"
./archives/enb_eth/lte-softmodem-nos1.Rel15.txt
"Built target lte-softmodem"
./enb_eth_row1.html
summary_table_row
"UL Simulator - Release 15"
./archives/phy_sim/ulsim.Rel15.txt
"Built target ulsim"
./phy_sim_row2.html
summary_table_row
"Coding - Release 15"
./archives/enb_eth/coding.Rel15.txt
"Built target coding"
./enb_eth_row2.html
summary_table_row
"Coding - Release 15"
./archives/phy_sim/coding.Rel15.txt
"Built target coding"
./phy_sim_row3.html
summary_table_row
"OAI ETHERNET transport - Release 15"
./archives/enb_eth/oai_eth_transpro.Rel15.txt
"Built target oai_eth_transpro"
./enb_eth_row3.html
if
[
-f
./archives/phy_sim/ldpctest.Rel15.txt
]
summary_table_row
"Parameters Lib Config - Release 15"
./archives/enb_eth/params_libconfig.Rel15.txt
"Built target params_libconfig"
./enb_eth_row4.html
then
summary_table_row
"RB Tools - Release 15"
./archives/enb_eth/rb_tool.Rel15.txt
"Built target rb_tool"
./enb_eth_row5.html
summary_table_row
"LDPC Test - Release 15"
./archives/phy_sim/ldpctest.Rel15.txt
"Built target ldpctest"
./phy_sim_row4.html
summary_table_row
"NAS Mesh - Release 15"
./archives/enb_eth/nasmesh.Rel15.txt
"Built target nasmesh"
./enb_eth_row6.html
fi
summary_table_footer
if
[
-f
./archives/phy_sim/polartest.Rel15.txt
]
then
summary_table_header
"OAI Build UE -- ETHERNET transport option"
summary_table_row
"Polar Test - Release 15"
./archives/phy_sim/polartest.Rel15.txt
"Built target polartest"
./phy_sim_row5.html
summary_table_row
"LTE UE SoftModem w/o S1 - Release 15"
./archives/ue_eth/lte-uesoftmodem-nos1.Rel15.txt
"Built target lte-uesoftmodem"
./ue_eth_row1.html
fi
summary_table_row
"Coding - Release 15"
./archives/ue_eth/coding.Rel15.txt
"Built target coding"
./ue_eth_row2.html
if
[
-f
./archives/phy_sim/nr_pbchsim.Rel15.txt
]
summary_table_row
"OAI ETHERNET transport - Release 15"
./archives/ue_eth/oai_eth_transpro.Rel15.txt
"Built target oai_eth_transpro"
./ue_eth_row3.html
then
summary_table_row
"Parameters Lib Config - Release 15"
./archives/ue_eth/params_libconfig.Rel15.txt
"Built target params_libconfig"
./ue_eth_row4.html
summary_table_row
"PBCH Test - Release 15"
./archives/phy_sim/nr_pbchsim.Rel15.txt
"Built target nr_pbchsim"
./phy_sim_row6.html
summary_table_row
"RB Tools - Release 15"
./archives/ue_eth/rb_tool.Rel15.txt
"Built target rb_tool"
./ue_eth_row5.html
fi
summary_table_row
"NAS Mesh - Release 15"
./archives/ue_eth/nasmesh.Rel15.txt
"Built target nasmesh"
./ue_eth_row6.html
summary_table_footer
summary_table_footer
echo
" <h2>Red Hat (CentOS Linux release 7.4.1708) -- Summary</h2>"
>>
./build_results.html
if
[
-f
archives/gnb_usrp/nr-softmodem.Rel15.txt
]
then
summary_table_header
"Red Hat -- OAI Build eNB -- USRP option"
summary_table_header
"OAI Build gNB -- USRP option"
summary_table_row
"LTE SoftModem - Release 15"
./archives/red_hat/lte-softmodem.Rel15.txt
"Built target lte-softmodem"
./enb_usrp_rh_row1.html
summary_table_row
"LTE SoftModem - Release 15"
./archives/gnb_usrp/nr-softmodem.Rel15.txt
"Built target nr-softmodem"
./gnb_usrp_row1.html
summary_table_row
"Coding - Release 15"
./archives/red_hat/coding.Rel15.txt
"Built target coding"
./enb_usrp_rh_row2.html
summary_table_row
"Coding - Release 15"
./archives/gnb_usrp/coding.Rel15.txt
"Built target coding"
./gnb_usrp_row2.html
summary_table_row
"OAI USRP device if - Release 15"
./archives/red_hat/oai_usrpdevif.Rel15.txt
"Built target oai_usrpdevif"
./enb_usrp_rh_row3.html
summary_table_row
"OAI USRP device if - Release 15"
./archives/gnb_usrp/oai_usrpdevif.Rel15.txt
"Built target oai_usrpdevif"
./gnb_usrp_row3.html
summary_table_row
"Parameters Lib Config - Release 15"
./archives/red_hat/params_libconfig.Rel15.txt
"Built target params_libconfig"
./enb_usrp_rh_row4.html
summary_table_row
"Parameters Lib Config - Release 15"
./archives/gnb_usrp/params_libconfig.Rel15.txt
"Built target params_libconfig"
./gnb_usrp_row4.html
summary_table_footer
summary_table_footer
fi
echo
" <h3>Details</h3>"
>>
./build_results.html
if
[
-f
archives/nrue_usrp/nr-uesoftmodem.Rel15.txt
]
for
DETAILS_TABLE
in
`
ls
./enb_usrp_row
*
.html
`
then
do
summary_table_header
"OAI Build 5G NR UE -- USRP option"
cat
$DETAILS_TABLE
>>
./build_results.html
summary_table_row
"UE SoftModem - Release 15"
./archives/nrue_usrp/nr-uesoftmodem.Rel15.txt
"Built target nr-uesoftmodem"
./nrue_usrp_row1.html
done
summary_table_row
"Coding - Release 15"
./archives/nrue_usrp/coding.Rel15.txt
"Built target coding"
./nrue_usrp_row2.html
for
DETAILS_TABLE
in
`
ls
./basic_sim_row
*
.html
`
summary_table_row
"OAI USRP device if - Release 15"
./archives/nrue_usrp/oai_usrpdevif.Rel15.txt
"Built target oai_usrpdevif"
./nrue_usrp_row3.html
do
summary_table_row
"Parameters Lib Config - Release 15"
./archives/nrue_usrp/params_libconfig.Rel15.txt
"Built target params_libconfig"
./nrue_usrp_row4.html
cat
$DETAILS_TABLE
>>
./build_results.html
summary_table_footer
done
fi
for
DETAILS_TABLE
in
`
ls
./phy_sim_row
*
.html
`
do
summary_table_header
"OAI Build eNB -- ETHERNET transport option"
cat
$DETAILS_TABLE
>>
./build_results.html
summary_table_row
"LTE SoftModem w/o S1 - Release 15"
./archives/enb_eth/lte-softmodem-nos1.Rel15.txt
"Built target lte-softmodem"
./enb_eth_row1.html
done
summary_table_row
"Coding - Release 15"
./archives/enb_eth/coding.Rel15.txt
"Built target coding"
./enb_eth_row2.html
summary_table_row
"OAI ETHERNET transport - Release 15"
./archives/enb_eth/oai_eth_transpro.Rel15.txt
"Built target oai_eth_transpro"
./enb_eth_row3.html
for
DETAILS_TABLE
in
`
ls
./gnb_usrp_row
*
.html
`
summary_table_row
"Parameters Lib Config - Release 15"
./archives/enb_eth/params_libconfig.Rel15.txt
"Built target params_libconfig"
./enb_eth_row4.html
do
summary_table_row
"RB Tools - Release 15"
./archives/enb_eth/rb_tool.Rel15.txt
"Built target rb_tool"
./enb_eth_row5.html
cat
$DETAILS_TABLE
>>
./build_results.html
summary_table_row
"NAS Mesh - Release 15"
./archives/enb_eth/nasmesh.Rel15.txt
"Built target nasmesh"
./enb_eth_row6.html
done
summary_table_footer
for
DETAILS_TABLE
in
`
ls
./nrue_usrp_row
*
.html
`
do
summary_table_header
"OAI Build UE -- ETHERNET transport option"
cat
$DETAILS_TABLE
>>
./build_results.html
summary_table_row
"LTE UE SoftModem w/o S1 - Release 15"
./archives/ue_eth/lte-uesoftmodem-nos1.Rel15.txt
"Built target lte-uesoftmodem"
./ue_eth_row1.html
done
summary_table_row
"Coding - Release 15"
./archives/ue_eth/coding.Rel15.txt
"Built target coding"
./ue_eth_row2.html
for
DETAILS_TABLE
in
`
ls
./enb_eth_row
*
.html
`
summary_table_row
"OAI ETHERNET transport - Release 15"
./archives/ue_eth/oai_eth_transpro.Rel15.txt
"Built target oai_eth_transpro"
./ue_eth_row3.html
do
summary_table_row
"Parameters Lib Config - Release 15"
./archives/ue_eth/params_libconfig.Rel15.txt
"Built target params_libconfig"
./ue_eth_row4.html
cat
$DETAILS_TABLE
>>
./build_results.html
summary_table_row
"RB Tools - Release 15"
./archives/ue_eth/rb_tool.Rel15.txt
"Built target rb_tool"
./ue_eth_row5.html
done
summary_table_row
"NAS Mesh - Release 15"
./archives/ue_eth/nasmesh.Rel15.txt
"Built target nasmesh"
./ue_eth_row6.html
for
DETAILS_TABLE
in
`
ls
./ue_eth_row
*
.html
`
summary_table_footer
do
cat
$DETAILS_TABLE
>>
./build_results.html
if
[
-e
./archives/red_hat
]
done
then
for
DETAILS_TABLE
in
`
ls
./enb_usrp_rh_row
*
.html
`
echo
" <h2>Red Hat (CentOS Linux release 7.4.1708) -- Summary</h2>"
>>
./build_results.html
do
cat
$DETAILS_TABLE
>>
./build_results.html
summary_table_header
"Red Hat -- OAI Build eNB -- USRP option"
done
summary_table_row
"LTE SoftModem - Release 15"
./archives/red_hat/lte-softmodem.Rel15.txt
"Built target lte-softmodem"
./enb_usrp_rh_row1.html
rm
-f
./enb_usrp_row
*
.html ./basic_sim_row
*
.html ./phy_sim_row
*
.html ./enb_eth_row
*
.html ./ue_eth_row
*
.html ./enb_usrp_rh_row
*
.html
summary_table_row
"Coding - Release 15"
./archives/red_hat/coding.Rel15.txt
"Built target coding"
./enb_usrp_rh_row2.html
summary_table_row
"OAI USRP device if - Release 15"
./archives/red_hat/oai_usrpdevif.Rel15.txt
"Built target oai_usrpdevif"
./enb_usrp_rh_row3.html
echo
"</body>"
>>
./build_results.html
summary_table_row
"Parameters Lib Config - Release 15"
./archives/red_hat/params_libconfig.Rel15.txt
"Built target params_libconfig"
./enb_usrp_rh_row4.html
echo
"</html>"
>>
./build_results.html
summary_table_footer
fi
exit
0
echo
" <h3>Details</h3>"
>>
./build_results.html
for
DETAILS_TABLE
in
`
ls
./enb_usrp_row
*
.html
`
do
cat
$DETAILS_TABLE
>>
./build_results.html
done
for
DETAILS_TABLE
in
`
ls
./basic_sim_row
*
.html
`
do
cat
$DETAILS_TABLE
>>
./build_results.html
done
for
DETAILS_TABLE
in
`
ls
./phy_sim_row
*
.html
`
do
cat
$DETAILS_TABLE
>>
./build_results.html
done
for
DETAILS_TABLE
in
`
ls
./gnb_usrp_row
*
.html
`
do
cat
$DETAILS_TABLE
>>
./build_results.html
done
for
DETAILS_TABLE
in
`
ls
./nrue_usrp_row
*
.html
`
do
cat
$DETAILS_TABLE
>>
./build_results.html
done
for
DETAILS_TABLE
in
`
ls
./enb_eth_row
*
.html
`
do
cat
$DETAILS_TABLE
>>
./build_results.html
done
for
DETAILS_TABLE
in
`
ls
./ue_eth_row
*
.html
`
do
cat
$DETAILS_TABLE
>>
./build_results.html
done
if
[
-e
./archives/red_hat
]
then
for
DETAILS_TABLE
in
`
ls
./enb_usrp_rh_row
*
.html
`
do
cat
$DETAILS_TABLE
>>
./build_results.html
done
fi
rm
-f
./
*
_row
*
.html
echo
"</body>"
>>
./build_results.html
echo
"</html>"
>>
./build_results.html
}
ci-scripts/reportTestLocally.sh
View file @
4bb2b8a2
...
@@ -20,14 +20,13 @@
...
@@ -20,14 +20,13 @@
# * contact@openairinterface.org
# * contact@openairinterface.org
# */
# */
function
usage
{
function
report_test_
usage
{
echo
"OAI
Test Report
script"
echo
"OAI
CI VM
script"
echo
" Original Author: Raphael Defosseux"
echo
" Original Author: Raphael Defosseux"
echo
""
echo
""
echo
"Usage:"
echo
"Usage:"
echo
"------"
echo
"------"
echo
""
echo
" oai-ci-vm-tool report-test [OPTIONS]"
echo
" reportTestLocally.sh [OPTIONS]"
echo
""
echo
""
echo
"Options:"
echo
"Options:"
echo
"--------"
echo
"--------"
...
@@ -47,6 +46,9 @@ function usage {
...
@@ -47,6 +46,9 @@ function usage {
echo
" --build-id #### OR -id ####"
echo
" --build-id #### OR -id ####"
echo
" Specify the build ID of the Jenkins job."
echo
" Specify the build ID of the Jenkins job."
echo
""
echo
""
echo
" --workspace #### OR -ws ####"
echo
" Specify the workspace."
echo
""
echo
" --trigger merge-request OR -mr"
echo
" --trigger merge-request OR -mr"
echo
" --trigger push OR -pu"
echo
" --trigger push OR -pu"
echo
" Specify trigger action of the Jenkins job. Either a merge-request event or a push event."
echo
" Specify trigger action of the Jenkins job. Either a merge-request event or a push event."
...
@@ -78,513 +80,375 @@ function usage {
...
@@ -78,513 +80,375 @@ function usage {
echo
""
echo
""
}
}
function
trigger_usage
{
function
report_test
{
echo
"OAI Test Report script"
echo
"############################################################"
echo
" Original Author: Raphael Defosseux"
echo
"OAI CI VM script"
echo
""
echo
"############################################################"
echo
" --trigger merge-request OR -mr"
echo
" --trigger push OR -pu"
echo
" Specify trigger action of the Jenkins job. Either a merge-request event or a push event."
echo
""
}
jb_checker
=
0
mr_checker
=
0
pu_checker
=
0
MR_TRIG
=
0
PU_TRIG
=
0
while
[[
$#
-gt
0
]]
do
key
=
"
$1
"
case
$key
in
echo
"JENKINS_WKSP =
$JENKINS_WKSP
"
-h
|
--help
)
shift
usage
exit
0
;;
-gu
|
--git-url
)
GIT_URL
=
"
$2
"
let
"jb_checker|=0x1"
shift
shift
;;
-jn
|
--job-name
)
JOB_NAME
=
"
$2
"
let
"jb_checker|=0x2"
shift
shift
;;
-id
|
--build-id
)
BUILD_ID
=
"
$2
"
let
"jb_checker|=0x4"
shift
shift
;;
--trigger
)
TRIG
=
"
$2
"
case
$TRIG
in
merge-request
)
MR_TRIG
=
1
;;
push
)
PU_TRIG
=
1
;;
*
)
echo
""
echo
"Syntax Error: Invalid Trigger option ->
$TRIG
"
echo
""
trigger_usage
exit
;;
esac
let
"jb_checker|=0x8"
shift
shift
;;
-mr
)
MR_TRIG
=
1
let
"jb_checker|=0x8"
shift
;;
-pu
)
PU_TRIG
=
1
let
"jb_checker|=0x8"
shift
;;
-sb
|
--src-branch
)
SOURCE_BRANCH
=
"
$2
"
let
"mr_checker|=0x1"
shift
shift
;;
-sc
|
--src-commit
)
SOURCE_COMMIT_ID
=
"
$2
"
let
"mr_checker|=0x2"
shift
shift
;;
-tb
|
--target-branch
)
TARGET_BRANCH
=
"
$2
"
let
"mr_checker|=0x4"
shift
shift
;;
-tc
|
--target-commit
)
TARGET_COMMIT_ID
=
"
$2
"
let
"mr_checker|=0x8"
shift
shift
;;
-br
|
--branch
)
SOURCE_BRANCH
=
"
$2
"
let
"pu_checker|=0x1"
shift
shift
;;
-co
|
--commit
)
SOURCE_COMMIT_ID
=
"
$2
"
let
"pu_checker|=0x2"
shift
shift
;;
*
)
echo
"Syntax Error: unknown option:
$key
"
echo
""
usage
exit
1
;;
esac
done
if
[
$jb_checker
-ne
15
]
then
echo
""
echo
"Syntax Error: missing job information."
# TODO : list missing info
echo
""
exit
1
fi
if
[
$PU_TRIG
-eq
1
]
&&
[
$MR_TRIG
-eq
1
]
cd
${
JENKINS_WKSP
}
then
echo
""
echo
"Syntax Error: trigger action incoherent."
echo
""
trigger_usage
exit
1
fi
if
[
$PU_TRIG
-eq
1
]
then
if
[
$pu_checker
-ne
3
]
then
echo
""
echo
"Syntax Error: missing push information."
# TODO : list missing info
echo
""
exit
1
fi
fi
if
[
$MR_TRIG
-eq
1
]
echo
"<!DOCTYPE html>"
>
./test_simulator_results.html
then
echo
"<html class=
\"
no-js
\"
lang=
\"
en-US
\"
>"
>>
./test_simulator_results.html
if
[
$mr_checker
-ne
15
]
echo
"<head>"
>>
./test_simulator_results.html
then
echo
" <title>Simulator Results for
$JOB_NAME
job build #
$BUILD_ID
</title>"
>>
./test_simulator_results.html
echo
""
echo
" <base href =
\"
http://www.openairinterface.org/
\"
/>"
>>
./test_simulator_results.html
echo
"Syntax Error: missing merge-request information."
echo
"</head>"
>>
./test_simulator_results.html
# TODO : list missing info
echo
"<body>"
>>
./test_simulator_results.html
echo
""
echo
" <table style=
\"
border-collapse: collapse; border: none;
\"
>"
>>
./test_simulator_results.html
exit
1
echo
" <tr style=
\"
border-collapse: collapse; border: none;
\"
>"
>>
./test_simulator_results.html
fi
echo
" <td style=
\"
border-collapse: collapse; border: none;
\"
>"
>>
./test_simulator_results.html
fi
echo
" <a href=
\"
http://www.openairinterface.org/
\"
>"
>>
./test_simulator_results.html
echo
" <img src=
\"
/wp-content/uploads/2016/03/cropped-oai_final_logo2.png
\"
alt=
\"\"
border=
\"
none
\"
height=50 width=150>"
>>
./test_simulator_results.html
echo
"<!DOCTYPE html>"
>
./test_simulator_results.html
echo
" </img>"
>>
./test_simulator_results.html
echo
"<html class=
\"
no-js
\"
lang=
\"
en-US
\"
>"
>>
./test_simulator_results.html
echo
" </a>"
>>
./test_simulator_results.html
echo
"<head>"
>>
./test_simulator_results.html
echo
" </td>"
>>
./test_simulator_results.html
echo
" <title>Simulator Results for
$JOB_NAME
job build #
$BUILD_ID
</title>"
>>
./test_simulator_results.html
echo
" <td style=
\"
border-collapse: collapse; border: none; vertical-align: center;
\"
>"
>>
./test_simulator_results.html
echo
" <base href =
\"
http://www.openairinterface.org/
\"
/>"
>>
./test_simulator_results.html
echo
" <b><font size =
\"
6
\"
>Job Summary -- Job:
$JOB_NAME
-- Build-ID:
$BUILD_ID
</font></b>"
>>
./test_simulator_results.html
echo
"</head>"
>>
./test_simulator_results.html
echo
" </td>"
>>
./test_simulator_results.html
echo
"<body>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
echo
" <table style=
\"
border-collapse: collapse; border: none;
\"
>"
>>
./test_simulator_results.html
echo
" </table>"
>>
./test_simulator_results.html
echo
" <tr style=
\"
border-collapse: collapse; border: none;
\"
>"
>>
./test_simulator_results.html
echo
" <br>"
>>
./test_simulator_results.html
echo
" <td style=
\"
border-collapse: collapse; border: none;
\"
>"
>>
./test_simulator_results.html
echo
" <table border =
\"
1
\"
>"
>>
./test_simulator_results.html
echo
" <a href=
\"
http://www.openairinterface.org/
\"
>"
>>
./test_simulator_results.html
echo
" <img src=
\"
/wp-content/uploads/2016/03/cropped-oai_final_logo2.png
\"
alt=
\"\"
border=
\"
none
\"
height=50 width=150>"
>>
./test_simulator_results.html
echo
" </img>"
>>
./test_simulator_results.html
echo
" </a>"
>>
./test_simulator_results.html
echo
" </td>"
>>
./test_simulator_results.html
echo
" <td style=
\"
border-collapse: collapse; border: none; vertical-align: center;
\"
>"
>>
./test_simulator_results.html
echo
" <b><font size =
\"
6
\"
>Job Summary -- Job:
$JOB_NAME
-- Build-ID:
$BUILD_ID
</font></b>"
>>
./test_simulator_results.html
echo
" </td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
echo
" </table>"
>>
./test_simulator_results.html
echo
" <br>"
>>
./test_simulator_results.html
echo
" <table border =
\"
1
\"
>"
>>
./test_simulator_results.html
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Build Start Time (UTC)</td>"
>>
./test_simulator_results.html
echo
" <td>TEMPLATE_BUILD_TIME</td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>GIT Repository</td>"
>>
./test_simulator_results.html
echo
" <td><a href=
\"
$GIT_URL
\"
>
$GIT_URL
</a></td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Job Trigger</td>"
>>
./test_simulator_results.html
if
[
$PU_TRIG
-eq
1
]
;
then
echo
" <td>Push Event</td>"
>>
./test_simulator_results.html
;
fi
if
[
$MR_TRIG
-eq
1
]
;
then
echo
" <td>Merge-Request</td>"
>>
./test_simulator_results.html
;
fi
echo
" </tr>"
>>
./test_simulator_results.html
if
[
$PU_TRIG
-eq
1
]
then
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Branch</td>"
>>
./test_simulator_results.html
echo
" <td>
$SOURCE_BRANCH
</td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Commit ID</td>"
>>
./test_simulator_results.html
echo
" <td>
$SOURCE_COMMIT_ID
</td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
fi
if
[
$MR_TRIG
-eq
1
]
then
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Source Branch</td>"
>>
./test_simulator_results.html
echo
" <td>
$SOURCE_BRANCH
</td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>
Source Commit ID
</td>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>
Build Start Time (UTC)
</td>"
>>
./test_simulator_results.html
echo
" <td>
$SOURCE_COMMIT_ID
</td>"
>>
./test_simulator_results.html
echo
" <td>
TEMPLATE_BUILD_TIME
</td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>
Target Branch
</td>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>
GIT Repository
</td>"
>>
./test_simulator_results.html
echo
" <td>
$TARGET_BRANCH
</td>"
>>
./test_simulator_results.html
echo
" <td>
<a href=
\"
$GIT_URL
\"
>
$GIT_URL
</a>
</td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Target Commit ID</td>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Job Trigger</td>"
>>
./test_simulator_results.html
echo
" <td>
$TARGET_COMMIT_ID
</td>"
>>
./test_simulator_results.html
if
[
$PU_TRIG
-eq
1
]
;
then
echo
" <td>Push Event</td>"
>>
./test_simulator_results.html
;
fi
if
[
$MR_TRIG
-eq
1
]
;
then
echo
" <td>Merge-Request</td>"
>>
./test_simulator_results.html
;
fi
echo
" </tr>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
fi
if
[
$PU_TRIG
-eq
1
]
echo
" </table>"
>>
./test_simulator_results.html
then
echo
" <h2>Test Summary</h2>"
>>
./test_simulator_results.html
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Branch</td>"
>>
./test_simulator_results.html
echo
" <td>
$SOURCE_BRANCH
</td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Commit ID</td>"
>>
./test_simulator_results.html
echo
" <td>
$SOURCE_COMMIT_ID
</td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
fi
if
[
$MR_TRIG
-eq
1
]
then
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Source Branch</td>"
>>
./test_simulator_results.html
echo
" <td>
$SOURCE_BRANCH
</td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Source Commit ID</td>"
>>
./test_simulator_results.html
echo
" <td>
$SOURCE_COMMIT_ID
</td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Target Branch</td>"
>>
./test_simulator_results.html
echo
" <td>
$TARGET_BRANCH
</td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
lightcyan
\"
>Target Commit ID</td>"
>>
./test_simulator_results.html
echo
" <td>
$TARGET_COMMIT_ID
</td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
fi
echo
" </table>"
>>
./test_simulator_results.html
echo
" <h2>Test Summary</h2>"
>>
./test_simulator_results.html
ARCHIVES_LOC
=
archives/basic_sim/test
ARCHIVES_LOC
=
archives/basic_sim/test
if
[
-d
$ARCHIVES_LOC
]
if
[
-d
$ARCHIVES_LOC
]
then
then
echo
" <h3>Basic Simulator Check</h3>"
>>
./test_simulator_results.html
echo
" <h3>Basic Simulator Check</h3>"
>>
./test_simulator_results.html
echo
" <table border =
\"
1
\"
>"
>>
./test_simulator_results.html
echo
" <table border =
\"
1
\"
>"
>>
./test_simulator_results.html
echo
" <tr bgcolor =
\"
#33CCFF
\"
>"
>>
./test_simulator_results.html
echo
" <tr bgcolor =
\"
#33CCFF
\"
>"
>>
./test_simulator_results.html
echo
" <th>Log File Name</th>"
>>
./test_simulator_results.html
echo
" <th>Log File Name</th>"
>>
./test_simulator_results.html
echo
" <th>Command</th>"
>>
./test_simulator_results.html
echo
" <th>Command</th>"
>>
./test_simulator_results.html
echo
" <th>Status</th>"
>>
./test_simulator_results.html
echo
" <th>Status</th>"
>>
./test_simulator_results.html
echo
" <th>Statistics</th>"
>>
./test_simulator_results.html
echo
" <th>Statistics</th>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
TRANS_MODES
=(
"fdd"
"tdd"
)
TRANS_MODES
=(
"fdd"
"tdd"
)
BW_CASES
=(
05 10 20
)
BW_CASES
=(
05 10 20
)
for
TMODE
in
${
TRANS_MODES
[@]
}
for
TMODE
in
${
TRANS_MODES
[@]
}
do
for
BW
in
${
BW_CASES
[@]
}
do
do
ENB_LOG
=
$ARCHIVES_LOC
/
${
TMODE
}
_
${
BW
}
MHz_enb.log
for
BW
in
${
BW_CASES
[@]
}
UE_LOG
=
`
echo
$ENB_LOG
|
sed
-e
"s#enb#ue#"
`
do
if
[
-f
$ENB_LOG
]
&&
[
-f
$UE_LOG
]
ENB_LOG
=
$ARCHIVES_LOC
/
${
TMODE
}
_
${
BW
}
MHz_enb.log
then
UE_LOG
=
`
echo
$ENB_LOG
|
sed
-e
"s#enb#ue#"
`
NAME_ENB
=
`
echo
$ENB_LOG
|
sed
-e
"s#
$ARCHIVES_LOC
/##"
`
if
[
-f
$ENB_LOG
]
&&
[
-f
$UE_LOG
]
NAME_UE
=
`
echo
$UE_LOG
|
sed
-e
"s#
$ARCHIVES_LOC
/##"
`
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <td>
$NAME_ENB
---
$NAME_UE
</td>"
>>
./test_simulator_results.html
echo
" <td>N/A</td>"
>>
./test_simulator_results.html
NB_ENB_GOT_SYNC
=
`
egrep
-c
"got sync"
$ENB_LOG
`
NB_UE_GOT_SYNC
=
`
egrep
-c
"got sync"
$UE_LOG
`
NB_ENB_SYNCED_WITH_UE
=
`
egrep
-c
"got UE capabilities for UE"
$ENB_LOG
`
if
[
$NB_ENB_GOT_SYNC
-eq
1
]
&&
[
$NB_UE_GOT_SYNC
-eq
2
]
&&
[
$NB_ENB_SYNCED_WITH_UE
-eq
1
]
then
echo
" <td bgcolor =
\"
green
\"
>OK</td>"
>>
./test_simulator_results.html
else
echo
" <td bgcolor =
\"
red
\"
>KO</td>"
>>
./test_simulator_results.html
fi
echo
" <td><pre>"
>>
./test_simulator_results.html
if
[
$NB_ENB_GOT_SYNC
-eq
1
]
then
echo
"<font color =
\"
blue
\"
>- eNB --> got sync</font>"
>>
./test_simulator_results.html
else
echo
"<font color =
\"
red
\"
><b>- eNB NEVER got sync</b></font>"
>>
./test_simulator_results.html
fi
if
[
$NB_UE_GOT_SYNC
-eq
2
]
then
echo
"<font color =
\"
blue
\"
>- UE --> got sync</font>"
>>
./test_simulator_results.html
else
echo
"<font color =
\"
red
\"
><b>- UE NEVER got sync</b></font>"
>>
./test_simulator_results.html
fi
if
[
$NB_ENB_SYNCED_WITH_UE
-eq
1
]
then
echo
"<font color =
\"
blue
\"
>- UE attached to eNB</font>"
>>
./test_simulator_results.html
else
echo
"<font color =
\"
red
\"
><b>- UE NEVER attached to eNB</b></font>"
>>
./test_simulator_results.html
fi
NB_SEGFAULT_ENB
=
`
egrep
-i
-c
"Segmentation Fault"
$ENB_LOG
`
if
[
$NB_SEGFAULT_ENB
-ne
0
]
then
echo
"<font color =
\"
red
\"
><b>- eNB --> Segmentation Fault</b></font>"
>>
./test_simulator_results.html
fi
NB_SEGFAULT_UE
=
`
egrep
-i
-c
"Segmentation Fault"
$UE_LOG
`
if
[
$NB_SEGFAULT_UE
-ne
0
]
then
echo
"<font color =
\"
red
\"
><b>- UE --> Segmentation Fault</b></font>"
>>
./test_simulator_results.html
fi
NB_ASSERTION_ENB
=
`
egrep
-i
-c
"Assertion"
$ENB_LOG
`
if
[
$NB_ASSERTION_ENB
-ne
0
]
then
echo
"<font color =
\"
red
\"
><b>- eNB --> Assertion</b></font>"
>>
./test_simulator_results.html
awk
'BEGIN{assertion=10}{if(assertion < 3){print " " $0; assertion++};if ($0 ~/Assertion/){print " " $0;assertion=1}}END{}'
$ENB_LOG
>>
./test_simulator_results.html
fi
NB_ASSERTION_UE
=
`
egrep
-i
-c
"Assertion"
$UE_LOG
`
if
[
$NB_ASSERTION_UE
-ne
0
]
then
echo
"<font color =
\"
red
\"
><b>- eNB --> Assertion</b></font>"
>>
./test_simulator_results.html
awk
'BEGIN{assertion=10}{if(assertion < 3){print " " $0; assertion++};if ($0 ~/Assertion/){print " " $0;assertion=1}}END{}'
$UE_LOG
>>
./test_simulator_results.html
fi
echo
" </pre></td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
fi
PING_CASE
=
$ARCHIVES_LOC
/
${
TMODE
}
_
${
BW
}
MHz_ping_ue.txt
if
[
-f
$PING_CASE
]
then
echo
" <tr>"
>>
./test_simulator_results.html
NAME
=
`
echo
$PING_CASE
|
sed
-e
"s#
$ARCHIVES_LOC
/##"
`
echo
" <td>
$NAME
</td>"
>>
./test_simulator_results.html
CMD
=
`
egrep
"COMMAND IS"
$PING_CASE
|
sed
-e
"s#COMMAND IS: ##"
`
echo
" <td>
$CMD
</td>"
>>
./test_simulator_results.html
FILE_COMPLETE
=
`
egrep
-c
"ping statistics"
$PING_CASE
`
if
[
$FILE_COMPLETE
-eq
0
]
then
then
echo
" <td bgcolor =
\"
red
\"
>KO</td>"
>>
./test_simulator_results.html
NAME_ENB
=
`
echo
$ENB_LOG
|
sed
-e
"s#
$ARCHIVES_LOC
/##"
`
NAME_UE
=
`
echo
$UE_LOG
|
sed
-e
"s#
$ARCHIVES_LOC
/##"
`
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <td>
$NAME_ENB
---
$NAME_UE
</td>"
>>
./test_simulator_results.html
echo
" <td>N/A</td>"
>>
./test_simulator_results.html
echo
" <td>N/A</td>"
>>
./test_simulator_results.html
else
NB_ENB_GOT_SYNC
=
`
egrep
-c
"got sync"
$ENB_LOG
`
NB_
TR_PACKETS
=
`
egrep
"packets transmitted"
$PING_CASE
|
sed
-e
"s# packets transmitted.*##"
`
NB_
UE_GOT_SYNC
=
`
egrep
-c
"got sync"
$UE_LOG
`
NB_
RC_PACKETS
=
`
egrep
"packets transmitted"
$PING_CASE
|
sed
-e
"s#^.*packets transmitted, ##"
-e
"s# received,.*##"
`
NB_
ENB_SYNCED_WITH_UE
=
`
egrep
-c
"got UE capabilities for UE"
$ENB_LOG
`
if
[
$NB_
TR_PACKETS
-eq
$NB_RC_PACKETS
]
if
[
$NB_
ENB_GOT_SYNC
-eq
1
]
&&
[
$NB_UE_GOT_SYNC
-eq
2
]
&&
[
$NB_ENB_SYNCED_WITH_UE
-eq
1
]
then
then
echo
" <td bgcolor =
\"
green
\"
>OK</td>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
green
\"
>OK</td>"
>>
./test_simulator_results.html
else
else
echo
" <td bgcolor =
\"
red
\"
>KO</td>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
red
\"
>KO</td>"
>>
./test_simulator_results.html
fi
fi
echo
" <td>"
>>
./test_simulator_results.html
echo
" <td><pre>"
>>
./test_simulator_results.html
echo
" <pre>"
>>
./test_simulator_results.html
if
[
$NB_ENB_GOT_SYNC
-eq
1
]
STATS
=
`
egrep
"packets transmitted"
$PING_CASE
|
sed
-e
"s#^.*received, ##"
-e
"s#, time.*##"
-e
"s# packet loss##"
`
then
echo
"Packet Loss :
$STATS
"
>>
./test_simulator_results.html
echo
"<font color =
\"
blue
\"
>- eNB --> got sync</font>"
>>
./test_simulator_results.html
RTTMIN
=
`
egrep
"rtt min"
$PING_CASE
|
awk
'{split($4,a,"/"); print a[1] " " $5}'
`
else
echo
"RTT Minimal :
$RTTMIN
"
>>
./test_simulator_results.html
echo
"<font color =
\"
red
\"
><b>- eNB NEVER got sync</b></font>"
>>
./test_simulator_results.html
RTTAVG
=
`
egrep
"rtt min"
$PING_CASE
|
awk
'{split($4,a,"/"); print a[2] " " $5}'
`
fi
echo
"RTT Average :
$RTTAVG
"
>>
./test_simulator_results.html
if
[
$NB_UE_GOT_SYNC
-eq
2
]
RTTMAX
=
`
egrep
"rtt min"
$PING_CASE
|
awk
'{split($4,a,"/"); print a[3] " " $5}'
`
then
echo
"RTT Maximal :
$RTTMAX
"
>>
./test_simulator_results.html
echo
"<font color =
\"
blue
\"
>- UE --> got sync</font>"
>>
./test_simulator_results.html
echo
" </pre>"
>>
./test_simulator_results.html
else
echo
" </td>"
>>
./test_simulator_results.html
echo
"<font color =
\"
red
\"
><b>- UE NEVER got sync</b></font>"
>>
./test_simulator_results.html
fi
fi
echo
" </tr>"
>>
./test_simulator_results.html
if
[
$NB_ENB_SYNCED_WITH_UE
-eq
1
]
fi
then
echo
"<font color =
\"
blue
\"
>- UE attached to eNB</font>"
>>
./test_simulator_results.html
if
[
-f
$ARCHIVES_LOC
/
${
TMODE
}
_
${
BW
}*
iperf
*
dl
*
client
*
txt
]
else
then
echo
"<font color =
\"
red
\"
><b>- UE NEVER attached to eNB</b></font>"
>>
./test_simulator_results.html
IPERF_TESTS
=
`
ls
$ARCHIVES_LOC
/
${
TMODE
}
_
${
BW
}*
iperf
*
client
*
txt
`
fi
else
NB_SEGFAULT_ENB
=
`
egrep
-i
-c
"Segmentation Fault"
$ENB_LOG
`
echo
"There are no iperf files"
if
[
$NB_SEGFAULT_ENB
-ne
0
]
IPERF_TESTS
=
""
then
fi
echo
"<font color =
\"
red
\"
><b>- eNB --> Segmentation Fault</b></font>"
>>
./test_simulator_results.html
for
IPERF_CASE
in
$IPERF_TESTS
fi
do
NB_SEGFAULT_UE
=
`
egrep
-i
-c
"Segmentation Fault"
$UE_LOG
`
echo
" <tr>"
>>
./test_simulator_results.html
if
[
$NB_SEGFAULT_UE
-ne
0
]
NAME
=
`
echo
$IPERF_CASE
|
sed
-e
"s#
$ARCHIVES_LOC
/##"
`
then
echo
" <td>
$NAME
</td>"
>>
./test_simulator_results.html
echo
"<font color =
\"
red
\"
><b>- UE --> Segmentation Fault</b></font>"
>>
./test_simulator_results.html
CMD
=
`
egrep
"COMMAND IS"
$IPERF_CASE
|
sed
-e
"s#COMMAND IS: ##"
`
fi
echo
" <td>
$CMD
</td>"
>>
./test_simulator_results.html
NB_ASSERTION_ENB
=
`
egrep
-i
-c
"Assertion"
$ENB_LOG
`
REQ_BITRATE
=
`
echo
$CMD
|
sed
-e
"s#^.*-b ##"
-e
"s#-i 1.*##"
`
if
[
$NB_ASSERTION_ENB
-ne
0
]
if
[[
$REQ_BITRATE
=
~ .
*
K.
*
]]
then
then
echo
"<font color =
\"
red
\"
><b>- eNB --> Assertion</b></font>"
>>
./test_simulator_results.html
REQ_BITRATE
=
`
echo
$REQ_BITRATE
|
sed
-e
"s#K##"
`
awk
'BEGIN{assertion=10}{if(assertion < 3){print " " $0; assertion++};if ($0 ~/Assertion/){print " " $0;assertion=1}}END{}'
$ENB_LOG
>>
./test_simulator_results.html
FLOAT_REQ_BITRATE
=
`
echo
"
$REQ_BITRATE
* 1000.0"
| bc
-l
`
fi
fi
NB_ASSERTION_UE
=
`
egrep
-i
-c
"Assertion"
$UE_LOG
`
if
[[
$REQ_BITRATE
=
~ .
*
M.
*
]]
if
[
$NB_ASSERTION_UE
-ne
0
]
then
then
REQ_BITRATE
=
`
echo
$REQ_BITRATE
|
sed
-e
"s#M##"
`
echo
"<font color =
\"
red
\"
><b>- eNB --> Assertion</b></font>"
>>
./test_simulator_results.html
FLOAT_REQ_BITRATE
=
`
echo
"
$REQ_BITRATE
* 1000000.0"
| bc
-l
`
awk
'BEGIN{assertion=10}{if(assertion < 3){print " " $0; assertion++};if ($0 ~/Assertion/){print " " $0;assertion=1}}END{}'
$UE_LOG
>>
./test_simulator_results.html
fi
echo
" </pre></td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
fi
fi
if
[[
$REQ_BITRATE
=
~ .
*
G.
*
]]
PING_CASE
=
$ARCHIVES_LOC
/
${
TMODE
}
_
${
BW
}
MHz_ping_ue.txt
if
[
-f
$PING_CASE
]
then
then
REQ_BITRATE
=
`
echo
$REQ_BITRATE
|
sed
-e
"s#G##"
`
echo
" <tr>"
>>
./test_simulator_results.html
FLOAT_REQ_BITRATE
=
`
echo
"
$REQ_BITRATE
* 1000000000.0"
| bc
-l
`
NAME
=
`
echo
$PING_CASE
|
sed
-e
"s#
$ARCHIVES_LOC
/##"
`
echo
" <td>
$NAME
</td>"
>>
./test_simulator_results.html
CMD
=
`
egrep
"COMMAND IS"
$PING_CASE
|
sed
-e
"s#COMMAND IS: ##"
`
echo
" <td>
$CMD
</td>"
>>
./test_simulator_results.html
FILE_COMPLETE
=
`
egrep
-c
"ping statistics"
$PING_CASE
`
if
[
$FILE_COMPLETE
-eq
0
]
then
echo
" <td bgcolor =
\"
red
\"
>KO</td>"
>>
./test_simulator_results.html
echo
" <td>N/A</td>"
>>
./test_simulator_results.html
else
NB_TR_PACKETS
=
`
egrep
"packets transmitted"
$PING_CASE
|
sed
-e
"s# packets transmitted.*##"
`
NB_RC_PACKETS
=
`
egrep
"packets transmitted"
$PING_CASE
|
sed
-e
"s#^.*packets transmitted, ##"
-e
"s# received,.*##"
`
if
[
$NB_TR_PACKETS
-eq
$NB_RC_PACKETS
]
then
echo
" <td bgcolor =
\"
green
\"
>OK</td>"
>>
./test_simulator_results.html
else
echo
" <td bgcolor =
\"
red
\"
>KO</td>"
>>
./test_simulator_results.html
fi
echo
" <td>"
>>
./test_simulator_results.html
echo
" <pre>"
>>
./test_simulator_results.html
STATS
=
`
egrep
"packets transmitted"
$PING_CASE
|
sed
-e
"s#^.*received, ##"
-e
"s#, time.*##"
-e
"s# packet loss##"
`
echo
"Packet Loss :
$STATS
"
>>
./test_simulator_results.html
RTTMIN
=
`
egrep
"rtt min"
$PING_CASE
|
awk
'{split($4,a,"/"); print a[1] " " $5}'
`
echo
"RTT Minimal :
$RTTMIN
"
>>
./test_simulator_results.html
RTTAVG
=
`
egrep
"rtt min"
$PING_CASE
|
awk
'{split($4,a,"/"); print a[2] " " $5}'
`
echo
"RTT Average :
$RTTAVG
"
>>
./test_simulator_results.html
RTTMAX
=
`
egrep
"rtt min"
$PING_CASE
|
awk
'{split($4,a,"/"); print a[3] " " $5}'
`
echo
"RTT Maximal :
$RTTMAX
"
>>
./test_simulator_results.html
echo
" </pre>"
>>
./test_simulator_results.html
echo
" </td>"
>>
./test_simulator_results.html
fi
echo
" </tr>"
>>
./test_simulator_results.html
fi
fi
FILE_COMPLETE
=
`
egrep
-c
"Server Report"
$IPERF_CASE
`
if
[
$FILE_COMPLETE
-eq
0
]
if
[
-f
$ARCHIVES_LOC
/
${
TMODE
}
_
${
BW
}*
iperf
*
dl
*
client
*
txt
]
then
then
echo
" <td bgcolor =
\"
red
\"
>KO</td>"
>>
./test_simulator_results.html
IPERF_TESTS
=
`
ls
$ARCHIVES_LOC
/
${
TMODE
}
_
${
BW
}*
iperf
*
client
*
txt
`
SERVER_FILE
=
`
echo
$IPERF_CASE
|
sed
-e
"s#client#server#"
`
FLOAT_EFF_BITRATE
=
`
grep
--color
=
never sec
$SERVER_FILE
|
sed
-e
"s#^.*Bytes *##"
-e
"s#sec *.*#sec#"
|
awk
'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; printf "%.0f", br}'
`
EFFECTIVE_BITRATE
=
`
grep
--color
=
never sec
$SERVER_FILE
|
sed
-e
"s#^.*Bytes *##"
-e
"s#sec *.*#sec#"
|
awk
'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; if(br>1000000){printf "%.2f MBits/sec", br/1000000}}'
`
PERF
=
`
echo
"100 *
$FLOAT_EFF_BITRATE
/
$FLOAT_REQ_BITRATE
"
| bc
-l
|
awk
'{printf "%.2f", $0}'
`
JITTER
=
`
grep
--color
=
never sec
$SERVER_FILE
|
sed
-e
"s#^.*/sec *##"
-e
"s# *ms.*##"
|
awk
'BEGIN{s=0;n=0}{n++;s+=$1}END{jitter=s/n; printf "%.3f ms", jitter}'
`
PACKETLOSS_NOSIGN
=
`
grep
--color
=
never sec
$SERVER_FILE
|
sed
-e
"s#^.*(##"
-e
"s#%.*##"
|
awk
'BEGIN{s=0;n=0}{n++;s+=$1}END{per=s/n; printf "%.1f", per}'
`
PACKETLOSS
=
`
echo
"
${
PACKETLOSS_NOSIGN
}
%"
`
else
else
EFFECTIVE_BITRATE
=
`
tail
-n3
$IPERF_CASE
| egrep
"Mbits/sec"
|
sed
-e
"s#^.*MBytes *##"
-e
"s#sec.*#sec#"
`
echo
"There are no iperf files"
if
[[
$EFFECTIVE_BITRATE
=
~ .
*
Kbits/sec.
*
]]
IPERF_TESTS
=
""
fi
for
IPERF_CASE
in
$IPERF_TESTS
do
echo
" <tr>"
>>
./test_simulator_results.html
NAME
=
`
echo
$IPERF_CASE
|
sed
-e
"s#
$ARCHIVES_LOC
/##"
`
echo
" <td>
$NAME
</td>"
>>
./test_simulator_results.html
CMD
=
`
egrep
"COMMAND IS"
$IPERF_CASE
|
sed
-e
"s#COMMAND IS: ##"
`
echo
" <td>
$CMD
</td>"
>>
./test_simulator_results.html
REQ_BITRATE
=
`
echo
$CMD
|
sed
-e
"s#^.*-b ##"
-e
"s#-i 1.*##"
`
if
[[
$REQ_BITRATE
=
~ .
*
K.
*
]]
then
then
EFFECTIVE_BITRATE
=
`
echo
$EFFECTIVE_BITRATE
|
sed
-e
"s# *Kbits/sec.*
##"
`
REQ_BITRATE
=
`
echo
$REQ_BITRATE
|
sed
-e
"s#K
##"
`
FLOAT_
EFF_BITRATE
=
`
echo
"
$EFFECTIVE_BITRATE
* 100
0"
| bc
-l
`
FLOAT_
REQ_BITRATE
=
`
echo
"
$REQ_BITRATE
* 1000.
0"
| bc
-l
`
fi
fi
if
[[
$
EFFECTIVE_BITRATE
=
~ .
*
Mbits/sec
.
*
]]
if
[[
$
REQ_BITRATE
=
~ .
*
M
.
*
]]
then
then
EFFECTIVE_BITRATE
=
`
echo
$EFFECTIVE_BITRATE
|
sed
-e
"s# *Mbits/sec.*
##"
`
REQ_BITRATE
=
`
echo
$REQ_BITRATE
|
sed
-e
"s#M
##"
`
FLOAT_
EFF_BITRATE
=
`
echo
"
$EFFECTIVE_BITRATE
* 100000
0"
| bc
-l
`
FLOAT_
REQ_BITRATE
=
`
echo
"
$REQ_BITRATE
* 1000000.
0"
| bc
-l
`
fi
fi
if
[[
$
EFFECTIVE_BITRATE
=
~ .
*
Gbits/sec
.
*
]]
if
[[
$
REQ_BITRATE
=
~ .
*
G
.
*
]]
then
then
EFFECTIVE_BITRATE
=
`
echo
$EFFECTIVE_BITRATE
|
sed
-e
"s# *Gbits/sec.*
##"
`
REQ_BITRATE
=
`
echo
$REQ_BITRATE
|
sed
-e
"s#G
##"
`
FLOAT_
EFF_BITRATE
=
`
echo
"
$EFFECTIVE_BITRATE
* 100000000
0"
| bc
-l
`
FLOAT_
REQ_BITRATE
=
`
echo
"
$REQ_BITRATE
* 1000000000.
0"
| bc
-l
`
fi
fi
PERF
=
`
echo
"100 *
$FLOAT_EFF_BITRATE
/
$FLOAT_REQ_BITRATE
"
| bc
-l
|
awk
'{printf "%.2f", $0}'
`
FILE_COMPLETE
=
`
egrep
-c
"Server Report"
$IPERF_CASE
`
PERF_INT
=
`
echo
"100 *
$FLOAT_EFF_BITRATE
/
$FLOAT_REQ_BITRATE
"
| bc
-l
|
awk
'{printf "%.0f", $0}'
`
if
[
$FILE_COMPLETE
-eq
0
]
if
[[
$PERF_INT
-lt
90
]]
then
then
echo
" <td bgcolor =
\"
red
\"
>KO</td>"
>>
./test_simulator_results.html
echo
" <td bgcolor =
\"
red
\"
>KO</td>"
>>
./test_simulator_results.html
SERVER_FILE
=
`
echo
$IPERF_CASE
|
sed
-e
"s#client#server#"
`
FLOAT_EFF_BITRATE
=
`
grep
--color
=
never sec
$SERVER_FILE
|
sed
-e
"s#^.*Bytes *##"
-e
"s#sec *.*#sec#"
|
awk
'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; printf "%.0f", br}'
`
EFFECTIVE_BITRATE
=
`
grep
--color
=
never sec
$SERVER_FILE
|
sed
-e
"s#^.*Bytes *##"
-e
"s#sec *.*#sec#"
|
awk
'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; if(br>1000000){printf "%.2f MBits/sec", br/1000000}}'
`
PERF
=
`
echo
"100 *
$FLOAT_EFF_BITRATE
/
$FLOAT_REQ_BITRATE
"
| bc
-l
|
awk
'{printf "%.2f", $0}'
`
JITTER
=
`
grep
--color
=
never sec
$SERVER_FILE
|
sed
-e
"s#^.*/sec *##"
-e
"s# *ms.*##"
|
awk
'BEGIN{s=0;n=0}{n++;s+=$1}END{jitter=s/n; printf "%.3f ms", jitter}'
`
PACKETLOSS_NOSIGN
=
`
grep
--color
=
never sec
$SERVER_FILE
|
sed
-e
"s#^.*(##"
-e
"s#%.*##"
|
awk
'BEGIN{s=0;n=0}{n++;s+=$1}END{per=s/n; printf "%.1f", per}'
`
PACKETLOSS
=
`
echo
"
${
PACKETLOSS_NOSIGN
}
%"
`
else
else
echo
" <td bgcolor =
\"
green
\"
>OK</td>"
>>
./test_simulator_results.html
EFFECTIVE_BITRATE
=
`
tail
-n3
$IPERF_CASE
| egrep
"Mbits/sec"
|
sed
-e
"s#^.*MBytes *##"
-e
"s#sec.*#sec#"
`
if
[[
$EFFECTIVE_BITRATE
=
~ .
*
Kbits/sec.
*
]]
then
EFFECTIVE_BITRATE
=
`
echo
$EFFECTIVE_BITRATE
|
sed
-e
"s# *Kbits/sec.*##"
`
FLOAT_EFF_BITRATE
=
`
echo
"
$EFFECTIVE_BITRATE
* 1000"
| bc
-l
`
fi
if
[[
$EFFECTIVE_BITRATE
=
~ .
*
Mbits/sec.
*
]]
then
EFFECTIVE_BITRATE
=
`
echo
$EFFECTIVE_BITRATE
|
sed
-e
"s# *Mbits/sec.*##"
`
FLOAT_EFF_BITRATE
=
`
echo
"
$EFFECTIVE_BITRATE
* 1000000"
| bc
-l
`
fi
if
[[
$EFFECTIVE_BITRATE
=
~ .
*
Gbits/sec.
*
]]
then
EFFECTIVE_BITRATE
=
`
echo
$EFFECTIVE_BITRATE
|
sed
-e
"s# *Gbits/sec.*##"
`
FLOAT_EFF_BITRATE
=
`
echo
"
$EFFECTIVE_BITRATE
* 1000000000"
| bc
-l
`
fi
PERF
=
`
echo
"100 *
$FLOAT_EFF_BITRATE
/
$FLOAT_REQ_BITRATE
"
| bc
-l
|
awk
'{printf "%.2f", $0}'
`
PERF_INT
=
`
echo
"100 *
$FLOAT_EFF_BITRATE
/
$FLOAT_REQ_BITRATE
"
| bc
-l
|
awk
'{printf "%.0f", $0}'
`
if
[[
$PERF_INT
-lt
90
]]
then
echo
" <td bgcolor =
\"
red
\"
>KO</td>"
>>
./test_simulator_results.html
else
echo
" <td bgcolor =
\"
green
\"
>OK</td>"
>>
./test_simulator_results.html
fi
EFFECTIVE_BITRATE
=
`
tail
-n3
$IPERF_CASE
| egrep
"Mbits/sec"
|
sed
-e
"s#^.*MBytes *##"
-e
"s#sec.*#sec#"
`
JITTER
=
`
tail
-n3
$IPERF_CASE
| egrep
"Mbits/sec"
|
sed
-e
"s#^.*Mbits/sec *##"
-e
"s#ms.*#ms#"
`
PACKETLOSS
=
`
tail
-n3
$IPERF_CASE
| egrep
"Mbits/sec"
|
sed
-e
"s#^.*(##"
-e
"s#).*##"
`
fi
fi
EFFECTIVE_BITRATE
=
`
tail
-n3
$IPERF_CASE
| egrep
"Mbits/sec"
|
sed
-e
"s#^.*MBytes *##"
-e
"s#sec.*#sec#"
`
echo
" <td>"
>>
./test_simulator_results.html
JITTER
=
`
tail
-n3
$IPERF_CASE
| egrep
"Mbits/sec"
|
sed
-e
"s#^.*Mbits/sec *##"
-e
"s#ms.*#ms#"
`
echo
" <pre>"
>>
./test_simulator_results.html
PACKETLOSS
=
`
tail
-n3
$IPERF_CASE
| egrep
"Mbits/sec"
|
sed
-e
"s#^.*(##"
-e
"s#).*##"
`
echo
"Bitrate :
$EFFECTIVE_BITRATE
"
>>
./test_simulator_results.html
fi
echo
"Bitrate Perf :
$PERF
%"
>>
./test_simulator_results.html
echo
" <td>"
>>
./test_simulator_results.html
echo
"Jitter :
$JITTER
"
>>
./test_simulator_results.html
echo
" <pre>"
>>
./test_simulator_results.html
echo
"Packet Loss :
$PACKETLOSS
"
>>
./test_simulator_results.html
echo
"Bitrate :
$EFFECTIVE_BITRATE
"
>>
./test_simulator_results.html
echo
" </pre>"
>>
./test_simulator_results.html
echo
"Bitrate Perf :
$PERF
%"
>>
./test_simulator_results.html
echo
" </td>"
>>
./test_simulator_results.html
echo
"Jitter :
$JITTER
"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
echo
"Packet Loss :
$PACKETLOSS
"
>>
./test_simulator_results.html
done
echo
" </pre>"
>>
./test_simulator_results.html
echo
" </td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
done
done
done
done
done
echo
" </table>"
>>
./test_simulator_results.html
echo
" </table>"
>>
./test_simulator_results.html
fi
fi
ARCHIVES_LOC
=
archives/phy_sim/test
if
[
-d
$ARCHIVES_LOC
]
then
echo
" <h3>Physical Simulators Check</h3>"
>>
./test_simulator_results.html
echo
" <table border =
\"
1
\"
>"
>>
./test_simulator_results.html
echo
" <tr bgcolor =
\"
#33CCFF
\"
>"
>>
./test_simulator_results.html
echo
" <th>Log File Name</th>"
>>
./test_simulator_results.html
echo
" <th>Nb Tests</th>"
>>
./test_simulator_results.html
echo
" <th>Nb Errors</th>"
>>
./test_simulator_results.html
echo
" <th>Nb Failures</th>"
>>
./test_simulator_results.html
echo
" <th>Nb Failures</th>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
XML_TESTS
=
`
ls
$ARCHIVES_LOC
/
*
xml
`
for
XML_FILE
in
$XML_TESTS
do
echo
" <tr>"
>>
./test_simulator_results.html
NAME
=
`
echo
$XML_FILE
|
sed
-e
"s#
$ARCHIVES_LOC
/##"
`
NB_TESTS
=
`
egrep
"testsuite errors"
$XML_FILE
|
sed
-e
"s#^.*tests='##"
-e
"s#' *time=.*##"
`
NB_ERRORS
=
`
egrep
"testsuite errors"
$XML_FILE
|
sed
-e
"s#^.*errors='##"
-e
"s#' *failures=.*##"
`
NB_FAILURES
=
`
egrep
"testsuite errors"
$XML_FILE
|
sed
-e
"s#^.*failures='##"
-e
"s#' *hostname=.*##"
`
NB_SKIPPED
=
`
egrep
"testsuite errors"
$XML_FILE
|
sed
-e
"s#^.*skipped='##"
-e
"s#' *tests=.*##"
`
if
[
$NB_ERRORS
-eq
0
]
&&
[
$NB_FAILURES
-eq
0
]
then
echo
" <td bgcolor =
\"
green
\"
>
$NAME
</td>"
>>
./test_simulator_results.html
else
echo
" <td bgcolor =
\"
red
\"
>
$NAME
</td>"
>>
./test_simulator_results.html
fi
echo
" <td>
$NB_TESTS
</td>"
>>
./test_simulator_results.html
echo
" <td>
$NB_ERRORS
</td>"
>>
./test_simulator_results.html
echo
" <td>
$NB_FAILURES
</td>"
>>
./test_simulator_results.html
echo
" <td>
$NB_SKIPPED
</td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
done
echo
" </table>"
>>
./test_simulator_results.html
ARCHIVES_LOC
=
archives/phy_sim/test
if
[
-d
$ARCHIVES_LOC
]
then
echo
" <h3>Physical Simulators Check</h3>"
>>
./test_simulator_results.html
echo
" <h4>Details</h4>"
>>
./test_simulator_results.html
for
XML_FILE
in
$XML_TESTS
do
echo
" <table border =
\"
1
\"
>"
>>
./test_simulator_results.html
echo
" <table border =
\"
1
\"
>"
>>
./test_simulator_results.html
echo
" <tr bgcolor =
\"
#33CCFF
\"
>"
>>
./test_simulator_results.html
echo
" <tr bgcolor =
\"
#33CCFF
\"
>"
>>
./test_simulator_results.html
echo
" <th>Test Name</th>"
>>
./test_simulator_results.html
echo
" <th>Log File Name</th>"
>>
./test_simulator_results.html
echo
" <th>Description</th>"
>>
./test_simulator_results.html
echo
" <th>Nb Tests</th>"
>>
./test_simulator_results.html
echo
" <th>Result</th>"
>>
./test_simulator_results.html
echo
" <th>Nb Errors</th>"
>>
./test_simulator_results.html
echo
" <th>Time</th>"
>>
./test_simulator_results.html
echo
" <th>Nb Failures</th>"
>>
./test_simulator_results.html
echo
" <th>Nb Failures</th>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
TESTCASES_LIST
=
`
sed
-e
"s# #@#g"
$XML_FILE
|
grep
testcase
`
for
TESTCASE
in
$TESTCASES_LIST
XML_TESTS
=
`
ls
$ARCHIVES_LOC
/
*
xml
`
for
XML_FILE
in
$XML_TESTS
do
do
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <tr>"
>>
./test_simulator_results.html
NAME
=
`
echo
$
TESTCASE
|
sed
-e
"s#^.*name='##"
-e
"s#'@description=.*##"
|
sed
-e
"s#@# #g
"
`
NAME
=
`
echo
$
XML_FILE
|
sed
-e
"s#
$ARCHIVES_LOC
/##
"
`
echo
" <td>
$NAME
</td>"
>>
./test_simulator_results.html
NB_TESTS
=
`
egrep
"testsuite errors"
$XML_FILE
|
sed
-e
"s#^.*tests='##"
-e
"s#' *time=.*##"
`
DESC
=
`
echo
$TESTCASE
|
sed
-e
"s#^.*description='##"
-e
"s#'@Run_result=.*##"
|
sed
-e
"s#@# #g
"
`
NB_ERRORS
=
`
egrep
"testsuite errors"
$XML_FILE
|
sed
-e
"s#^.*errors='##"
-e
"s#' *failures=.*##
"
`
echo
" <td>
$DESC
</td>"
>>
./test_simulator_results.html
NB_FAILURES
=
`
egrep
"testsuite errors"
$XML_FILE
|
sed
-e
"s#^.*failures='##"
-e
"s#' *hostname=.*##"
`
RESULT
=
`
echo
$TESTCASE
|
sed
-e
"s#^.*RESULT='##"
-e
"s#'.*##"
|
sed
-e
"s#@# #g
"
`
NB_SKIPPED
=
`
egrep
"testsuite errors"
$XML_FILE
|
sed
-e
"s#^.*skipped='##"
-e
"s#' *tests=.*##
"
`
if
[
[
$RESULT
=
~ .
*
PASS.
*
]
]
if
[
$NB_ERRORS
-eq
0
]
&&
[
$NB_FAILURES
-eq
0
]
then
then
echo
"
<td bgcolor =
\"
green
\"
>
$RESULT
</td>"
>>
./test_simulator_results.html
echo
"
<td bgcolor =
\"
green
\"
>
$NAME
</td>"
>>
./test_simulator_results.html
else
else
echo
"
<td bgcolor =
\"
red
\"
>
$RESULT
</td>"
>>
./test_simulator_results.html
echo
"
<td bgcolor =
\"
red
\"
>
$NAME
</td>"
>>
./test_simulator_results.html
fi
fi
TIME
=
`
echo
$TESTCASE
|
sed
-e
"s#^.*time='##"
-e
"s#'@RESULT=.*##"
|
sed
-e
"s#@# #g"
`
echo
" <td>
$NB_TESTS
</td>"
>>
./test_simulator_results.html
echo
" <td>
$TIME
</td>"
>>
./test_simulator_results.html
echo
" <td>
$NB_ERRORS
</td>"
>>
./test_simulator_results.html
echo
" <td>
$NB_FAILURES
</td>"
>>
./test_simulator_results.html
echo
" <td>
$NB_SKIPPED
</td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
done
done
echo
" </table>"
>>
./test_simulator_results.html
echo
" </table>"
>>
./test_simulator_results.html
done
fi
echo
"</body>"
>>
./test_simulator_results.html
echo
" <h4>Details</h4>"
>>
./test_simulator_results.html
echo
"</html>"
>>
./test_simulator_results.html
for
XML_FILE
in
$XML_TESTS
do
echo
" <table border =
\"
1
\"
>"
>>
./test_simulator_results.html
echo
" <tr bgcolor =
\"
#33CCFF
\"
>"
>>
./test_simulator_results.html
echo
" <th>Test Name</th>"
>>
./test_simulator_results.html
echo
" <th>Description</th>"
>>
./test_simulator_results.html
echo
" <th>Result</th>"
>>
./test_simulator_results.html
echo
" <th>Time</th>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
PREV_SECTION
=
0
PREV_TIME_IN_SECS
=
0
TESTCASES_LIST
=
`
sed
-e
"s# #@#g"
$XML_FILE
|
grep
testcase
`
for
TESTCASE
in
$TESTCASES_LIST
do
NAME
=
`
echo
$TESTCASE
|
sed
-e
"s#^.*name='##"
-e
"s#'@description=.*##"
|
sed
-e
"s#@# #g"
`
SECTION
=
`
echo
$NAME
|
sed
-e
"s#
\.
.*##"
`
if
[
$SECTION
!=
$PREV_SECTION
]
then
echo
" <tr bgcolor =
\"
#8FBC8F
\"
>"
>>
./test_simulator_results.html
echo
" <td align =
\"
center
\"
colspan = 4 >
\"
$SECTION
\"
series</td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
PREV_SECTION
=
$SECTION
PREV_TIME_IN_SECS
=
0
fi
DESC
=
`
echo
$TESTCASE
|
sed
-e
"s#^.*description='##"
-e
"s#'@Run_result=.*##"
|
sed
-e
"s#@# #g"
`
RESULT
=
`
echo
$TESTCASE
|
sed
-e
"s#^.*RESULT='##"
-e
"s#'.*##"
|
sed
-e
"s#@# #g"
`
TIME_IN_SECS
=
`
echo
$TESTCASE
|
sed
-e
"s#^.*time='##"
-e
"s#'@RESULT=.*##"
|
sed
-e
"s#@# #g"
-e
"s# s.*##"
`
TIME
=
`
echo
"
$TIME_IN_SECS
-
$PREV_TIME_IN_SECS
"
| bc
-l
|
awk
'{printf "%.2f s", $0}'
`
PREV_TIME_IN_SECS
=
$TIME_IN_SECS
echo
" <tr>"
>>
./test_simulator_results.html
echo
" <td>
$NAME
</td>"
>>
./test_simulator_results.html
echo
" <td>
$DESC
</td>"
>>
./test_simulator_results.html
if
[[
$RESULT
=
~ .
*
PASS.
*
]]
then
echo
" <td bgcolor =
\"
green
\"
>
$RESULT
</td>"
>>
./test_simulator_results.html
else
SPLITTED_LINE
=
`
echo
-e
$TESTCASE
|
sed
-e
"s#@#
\n
#g"
`
NB_RUNS
=
`
echo
-e
"
${
SPLITTED_LINE
}
"
|
grep
-v
Run_result | egrep
-c
"Run_"
`
NB_FAILS
=
`
echo
-e
"
${
SPLITTED_LINE
}
"
|
grep
-v
Run_result | egrep
-c
"=FAIL"
`
echo
" <td bgcolor =
\"
red
\"
>
${
RESULT
}
(
${
NB_FAILS
}
/
${
NB_RUNS
}
)</td>"
>>
./test_simulator_results.html
fi
echo
" <td>
$TIME
</td>"
>>
./test_simulator_results.html
echo
" </tr>"
>>
./test_simulator_results.html
done
echo
" </table>"
>>
./test_simulator_results.html
done
fi
exit
0
echo
"</body>"
>>
./test_simulator_results.html
echo
"</html>"
>>
./test_simulator_results.html
}
ci-scripts/runTestOnVM.sh
View file @
4bb2b8a2
...
@@ -20,15 +20,18 @@
...
@@ -20,15 +20,18 @@
# * contact@openairinterface.org
# * contact@openairinterface.org
# */
# */
function
usage
{
function
run_test_
usage
{
echo
"OAI
VM Test Run
script"
echo
"OAI
CI VM
script"
echo
" Original Author: Raphael Defosseux"
echo
" Original Author: Raphael Defosseux"
echo
" Requirements:"
echo
" -- uvtool uvtool-libvirt apt-cacher"
echo
" -- xenial image already synced"
echo
" Default:"
echo
" Default:"
echo
" -- eNB with USRP"
echo
" -- eNB with USRP"
echo
""
echo
""
echo
"Usage:"
echo
"Usage:"
echo
"------"
echo
"------"
echo
"
runTestOnVM.sh
[OPTIONS]"
echo
"
oai-ci-vm-tool test
[OPTIONS]"
echo
""
echo
""
echo
"Options:"
echo
"Options:"
echo
"--------"
echo
"--------"
...
@@ -41,12 +44,7 @@ function usage {
...
@@ -41,12 +44,7 @@ function usage {
echo
" --workspace #### OR -ws ####"
echo
" --workspace #### OR -ws ####"
echo
" Specify the workspace."
echo
" Specify the workspace."
echo
""
echo
""
echo
" --variant enb-usrp OR -v1"
variant_usage
echo
" --variant basic-sim OR -v2"
echo
" --variant phy-sim OR -v3"
echo
" --variant cppcheck OR -v4"
echo
" --variant enb-ethernet OR -v7"
echo
" --variant ue-ethernet OR -v8"
echo
" Specify the variant to build."
echo
" Specify the variant to build."
echo
""
echo
""
echo
" --keep-vm-alive OR -k"
echo
" --keep-vm-alive OR -k"
...
@@ -57,19 +55,6 @@ function usage {
...
@@ -57,19 +55,6 @@ function usage {
echo
""
echo
""
}
}
function
variant_usage
{
echo
"OAI VM Test Run script"
echo
" Original Author: Raphael Defosseux"
echo
""
echo
" --variant enb-usrp OR -v1"
echo
" --variant basic-sim OR -v2"
echo
" --variant phy-sim OR -v3"
echo
" --variant cppcheck OR -v4"
echo
" --variant enb-ethernet OR -v7"
echo
" --variant ue-ethernet OR -v8"
echo
""
}
function
start_basic_sim_enb
{
function
start_basic_sim_enb
{
local
LOC_VM_IP_ADDR
=
$2
local
LOC_VM_IP_ADDR
=
$2
local
LOC_EPC_IP_ADDR
=
$3
local
LOC_EPC_IP_ADDR
=
$3
...
@@ -95,6 +80,7 @@ function start_basic_sim_enb {
...
@@ -95,6 +80,7 @@ function start_basic_sim_enb {
echo
"echo
\"
ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-
$LOC_CONF_FILE
\"
> ./my-lte-softmodem-run.sh "
>>
$1
echo
"echo
\"
ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-
$LOC_CONF_FILE
\"
> ./my-lte-softmodem-run.sh "
>>
$1
echo
"chmod 775 ./my-lte-softmodem-run.sh"
>>
$1
echo
"chmod 775 ./my-lte-softmodem-run.sh"
>>
$1
echo
"cat ./my-lte-softmodem-run.sh"
>>
$1
echo
"cat ./my-lte-softmodem-run.sh"
>>
$1
echo
"if [ -e /home/ubuntu/tmp/cmake_targets/log/
$LOC_LOG_FILE
]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/
$LOC_LOG_FILE
; fi"
>>
$1
echo
"sudo -E daemon --inherit --unsafe --name=enb_daemon --chdir=/home/ubuntu/tmp/cmake_targets/basic_simulator/enb -o /home/ubuntu/tmp/cmake_targets/log/
$LOC_LOG_FILE
./my-lte-softmodem-run.sh"
>>
$1
echo
"sudo -E daemon --inherit --unsafe --name=enb_daemon --chdir=/home/ubuntu/tmp/cmake_targets/basic_simulator/enb -o /home/ubuntu/tmp/cmake_targets/log/
$LOC_LOG_FILE
./my-lte-softmodem-run.sh"
>>
$1
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$LOC_VM_IP_ADDR
<
$1
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$LOC_VM_IP_ADDR
<
$1
...
@@ -112,6 +98,7 @@ function start_basic_sim_ue {
...
@@ -112,6 +98,7 @@ function start_basic_sim_ue {
echo
"echo
\"
./lte-uesoftmodem -C
${
LOC_FREQUENCY
}
000000 -r
$LOC_NB_RBS
--ue-rxgain 140
\"
> ./my-lte-uesoftmodem-run.sh"
>>
$1
echo
"echo
\"
./lte-uesoftmodem -C
${
LOC_FREQUENCY
}
000000 -r
$LOC_NB_RBS
--ue-rxgain 140
\"
> ./my-lte-uesoftmodem-run.sh"
>>
$1
echo
"chmod 775 ./my-lte-uesoftmodem-run.sh"
>>
$1
echo
"chmod 775 ./my-lte-uesoftmodem-run.sh"
>>
$1
echo
"cat ./my-lte-uesoftmodem-run.sh"
>>
$1
echo
"cat ./my-lte-uesoftmodem-run.sh"
>>
$1
echo
"if [ -e /home/ubuntu/tmp/cmake_targets/log/
$LOC_UE_LOG_FILE
]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/
$LOC_UE_LOG_FILE
; fi"
>>
$1
echo
"sudo -E daemon --inherit --unsafe --name=ue_daemon --chdir=/home/ubuntu/tmp/cmake_targets/basic_simulator/ue -o /home/ubuntu/tmp/cmake_targets/log/
$LOC_UE_LOG_FILE
./my-lte-uesoftmodem-run.sh"
>>
$1
echo
"sudo -E daemon --inherit --unsafe --name=ue_daemon --chdir=/home/ubuntu/tmp/cmake_targets/basic_simulator/ue -o /home/ubuntu/tmp/cmake_targets/log/
$LOC_UE_LOG_FILE
./my-lte-uesoftmodem-run.sh"
>>
$1
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$2
<
$1
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$2
<
$1
...
@@ -299,740 +286,619 @@ function terminate_ltebox_epc {
...
@@ -299,740 +286,619 @@ function terminate_ltebox_epc {
rm
$1
rm
$1
}
}
if
[
$#
-lt
1
]
||
[
$#
-gt
9
]
function
run_test_on_vm
{
then
echo
"Syntax Error: not the correct number of arguments"
echo
""
usage
exit
1
fi
VM_TEMPLATE
=
ci-
JOB_NAME
=
XX
BUILD_ID
=
XX
VM_NAME
=
ci-enb-usrp
ARCHIVES_LOC
=
enb_usrp/test
KEEP_VM_ALIVE
=
0
RUN_OPTIONS
=
"none"
STATUS
=
0
while
[[
$#
-gt
0
]]
do
key
=
"
$1
"
case
$key
in
-h
|
--help
)
shift
usage
exit
0
;;
-jn
|
--job-name
)
JOB_NAME
=
"
$2
"
shift
shift
;;
-id
|
--build-id
)
BUILD_ID
=
"
$2
"
shift
shift
;;
-ws
|
--workspace
)
JENKINS_WKSP
=
"
$2
"
shift
shift
;;
-k
|
--keep-vm-alive
)
KEEP_VM_ALIVE
=
1
shift
;;
-v1
)
VM_NAME
=
ci-enb-usrp
shift
;;
-v2
)
VM_NAME
=
ci-basic-sim
RUN_OPTIONS
=
"complex"
ARCHIVES_LOC
=
basic_sim/test
shift
;;
-v3
)
VM_NAME
=
ci-phy-sim
RUN_OPTIONS
=
"./run_exec_autotests.bash -g
\"
01510*
\"
-q -np -b"
ARCHIVES_LOC
=
phy_sim/test
shift
;;
-v4
)
VM_NAME
=
ci-cppcheck
shift
;;
-v7
)
VM_NAME
=
ci-enb-ethernet
shift
;;
-v8
)
VM_NAME
=
ci-ue-ethernet
shift
;;
--variant
)
variant
=
"
$2
"
case
$variant
in
enb-usrp
)
VM_NAME
=
ci-enb-usrp
;;
basic-sim
)
VM_NAME
=
ci-basic-sim
RUN_OPTIONS
=
"complex"
ARCHIVES_LOC
=
basic_sim/test
;;
phy-sim
)
VM_NAME
=
ci-phy-sim
RUN_OPTIONS
=
"./run_exec_autotests.bash -g
\"
01510*
\"
-q -np -b"
ARCHIVES_LOC
=
phy_sim/test
;;
cppcheck
)
VM_NAME
=
ci-cppcheck
;;
enb-ethernet
)
VM_NAME
=
ci-enb-ethernet
;;
ue-ethernet
)
VM_NAME
=
ci-ue-ethernet
;;
*
)
echo
""
echo
"Syntax Error: Invalid Variant option ->
$variant
"
echo
""
variant_usage
exit
1
esac
shift
shift
;;
*
)
echo
"Syntax Error: unknown option:
$key
"
echo
""
usage
exit
1
esac
done
if
[
"
$JOB_NAME
"
==
"XX"
]
||
[
"
$BUILD_ID
"
==
"XX"
]
then
VM_TEMPLATE
=
ci-
else
VM_TEMPLATE
=
${
JOB_NAME
}
-b
${
BUILD_ID
}
-
fi
VM_NAME
=
`
echo
$VM_NAME
|
sed
-e
"s#ci-#
$VM_TEMPLATE
#"
`
VM_CMDS
=
${
VM_NAME
}
_cmds.txt
ARCHIVES_LOC
=
${
JENKINS_WKSP
}
/archives/
${
ARCHIVES_LOC
}
echo
"VM_NAME =
$VM_NAME
"
echo
"VM_CMD_FILE =
$VM_CMDS
"
echo
"JENKINS_WKSP =
$JENKINS_WKSP
"
echo
"ARCHIVES_LOC =
$ARCHIVES_LOC
"
echo
"############################################################"
echo
"Waiting for VM to be started"
echo
"############################################################"
uvt-kvm
wait
$VM_NAME
--insecure
VM_IP_ADDR
=
`
uvt-kvm ip
$VM_NAME
`
echo
"
$VM_NAME
has for IP addr =
$VM_IP_ADDR
"
if
[
"
$RUN_OPTIONS
"
==
"none"
]
then
echo
"No run on VM testing for this variant currently"
exit
$STATUS
fi
if
[[
$RUN_OPTIONS
=
~ .
*
run_exec_autotests.
*
]]
then
echo
"############################################################"
echo
"############################################################"
echo
"
Running test script on VM (
$VM_NAME
)
"
echo
"
OAI CI VM script
"
echo
"############################################################"
echo
"############################################################"
echo
"echo
\"
sudo apt-get --yes --quiet install bc
\"
"
>
$VM_CMDS
echo
"VM_NAME =
$VM_NAME
"
echo
"sudo apt-get update > bc-install.txt 2>&1"
>>
$VM_CMDS
echo
"VM_CMD_FILE =
$VM_CMDS
"
echo
"sudo apt-get --yes install bc >> bc-install.txt 2>&1"
>>
$VM_CMDS
echo
"JENKINS_WKSP =
$JENKINS_WKSP
"
echo
"cd tmp"
>>
$VM_CMDS
echo
"ARCHIVES_LOC =
$ARCHIVES_LOC
"
echo
"echo
\"
source oaienv
\"
"
>>
$VM_CMDS
echo
"source oaienv"
>>
$VM_CMDS
echo
"echo
\"
cd cmake_targets/autotests
\"
"
>>
$VM_CMDS
echo
"cd cmake_targets/autotests"
>>
$VM_CMDS
echo
"echo
\"
rm -Rf log
\"
"
>>
$VM_CMDS
echo
"rm -Rf log"
>>
$VM_CMDS
echo
"
$RUN_OPTIONS
"
|
sed
-e
's@"@\\"@g'
-e
's@^@echo "@'
-e
's@$@"@'
>>
$VM_CMDS
echo
"
$RUN_OPTIONS
"
>>
$VM_CMDS
echo
"cp /home/ubuntu/bc-install.txt log"
>>
$VM_CMDS
echo
"cd log"
>>
$VM_CMDS
echo
"zip -r -qq tmp.zip *.* 0*"
>>
$VM_CMDS
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
<
$VM_CMDS
echo
"############################################################"
echo
"############################################################"
echo
"
Creating a tmp folder to store results and artifacts
"
echo
"
Waiting for VM to be started
"
echo
"############################################################"
echo
"############################################################"
uvt-kvm
wait
$VM_NAME
--insecure
if
[
-d
$ARCHIVES_LOC
]
VM_IP_ADDR
=
`
uvt-kvm ip
$VM_NAME
`
then
echo
"
$VM_NAME
has for IP addr =
$VM_IP_ADDR
"
rm
-Rf
$ARCHIVES_LOC
fi
mkdir
--parents
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/autotests/log/tmp.zip
$ARCHIVES_LOC
if
[
"
$RUN_OPTIONS
"
==
"none"
]
pushd
$ARCHIVES_LOC
unzip
-qq
-DD
tmp.zip
rm
tmp.zip
if
[
-f
results_autotests.xml
]
then
then
FUNCTION
=
`
echo
$VM_NAME
|
sed
-e
"s@
$VM_TEMPLATE
@@"
`
echo
"No run on VM testing for this variant currently"
NEW_NAME
=
`
echo
"results_autotests.xml"
|
sed
-e
"s@results_autotests@results_autotests-
$FUNCTION
@"
`
exit
$STATUS
echo
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
?>"
>
$NEW_NAME
echo
"<?xml-stylesheet type=
\"
text/xsl
\"
href=
\"
$FUNCTION
.xsl
\"
?>"
>>
$NEW_NAME
cat
results_autotests.xml
>>
$NEW_NAME
sed
-e
"s@TEMPLATE@
$FUNCTION
@"
$JENKINS_WKSP
/ci-scripts/template.xsl
>
$FUNCTION
.xsl
#mv results_autotests.xml $NEW_NAME
rm
results_autotests.xml
fi
fi
popd
if
[
$KEEP_VM_ALIVE
-eq
0
]
if
[
[
$RUN_OPTIONS
=
~ .
*
run_exec_autotests.
*
]
]
then
then
echo
"############################################################"
echo
"############################################################"
echo
"
Destroying VM
"
echo
"
Running test script on VM (
$VM_NAME
)
"
echo
"############################################################"
echo
"############################################################"
uvt-kvm destroy
$VM_NAME
echo
"echo
\"
sudo apt-get --yes --quiet install bc
\"
"
>
$VM_CMDS
ssh-keygen
-R
$VM_IP_ADDR
echo
"sudo apt-get update > bc-install.txt 2>&1"
>>
$VM_CMDS
fi
echo
"sudo apt-get --yes install bc >> bc-install.txt 2>&1"
>>
$VM_CMDS
rm
-f
$VM_CMDS
echo
"cd tmp"
>>
$VM_CMDS
echo
"echo
\"
source oaienv
\"
"
>>
$VM_CMDS
echo
"############################################################"
echo
"source oaienv"
>>
$VM_CMDS
echo
"Checking run status"
echo
"echo
\"
cd cmake_targets/autotests
\"
"
>>
$VM_CMDS
echo
"############################################################"
echo
"cd cmake_targets/autotests"
>>
$VM_CMDS
echo
"echo
\"
rm -Rf log
\"
"
>>
$VM_CMDS
LOG_FILES
=
`
ls
$ARCHIVES_LOC
/results_autotests
*
.xml
`
echo
"rm -Rf log"
>>
$VM_CMDS
NB_FOUND_FILES
=
0
echo
"
$RUN_OPTIONS
"
|
sed
-e
's@"@\\"@g'
-e
's@^@echo "@'
-e
's@$@"@'
>>
$VM_CMDS
NB_RUNS
=
0
echo
"
$RUN_OPTIONS
"
>>
$VM_CMDS
NB_FAILURES
=
0
echo
"cp /home/ubuntu/bc-install.txt log"
>>
$VM_CMDS
echo
"cd log"
>>
$VM_CMDS
for
FULLFILE
in
$LOG_FILES
echo
"zip -r -qq tmp.zip *.* 0*"
>>
$VM_CMDS
do
TESTSUITES
=
`
egrep
"testsuite errors"
$FULLFILE
`
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
<
$VM_CMDS
for
TESTSUITE
in
$TESTSUITES
do
if
[[
"
$TESTSUITE
"
==
*
"tests="
*
]]
then
RUNS
=
`
echo
$TESTSUITE
|
awk
'BEGIN{FS="="}{print $2}END{}'
|
sed
-e
"s@'@@g"
`
NB_RUNS
=
$((
NB_RUNS
+
RUNS
))
fi
if
[[
"
$TESTSUITE
"
==
*
"failures="
*
]]
then
FAILS
=
`
echo
$TESTSUITE
|
awk
'BEGIN{FS="="}{print $2}END{}'
|
sed
-e
"s@'@@g"
`
NB_FAILURES
=
$((
NB_FAILURES
+
FAILS
))
fi
done
NB_FOUND_FILES
=
$((
NB_FOUND_FILES
+
1
))
done
echo
"NB_FOUND_FILES =
$NB_FOUND_FILES
"
echo
"NB_RUNS =
$NB_RUNS
"
echo
"NB_FAILURES =
$NB_FAILURES
"
if
[
$NB_FOUND_FILES
-eq
0
]
;
then
STATUS
=
-1
;
fi
echo
"############################################################"
if
[
$NB_RUNS
-eq
0
]
;
then
STATUS
=
-1
;
fi
echo
"Creating a tmp folder to store results and artifacts"
if
[
$NB_FAILURES
-ne
0
]
;
then
STATUS
=
-1
;
fi
echo
"############################################################"
fi
if
[
-d
$ARCHIVES_LOC
]
then
rm
-Rf
$ARCHIVES_LOC
fi
mkdir
--parents
$ARCHIVES_LOC
if
[[
"
$RUN_OPTIONS
"
==
"complex"
]]
&&
[[
$VM_NAME
=
~ .
*
-basic-sim
.
*
]]
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/autotests/log/tmp.zip
$ARCHIVES_LOC
then
pushd
$ARCHIVES_LOC
PING_STATUS
=
0
unzip
-qq
-DD
tmp.zip
IPERF_STATUS
=
0
rm
tmp.zip
if
[
-d
$ARCHIVES_LOC
]
if
[
-f
results_autotests.xml
]
then
then
rm
-Rf
$ARCHIVES_LOC
FUNCTION
=
`
echo
$VM_NAME
|
sed
-e
"s@
$VM_TEMPLATE
@@"
`
fi
NEW_NAME
=
`
echo
"results_autotests.xml"
|
sed
-e
"s@results_autotests@results_autotests-
$FUNCTION
@"
`
mkdir
--parents
$ARCHIVES_LOC
echo
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
?>"
>
$NEW_NAME
echo
"<?xml-stylesheet type=
\"
text/xsl
\"
href=
\"
$FUNCTION
.xsl
\"
?>"
>>
$NEW_NAME
cat
results_autotests.xml
>>
$NEW_NAME
sed
-e
"s@TEMPLATE@
$FUNCTION
@"
$JENKINS_WKSP
/ci-scripts/template.xsl
>
$FUNCTION
.xsl
#mv results_autotests.xml $NEW_NAME
rm
results_autotests.xml
fi
popd
EPC_VM_NAME
=
`
echo
$VM_NAME
|
sed
-e
"s#basic-sim#epc#"
`
if
[
$KEEP_VM_ALIVE
-eq
0
]
LTEBOX
=
0
if
[
-d
/opt/ltebox-archives/
]
then
# Checking if all ltebox archives are available to run ltebx epc on a brand new VM
if
[
-f
/opt/ltebox-archives/ltebox_2.2.70_16_04_amd64.deb
]
&&
[
-f
/opt/ltebox-archives/etc-conf.zip
]
&&
[
-f
/opt/ltebox-archives/hss-sim.zip
]
then
then
echo
"############################################################"
echo
"############################################################"
echo
"
Test EPC on VM (
$EPC_VM_NAME
) will be using ltebox
"
echo
"
Destroying VM
"
echo
"############################################################"
echo
"############################################################"
LTEBOX
=
1
uvt-kvm destroy
$VM_NAME
ssh-keygen
-R
$VM_IP_ADDR
fi
fi
fi
rm
-f
$VM_CMDS
# Here we could have other types of EPC detection
# Do we need to start the EPC VM
EPC_VM_CMDS
=
`
echo
$VM_CMDS
|
sed
-e
"s#cmds#epc-cmds#"
`
echo
"EPC_VM_CMD_FILE =
$EPC_VM_CMDS
"
IS_EPC_VM_ALIVE
=
`
uvt-kvm list |
grep
-c
$EPC_VM_NAME
`
if
[
$IS_EPC_VM_ALIVE
-eq
0
]
then
echo
"############################################################"
echo
"############################################################"
echo
"C
reating test EPC VM (
$EPC_VM_NAME
) on Ubuntu Cloud Image base
"
echo
"C
hecking run status
"
echo
"############################################################"
echo
"############################################################"
uvt-kvm create
$EPC_VM_NAME
release
=
xenial
--unsafe-caching
fi
uvt-kvm
wait
$EPC_VM_NAME
--insecure
LOG_FILES
=
`
ls
$ARCHIVES_LOC
/results_autotests
*
.xml
`
EPC_VM_IP_ADDR
=
`
uvt-kvm ip
$EPC_VM_NAME
`
NB_FOUND_FILES
=
0
echo
"
$EPC_VM_NAME
has for IP addr =
$EPC_VM_IP_ADDR
"
NB_RUNS
=
0
scp
-o
StrictHostKeyChecking
=
no /etc/apt/apt.conf.d/01proxy ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu
NB_FAILURES
=
0
# ltebox specific actions (install and start)
for
FULLFILE
in
$LOG_FILES
LTE_BOX_TO_INSTALL
=
1
do
if
[
$LTEBOX
-eq
1
]
TESTSUITES
=
`
egrep
"testsuite errors"
$FULLFILE
`
then
for
TESTSUITE
in
$TESTSUITES
echo
"ls -ls /opt/ltebox/tools/start_ltebox"
>
$EPC_VM_CMDS
do
RESPONSE
=
`
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
<
$EPC_VM_CMDS
`
if
[[
"
$TESTSUITE
"
==
*
"tests="
*
]]
NB_EXES
=
`
echo
$RESPONSE
|
grep
-c
ltebox
`
then
if
[
$NB_EXES
-eq
1
]
;
then
LTE_BOX_TO_INSTALL
=
0
;
fi
RUNS
=
`
echo
$TESTSUITE
|
awk
'BEGIN{FS="="}{print $2}END{}'
|
sed
-e
"s@'@@g"
`
fi
NB_RUNS
=
$((
NB_RUNS
+
RUNS
))
fi
if
[[
"
$TESTSUITE
"
==
*
"failures="
*
]]
then
FAILS
=
`
echo
$TESTSUITE
|
awk
'BEGIN{FS="="}{print $2}END{}'
|
sed
-e
"s@'@@g"
`
NB_FAILURES
=
$((
NB_FAILURES
+
FAILS
))
fi
done
NB_FOUND_FILES
=
$((
NB_FOUND_FILES
+
1
))
done
echo
"NB_FOUND_FILES =
$NB_FOUND_FILES
"
echo
"NB_RUNS =
$NB_RUNS
"
echo
"NB_FAILURES =
$NB_FAILURES
"
if
[
$NB_FOUND_FILES
-eq
0
]
;
then
STATUS
=
-1
;
fi
if
[
$NB_RUNS
-eq
0
]
;
then
STATUS
=
-1
;
fi
if
[
$NB_FAILURES
-ne
0
]
;
then
STATUS
=
-1
;
fi
if
[
$LTEBOX
-eq
1
]
&&
[
$LTE_BOX_TO_INSTALL
-eq
1
]
then
echo
"############################################################"
echo
"Copying ltebox archives into EPC VM (
$EPC_VM_NAME
)"
echo
"############################################################"
scp
-o
StrictHostKeyChecking
=
no /opt/ltebox-archives/ltebox_2.2.70_16_04_amd64.deb ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu
scp
-o
StrictHostKeyChecking
=
no /opt/ltebox-archives/etc-conf.zip ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu
scp
-o
StrictHostKeyChecking
=
no /opt/ltebox-archives/hss-sim.zip ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu
echo
"############################################################"
echo
"Install EPC on EPC VM (
$EPC_VM_NAME
)"
echo
"############################################################"
echo
"sudo cp 01proxy /etc/apt/apt.conf.d/"
>
$EPC_VM_CMDS
echo
"touch /home/ubuntu/.hushlogin"
>>
$EPC_VM_CMDS
echo
"echo
\"
sudo apt-get --yes --quiet install zip openjdk-8-jre libconfuse-dev libreadline-dev liblog4c-dev libgcrypt-dev libsctp-dev python2.7 python2.7-dev daemon iperf
\"
"
>>
$EPC_VM_CMDS
echo
"sudo apt-get update > zip-install.txt 2>&1"
>>
$EPC_VM_CMDS
echo
"sudo apt-get --yes install zip openjdk-8-jre libconfuse-dev libreadline-dev liblog4c-dev libgcrypt-dev libsctp-dev python2.7 python2.7-dev daemon iperf >> zip-install.txt 2>&1"
>>
$EPC_VM_CMDS
# Installing HSS
echo
"echo
\"
cd /opt
\"
"
>>
$EPC_VM_CMDS
echo
"cd /opt"
>>
$EPC_VM_CMDS
echo
"echo
\"
sudo unzip -qq /home/ubuntu/hss-sim.zip
\"
"
>>
$EPC_VM_CMDS
echo
"sudo unzip -qq /home/ubuntu/hss-sim.zip"
>>
$EPC_VM_CMDS
echo
"echo
\"
cd /opt/hss_sim0609
\"
"
>>
$EPC_VM_CMDS
echo
"cd /opt/hss_sim0609"
>>
$EPC_VM_CMDS
# Installing ltebox
echo
"echo
\"
cd /home/ubuntu
\"
"
>>
$EPC_VM_CMDS
echo
"cd /home/ubuntu"
>>
$EPC_VM_CMDS
echo
"echo
\"
sudo dpkg -i ltebox_2.2.70_16_04_amd64.deb
\"
"
>>
$EPC_VM_CMDS
echo
"sudo dpkg -i ltebox_2.2.70_16_04_amd64.deb >> zip-install.txt 2>&1"
>>
$EPC_VM_CMDS
echo
"echo
\"
cd /opt/ltebox/etc/
\"
"
>>
$EPC_VM_CMDS
echo
"cd /opt/ltebox/etc/"
>>
$EPC_VM_CMDS
echo
"echo
\"
sudo unzip -qq -o /home/ubuntu/etc-conf.zip
\"
"
>>
$EPC_VM_CMDS
echo
"sudo unzip -qq -o /home/ubuntu/etc-conf.zip"
>>
$EPC_VM_CMDS
echo
"sudo sed -i -e 's#EPC_VM_IP_ADDRESS#
$EPC_VM_IP_ADDR
#' gw.conf"
>>
$EPC_VM_CMDS
echo
"sudo sed -i -e 's#EPC_VM_IP_ADDRESS#
$EPC_VM_IP_ADDR
#' mme.conf"
>>
$EPC_VM_CMDS
fi
fi
# Starting EPC
if
[[
"
$RUN_OPTIONS
"
==
"complex"
]]
&&
[[
$VM_NAME
=
~ .
*
-basic-sim
.
*
]]
if
[
$LTEBOX
-eq
1
]
then
then
echo
"############################################################"
PING_STATUS
=
0
echo
"Start EPC on EPC VM (
$EPC_VM_NAME
)"
IPERF_STATUS
=
0
echo
"############################################################"
if
[
-d
$ARCHIVES_LOC
]
echo
"echo
\"
cd /opt/hss_sim0609
\"
"
>>
$EPC_VM_CMDS
then
echo
"cd /opt/hss_sim0609"
>>
$EPC_VM_CMDS
rm
-Rf
$ARCHIVES_LOC
echo
"echo
\"
sudo daemon --unsafe --name=simulated_hss --chdir=/opt/hss_sim0609 ./starthss_real
\"
"
>>
$EPC_VM_CMDS
fi
echo
"sudo daemon --unsafe --name=simulated_hss --chdir=/opt/hss_sim0609 ./starthss_real"
>>
$EPC_VM_CMDS
mkdir
--parents
$ARCHIVES_LOC
echo
"echo
\"
cd /opt/ltebox/tools/
\"
"
>>
$EPC_VM_CMDS
EPC_VM_NAME
=
`
echo
$VM_NAME
|
sed
-e
"s#basic-sim#epc#"
`
echo
"cd /opt/ltebox/tools/"
>>
$EPC_VM_CMDS
LTEBOX
=
0
echo
"echo
\"
sudo ./start_ltebox
\"
"
>>
$EPC_VM_CMDS
if
[
-d
/opt/ltebox-archives/
]
echo
"nohup sudo ./start_ltebox > /home/ubuntu/ltebox.txt"
>>
$EPC_VM_CMDS
then
# Checking if all ltebox archives are available to run ltebx epc on a brand new VM
if
[
-f
/opt/ltebox-archives/ltebox_2.2.70_16_04_amd64.deb
]
&&
[
-f
/opt/ltebox-archives/etc-conf.zip
]
&&
[
-f
/opt/ltebox-archives/hss-sim.zip
]
then
echo
"############################################################"
echo
"Test EPC on VM (
$EPC_VM_NAME
) will be using ltebox"
echo
"############################################################"
LTEBOX
=
1
fi
fi
# Here we could have other types of EPC detection
# Do we need to start the EPC VM
EPC_VM_CMDS
=
`
echo
$VM_CMDS
|
sed
-e
"s#cmds#epc-cmds#"
`
echo
"EPC_VM_CMD_FILE =
$EPC_VM_CMDS
"
IS_EPC_VM_ALIVE
=
`
uvt-kvm list |
grep
-c
$EPC_VM_NAME
`
if
[
$IS_EPC_VM_ALIVE
-eq
0
]
then
echo
"############################################################"
echo
"Creating test EPC VM (
$EPC_VM_NAME
) on Ubuntu Cloud Image base"
echo
"############################################################"
uvt-kvm create
$EPC_VM_NAME
release
=
xenial
--unsafe-caching
fi
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
<
$EPC_VM_CMDS
uvt-kvm
wait
$EPC_VM_NAME
--insecure
rm
-f
$EPC_VM_CMDS
EPC_VM_IP_ADDR
=
`
uvt-kvm ip
$EPC_VM_NAME
`
echo
"
$EPC_VM_NAME
has for IP addr =
$EPC_VM_IP_ADDR
"
scp
-o
StrictHostKeyChecking
=
no /etc/apt/apt.conf.d/01proxy ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu
# ltebox specific actions (install and start)
LTE_BOX_TO_INSTALL
=
1
if
[
$LTEBOX
-eq
1
]
then
echo
"ls -ls /opt/ltebox/tools/start_ltebox"
>
$EPC_VM_CMDS
RESPONSE
=
`
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
<
$EPC_VM_CMDS
`
NB_EXES
=
`
echo
$RESPONSE
|
grep
-c
ltebox
`
if
[
$NB_EXES
-eq
1
]
;
then
LTE_BOX_TO_INSTALL
=
0
;
fi
fi
# We may have some adaptation to do
if
[
$LTEBOX
-eq
1
]
&&
[
$LTE_BOX_TO_INSTALL
-eq
1
]
if
[
-f
/opt/ltebox-archives/adapt_ue_sim.txt
]
then
then
echo
"############################################################"
echo
"############################################################"
echo
"Doing some adaptation on UE side"
echo
"Copying ltebox archives into EPC VM (
$EPC_VM_NAME
)"
echo
"############################################################"
scp
-o
StrictHostKeyChecking
=
no /opt/ltebox-archives/ltebox_2.2.70_16_04_amd64.deb ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu
scp
-o
StrictHostKeyChecking
=
no /opt/ltebox-archives/etc-conf.zip ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu
scp
-o
StrictHostKeyChecking
=
no /opt/ltebox-archives/hss-sim.zip ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu
echo
"############################################################"
echo
"Install EPC on EPC VM (
$EPC_VM_NAME
)"
echo
"############################################################"
echo
"############################################################"
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
< /opt/ltebox-archives/adapt_ue_sim.txt
echo
"sudo cp 01proxy /etc/apt/apt.conf.d/"
>
$EPC_VM_CMDS
echo
"touch /home/ubuntu/.hushlogin"
>>
$EPC_VM_CMDS
echo
"echo
\"
sudo apt-get --yes --quiet install zip openjdk-8-jre libconfuse-dev libreadline-dev liblog4c-dev libgcrypt-dev libsctp-dev python2.7 python2.7-dev daemon iperf
\"
"
>>
$EPC_VM_CMDS
echo
"sudo apt-get update > zip-install.txt 2>&1"
>>
$EPC_VM_CMDS
echo
"sudo apt-get --yes install zip openjdk-8-jre libconfuse-dev libreadline-dev liblog4c-dev libgcrypt-dev libsctp-dev python2.7 python2.7-dev daemon iperf >> zip-install.txt 2>&1"
>>
$EPC_VM_CMDS
# Installing HSS
echo
"echo
\"
cd /opt
\"
"
>>
$EPC_VM_CMDS
echo
"cd /opt"
>>
$EPC_VM_CMDS
echo
"echo
\"
sudo unzip -qq /home/ubuntu/hss-sim.zip
\"
"
>>
$EPC_VM_CMDS
echo
"sudo unzip -qq /home/ubuntu/hss-sim.zip"
>>
$EPC_VM_CMDS
echo
"echo
\"
cd /opt/hss_sim0609
\"
"
>>
$EPC_VM_CMDS
echo
"cd /opt/hss_sim0609"
>>
$EPC_VM_CMDS
# Installing ltebox
echo
"echo
\"
cd /home/ubuntu
\"
"
>>
$EPC_VM_CMDS
echo
"cd /home/ubuntu"
>>
$EPC_VM_CMDS
echo
"echo
\"
sudo dpkg -i ltebox_2.2.70_16_04_amd64.deb
\"
"
>>
$EPC_VM_CMDS
echo
"sudo dpkg -i ltebox_2.2.70_16_04_amd64.deb >> zip-install.txt 2>&1"
>>
$EPC_VM_CMDS
echo
"echo
\"
cd /opt/ltebox/etc/
\"
"
>>
$EPC_VM_CMDS
echo
"cd /opt/ltebox/etc/"
>>
$EPC_VM_CMDS
echo
"echo
\"
sudo unzip -qq -o /home/ubuntu/etc-conf.zip
\"
"
>>
$EPC_VM_CMDS
echo
"sudo unzip -qq -o /home/ubuntu/etc-conf.zip"
>>
$EPC_VM_CMDS
echo
"sudo sed -i -e 's#EPC_VM_IP_ADDRESS#
$EPC_VM_IP_ADDR
#' gw.conf"
>>
$EPC_VM_CMDS
echo
"sudo sed -i -e 's#EPC_VM_IP_ADDRESS#
$EPC_VM_IP_ADDR
#' mme.conf"
>>
$EPC_VM_CMDS
fi
fi
i
=
"0"
# Starting EPC
echo
"ifconfig tun5 | egrep -c
\"
inet addr
\"
"
>
$EPC_VM_CMDS
if
[
$LTEBOX
-eq
1
]
while
[
$i
-lt
10
]
then
do
echo
"############################################################"
sleep
2
echo
"Start EPC on EPC VM (
$EPC_VM_NAME
)"
CONNECTED
=
`
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
<
$EPC_VM_CMDS
`
echo
"############################################################"
if
[
$CONNECTED
-eq
1
]
echo
"echo
\"
cd /opt/hss_sim0609
\"
"
>>
$EPC_VM_CMDS
echo
"cd /opt/hss_sim0609"
>>
$EPC_VM_CMDS
echo
"echo
\"
sudo daemon --unsafe --name=simulated_hss --chdir=/opt/hss_sim0609 ./starthss_real
\"
"
>>
$EPC_VM_CMDS
echo
"sudo daemon --unsafe --name=simulated_hss --chdir=/opt/hss_sim0609 ./starthss_real"
>>
$EPC_VM_CMDS
echo
"echo
\"
cd /opt/ltebox/tools/
\"
"
>>
$EPC_VM_CMDS
echo
"cd /opt/ltebox/tools/"
>>
$EPC_VM_CMDS
echo
"echo
\"
sudo ./start_ltebox
\"
"
>>
$EPC_VM_CMDS
echo
"nohup sudo ./start_ltebox > /home/ubuntu/ltebox.txt"
>>
$EPC_VM_CMDS
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
<
$EPC_VM_CMDS
rm
-f
$EPC_VM_CMDS
# We may have some adaptation to do
if
[
-f
/opt/ltebox-archives/adapt_ue_sim.txt
]
then
then
i
=
"100"
echo
"############################################################"
else
echo
"Doing some adaptation on UE side"
i
=
$[$i
+1]
echo
"############################################################"
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
< /opt/ltebox-archives/adapt_ue_sim.txt
fi
fi
done
rm
$EPC_VM_CMDS
i
=
"0"
if
[
$i
-lt
50
]
echo
"ifconfig tun5 | egrep -c
\"
inet addr
\"
"
>
$EPC_VM_CMDS
while
[
$i
-lt
10
]
do
sleep
2
CONNECTED
=
`
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
<
$EPC_VM_CMDS
`
if
[
$CONNECTED
-eq
1
]
then
i
=
"100"
else
i
=
$[$i
+1]
fi
done
rm
$EPC_VM_CMDS
if
[
$i
-lt
50
]
then
echo
"Problem w/ starting ltebox EPC"
exit
-1
fi
fi
# HERE ADD ANY INSTALL ACTIONS FOR ANOTHER EPC
# Retrieve EPC real IP address
if
[
$LTEBOX
-eq
1
]
then
# in our configuration file, we are using pool 5
echo
"ifconfig tun5 | egrep
\"
inet addr
\"
| sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*
\$
##'"
>
$EPC_VM_CMDS
REAL_EPC_IP_ADDR
=
`
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
<
$EPC_VM_CMDS
`
echo
"EPC IP Address is :
$REAL_EPC_IP_ADDR
"
rm
$EPC_VM_CMDS
fi
echo
"############################################################"
echo
"Starting the eNB in FDD-5MHz mode"
echo
"############################################################"
CURRENT_ENB_LOG_FILE
=
fdd_05MHz_enb.log
start_basic_sim_enb
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_IP_ADDR
$CURRENT_ENB_LOG_FILE
25 lte-fdd-basic-sim.conf
echo
"############################################################"
echo
"Starting the UE in FDD-5MHz mode"
echo
"############################################################"
CURRENT_UE_LOG_FILE
=
fdd_05MHz_ue.log
start_basic_sim_ue
$VM_CMDS
$VM_IP_ADDR
$CURRENT_UE_LOG_FILE
25 2680
if
[
$UE_SYNC
-eq
0
]
then
then
echo
"Problem w/ starting ltebox EPC"
echo
"Problem w/ eNB and UE not syncing"
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
terminate_ltebox_epc
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
exit
-1
exit
-1
fi
fi
fi
get_ue_ip_addr
$VM_CMDS
$VM_IP_ADDR
# HERE ADD ANY INSTALL ACTIONS FOR ANOTHER EPC
echo
"############################################################"
echo
"Pinging the UE"
echo
"############################################################"
PING_LOG_FILE
=
fdd_05MHz_ping_ue.txt
ping_ue_ip_addr
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
$UE_IP_ADDR
$PING_LOG_FILE
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
$PING_LOG_FILE
$ARCHIVES_LOC
check_ping_result
$ARCHIVES_LOC
/
$PING_LOG_FILE
20
# Retrieve EPC real IP address
echo
"############################################################"
if
[
$LTEBOX
-eq
1
]
echo
"Iperf DL"
then
echo
"############################################################"
# in our configuration file, we are using pool 5
CURR_IPERF_LOG_BASE
=
fdd_05MHz_iperf_dl
echo
"ifconfig tun5 | egrep
\"
inet addr
\"
| sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*
\$
##'"
>
$EPC_VM_CMDS
iperf_dl
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
15
$CURR_IPERF_LOG_BASE
REAL_EPC_IP_ADDR
=
`
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
<
$EPC_VM_CMDS
`
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
${
CURR_IPERF_LOG_BASE
}
_client.txt
$ARCHIVES_LOC
echo
"EPC IP Address is :
$REAL_EPC_IP_ADDR
"
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
${
CURR_IPERF_LOG_BASE
}
_server.txt
$ARCHIVES_LOC
rm
$EPC_VM_CMDS
check_iperf
$ARCHIVES_LOC
/
$CURR_IPERF_LOG_BASE
15
fi
echo
"############################################################"
echo
"############################################################"
echo
"Starting the eNB in FDD-5MHz mode"
echo
"Iperf UL"
echo
"############################################################"
echo
"############################################################"
CURRENT_ENB_LOG_FILE
=
fdd_05MHz_enb.log
CURR_IPERF_LOG_BASE
=
fdd_05MHz_iperf_ul
start_basic_sim_enb
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_IP_ADDR
$CURRENT_ENB_LOG_FILE
25 lte-fdd-basic-sim.conf
iperf_ul
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
2
$CURR_IPERF_LOG_BASE
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
${
CURR_IPERF_LOG_BASE
}
_server.txt
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
${
CURR_IPERF_LOG_BASE
}
_client.txt
$ARCHIVES_LOC
check_iperf
$ARCHIVES_LOC
/
$CURR_IPERF_LOG_BASE
2
echo
"############################################################"
echo
"############################################################"
echo
"Starting the UE in FDD-5MHz mode"
echo
"Terminate enb/ue simulators"
echo
"############################################################"
echo
"############################################################"
CURRENT_UE_LOG_FILE
=
fdd_05MHz_ue.log
start_basic_sim_ue
$VM_CMDS
$VM_IP_ADDR
$CURRENT_UE_LOG_FILE
25 2680
if
[
$UE_SYNC
-eq
0
]
then
echo
"Problem w/ eNB and UE not syncing"
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
terminate_ltebox_epc
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
sleep
10
exit
-1
fi
get_ue_ip_addr
$VM_CMDS
$VM_IP_ADDR
echo
"############################################################"
echo
"############################################################"
echo
"Pinging the UE"
echo
"Starting the eNB in FDD-10MHz mode"
echo
"############################################################"
echo
"############################################################"
PING_LOG_FILE
=
fdd_05MHz_ping_ue.txt
CURRENT_ENB_LOG_FILE
=
fdd_10MHz_enb.log
ping_ue_ip_addr
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
$UE_IP_ADDR
$PING_LOG_FILE
start_basic_sim_enb
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_IP_ADDR
$CURRENT_ENB_LOG_FILE
50 lte-fdd-basic-sim.conf
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
$PING_LOG_FILE
$ARCHIVES_LOC
check_ping_result
$ARCHIVES_LOC
/
$PING_LOG_FILE
20
echo
"############################################################"
echo
"############################################################"
echo
"Iperf DL"
echo
"Starting the UE in FDD-10MHz mode"
echo
"############################################################"
echo
"############################################################"
CURR_IPERF_LOG_BASE
=
fdd_05MHz_iperf_dl
CURRENT_UE_LOG_FILE
=
fdd_10MHz_ue.log
iperf_dl
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
15
$CURR_IPERF_LOG_BASE
start_basic_sim_ue
$VM_CMDS
$VM_IP_ADDR
$CURRENT_UE_LOG_FILE
50 2680
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
${
CURR_IPERF_LOG_BASE
}
_client.txt
$ARCHIVES_LOC
if
[
$UE_SYNC
-eq
0
]
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
${
CURR_IPERF_LOG_BASE
}
_server.txt
$ARCHIVES_LOC
then
check_iperf
$ARCHIVES_LOC
/
$CURR_IPERF_LOG_BASE
15
echo
"Problem w/ eNB and UE not syncing"
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
terminate_ltebox_epc
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
exit
-1
fi
get_ue_ip_addr
$VM_CMDS
$VM_IP_ADDR
echo
"############################################################"
echo
"############################################################"
echo
"Iperf UL"
echo
"Pinging the UE"
echo
"############################################################"
echo
"############################################################"
CURR_IPERF_LOG_BASE
=
fdd_05MHz_iperf_ul
PING_LOG_FILE
=
fdd_10MHz_ping_ue.txt
iperf_ul
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
2
$CURR_IPERF_LOG_BASE
ping_ue_ip_addr
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
$UE_IP_ADDR
$PING_LOG_FILE
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
${
CURR_IPERF_LOG_BASE
}
_server.txt
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
$PING_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
${
CURR_IPERF_LOG_BASE
}
_client.txt
$ARCHIVES_LOC
check_ping_result
$ARCHIVES_LOC
/
$PING_LOG_FILE
20
check_iperf
$ARCHIVES_LOC
/
$CURR_IPERF_LOG_BASE
2
echo
"############################################################"
echo
"############################################################"
echo
"Terminate enb/ue simulators
"
echo
"Iperf DL
"
echo
"############################################################"
echo
"############################################################"
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
CURR_IPERF_LOG_BASE
=
fdd_10MHz_iperf_dl
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
iperf_dl
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
15
$CURR_IPERF_LOG_BASE
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
${
CURR_IPERF_LOG_BASE
}
_client.txt
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
${
CURR_IPERF_LOG_BASE
}
_server.txt
$ARCHIVES_LOC
sleep
10
check_iperf
$ARCHIVES_LOC
/
$CURR_IPERF_LOG_BASE
15
echo
"############################################################"
echo
"############################################################"
echo
"Starting the eNB in FDD-10MHz mode"
echo
"Iperf UL"
echo
"############################################################"
echo
"############################################################"
CURRENT_ENB_LOG_FILE
=
fdd_10MHz_enb.log
CURR_IPERF_LOG_BASE
=
fdd_10MHz_iperf_ul
start_basic_sim_enb
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_IP_ADDR
$CURRENT_ENB_LOG_FILE
50 lte-fdd-basic-sim.conf
iperf_ul
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
2
$CURR_IPERF_LOG_BASE
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
${
CURR_IPERF_LOG_BASE
}
_server.txt
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
${
CURR_IPERF_LOG_BASE
}
_client.txt
$ARCHIVES_LOC
check_iperf
$ARCHIVES_LOC
/
$CURR_IPERF_LOG_BASE
2
echo
"############################################################"
echo
"############################################################"
echo
"Starting the UE in FDD-10MHz mode"
echo
"Terminate enb/ue simulators"
echo
"############################################################"
echo
"############################################################"
CURRENT_UE_LOG_FILE
=
fdd_10MHz_ue.log
start_basic_sim_ue
$VM_CMDS
$VM_IP_ADDR
$CURRENT_UE_LOG_FILE
50 2680
if
[
$UE_SYNC
-eq
0
]
then
echo
"Problem w/ eNB and UE not syncing"
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
terminate_ltebox_epc
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
sleep
10
exit
-1
fi
get_ue_ip_addr
$VM_CMDS
$VM_IP_ADDR
echo
"############################################################"
echo
"############################################################"
echo
"Pinging the UE"
echo
"Starting the eNB in FDD-20MHz mode"
echo
"############################################################"
echo
"############################################################"
PING_LOG_FILE
=
fdd_10MHz_ping_ue.txt
CURRENT_ENB_LOG_FILE
=
fdd_20MHz_enb.log
ping_ue_ip_addr
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
$UE_IP_ADDR
$PING_LOG_FILE
start_basic_sim_enb
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_IP_ADDR
$CURRENT_ENB_LOG_FILE
100 lte-fdd-basic-sim.conf
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
$PING_LOG_FILE
$ARCHIVES_LOC
check_ping_result
$ARCHIVES_LOC
/
$PING_LOG_FILE
20
echo
"############################################################"
echo
"Iperf DL"
echo
"############################################################"
CURR_IPERF_LOG_BASE
=
fdd_10MHz_iperf_dl
iperf_dl
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
15
$CURR_IPERF_LOG_BASE
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
${
CURR_IPERF_LOG_BASE
}
_client.txt
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
${
CURR_IPERF_LOG_BASE
}
_server.txt
$ARCHIVES_LOC
check_iperf
$ARCHIVES_LOC
/
$CURR_IPERF_LOG_BASE
15
echo
"############################################################"
echo
"############################################################"
echo
"Iperf UL"
echo
"Starting the UE in FDD-20MHz mode"
echo
"############################################################"
echo
"############################################################"
CURR_IPERF_LOG_BASE
=
fdd_10MHz_iperf_ul
CURRENT_UE_LOG_FILE
=
fdd_20MHz_ue.log
iperf_ul
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
2
$CURR_IPERF_LOG_BASE
start_basic_sim_ue
$VM_CMDS
$VM_IP_ADDR
$CURRENT_UE_LOG_FILE
100 2680
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
${
CURR_IPERF_LOG_BASE
}
_server.txt
$ARCHIVES_LOC
if
[
$UE_SYNC
-eq
0
]
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
${
CURR_IPERF_LOG_BASE
}
_client.txt
$ARCHIVES_LOC
then
check_iperf
$ARCHIVES_LOC
/
$CURR_IPERF_LOG_BASE
2
echo
"Problem w/ eNB and UE not syncing"
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
terminate_ltebox_epc
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
exit
-1
fi
get_ue_ip_addr
$VM_CMDS
$VM_IP_ADDR
echo
"############################################################"
echo
"############################################################"
echo
"Terminate enb/ue simulators"
echo
"Pinging the UE"
echo
"############################################################"
echo
"############################################################"
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
PING_LOG_FILE
=
fdd_20MHz_ping_ue.txt
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
ping_ue_ip_addr
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
$UE_IP_ADDR
$PING_LOG_FILE
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
$PING_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
check_ping_result
$ARCHIVES_LOC
/
$PING_LOG_FILE
20
sleep
10
echo
"############################################################"
echo
"############################################################"
echo
"Starting the eNB in FDD-20MHz mode"
echo
"Iperf DL"
echo
"############################################################"
echo
"############################################################"
CURRENT_ENB_LOG_FILE
=
fdd_20MHz_enb.log
CURR_IPERF_LOG_BASE
=
fdd_20MHz_iperf_dl
start_basic_sim_enb
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_IP_ADDR
$CURRENT_ENB_LOG_FILE
100 lte-fdd-basic-sim.conf
iperf_dl
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
15
$CURR_IPERF_LOG_BASE
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
${
CURR_IPERF_LOG_BASE
}
_client.txt
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
${
CURR_IPERF_LOG_BASE
}
_server.txt
$ARCHIVES_LOC
check_iperf
$ARCHIVES_LOC
/
$CURR_IPERF_LOG_BASE
15
echo
"############################################################"
echo
"############################################################"
echo
"Starting the UE in FDD-20MHz mode"
echo
"Terminate enb/ue simulators"
echo
"############################################################"
echo
"############################################################"
CURRENT_UE_LOG_FILE
=
fdd_20MHz_ue.log
start_basic_sim_ue
$VM_CMDS
$VM_IP_ADDR
$CURRENT_UE_LOG_FILE
100 2680
if
[
$UE_SYNC
-eq
0
]
then
echo
"Problem w/ eNB and UE not syncing"
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
terminate_ltebox_epc
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
sleep
10
exit
-1
fi
get_ue_ip_addr
$VM_CMDS
$VM_IP_ADDR
echo
"############################################################"
echo
"Pinging the UE"
echo
"############################################################"
PING_LOG_FILE
=
fdd_20MHz_ping_ue.txt
ping_ue_ip_addr
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
$UE_IP_ADDR
$PING_LOG_FILE
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
$PING_LOG_FILE
$ARCHIVES_LOC
check_ping_result
$ARCHIVES_LOC
/
$PING_LOG_FILE
20
echo
"############################################################"
echo
"############################################################"
echo
"Iperf DL"
echo
"Starting the eNB in TDD-5MHz mode"
echo
"############################################################"
echo
"############################################################"
CURR_IPERF_LOG_BASE
=
fdd_20MHz_iperf_dl
CURRENT_ENB_LOG_FILE
=
tdd_05MHz_enb.log
iperf_dl
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
15
$CURR_IPERF_LOG_BASE
start_basic_sim_enb
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_IP_ADDR
$CURRENT_ENB_LOG_FILE
25 lte-tdd-basic-sim.conf
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
${
CURR_IPERF_LOG_BASE
}
_client.txt
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
${
CURR_IPERF_LOG_BASE
}
_server.txt
$ARCHIVES_LOC
check_iperf
$ARCHIVES_LOC
/
$CURR_IPERF_LOG_BASE
15
echo
"############################################################"
echo
"############################################################"
echo
"Terminate enb/ue simulators"
echo
"Starting the UE in TDD-5MHz mode"
echo
"############################################################"
echo
"############################################################"
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
CURRENT_UE_LOG_FILE
=
tdd_05MHz_ue.log
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
start_basic_sim_ue
$VM_CMDS
$VM_IP_ADDR
$CURRENT_UE_LOG_FILE
25 2350
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
if
[
$UE_SYNC
-eq
0
]
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
then
sleep
10
echo
"Problem w/ eNB and UE not syncing"
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
terminate_ltebox_epc
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
exit
-1
fi
get_ue_ip_addr
$VM_CMDS
$VM_IP_ADDR
echo
"############################################################"
echo
"############################################################"
echo
"Starting the eNB in TDD-5MHz mode"
echo
"Pinging the UE"
echo
"############################################################"
echo
"############################################################"
CURRENT_ENB_LOG_FILE
=
tdd_05MHz_enb.log
PING_LOG_FILE
=
tdd_05MHz_ping_ue.txt
start_basic_sim_enb
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_IP_ADDR
$CURRENT_ENB_LOG_FILE
25 lte-tdd-basic-sim.conf
ping_ue_ip_addr
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
$UE_IP_ADDR
$PING_LOG_FILE
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
$PING_LOG_FILE
$ARCHIVES_LOC
check_ping_result
$ARCHIVES_LOC
/
$PING_LOG_FILE
20
# Bug in TDD 5Mhz --- not running it
# echo "############################################################"
# echo "Iperf DL"
# echo "############################################################"
# CURR_IPERF_LOG_BASE=tdd_05MHz_iperf_dl
# iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 6 $CURR_IPERF_LOG_BASE
# scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
# scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
# check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 6
echo
"############################################################"
echo
"############################################################"
echo
"Starting the UE in TDD-5MHz mode"
echo
"Terminate enb/ue simulators"
echo
"############################################################"
echo
"############################################################"
CURRENT_UE_LOG_FILE
=
tdd_05MHz_ue.log
start_basic_sim_ue
$VM_CMDS
$VM_IP_ADDR
$CURRENT_UE_LOG_FILE
25 2350
if
[
$UE_SYNC
-eq
0
]
then
echo
"Problem w/ eNB and UE not syncing"
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
terminate_ltebox_epc
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
sleep
10
exit
-1
fi
get_ue_ip_addr
$VM_CMDS
$VM_IP_ADDR
echo
"############################################################"
echo
"############################################################"
echo
"Pinging the UE"
echo
"Starting the eNB in TDD-10MHz mode"
echo
"############################################################"
echo
"############################################################"
PING_LOG_FILE
=
tdd_05MHz_ping_ue.txt
CURRENT_ENB_LOG_FILE
=
tdd_10MHz_enb.log
ping_ue_ip_addr
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
$UE_IP_ADDR
$PING_LOG_FILE
start_basic_sim_enb
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_IP_ADDR
$CURRENT_ENB_LOG_FILE
50 lte-tdd-basic-sim.conf
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
$PING_LOG_FILE
$ARCHIVES_LOC
check_ping_result
$ARCHIVES_LOC
/
$PING_LOG_FILE
20
# Bug in TDD 5Mhz --- not running it
# echo "############################################################"
# echo "Iperf DL"
# echo "############################################################"
# CURR_IPERF_LOG_BASE=tdd_05MHz_iperf_dl
# iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 6 $CURR_IPERF_LOG_BASE
# scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
# scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
# check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 6
echo
"############################################################"
echo
"############################################################"
echo
"Terminate enb/ue simulators"
echo
"Starting the UE in TDD-10MHz mode"
echo
"############################################################"
echo
"############################################################"
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
CURRENT_UE_LOG_FILE
=
tdd_10MHz_ue.log
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
start_basic_sim_ue
$VM_CMDS
$VM_IP_ADDR
$CURRENT_UE_LOG_FILE
50 2350
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
if
[
$UE_SYNC
-eq
0
]
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
then
sleep
10
echo
"Problem w/ eNB and UE not syncing"
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
terminate_ltebox_epc
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
exit
-1
fi
get_ue_ip_addr
$VM_CMDS
$VM_IP_ADDR
echo
"############################################################"
echo
"############################################################"
echo
"Starting the eNB in TDD-10MHz mode"
echo
"Pinging the UE"
echo
"############################################################"
echo
"############################################################"
CURRENT_ENB_LOG_FILE
=
tdd_10MHz_enb.log
PING_LOG_FILE
=
tdd_10MHz_ping_ue.txt
start_basic_sim_enb
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_IP_ADDR
$CURRENT_ENB_LOG_FILE
50 lte-tdd-basic-sim.conf
ping_ue_ip_addr
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
$UE_IP_ADDR
$PING_LOG_FILE
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
$PING_LOG_FILE
$ARCHIVES_LOC
check_ping_result
$ARCHIVES_LOC
/
$PING_LOG_FILE
20
echo
"############################################################"
echo
"############################################################"
echo
"Starting the UE in TDD-10MHz mode"
echo
"Iperf DL"
echo
"############################################################"
echo
"############################################################"
CURRENT_UE_LOG_FILE
=
tdd_10MHz_ue.log
CURR_IPERF_LOG_BASE
=
tdd_10MHz_iperf_dl
start_basic_sim_ue
$VM_CMDS
$VM_IP_ADDR
$CURRENT_UE_LOG_FILE
50 2350
iperf_dl
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
6
$CURR_IPERF_LOG_BASE
if
[
$UE_SYNC
-eq
0
]
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
${
CURR_IPERF_LOG_BASE
}
_client.txt
$ARCHIVES_LOC
then
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
${
CURR_IPERF_LOG_BASE
}
_server.txt
$ARCHIVES_LOC
echo
"Problem w/ eNB and UE not syncing"
check_iperf
$ARCHIVES_LOC
/
$CURR_IPERF_LOG_BASE
6
echo
"############################################################"
echo
"Terminate enb/ue simulators"
echo
"############################################################"
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
terminate_ltebox_epc
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
sleep
10
exit
-1
fi
get_ue_ip_addr
$VM_CMDS
$VM_IP_ADDR
echo
"############################################################"
echo
"############################################################"
echo
"Pinging the UE"
echo
"Starting the eNB in TDD-20MHz mode"
echo
"############################################################"
echo
"############################################################"
PING_LOG_FILE
=
tdd_10MHz_ping_ue.txt
CURRENT_ENB_LOG_FILE
=
tdd_20MHz_enb.log
ping_ue_ip_addr
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
$UE_IP_ADDR
$PING_LOG_FILE
start_basic_sim_enb
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_IP_ADDR
$CURRENT_ENB_LOG_FILE
100 lte-tdd-basic-sim.conf
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
$PING_LOG_FILE
$ARCHIVES_LOC
check_ping_result
$ARCHIVES_LOC
/
$PING_LOG_FILE
20
echo
"############################################################"
echo
"############################################################"
echo
"Iperf DL"
echo
"Starting the UE in TDD-20MHz mode"
echo
"############################################################"
echo
"############################################################"
CURR_IPERF_LOG_BASE
=
tdd_10MHz_iperf_dl
CURRENT_UE_LOG_FILE
=
tdd_20MHz_ue.log
iperf_dl
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
6
$CURR_IPERF_LOG_BASE
start_basic_sim_ue
$VM_CMDS
$VM_IP_ADDR
$CURRENT_UE_LOG_FILE
100 2350
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
${
CURR_IPERF_LOG_BASE
}
_client.txt
$ARCHIVES_LOC
if
[
$UE_SYNC
-eq
0
]
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
${
CURR_IPERF_LOG_BASE
}
_server.txt
$ARCHIVES_LOC
then
check_iperf
$ARCHIVES_LOC
/
$CURR_IPERF_LOG_BASE
6
echo
"Problem w/ eNB and UE not syncing"
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
terminate_ltebox_epc
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
exit
-1
fi
get_ue_ip_addr
$VM_CMDS
$VM_IP_ADDR
echo
"############################################################"
echo
"############################################################"
echo
"Terminate enb/ue simulators"
echo
"Pinging the UE"
echo
"############################################################"
echo
"############################################################"
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
PING_LOG_FILE
=
tdd_20MHz_ping_ue.txt
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
ping_ue_ip_addr
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
$UE_IP_ADDR
$PING_LOG_FILE
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
$PING_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
check_ping_result
$ARCHIVES_LOC
/
$PING_LOG_FILE
20
sleep
10
echo
"############################################################"
echo
"############################################################"
echo
"Starting the eNB in TDD-20MHz mode"
echo
"Iperf DL"
echo
"############################################################"
echo
"############################################################"
CURRENT_ENB_LOG_FILE
=
tdd_20MHz_enb.log
CURR_IPERF_LOG_BASE
=
tdd_20MHz_iperf_dl
start_basic_sim_enb
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_IP_ADDR
$CURRENT_ENB_LOG_FILE
100 lte-tdd-basic-sim.conf
iperf_dl
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
6
$CURR_IPERF_LOG_BASE
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
${
CURR_IPERF_LOG_BASE
}
_client.txt
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
${
CURR_IPERF_LOG_BASE
}
_server.txt
$ARCHIVES_LOC
check_iperf
$ARCHIVES_LOC
/
$CURR_IPERF_LOG_BASE
6
echo
"############################################################"
echo
"############################################################"
echo
"Starting the UE in TDD-20MHz mode"
echo
"Terminate enb/ue simulators"
echo
"############################################################"
echo
"############################################################"
CURRENT_UE_LOG_FILE
=
tdd_20MHz_ue.log
start_basic_sim_ue
$VM_CMDS
$VM_IP_ADDR
$CURRENT_UE_LOG_FILE
100 2350
if
[
$UE_SYNC
-eq
0
]
then
echo
"Problem w/ eNB and UE not syncing"
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
terminate_ltebox_epc
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
sleep
10
exit
-1
fi
get_ue_ip_addr
$VM_CMDS
$VM_IP_ADDR
echo
"############################################################"
echo
"Pinging the UE"
echo
"############################################################"
PING_LOG_FILE
=
tdd_20MHz_ping_ue.txt
ping_ue_ip_addr
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
$UE_IP_ADDR
$PING_LOG_FILE
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
$PING_LOG_FILE
$ARCHIVES_LOC
check_ping_result
$ARCHIVES_LOC
/
$PING_LOG_FILE
20
echo
"############################################################"
echo
"Iperf DL"
echo
"############################################################"
CURR_IPERF_LOG_BASE
=
tdd_20MHz_iperf_dl
iperf_dl
$VM_CMDS
$VM_IP_ADDR
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
6
$CURR_IPERF_LOG_BASE
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$EPC_VM_IP_ADDR
:/home/ubuntu/
${
CURR_IPERF_LOG_BASE
}
_client.txt
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
${
CURR_IPERF_LOG_BASE
}
_server.txt
$ARCHIVES_LOC
check_iperf
$ARCHIVES_LOC
/
$CURR_IPERF_LOG_BASE
6
echo
"############################################################"
echo
"Terminate enb/ue simulators"
echo
"############################################################"
terminate_enb_ue_basic_sim
$VM_CMDS
$VM_IP_ADDR
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
$CURRENT_UE_LOG_FILE
$ARCHIVES_LOC
recover_core_dump
$VM_CMDS
$VM_IP_ADDR
$ARCHIVES_LOC
/
$CURRENT_ENB_LOG_FILE
$ARCHIVES_LOC
sleep
10
echo
"############################################################"
echo
"Terminate EPC"
echo
"############################################################"
if
[
$LTEBOX
-eq
1
]
echo
"############################################################"
then
echo
"Terminate EPC"
terminate_ltebox_epc
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
echo
"############################################################"
fi
echo
"############################################################"
if
[
$LTEBOX
-eq
1
]
echo
"Checking run status"
then
echo
"############################################################"
terminate_ltebox_epc
$EPC_VM_CMDS
$EPC_VM_IP_ADDR
fi
if
[
$PING_STATUS
-ne
0
]
;
then
STATUS
=
-1
;
fi
if
[
$KEEP_VM_ALIVE
-eq
0
]
if
[
$IPERF_STATUS
-ne
0
]
;
then
STATUS
=
-1
;
fi
then
echo
"############################################################"
echo
"Destroying VMs"
echo
"############################################################"
uvt-kvm destroy
$VM_NAME
ssh-keygen
-R
$VM_IP_ADDR
uvt-kvm destroy
$EPC_VM_NAME
ssh-keygen
-R
$EPC_VM_IP_ADDR
fi
fi
echo
"############################################################"
echo
"Checking run status"
echo
"############################################################"
if
[
$STATUS
-eq
0
]
if
[
$PING_STATUS
-ne
0
]
;
then
STATUS
=
-1
;
fi
then
if
[
$IPERF_STATUS
-ne
0
]
;
then
STATUS
=
-1
;
fi
echo
"STATUS seems OK"
else
echo
"STATUS failed?"
fi
exit
$STATUS
fi
}
ci-scripts/waitBuildOnVM.sh
View file @
4bb2b8a2
...
@@ -20,8 +20,8 @@
...
@@ -20,8 +20,8 @@
# * contact@openairinterface.org
# * contact@openairinterface.org
# */
# */
function
usage
{
function
wait_
usage
{
echo
"OAI
VM Build Check
script"
echo
"OAI
CI VM
script"
echo
" Original Author: Raphael Defosseux"
echo
" Original Author: Raphael Defosseux"
echo
" Requirements:"
echo
" Requirements:"
echo
" -- uvtool uvtool-libvirt apt-cacher"
echo
" -- uvtool uvtool-libvirt apt-cacher"
...
@@ -31,9 +31,9 @@ function usage {
...
@@ -31,9 +31,9 @@ function usage {
echo
""
echo
""
echo
"Usage:"
echo
"Usage:"
echo
"------"
echo
"------"
echo
"
waitBuildOnVM.sh
[OPTIONS]"
echo
"
oai-ci-vm-tool wait
[OPTIONS]"
echo
""
echo
""
echo
"Options:"
echo
"
Mandatory
Options:"
echo
"--------"
echo
"--------"
echo
" --job-name #### OR -jn ####"
echo
" --job-name #### OR -jn ####"
echo
" Specify the name of the Jenkins job."
echo
" Specify the name of the Jenkins job."
...
@@ -44,16 +44,11 @@ function usage {
...
@@ -44,16 +44,11 @@ function usage {
echo
" --workspace #### OR -ws ####"
echo
" --workspace #### OR -ws ####"
echo
" Specify the workspace."
echo
" Specify the workspace."
echo
""
echo
""
echo
" --variant enb-usrp OR -v1"
variant_usage
echo
" --variant basic-sim OR -v2"
echo
" --variant phy-sim OR -v3"
echo
" --variant cppcheck OR -v4"
echo
" --variant gnb-usrp OR -v5"
echo
" --variant nu-ue-usrp OR -v6"
echo
" --variant enb-ethernet OR -v7"
echo
" --variant ue-ethernet OR -v8"
echo
" Specify the variant to build."
echo
" Specify the variant to build."
echo
""
echo
""
echo
"Options:"
echo
"--------"
echo
" --keep-vm-alive OR -k"
echo
" --keep-vm-alive OR -k"
echo
" Keep the VM alive after the build."
echo
" Keep the VM alive after the build."
echo
""
echo
""
...
@@ -62,345 +57,114 @@ function usage {
...
@@ -62,345 +57,114 @@ function usage {
echo
""
echo
""
}
}
function
variant_usage
{
function
wait_on_vm_build
{
echo
"OAI VM Build Check script"
echo
"############################################################"
echo
" Original Author: Raphael Defosseux"
echo
"OAI CI VM script"
echo
""
echo
"############################################################"
echo
" --variant enb-usrp OR -v1"
echo
" --variant basic-sim OR -v2"
echo
" --variant phy-sim OR -v3"
echo
" --variant cppcheck OR -v4"
echo
" --variant gnb-usrp OR -v5"
echo
" --variant nu-ue-usrp OR -v6"
echo
" --variant enb-ethernet OR -v7"
echo
" --variant ue-ethernet OR -v8"
echo
""
}
if
[
$#
-lt
1
]
||
[
$#
-gt
9
]
then
echo
"Syntax Error: not the correct number of arguments"
echo
""
usage
exit
1
fi
VM_TEMPLATE
=
ci-
JOB_NAME
=
XX
BUILD_ID
=
XX
VM_NAME
=
ci-enb-usrp
VM_MEMORY
=
2048
VM_CPU
=
4
ARCHIVES_LOC
=
enb_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--eNB -w USRP"
KEEP_VM_ALIVE
=
0
while
[[
$#
-gt
0
]]
do
key
=
"
$1
"
case
$key
in
-h
|
--help
)
shift
usage
exit
0
;;
-jn
|
--job-name
)
JOB_NAME
=
"
$2
"
shift
shift
;;
-id
|
--build-id
)
BUILD_ID
=
"
$2
"
shift
shift
;;
-ws
|
--workspace
)
JENKINS_WKSP
=
"
$2
"
shift
shift
;;
-k
|
--keep-vm-alive
)
KEEP_VM_ALIVE
=
1
shift
;;
-v1
)
VM_NAME
=
ci-enb-usrp
ARCHIVES_LOC
=
enb_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--eNB -w USRP --mu"
shift
;;
-v2
)
VM_NAME
=
ci-basic-sim
ARCHIVES_LOC
=
basic_sim
LOG_PATTERN
=
basic_simulator
NB_PATTERN_FILES
=
2
BUILD_OPTIONS
=
"--basic-simulator"
VM_MEMORY
=
8192
VM_CPU
=
4
shift
;;
-v3
)
VM_NAME
=
ci-phy-sim
ARCHIVES_LOC
=
phy_sim
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--phy_simulators"
shift
;;
-v4
)
VM_NAME
=
ci-cppcheck
VM_MEMORY
=
8192
ARCHIVES_LOC
=
cppcheck
LOG_PATTERN
=
cppcheck.xml
NB_PATTERN_FILES
=
1
BUILD_OPTIONS
=
"--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c"
shift
;;
-v5
)
VM_NAME
=
ci-gnb-usrp
ARCHIVES_LOC
=
gnb_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--gNB -w USRP"
shift
;;
-v6
)
VM_NAME
=
ci-ue-nr-usrp
ARCHIVES_LOC
=
nrue_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--nrUE -w USRP"
shift
;;
-v7
)
VM_NAME
=
ci-enb-ethernet
ARCHIVES_LOC
=
enb_eth
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--eNB -t ETHERNET --noS1"
shift
;;
-v8
)
VM_NAME
=
ci-ue-ethernet
ARCHIVES_LOC
=
ue_eth
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--UE -t ETHERNET --noS1"
shift
;;
--variant
)
variant
=
"
$2
"
case
$variant
in
enb-usrp
)
VM_NAME
=
ci-enb-usrp
ARCHIVES_LOC
=
enb_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--eNB -w USRP --mu"
;;
basic-sim
)
VM_NAME
=
ci-basic-sim
ARCHIVES_LOC
=
basic_sim
LOG_PATTERN
=
basic_simulator
NB_PATTERN_FILES
=
2
BUILD_OPTIONS
=
"--basic-simulator"
VM_MEMORY
=
8192
VM_CPU
=
4
;;
phy-sim
)
VM_NAME
=
ci-phy-sim
ARCHIVES_LOC
=
phy_sim
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--phy_simulators"
;;
cppcheck
)
VM_NAME
=
ci-cppcheck
VM_MEMORY
=
8192
ARCHIVES_LOC
=
cppcheck
LOG_PATTERN
=
cppcheck.xml
NB_PATTERN_FILES
=
1
BUILD_OPTIONS
=
"--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c"
;;
gnb-usrp
)
VM_NAME
=
ci-gnb-usrp
ARCHIVES_LOC
=
gnb_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--gNB -w USRP"
;;
nu-ue-usrp
)
VM_NAME
=
ci-ue-nr-usrp
ARCHIVES_LOC
=
nrue_usrp
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
4
BUILD_OPTIONS
=
"--nrUE -w USRP"
;;
enb-ethernet
)
VM_NAME
=
ci-enb-ethernet
ARCHIVES_LOC
=
enb_eth
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--eNB -t ETHERNET --noS1"
;;
ue-ethernet
)
VM_NAME
=
ci-ue-ethernet
ARCHIVES_LOC
=
ue_eth
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--UE -t ETHERNET --noS1"
;;
*
)
echo
""
echo
"Syntax Error: Invalid Variant option ->
$variant
"
echo
""
variant_usage
exit
1
esac
shift
shift
;;
*
)
echo
"Syntax Error: unknown option:
$key
"
echo
""
usage
exit
1
esac
done
if
[
!
-f
$JENKINS_WKSP
/localZip.zip
]
echo
"VM_NAME =
$VM_NAME
"
then
echo
"VM_CMD_FILE =
$VM_CMDS
"
echo
"Missing localZip.zip file!"
echo
"JENKINS_WKSP =
$JENKINS_WKSP
"
exit
1
echo
"ARCHIVES_LOC =
$ARCHIVES_LOC
"
fi
echo
"BUILD_OPTIONS =
$BUILD_OPTIONS
"
if
[
!
-f
/etc/apt/apt.conf.d/01proxy
]
then
echo
"Missing /etc/apt/apt.conf.d/01proxy file!"
echo
"Is apt-cacher installed and configured?"
exit
1
fi
if
[
"
$JOB_NAME
"
==
"XX"
]
||
[
"
$BUILD_ID
"
==
"XX"
]
IS_VM_ALIVE
=
`
uvt-kvm list |
grep
-c
$VM_NAME
`
then
VM_TEMPLATE
=
ci-
else
VM_TEMPLATE
=
${
JOB_NAME
}
-b
${
BUILD_ID
}
-
fi
VM_NAME
=
`
echo
$VM_NAME
|
sed
-e
"s#ci-#
$VM_TEMPLATE
#"
`
if
[
$IS_VM_ALIVE
-eq
0
]
VM_CMDS
=
${
VM_NAME
}
_cmds.txt
then
ARCHIVES_LOC
=
${
JENKINS_WKSP
}
/archives/
${
ARCHIVES_LOC
}
echo
"############################################################"
echo
"You should have created the VM before doing anything"
echo
"############################################################"
STATUS
=
1
return
fi
echo
"VM_NAME =
$VM_NAME
"
echo
"Waiting for VM to be started"
echo
"VM_CMD_FILE =
$VM_CMDS
"
uvt-kvm
wait
$VM_NAME
--insecure
echo
"JENKINS_WKSP =
$JENKINS_WKSP
"
echo
"ARCHIVES_LOC =
$ARCHIVES_LOC
"
echo
"BUILD_OPTIONS =
$BUILD_OPTIONS
"
IS_VM_ALIVE
=
`
uvt-kvm list |
grep
-c
$VM_NAME
`
VM_IP_ADDR
=
`
uvt-kvm ip
$VM_NAME
`
echo
"
$VM_NAME
has for IP addr =
$VM_IP_ADDR
"
if
[
$IS_VM_ALIVE
-eq
0
]
then
echo
"############################################################"
echo
"############################################################"
echo
"
You should have created the VM before doing anything
"
echo
"
Waiting build process to end on VM (
$VM_NAME
)
"
echo
"############################################################"
echo
"############################################################"
exit
1
fi
echo
"Waiting for VM to be started"
uvt-kvm
wait
$VM_NAME
--insecure
VM_IP_ADDR
=
`
uvt-kvm ip
$VM_NAME
`
if
[[
"
$VM_NAME
"
==
*
"-cppcheck"
*
]]
echo
"
$VM_NAME
has for IP addr =
$VM_IP_ADDR
"
then
echo
"echo
\"
ps -aux | grep cppcheck
\"
"
>>
$VM_CMDS
echo
"############################################################"
echo
"while [
\$
(ps -aux | grep --color=never cppcheck | grep -v grep | wc -l) -gt 0 ]; do sleep 3; done"
>>
$VM_CMDS
echo
"Waiting build process to end on VM (
$VM_NAME
)"
else
echo
"############################################################"
echo
"echo
\"
ps -aux | grep build
\"
"
>>
$VM_CMDS
echo
"while [
\$
(ps -aux | grep --color=never build_oai | grep -v grep | wc -l) -gt 0 ]; do sleep 3; done"
>>
$VM_CMDS
fi
if
[[
"
$VM_NAME
"
==
*
"-cppcheck"
*
]]
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
<
$VM_CMDS
then
rm
-f
$VM_CMDS
echo
"echo
\"
ps -aux | grep cppcheck
\"
"
>>
$VM_CMDS
}
echo
"while [
\$
(ps -aux | grep --color=never cppcheck | grep -v grep | wc -l) -gt 0 ]; do sleep 3; done"
>>
$VM_CMDS
else
echo
"echo
\"
ps -aux | grep build
\"
"
>>
$VM_CMDS
echo
"while [
\$
(ps -aux | grep --color=never build_oai | grep -v grep | wc -l) -gt 0 ]; do sleep 3; done"
>>
$VM_CMDS
fi
ssh
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
<
$VM_CMDS
function
check_on_vm_build
{
echo
"############################################################"
echo
"Creating a tmp folder to store results and artifacts"
echo
"############################################################"
if
[
!
-d
$JENKINS_WKSP
/archives
]
then
mkdir
$JENKINS_WKSP
/archives
fi
echo
"############################################################"
if
[
!
-d
$ARCHIVES_LOC
]
echo
"Creating a tmp folder to store results and artifacts"
then
echo
"############################################################"
mkdir
$ARCHIVES_LOC
if
[
!
-d
$JENKINS_WKSP
/archives
]
fi
then
mkdir
$JENKINS_WKSP
/archives
fi
if
[
!
-d
$ARCHIVES_LOC
]
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
*
.txt
$ARCHIVES_LOC
then
if
[[
"
$VM_NAME
"
==
*
"-cppcheck"
*
]]
mkdir
$ARCHIVES_LOC
then
fi
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
*
.xml
$ARCHIVES_LOC
fi
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
*
.txt
$ARCHIVES_LOC
if
[
$KEEP_VM_ALIVE
-eq
0
]
if
[[
"
$VM_NAME
"
==
*
"-cppcheck"
*
]]
then
then
echo
"############################################################"
scp
-o
StrictHostKeyChecking
=
no ubuntu@
$VM_IP_ADDR
:/home/ubuntu/tmp/cmake_targets/log/
*
.xml
$ARCHIVES_LOC
echo
"Destroying VM"
fi
echo
"############################################################"
uvt-kvm destroy
$VM_NAME
ssh-keygen
-R
$VM_IP_ADDR
fi
rm
-f
$VM_CMDS
if
[
$KEEP_VM_ALIVE
-eq
0
]
then
echo
"############################################################"
echo
"############################################################"
echo
"
Destroying VM"
echo
"
Checking build status"
echo
"############################################################"
echo
"############################################################"
uvt-kvm destroy
$VM_NAME
ssh-keygen
-R
$VM_IP_ADDR
fi
rm
-f
$VM_CMDS
echo
"############################################################"
echo
"Checking build status"
echo
"############################################################"
LOG_FILES
=
`
ls
$ARCHIVES_LOC
/
*
.txt
$ARCHIVES_LOC
/
*
.xml
`
LOG_FILES
=
`
ls
$ARCHIVES_LOC
/
*
.txt
$ARCHIVES_LOC
/
*
.xml
`
STATUS
=
0
STATUS
=
0
NB_FOUND_FILES
=
0
NB_FOUND_FILES
=
0
for
FULLFILE
in
$LOG_FILES
for
FULLFILE
in
$LOG_FILES
do
do
if
[[
$FULLFILE
==
*
"
$LOG_PATTERN
"
*
]]
if
[[
$FULLFILE
==
*
"
$LOG_PATTERN
"
*
]]
then
filename
=
$(
basename
--
"
$FULLFILE
"
)
if
[
"
$LOG_PATTERN
"
==
".Rel15.txt"
]
then
PASS_PATTERN
=
`
echo
$filename
|
sed
-e
"s#
$LOG_PATTERN
##"
`
fi
if
[
"
$LOG_PATTERN
"
==
"basic_simulator"
]
then
PASS_PATTERN
=
"lte-"
fi
if
[
"
$LOG_PATTERN
"
==
"cppcheck.xml"
]
then
then
PASS_PATTERN
=
"results version"
filename
=
$(
basename
--
"
$FULLFILE
"
)
LOCAL_STAT
=
`
egrep
-c
"
$PASS_PATTERN
"
$FULLFILE
`
if
[
"
$LOG_PATTERN
"
==
".Rel15.txt"
]
else
then
LOCAL_STAT
=
`
egrep
-c
"Built target
$PASS_PATTERN
"
$FULLFILE
`
PASS_PATTERN
=
`
echo
$filename
|
sed
-e
"s#
$LOG_PATTERN
##"
`
fi
if
[
"
$LOG_PATTERN
"
==
"basic_simulator"
]
then
PASS_PATTERN
=
"lte-"
fi
if
[
"
$LOG_PATTERN
"
==
"cppcheck.xml"
]
then
PASS_PATTERN
=
"results version"
LOCAL_STAT
=
`
egrep
-c
"
$PASS_PATTERN
"
$FULLFILE
`
else
LOCAL_STAT
=
`
egrep
-c
"Built target
$PASS_PATTERN
"
$FULLFILE
`
fi
if
[
$LOCAL_STAT
-eq
0
]
;
then
STATUS
=
-1
;
fi
NB_FOUND_FILES
=
$((
NB_FOUND_FILES
+
1
))
fi
fi
if
[
$LOCAL_STAT
-eq
0
]
;
then
STATUS
=
-1
;
fi
done
NB_FOUND_FILES
=
$((
NB_FOUND_FILES
+
1
))
fi
done
if
[
$NB_PATTERN_FILES
-ne
$NB_FOUND_FILES
]
;
then
STATUS
=
-1
;
fi
if
[
$NB_PATTERN_FILES
-ne
$NB_FOUND_FILES
]
;
then
STATUS
=
-1
;
fi
if
[
$STATUS
-eq
0
]
}
then
echo
"STATUS seems OK"
else
echo
"STATUS failed?"
fi
exit
$STATUS
cmake_targets/autotests/test_case_list.xml
View file @
4bb2b8a2
...
@@ -1055,7 +1055,7 @@
...
@@ -1055,7 +1055,7 @@
<main_exec_args>
-s-11 -S-10 -n1000
<main_exec_args>
-s-11 -S-10 -n1000
-s-11 -S-10 -n10 -I
</main_exec_args>
-s-11 -S-10 -n10 -I
</main_exec_args>
<tags>
nr_pbchsim.test1
</tags>
<tags>
nr_pbchsim.test1
</tags>
<search_expr_true>
n_errors \(negative CRC\) = 0
</search_expr_true>
<search_expr_true>
PBCH test OK
</search_expr_true>
<search_expr_false>
segmentation fault|assertion|exiting|fatal
</search_expr_false>
<search_expr_false>
segmentation fault|assertion|exiting|fatal
</search_expr_false>
<nruns>
3
</nruns>
<nruns>
3
</nruns>
</testCase>
</testCase>
...
...
openair1/PHY/INIT/nr_init.c
View file @
4bb2b8a2
...
@@ -406,7 +406,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu)
...
@@ -406,7 +406,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu)
gNB_config
->
rf_config
.
ul_carrier_bandwidth
.
value
=
N_RB_UL
;
gNB_config
->
rf_config
.
ul_carrier_bandwidth
.
value
=
N_RB_UL
;
gNB_config
->
sch_config
.
half_frame_index
.
value
=
0
;
gNB_config
->
sch_config
.
half_frame_index
.
value
=
0
;
gNB_config
->
sch_config
.
ssb_subcarrier_offset
.
value
=
0
;
gNB_config
->
sch_config
.
ssb_subcarrier_offset
.
value
=
0
;
gNB_config
->
sch_config
.
n_ssb_crb
.
value
=
(
N_RB_DL
-
20
)
>>
1
;
gNB_config
->
sch_config
.
n_ssb_crb
.
value
=
(
N_RB_DL
-
20
);
gNB_config
->
sch_config
.
ssb_subcarrier_offset
.
value
=
0
;
gNB_config
->
sch_config
.
ssb_subcarrier_offset
.
value
=
0
;
...
@@ -441,7 +441,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config)
...
@@ -441,7 +441,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config)
gNB_config
->
rf_config
.
ul_carrier_bandwidth
.
value
=
phy_config
->
cfg
->
rf_config
.
ul_carrier_bandwidth
.
value
;
//106;
gNB_config
->
rf_config
.
ul_carrier_bandwidth
.
value
=
phy_config
->
cfg
->
rf_config
.
ul_carrier_bandwidth
.
value
;
//106;
gNB_config
->
sch_config
.
half_frame_index
.
value
=
0
;
gNB_config
->
sch_config
.
half_frame_index
.
value
=
0
;
gNB_config
->
sch_config
.
ssb_subcarrier_offset
.
value
=
phy_config
->
cfg
->
sch_config
.
ssb_subcarrier_offset
.
value
;
//0;
gNB_config
->
sch_config
.
ssb_subcarrier_offset
.
value
=
phy_config
->
cfg
->
sch_config
.
ssb_subcarrier_offset
.
value
;
//0;
gNB_config
->
sch_config
.
n_ssb_crb
.
value
=
(
phy_config
->
cfg
->
rf_config
.
dl_carrier_bandwidth
.
value
-
20
)
>>
1
;
gNB_config
->
sch_config
.
n_ssb_crb
.
value
=
(
phy_config
->
cfg
->
rf_config
.
dl_carrier_bandwidth
.
value
-
20
);
gNB_config
->
sch_config
.
physical_cell_id
.
value
=
phy_config
->
cfg
->
sch_config
.
physical_cell_id
.
value
;
gNB_config
->
sch_config
.
physical_cell_id
.
value
=
phy_config
->
cfg
->
sch_config
.
physical_cell_id
.
value
;
if
(
phy_config
->
cfg
->
subframe_config
.
duplex_mode
.
value
==
0
)
{
if
(
phy_config
->
cfg
->
subframe_config
.
duplex_mode
.
value
==
0
)
{
...
...
openair1/PHY/INIT/nr_init_ue.c
View file @
4bb2b8a2
...
@@ -655,7 +655,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
...
@@ -655,7 +655,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
int
i
,
j
,
k
,
l
;
int
i
,
j
,
k
,
l
;
int
eNB_id
;
int
eNB_id
;
int
th_id
;
int
th_id
;
int
n_ssb_crb
=
(
fp
->
N_RB_DL
-
20
)
>>
1
;
int
n_ssb_crb
=
(
fp
->
N_RB_DL
-
20
);
abstraction_flag
=
0
;
abstraction_flag
=
0
;
fp
->
nb_antennas_tx
=
1
;
fp
->
nb_antennas_tx
=
1
;
fp
->
nb_antennas_rx
=
1
;
fp
->
nb_antennas_rx
=
1
;
...
...
openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
View file @
4bb2b8a2
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
//#define NR_LTE_PDCCH_DCI_SWITCH
//#define NR_LTE_PDCCH_DCI_SWITCH
#define NR_PDCCH_DCI_RUN // activates new nr functions
#define NR_PDCCH_DCI_RUN // activates new nr functions
//
#define NR_PDCCH_DCI_DEBUG // activates NR_PDCCH_DCI_DEBUG logs
#define NR_PDCCH_DCI_DEBUG // activates NR_PDCCH_DCI_DEBUG logs
#define NR_NBR_CORESET_ACT_BWP 3 // The number of CoreSets per BWP is limited to 3 (including initial CORESET: ControlResourceId 0)
#define NR_NBR_CORESET_ACT_BWP 3 // The number of CoreSets per BWP is limited to 3 (including initial CORESET: ControlResourceId 0)
#define NR_NBR_SEARCHSPACE_ACT_BWP 10 // The number of SearSpaces per BWP is limited to 10 (including initial SEARCHSPACE: SearchSpaceId 0)
#define NR_NBR_SEARCHSPACE_ACT_BWP 10 // The number of SearSpaces per BWP is limited to 10 (including initial SEARCHSPACE: SearchSpaceId 0)
#define PDCCH_TEST_POLAR_TEMP_FIX
#define PDCCH_TEST_POLAR_TEMP_FIX
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
View file @
4bb2b8a2
...
@@ -149,7 +149,7 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode)
...
@@ -149,7 +149,7 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode)
int
rx_power
=
0
;
//aarx,
int
rx_power
=
0
;
//aarx,
//nfapi_nr_config_request_t* config;
//nfapi_nr_config_request_t* config;
int
n_ssb_crb
=
(
fp
->
N_RB_DL
-
20
)
>>
1
;
int
n_ssb_crb
=
(
fp
->
N_RB_DL
-
20
);
// First try TDD normal prefix, mu 1
// First try TDD normal prefix, mu 1
fp
->
Ncp
=
NORMAL
;
fp
->
Ncp
=
NORMAL
;
fp
->
frame_type
=
TDD
;
fp
->
frame_type
=
TDD
;
...
@@ -212,12 +212,12 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode)
...
@@ -212,12 +212,12 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode)
nr_gold_pdcch
(
ue
,
0
,
2
);
nr_gold_pdcch
(
ue
,
0
,
2
);
/*
/*
int nb_prefix_samples0 = f
rame_parms
->nb_prefix_samples0;
int nb_prefix_samples0 = f
p
->nb_prefix_samples0;
f
rame_parms->nb_prefix_samples0 = frame_parms->nb_prefix_samples.
f
p->nb_prefix_samples0 = fp->nb_prefix_samples;
nr_slot_fep(ue,0, 0, ue->ssb_offset, 0, 1, NR_PDCCH_EST);
nr_slot_fep(ue,0, 0, ue->ssb_offset, 0, 1, NR_PDCCH_EST);
nr_slot_fep(ue,1, 0, ue->ssb_offset, 0, 1, NR_PDCCH_EST);
nr_slot_fep(ue,1, 0, ue->ssb_offset, 0, 1, NR_PDCCH_EST);
f
rame_parms
->nb_prefix_samples0 = nb_prefix_samples0;
f
p
->nb_prefix_samples0 = nb_prefix_samples0;
LOG_I(PHY,"[UE %d] AUTOTEST Cell Sync : frame = %d, rx_offset %d, freq_offset %d \n",
LOG_I(PHY,"[UE %d] AUTOTEST Cell Sync : frame = %d, rx_offset %d, freq_offset %d \n",
ue->Mod_id,
ue->Mod_id,
...
...
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
View file @
4bb2b8a2
...
@@ -5557,8 +5557,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN
...
@@ -5557,8 +5557,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN
#endif
#endif
//nr_gold_pdcch(ue,0, 2);
//nr_gold_pdcch(ue,0, 2);
/*
for (l=0; l<2; l++) {
for
(
int
l
=
0
;
l
<
2
;
l
++
)
{
if
(
abstraction_flag
==
0
)
{
if
(
abstraction_flag
==
0
)
{
#if UE_TIMING_TRACE
#if UE_TIMING_TRACE
start_meas
(
&
ue
->
ofdm_demod_stats
);
start_meas
(
&
ue
->
ofdm_demod_stats
);
...
@@ -5566,40 +5566,63 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN
...
@@ -5566,40 +5566,63 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP
,
VCD_FUNCTION_IN
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP
,
VCD_FUNCTION_IN
);
nr_slot_fep
(
ue
,
nr_slot_fep
(
ue
,
l,
l
,
nr_tti_rx,
nr_tti_rx
,
ue->ssb_offset
,
0
,
0,
0
,
1,
1
,
NR_PDCCH_EST
);
NR_PDCCH_EST
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP
,
VCD_FUNCTION_OUT
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP
,
VCD_FUNCTION_OUT
);
#if UE_TIMING_TRACE
#if UE_TIMING_TRACE
stop_meas
(
&
ue
->
ofdm_demod_stats
);
stop_meas
(
&
ue
->
ofdm_demod_stats
);
#endif
#endif
}
}
}*/
}
//ue_measurement_procedures(l-1,ue,proc,eNB_id,(nr_tti_rx<<1),abstraction_flag,mode);
//if (do_pdcch_flag) {
write_output
(
"rxdataF.m"
,
"rxF"
,
ue
->
common_vars
.
common_vars_rx_data_per_thread
[
ue
->
current_thread_id
[
nr_tti_rx
>>
1
]].
rxdataF
[
0
],
ue
->
frame_parms
.
ofdm_symbol_size
*
2
,
1
,
1
);
// if ((l==pilot1) || ((pmch_flag==1)&(l==l2))) {
// LOG_D(PHY,"[UE %d] Frame %d: Calling pdcch procedures (eNB %d)\n",ue->Mod_id,frame_rx,eNB_id);
//start_meas(&ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]]);
//ue_measurement_procedures(l-1,ue,proc,eNB_id,(nr_tti_rx<<1),abstraction_flag,mode);
if
(
nr_ue_pdcch_procedures
(
eNB_id
,
ue
,
proc
,
abstraction_flag
)
==
-
1
)
{
LOG_E
(
PHY
,
"[UE %d] Frame %d, nr_tti_rx %d: Error in pdcch procedures
\n
"
,
ue
->
Mod_id
,
frame_rx
,
nr_tti_rx
);
return
(
-
1
);
}
//stop_meas(&ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]]);
//printf("nr_tti_rx %d n_pdcch_sym %d pdcch procedures %5.3f \n",
// nr_tti_rx, ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols,
// (ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]].p_time)/(cpuf*1000.0));
LOG_D
(
PHY
,
"num_pdcch_symbols %d
\n
"
,
ue
->
pdcch_vars
[
ue
->
current_thread_id
[
nr_tti_rx
]][
eNB_id
]
->
num_pdcch_symbols
);
// }
//}
// } // for l=1..l2
//if (do_pdcch_flag) {
// if ((l==pilot1) || ((pmch_flag==1)&(l==l2))) {
// LOG_D(PHY,"[UE %d] Frame %d: Calling pdcch procedures (eNB %d)\n",ue->Mod_id,frame_rx,eNB_id);
//start_meas(&ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]]);
//printf(">>> at phy_procedures_nrUE_RX, nr_ue_pdcch_procedures init, dlsch->active=%d\n",
// ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active);
if
(
nr_ue_pdcch_procedures
(
eNB_id
,
ue
,
proc
,
abstraction_flag
)
==
-
1
)
{
LOG_E
(
PHY
,
"[UE %d] Frame %d, nr_tti_rx %d: Error in pdcch procedures
\n
"
,
ue
->
Mod_id
,
frame_rx
,
nr_tti_rx
);
return
(
-
1
);
}
//for (int m=0;m<1000;m++) printf("%d",m);
//printf("\n>>> at phy_procedures_nrUE_RX, nr_ue_pdcch_procedures end, dlsch->active=%d\n",
// ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active);
// preparing for PDSCH procedures
// if (ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active == 1) {
// ue_pdsch_procedures(ue,
// proc,
// eNB_id,
// PDSCH,
// ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0],
// NULL,
// ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols,
// ue->frame_parms.symbols_per_tti>>1,
// abstraction_flag);
// }
#if 0
#if 0
//stop_meas(&ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]]);
//printf("nr_tti_rx %d n_pdcch_sym %d pdcch procedures %5.3f \n",
// nr_tti_rx, ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols,
// (ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]].p_time)/(cpuf*1000.0));
LOG_D(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols);
// }
//}
// } // for l=1..l2
ue_measurement_procedures(l-1,ue,proc,eNB_id,(nr_tti_rx<<1),abstraction_flag,mode);
ue_measurement_procedures(l-1,ue,proc,eNB_id,(nr_tti_rx<<1),abstraction_flag,mode);
LOG_D(PHY," ------ end FFT/ChannelEst/PDCCH slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, nr_tti_rx);
LOG_D(PHY," ------ end FFT/ChannelEst/PDCCH slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, nr_tti_rx);
...
...
openair1/SIMULATION/NR_PHY/pbchsim.c
View file @
4bb2b8a2
...
@@ -133,6 +133,8 @@ int main(int argc, char **argv)
...
@@ -133,6 +133,8 @@ int main(int argc, char **argv)
int
loglvl
=
OAILOG_WARNING
;
int
loglvl
=
OAILOG_WARNING
;
float
target_error_rate
=
0
.
01
;
cpuf
=
get_cpu_freq_GHz
();
cpuf
=
get_cpu_freq_GHz
();
if
(
load_configmodule
(
argc
,
argv
)
==
0
)
{
if
(
load_configmodule
(
argc
,
argv
)
==
0
)
{
...
@@ -296,6 +298,7 @@ int main(int argc, char **argv)
...
@@ -296,6 +298,7 @@ int main(int argc, char **argv)
case
'I'
:
case
'I'
:
run_initial_sync
=
1
;
run_initial_sync
=
1
;
target_error_rate
=
0
.
1
;
break
;
break
;
case
'L'
:
case
'L'
:
...
@@ -442,11 +445,10 @@ int main(int argc, char **argv)
...
@@ -442,11 +445,10 @@ int main(int argc, char **argv)
for
(
int
i
=
0
;
i
<
4
;
i
++
)
gNB
->
pbch_pdu
[
i
]
=
i
+
1
;
for
(
int
i
=
0
;
i
<
4
;
i
++
)
gNB
->
pbch_pdu
[
i
]
=
i
+
1
;
nr_common_signal_procedures
(
gNB
,
frame
,
subframe
);
nr_common_signal_procedures
(
gNB
,
frame
,
subframe
);
/*
LOG_M
(
"txsigF0.m"
,
"txsF0"
,
gNB
->
common_vars
.
txdataF
[
0
],
frame_length_complex_samples_no_prefix
,
1
,
1
);
LOG_M
(
"txsigF0.m"
,
"txsF0"
,
gNB
->
common_vars
.
txdataF
[
0
],
frame_length_complex_samples_no_prefix
,
1
,
1
);
if
(
gNB
->
frame_parms
.
nb_antennas_tx
>
1
)
if
(
gNB
->
frame_parms
.
nb_antennas_tx
>
1
)
LOG_M
(
"txsigF1.m"
,
"txsF1"
,
gNB
->
common_vars
.
txdataF
[
1
],
frame_length_complex_samples_no_prefix
,
1
,
1
);
LOG_M
(
"txsigF1.m"
,
"txsF1"
,
gNB
->
common_vars
.
txdataF
[
1
],
frame_length_complex_samples_no_prefix
,
1
,
1
);
*/
//TODO: loop over slots
//TODO: loop over slots
for
(
aa
=
0
;
aa
<
gNB
->
frame_parms
.
nb_antennas_tx
;
aa
++
)
{
for
(
aa
=
0
;
aa
<
gNB
->
frame_parms
.
nb_antennas_tx
;
aa
++
)
{
if
(
gNB_config
->
subframe_config
.
dl_cyclic_prefix_type
.
value
==
1
)
{
if
(
gNB_config
->
subframe_config
.
dl_cyclic_prefix_type
.
value
==
1
)
{
...
@@ -572,6 +574,11 @@ int main(int argc, char **argv)
...
@@ -572,6 +574,11 @@ int main(int argc, char **argv)
printf
(
"SNR %f : n_errors (negative CRC) = %d/%d
\n
"
,
SNR
,
n_errors
,
n_trials
);
printf
(
"SNR %f : n_errors (negative CRC) = %d/%d
\n
"
,
SNR
,
n_errors
,
n_trials
);
if
((
float
)
n_errors
/
(
float
)
n_trials
<=
target_error_rate
)
{
printf
(
"PBCH test OK
\n
"
);
break
;
}
if
(
n_trials
==
1
)
if
(
n_trials
==
1
)
break
;
break
;
...
...
targets/RT/USER/nr-ue.c
View file @
4bb2b8a2
...
@@ -963,7 +963,7 @@ nb_sf_init=5;
...
@@ -963,7 +963,7 @@ nb_sf_init=5;
#if BASIC_SIMULATOR
#if BASIC_SIMULATOR
{
{
int
t
;
int
t
;
for
(
t
=
0
;
t
<
2
;
t
++
)
{
for
(
t
=
0
;
t
<
RX_NB_TH
;
t
++
)
{
UE_rxtx_proc_t
*
proc
=
&
UE
->
proc
.
proc_rxtx
[
t
];
UE_rxtx_proc_t
*
proc
=
&
UE
->
proc
.
proc_rxtx
[
t
];
pthread_mutex_lock
(
&
proc
->
mutex_rxtx
);
pthread_mutex_lock
(
&
proc
->
mutex_rxtx
);
while
(
proc
->
instance_cnt_rxtx
>=
0
)
pthread_cond_wait
(
&
proc
->
cond_rxtx
,
&
proc
->
mutex_rxtx
);
while
(
proc
->
instance_cnt_rxtx
>=
0
)
pthread_cond_wait
(
&
proc
->
cond_rxtx
,
&
proc
->
mutex_rxtx
);
...
@@ -971,13 +971,13 @@ nb_sf_init=5;
...
@@ -971,13 +971,13 @@ nb_sf_init=5;
}
}
}
}
#endif
#endif
LOG_D
(
PHY
,
"Process subframe %d thread Idx %d
\n
"
,
subframe_nr
,
UE
->
current_thread_id
[
subframe_nr
]);
LOG_D
(
PHY
,
"Process subframe %d thread Idx %d
\n
"
,
subframe_nr
,
UE
->
current_thread_id
[
subframe_nr
]);
thread_idx
++
;
thread_idx
++
;
if
(
thread_idx
>=
RX_NB_TH
)
if
(
thread_idx
>=
RX_NB_TH
)
thread_idx
=
0
;
thread_idx
=
0
;
if
(
UE
->
mode
!=
loop_through_memory
)
{
if
(
UE
->
mode
!=
loop_through_memory
)
{
for
(
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_rx
;
i
++
)
for
(
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_rx
;
i
++
)
rxp
[
i
]
=
(
void
*
)
&
UE
->
common_vars
.
rxdata
[
i
][
UE
->
frame_parms
.
ofdm_symbol_size
+
rxp
[
i
]
=
(
void
*
)
&
UE
->
common_vars
.
rxdata
[
i
][
UE
->
frame_parms
.
ofdm_symbol_size
+
...
@@ -1040,9 +1040,6 @@ nb_sf_init=5;
...
@@ -1040,9 +1040,6 @@ nb_sf_init=5;
if
(
first_symbols
<
0
)
if
(
first_symbols
<
0
)
LOG_E
(
PHY
,
"can't compensate: diff =%d
\n
"
,
first_symbols
);
LOG_E
(
PHY
,
"can't compensate: diff =%d
\n
"
,
first_symbols
);
}
}
}
//UE->mode != loop_through_memory
else
rt_sleep_ns
(
1000
*
1000
);
pickTime
(
gotIQs
);
pickTime
(
gotIQs
);
// operate on thread sf mod 2
// operate on thread sf mod 2
...
@@ -1054,13 +1051,13 @@ nb_sf_init=5;
...
@@ -1054,13 +1051,13 @@ nb_sf_init=5;
UE
->
proc
.
proc_rxtx
[
th_id
].
frame_rx
++
;
UE
->
proc
.
proc_rxtx
[
th_id
].
frame_rx
++
;
}
}
#ifdef SAIF_ENABLED
#ifdef SAIF_ENABLED
if
(
!
(
proc
->
frame_rx
%
4000
))
if
(
!
(
proc
->
frame_rx
%
4000
))
{
{
printf
(
"frame_rx=%d rx_thread_busy=%ld - rate %8.3f
\n
"
,
printf
(
"frame_rx=%d rx_thread_busy=%ld - rate %8.3f
\n
"
,
proc
->
frame_rx
,
g_ue_rx_thread_busy
,
proc
->
frame_rx
,
g_ue_rx_thread_busy
,
(
float
)
g_ue_rx_thread_busy
/
(
proc
->
frame_rx
*
10
+
1
)
*
100
.
0
);
(
float
)
g_ue_rx_thread_busy
/
(
proc
->
frame_rx
*
10
+
1
)
*
100
.
0
);
fflush
(
stdout
);
fflush
(
stdout
);
}
}
#endif
#endif
}
}
//UE->proc.proc_rxtx[0].gotIQs=readTime(gotIQs);
//UE->proc.proc_rxtx[0].gotIQs=readTime(gotIQs);
...
@@ -1078,7 +1075,7 @@ nb_sf_init=5;
...
@@ -1078,7 +1075,7 @@ nb_sf_init=5;
proc
->
frame_tx
=
(
proc
->
frame_tx
+
1
)
%
MAX_FRAME_NUMBER
;
proc
->
frame_tx
=
(
proc
->
frame_tx
+
1
)
%
MAX_FRAME_NUMBER
;
proc
->
nr_tti_tx
%=
NR_NUMBER_OF_SUBFRAMES_PER_FRAME
;
proc
->
nr_tti_tx
%=
NR_NUMBER_OF_SUBFRAMES_PER_FRAME
;
}
}
proc
->
subframe_tx
=
subframe_nr
+
DURATION_RX_TO_TX
;
proc
->
subframe_tx
=
proc
->
nr_tti_rx
;
proc
->
timestamp_tx
=
timestamp
+
proc
->
timestamp_tx
=
timestamp
+
(
DURATION_RX_TO_TX
*
UE
->
frame_parms
.
samples_per_subframe
)
-
(
DURATION_RX_TO_TX
*
UE
->
frame_parms
.
samples_per_subframe
)
-
UE
->
frame_parms
.
ofdm_symbol_size
-
UE
->
frame_parms
.
nb_prefix_samples0
;
UE
->
frame_parms
.
ofdm_symbol_size
-
UE
->
frame_parms
.
nb_prefix_samples0
;
...
@@ -1114,7 +1111,41 @@ nb_sf_init=5;
...
@@ -1114,7 +1111,41 @@ nb_sf_init=5;
// initStaticTime(lastTime);
// initStaticTime(lastTime);
// updateTimes(lastTime, &t1, 20000, "Delay between two IQ acquisitions (case 1)");
// updateTimes(lastTime, &t1, 20000, "Delay between two IQ acquisitions (case 1)");
// pickStaticTime(lastTime);
// pickStaticTime(lastTime);
}
//UE->mode != loop_through_memory
else
{
proc
->
nr_tti_rx
=
subframe_nr
;
proc
->
subframe_rx
=
subframe_nr
;
if
(
subframe_nr
==
0
)
{
for
(
th_id
=
0
;
th_id
<
RX_NB_TH
;
th_id
++
)
{
UE
->
proc
.
proc_rxtx
[
th_id
].
frame_rx
++
;
}
}
proc
->
frame_tx
=
proc
->
frame_rx
;
proc
->
nr_tti_tx
=
subframe_nr
+
DURATION_RX_TO_TX
;
if
(
proc
->
nr_tti_tx
>
NR_NUMBER_OF_SUBFRAMES_PER_FRAME
)
{
proc
->
frame_tx
=
(
proc
->
frame_tx
+
1
)
%
MAX_FRAME_NUMBER
;
proc
->
nr_tti_tx
%=
NR_NUMBER_OF_SUBFRAMES_PER_FRAME
;
}
proc
->
subframe_tx
=
proc
->
nr_tti_tx
;
printf
(
"Processing subframe %d
\n
"
,
proc
->
subframe_rx
);
if
(
UE
->
if_inst
!=
NULL
&&
UE
->
if_inst
->
ul_indication
!=
NULL
){
UE
->
ul_indication
.
module_id
=
0
;
UE
->
ul_indication
.
gNB_index
=
0
;
UE
->
ul_indication
.
cc_id
=
0
;
UE
->
ul_indication
.
slot
=
0
;
// to be fill
UE
->
ul_indication
.
frame
=
0
;
// to be fill
// [TODO] mapping right after NR initial sync
UE
->
ul_indication
.
frame
=
proc
->
frame_rx
;
UE
->
ul_indication
.
slot
=
proc
->
nr_tti_rx
;
UE
->
if_inst
->
ul_indication
(
&
UE
->
ul_indication
);
}
phy_procedures_nrUE_RX
(
UE
,
proc
,
0
,
0
,
1
,
UE
->
mode
,
no_relay
);
getchar
();
}
// else loop_through_memory
}
// start_rx_stream==1
}
// start_rx_stream==1
}
// UE->is_synchronized==1
}
// UE->is_synchronized==1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment