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
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
zzha zzha
OpenXG-RAN
Commits
9d92f4f9
Commit
9d92f4f9
authored
Jan 25, 2024
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CI: catch exceptions in CI code and print in HTML
parent
31d04336
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
152 additions
and
144 deletions
+152
-144
ci-scripts/main.py
ci-scripts/main.py
+152
-144
No files found.
ci-scripts/main.py
View file @
9d92f4f9
...
...
@@ -65,6 +65,7 @@ import logging
import
datetime
import
signal
import
subprocess
import
traceback
from
multiprocessing
import
Process
,
Lock
,
SimpleQueue
logging
.
basicConfig
(
level
=
logging
.
DEBUG
,
...
...
@@ -745,150 +746,157 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
continue
CiTestObj
.
ShowTestID
()
GetParametersFromXML
(
action
)
if
action
==
'Build_eNB'
:
RAN
.
BuildeNB
(
HTML
)
elif
action
==
'WaitEndBuild_eNB'
:
RAN
.
WaitBuildeNBisFinished
(
HTML
)
elif
action
==
'Custom_Command'
:
RAN
.
CustomCommand
(
HTML
)
if
RAN
.
prematureExit
:
CiTestObj
.
AutoTerminateeNB
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
elif
action
==
'Initialize_eNB'
:
RAN
.
InitializeeNB
(
HTML
,
EPC
)
if
RAN
.
prematureExit
:
CiTestObj
.
AutoTerminateeNB
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
elif
action
==
'Terminate_eNB'
:
RAN
.
TerminateeNB
(
HTML
,
EPC
)
elif
action
==
'Initialize_UE'
:
CiTestObj
.
InitializeUE
(
HTML
)
elif
action
==
'Terminate_UE'
:
CiTestObj
.
TerminateUE
(
HTML
)
elif
action
==
'Attach_UE'
:
CiTestObj
.
AttachUE
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
elif
action
==
'Detach_UE'
:
CiTestObj
.
DetachUE
(
HTML
)
elif
action
==
'DataDisable_UE'
:
CiTestObj
.
DataDisableUE
(
HTML
)
elif
action
==
'DataEnable_UE'
:
CiTestObj
.
DataEnableUE
(
HTML
)
elif
action
==
'CheckStatusUE'
:
CiTestObj
.
CheckStatusUE
(
HTML
)
elif
action
==
'Build_OAI_UE'
:
CiTestObj
.
BuildOAIUE
(
HTML
)
elif
action
==
'Initialize_OAI_UE'
:
CiTestObj
.
InitializeOAIUE
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
elif
action
==
'Terminate_OAI_UE'
:
CiTestObj
.
TerminateOAIUE
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
elif
action
==
'Ping'
:
CiTestObj
.
Ping
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
elif
action
==
'Iperf'
:
CiTestObj
.
Iperf
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
elif
action
==
'Initialize_HSS'
:
EPC
.
InitializeHSS
(
HTML
)
elif
action
==
'Terminate_HSS'
:
EPC
.
TerminateHSS
(
HTML
)
elif
action
==
'Initialize_MME'
:
EPC
.
InitializeMME
(
HTML
)
elif
action
==
'Terminate_MME'
:
EPC
.
TerminateMME
(
HTML
)
elif
action
==
'Initialize_SPGW'
:
EPC
.
InitializeSPGW
(
HTML
)
elif
action
==
'Terminate_SPGW'
:
EPC
.
TerminateSPGW
(
HTML
)
elif
action
==
'Initialize_5GCN'
:
EPC
.
Initialize5GCN
(
HTML
)
elif
action
==
'Terminate_5GCN'
:
EPC
.
Terminate5GCN
(
HTML
)
elif
action
==
'Deploy_EPC'
:
EPC
.
DeployEpc
(
HTML
)
elif
action
==
'Undeploy_EPC'
:
EPC
.
UndeployEpc
(
HTML
)
elif
action
==
'IdleSleep'
:
CiTestObj
.
IdleSleep
(
HTML
)
elif
action
==
'Perform_X2_Handover'
:
CiTestObj
.
Perform_X2_Handover
(
HTML
,
RAN
,
EPC
)
elif
action
==
'Build_PhySim'
:
HTML
=
ldpc
.
Build_PhySim
(
HTML
,
CONST
)
if
ldpc
.
exitStatus
==
1
:
RAN
.
prematureExit
=
True
elif
action
==
'Run_LDPCTest'
:
HTML
=
ldpc
.
Run_LDPCTest
(
HTML
,
CONST
,
id
)
if
ldpc
.
exitStatus
==
1
:
RAN
.
prematureExit
=
True
elif
action
==
'Run_LDPCt1Test'
:
HTML
=
ldpc
.
Run_LDPCt1Test
(
HTML
,
CONST
,
id
)
if
ldpc
.
exitStatus
==
1
:
RAN
.
prematureExit
=
True
elif
action
==
'Run_NRulsimTest'
:
HTML
=
ldpc
.
Run_NRulsimTest
(
HTML
,
CONST
,
id
)
if
ldpc
.
exitStatus
==
1
:
RAN
.
prematureExit
=
True
elif
action
==
'Pull_Cluster_Image'
:
if
not
CLUSTER
.
PullClusterImage
(
HTML
,
RAN
):
RAN
.
prematureExit
=
True
elif
action
==
'Build_Cluster_Image'
:
if
not
CLUSTER
.
BuildClusterImage
(
HTML
):
RAN
.
prematureExit
=
True
elif
action
==
'Build_Image'
:
success
=
CONTAINERS
.
BuildImage
(
HTML
)
if
not
success
:
RAN
.
prematureExit
=
True
elif
action
==
'Build_Run_Tests'
:
success
=
CONTAINERS
.
BuildRunTests
(
HTML
)
if
not
success
:
RAN
.
prematureExit
=
True
elif
action
==
'Build_Proxy'
:
success
=
CONTAINERS
.
BuildProxy
(
HTML
)
if
not
success
:
RAN
.
prematureExit
=
True
elif
action
==
'Push_Local_Registry'
:
success
=
CONTAINERS
.
Push_Image_to_Local_Registry
(
HTML
)
if
not
success
:
RAN
.
prematureExit
=
True
elif
action
==
'Pull_Local_Registry'
:
success
=
CONTAINERS
.
Pull_Image_from_Local_Registry
(
HTML
)
if
not
success
:
RAN
.
prematureExit
=
True
elif
action
==
'Clean_Test_Server_Images'
:
success
=
CONTAINERS
.
Clean_Test_Server_Images
(
HTML
)
if
not
success
:
RAN
.
prematureExit
=
True
elif
action
==
'Deploy_Object'
:
CONTAINERS
.
DeployObject
(
HTML
,
EPC
)
if
CONTAINERS
.
exitStatus
==
1
:
CiTestObj
.
AutoTerminateeNB
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
RAN
.
prematureExit
=
True
elif
action
==
'Undeploy_Object'
:
CONTAINERS
.
UndeployObject
(
HTML
,
RAN
)
if
CONTAINERS
.
exitStatus
==
1
:
CiTestObj
.
AutoTerminateeNB
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
RAN
.
prematureExit
=
True
elif
action
==
'Cppcheck_Analysis'
:
SCA
.
CppCheckAnalysis
(
HTML
)
elif
action
==
'LicenceAndFormattingCheck'
:
ret
=
SCA
.
LicenceAndFormattingCheck
(
HTML
)
if
ret
!=
0
:
RAN
.
prematureExit
=
True
elif
action
==
'Deploy_Run_PhySim'
:
PHYSIM
.
Deploy_PhySim
(
HTML
,
RAN
)
elif
action
==
'DeployGenObject'
:
CONTAINERS
.
DeployGenObject
(
HTML
,
RAN
,
CiTestObj
)
if
CONTAINERS
.
exitStatus
==
1
:
RAN
.
prematureExit
=
True
elif
action
==
'UndeployGenObject'
:
CONTAINERS
.
UndeployGenObject
(
HTML
,
RAN
,
CiTestObj
)
if
CONTAINERS
.
exitStatus
==
1
:
RAN
.
prematureExit
=
True
elif
action
==
'IperfFromContainer'
:
CONTAINERS
.
IperfFromContainer
(
HTML
,
RAN
,
CiTestObj
)
if
CONTAINERS
.
exitStatus
==
1
:
RAN
.
prematureExit
=
True
elif
action
==
'StatsFromGenObject'
:
CONTAINERS
.
StatsFromGenObject
(
HTML
)
elif
action
==
'Push_Images_To_Test_Servers'
:
logging
.
debug
(
'To be implemented'
)
else
:
sys
.
exit
(
'Invalid class (action) from xml'
)
try
:
if
action
==
'Build_eNB'
:
RAN
.
BuildeNB
(
HTML
)
elif
action
==
'WaitEndBuild_eNB'
:
RAN
.
WaitBuildeNBisFinished
(
HTML
)
elif
action
==
'Custom_Command'
:
RAN
.
CustomCommand
(
HTML
)
if
RAN
.
prematureExit
:
CiTestObj
.
AutoTerminateeNB
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
elif
action
==
'Initialize_eNB'
:
RAN
.
InitializeeNB
(
HTML
,
EPC
)
if
RAN
.
prematureExit
:
CiTestObj
.
AutoTerminateeNB
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
elif
action
==
'Terminate_eNB'
:
RAN
.
TerminateeNB
(
HTML
,
EPC
)
elif
action
==
'Initialize_UE'
:
CiTestObj
.
InitializeUE
(
HTML
)
elif
action
==
'Terminate_UE'
:
CiTestObj
.
TerminateUE
(
HTML
)
elif
action
==
'Attach_UE'
:
CiTestObj
.
AttachUE
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
elif
action
==
'Detach_UE'
:
CiTestObj
.
DetachUE
(
HTML
)
elif
action
==
'DataDisable_UE'
:
CiTestObj
.
DataDisableUE
(
HTML
)
elif
action
==
'DataEnable_UE'
:
CiTestObj
.
DataEnableUE
(
HTML
)
elif
action
==
'CheckStatusUE'
:
CiTestObj
.
CheckStatusUE
(
HTML
)
elif
action
==
'Build_OAI_UE'
:
CiTestObj
.
BuildOAIUE
(
HTML
)
elif
action
==
'Initialize_OAI_UE'
:
CiTestObj
.
InitializeOAIUE
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
elif
action
==
'Terminate_OAI_UE'
:
CiTestObj
.
TerminateOAIUE
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
elif
action
==
'Ping'
:
CiTestObj
.
Ping
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
elif
action
==
'Iperf'
:
CiTestObj
.
Iperf
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
elif
action
==
'Initialize_HSS'
:
EPC
.
InitializeHSS
(
HTML
)
elif
action
==
'Terminate_HSS'
:
EPC
.
TerminateHSS
(
HTML
)
elif
action
==
'Initialize_MME'
:
EPC
.
InitializeMME
(
HTML
)
elif
action
==
'Terminate_MME'
:
EPC
.
TerminateMME
(
HTML
)
elif
action
==
'Initialize_SPGW'
:
EPC
.
InitializeSPGW
(
HTML
)
elif
action
==
'Terminate_SPGW'
:
EPC
.
TerminateSPGW
(
HTML
)
elif
action
==
'Initialize_5GCN'
:
EPC
.
Initialize5GCN
(
HTML
)
elif
action
==
'Terminate_5GCN'
:
EPC
.
Terminate5GCN
(
HTML
)
elif
action
==
'Deploy_EPC'
:
EPC
.
DeployEpc
(
HTML
)
elif
action
==
'Undeploy_EPC'
:
EPC
.
UndeployEpc
(
HTML
)
elif
action
==
'IdleSleep'
:
CiTestObj
.
IdleSleep
(
HTML
)
elif
action
==
'Perform_X2_Handover'
:
CiTestObj
.
Perform_X2_Handover
(
HTML
,
RAN
,
EPC
)
elif
action
==
'Build_PhySim'
:
HTML
=
ldpc
.
Build_PhySim
(
HTML
,
CONST
)
if
ldpc
.
exitStatus
==
1
:
RAN
.
prematureExit
=
True
elif
action
==
'Run_LDPCTest'
:
HTML
=
ldpc
.
Run_LDPCTest
(
HTML
,
CONST
,
id
)
if
ldpc
.
exitStatus
==
1
:
RAN
.
prematureExit
=
True
elif
action
==
'Run_LDPCt1Test'
:
HTML
=
ldpc
.
Run_LDPCt1Test
(
HTML
,
CONST
,
id
)
if
ldpc
.
exitStatus
==
1
:
RAN
.
prematureExit
=
True
elif
action
==
'Run_NRulsimTest'
:
HTML
=
ldpc
.
Run_NRulsimTest
(
HTML
,
CONST
,
id
)
if
ldpc
.
exitStatus
==
1
:
RAN
.
prematureExit
=
True
elif
action
==
'Pull_Cluster_Image'
:
if
not
CLUSTER
.
PullClusterImage
(
HTML
,
RAN
):
RAN
.
prematureExit
=
True
elif
action
==
'Build_Cluster_Image'
:
if
not
CLUSTER
.
BuildClusterImage
(
HTML
):
RAN
.
prematureExit
=
True
elif
action
==
'Build_Image'
:
success
=
CONTAINERS
.
BuildImage
(
HTML
)
if
not
success
:
RAN
.
prematureExit
=
True
elif
action
==
'Build_Run_Tests'
:
success
=
CONTAINERS
.
BuildRunTests
(
HTML
)
if
not
success
:
RAN
.
prematureExit
=
True
elif
action
==
'Build_Proxy'
:
success
=
CONTAINERS
.
BuildProxy
(
HTML
)
if
not
success
:
RAN
.
prematureExit
=
True
elif
action
==
'Push_Local_Registry'
:
success
=
CONTAINERS
.
Push_Image_to_Local_Registry
(
HTML
)
if
not
success
:
RAN
.
prematureExit
=
True
elif
action
==
'Pull_Local_Registry'
:
success
=
CONTAINERS
.
Pull_Image_from_Local_Registry
(
HTML
)
if
not
success
:
RAN
.
prematureExit
=
True
elif
action
==
'Clean_Test_Server_Images'
:
success
=
CONTAINERS
.
Clean_Test_Server_Images
(
HTML
)
if
not
success
:
RAN
.
prematureExit
=
True
elif
action
==
'Deploy_Object'
:
CONTAINERS
.
DeployObject
(
HTML
,
EPC
)
if
CONTAINERS
.
exitStatus
==
1
:
CiTestObj
.
AutoTerminateeNB
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
RAN
.
prematureExit
=
True
elif
action
==
'Undeploy_Object'
:
CONTAINERS
.
UndeployObject
(
HTML
,
RAN
)
if
CONTAINERS
.
exitStatus
==
1
:
CiTestObj
.
AutoTerminateeNB
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
RAN
.
prematureExit
=
True
elif
action
==
'Cppcheck_Analysis'
:
SCA
.
CppCheckAnalysis
(
HTML
)
elif
action
==
'LicenceAndFormattingCheck'
:
ret
=
SCA
.
LicenceAndFormattingCheck
(
HTML
)
if
ret
!=
0
:
RAN
.
prematureExit
=
True
elif
action
==
'Deploy_Run_PhySim'
:
PHYSIM
.
Deploy_PhySim
(
HTML
,
RAN
)
elif
action
==
'DeployGenObject'
:
CONTAINERS
.
DeployGenObject
(
HTML
,
RAN
,
CiTestObj
)
if
CONTAINERS
.
exitStatus
==
1
:
RAN
.
prematureExit
=
True
elif
action
==
'UndeployGenObject'
:
CONTAINERS
.
UndeployGenObject
(
HTML
,
RAN
,
CiTestObj
)
if
CONTAINERS
.
exitStatus
==
1
:
RAN
.
prematureExit
=
True
elif
action
==
'IperfFromContainer'
:
CONTAINERS
.
IperfFromContainer
(
HTML
,
RAN
,
CiTestObj
)
if
CONTAINERS
.
exitStatus
==
1
:
RAN
.
prematureExit
=
True
elif
action
==
'StatsFromGenObject'
:
CONTAINERS
.
StatsFromGenObject
(
HTML
)
elif
action
==
'Push_Images_To_Test_Servers'
:
logging
.
debug
(
'To be implemented'
)
else
:
sys
.
exit
(
'Invalid class (action) from xml'
)
except
Exception
as
e
:
s
=
traceback
.
format_exc
()
logging
.
error
(
f'while running CI, an exception occurred:
\n
{
s
}
'
)
HTML
.
CreateHtmlTestRowQueue
(
"N/A"
,
'KO'
,
[
f"CI test code encountered an exception:
\n
{
s
}
"
])
RAN
.
prematureExit
=
True
if
RAN
.
prematureExit
:
if
CiTestObj
.
testCase_id
==
CiTestObj
.
testMinStableId
:
logging
.
warning
(
'Scenario has reached minimal stability point'
)
...
...
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