Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
7a505f75
Commit
7a505f75
authored
Sep 14, 2021
by
hardy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding cn logs to artifacts
parent
8dca1822
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
5 deletions
+41
-5
ci-scripts/Jenkinsfile-tmp-multi-enb-nsa
ci-scripts/Jenkinsfile-tmp-multi-enb-nsa
+15
-0
ci-scripts/epc.py
ci-scripts/epc.py
+26
-5
No files found.
ci-scripts/Jenkinsfile-tmp-multi-enb-nsa
View file @
7a505f75
...
...
@@ -262,6 +262,21 @@ pipeline {
if
(
fileExists
(
"enb.log.${env.BUILD_ID}.zip"
))
{
archiveArtifacts
"enb.log.${env.BUILD_ID}.zip"
}
}
}
}
stage
(
'Log Collection (CN)'
)
{
steps
{
withCredentials
([
[
$class
:
'UsernamePasswordMultiBinding'
,
credentialsId:
"${params.EPC_Credentials}"
,
usernameVariable:
'EPC_Username'
,
passwordVariable:
'EPC_Password'
]
])
{
echo
'\u2705 \u001B[32mLog Transfer (CN)\u001B[0m'
sh
"sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/logs/oai-cn5g.log.zip ./oai-cn5g.log.${env.BUILD_ID}.zip || true"
}
script
{
if
(
fileExists
(
"oai-cn5g.log.${env.BUILD_ID}.zip"
))
{
archiveArtifacts
"oai-cn5g.log.${env.BUILD_ID}.zip"
}
if
(
fileExists
(
"ci-scripts/test_results.html"
))
{
sh
"mv ci-scripts/test_results.html test_results-${JOB_NAME}.html"
sh
"sed -i -e 's#TEMPLATE_JOB_NAME#${JOB_NAME}#' -e 's@build #TEMPLATE_BUILD_ID@build #${BUILD_ID}@' -e 's#Build-ID: TEMPLATE_BUILD_ID#Build-ID: <a href=\"${BUILD_URL}\">${BUILD_ID}</a>#' -e 's#TEMPLATE_STAGE_NAME#${testStageName}#' test_results-${JOB_NAME}.html"
...
...
ci-scripts/epc.py
View file @
7a505f75
...
...
@@ -229,13 +229,12 @@ class EPCManagement():
logging
.
debug
(
'Using the sabox'
)
mySSH
.
command
(
'cd /opt/ltebox/tools'
,
'\$'
,
5
)
mySSH
.
command
(
'echo '
+
self
.
Password
+
' | sudo -S ./start_sabox'
,
'\$'
,
5
)
elif
re
.
match
(
'OAI'
,
self
.
Type
,
re
.
IGNORECASE
):
elif
re
.
match
(
'OAI
CN5G
'
,
self
.
Type
,
re
.
IGNORECASE
):
logging
.
debug
(
'Starting OAI CN5G'
)
mySSH
.
command
(
'if [ -d '
+
self
.
SourceCodePath
+
'/scripts ]; then echo '
+
self
.
Password
+
' | sudo -S rm -Rf '
+
self
.
SourceCodePath
+
'/scripts ; fi'
,
'\$'
,
5
)
mySSH
.
command
(
'mkdir -p '
+
self
.
SourceCodePath
+
'/scripts'
,
'\$'
,
5
)
mySSH
.
command
(
'cd /opt/oai-cn5g-fed/docker-compose'
,
'\$'
,
5
)
mySSH
.
command
(
'echo '
+
self
.
Password
+
' | sudo -S ./core-network.sh start nrf spgwu'
,
'\$'
,
5
)
time
.
sleep
(
20
)
#leave some time for deployment and health check
mySSH
.
command
(
'./core-network.sh start nrf spgwu'
,
'\$'
,
30
)
else
:
logging
.
error
(
'This option should not occur!'
)
mySSH
.
close
()
...
...
@@ -249,6 +248,14 @@ class EPCManagement():
return
if
re
.
match
(
'ltebox'
,
self
.
Type
,
re
.
IGNORECASE
):
self
.
MmeIPAddress
=
self
.
IPAddress
elif
re
.
match
(
'OAICN5G'
,
self
.
Type
,
re
.
IGNORECASE
):
mySSH
=
SSH
.
SSHConnection
()
mySSH
.
open
(
self
.
IPAddress
,
self
.
UserName
,
self
.
Password
)
mySSH
.
command2
(
'docker inspect --format=
\'
{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}
\'
oai-amf'
,
5
)
self
.
MmeIPAddress
=
str
(
mySSH
.
cmd2Results
[
0
],
'utf-8'
)
self
.
MmeIPAddress
.
rstrip
()
logging
.
debug
(
'AMF IP Address '
+
self
.
MmeIPAddress
)
mySSH
.
close
()
def
CheckHSSProcess
(
self
,
status_queue
):
try
:
...
...
@@ -448,10 +455,11 @@ class EPCManagement():
mySSH
.
command
(
'cd scripts'
,
'\$'
,
5
)
time
.
sleep
(
1
)
mySSH
.
command
(
'echo '
+
self
.
Password
+
' | sudo -S screen -S simulated_5g_hss -X quit'
,
'\$'
,
5
)
elif
re
.
match
(
'OAI'
,
self
.
Type
,
re
.
IGNORECASE
):
elif
re
.
match
(
'OAICN5G'
,
self
.
Type
,
re
.
IGNORECASE
):
self
.
LogCollectOAICN5G
()
logging
.
debug
(
'Terminating OAI CN5G'
)
mySSH
.
command
(
'cd /opt/oai-cn5g-fed/docker-compose'
,
'\$'
,
5
)
mySSH
.
command
(
'
echo '
+
self
.
Password
+
' | sudo -S ./core-network.sh stop nrf spgwu'
,
'\$'
,
5
)
mySSH
.
command
(
'
./core-network.sh stop nrf spgwu'
,
'\$'
,
5
)
else
:
logging
.
error
(
'This should not happen!'
)
mySSH
.
close
()
...
...
@@ -691,3 +699,16 @@ class EPCManagement():
logging
.
error
(
'This option should not occur!'
)
mySSH
.
close
()
def
LogCollectOAICN5G
(
self
):
mySSH
=
SSH
.
SSHConnection
()
mySSH
.
open
(
self
.
IPAddress
,
self
.
UserName
,
self
.
Password
)
logging
.
debug
(
'OAI CN5G Collecting Log files to workspace'
)
mySSH
.
command
(
'echo '
+
self
.
Password
+
' | sudo rm -rf '
+
self
.
SourceCodePath
+
'/logs'
,
'\$'
,
5
)
mySSH
.
command
(
'mkdir '
+
self
.
SourceCodePath
+
'/logs'
,
'\$'
,
5
)
containers_list
=
[
'oai-smf'
,
'oai-spgwu'
,
'oai-amf'
,
'oai-nrf'
]
for
c
in
containers_list
:
mySSH
.
command
(
'docker logs '
+
c
+
' > '
+
self
.
SourceCodePath
+
'/logs/'
+
c
+
'.log'
,
'\$'
,
5
)
mySSH
.
command
(
'cd '
+
self
.
SourceCodePath
+
'/logs'
,
'\$'
,
5
)
mySSH
.
command
(
'zip oai-cn5g.log.zip *.log'
,
'\$'
,
60
)
mySSH
.
close
()
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