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
wangwenhui
OpenXG-RAN
Commits
92ce0e8d
Commit
92ce0e8d
authored
Apr 21, 2020
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CI: fix merge request case
Signed-off-by:
Raphael Defosseux
<
raphael.defosseux@eurecom.fr
>
parent
46b386f0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
73 deletions
+82
-73
ci-scripts/html.py
ci-scripts/html.py
+79
-69
ci-scripts/main.py
ci-scripts/main.py
+2
-4
ci-scripts/ran.py
ci-scripts/ran.py
+1
-0
No files found.
ci-scripts/html.py
View file @
92ce0e8d
...
...
@@ -49,23 +49,33 @@ class HTMLManagement():
self
.
htmlFile
=
''
self
.
htmlHeaderCreated
=
False
self
.
htmlFooterCreated
=
False
self
.
ranRepository
=
''
self
.
ranBranch
=
''
self
.
ranCommitID
=
''
self
.
ranAllowMerge
=
False
self
.
ranTargetBranch
=
''
self
.
nbTestXMLfiles
=
0
self
.
htmlTabRefs
=
[]
self
.
htmlTabNames
=
[]
self
.
htmlTabIcons
=
[]
self
.
testXMLfiles
=
[]
self
.
htmleNBFailureMsg
=
''
self
.
htmlUEFailureMsg
=
''
self
.
startTime
=
int
(
round
(
time
.
time
()
*
1000
))
self
.
testCase_id
=
''
self
.
desc
=
''
#-----------------------------------------------------------
# Setters and Getters
#-----------------------------------------------------------
def
SethtmlUEFailureMsg
(
self
,
huefa
):
self
.
htmlUEFailureMsg
=
huefa
def
GethtmlUEFailureMsg
(
self
):
return
huefa
return
self
.
htmlUEFailureMsg
def
SetreseNB
(
self
,
rsenb
):
self
.
reseNB
=
rsenb
...
...
@@ -386,76 +396,76 @@ class HTMLManagement():
self
.
htmlFile
.
close
()
def
CreateHtmlTestRow
(
self
,
options
,
status
,
processesStatus
,
machine
=
'eNB'
):
if
((
not
self
.
htmlFooterCreated
)
and
(
self
.
htmlHeaderCreated
)):
self
.
htmlFile
=
open
(
'test_results.html'
,
'a'
)
currentTime
=
int
(
round
(
time
.
time
()
*
1000
))
-
self
.
startTime
self
.
htmlFile
.
write
(
' <tr>
\n
'
)
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcyan" >'
+
format
(
currentTime
/
1000
,
'.1f'
)
+
'</td>
\n
'
)
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcyan" >'
+
self
.
testCase_id
+
'</td>
\n
'
)
self
.
htmlFile
.
write
(
' <td>'
+
self
.
desc
+
'</td>
\n
'
)
self
.
htmlFile
.
write
(
' <td>'
+
str
(
options
)
+
'</td>
\n
'
)
if
(
str
(
status
)
==
'OK'
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightgreen" >'
+
str
(
status
)
+
'</td>
\n
'
)
elif
(
str
(
status
)
==
'KO'
):
if
(
processesStatus
==
0
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >'
+
str
(
status
)
+
'</td>
\n
'
)
elif
(
processesStatus
==
ENB_PROCESS_FAILED
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - eNB process not found</td>
\n
'
)
elif
(
processesStatus
==
OAI_UE_PROCESS_FAILED
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - OAI UE process not found</td>
\n
'
)
elif
(
processesStatus
==
ENB_PROCESS_SEG_FAULT
)
or
(
processesStatus
==
OAI_UE_PROCESS_SEG_FAULT
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - '
+
machine
+
' process ended in Segmentation Fault</td>
\n
'
)
elif
(
processesStatus
==
ENB_PROCESS_ASSERTION
)
or
(
processesStatus
==
OAI_UE_PROCESS_ASSERTION
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - '
+
machine
+
' process ended in Assertion</td>
\n
'
)
elif
(
processesStatus
==
ENB_PROCESS_REALTIME_ISSUE
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - '
+
machine
+
' process faced Real Time issue(s)</td>
\n
'
)
elif
(
processesStatus
==
ENB_PROCESS_NOLOGFILE_TO_ANALYZE
)
or
(
processesStatus
==
OAI_UE_PROCESS_NOLOGFILE_TO_ANALYZE
):
self
.
htmlFile
.
write
(
' <td bgcolor = "orange" >OK?</td>
\n
'
)
elif
(
processesStatus
==
ENB_PROCESS_SLAVE_RRU_NOT_SYNCED
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - '
+
machine
+
' Slave RRU could not synch</td>
\n
'
)
elif
(
processesStatus
==
OAI_UE_PROCESS_COULD_NOT_SYNC
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - UE could not sync</td>
\n
'
)
elif
(
processesStatus
==
HSS_PROCESS_FAILED
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - HSS process not found</td>
\n
'
)
elif
(
processesStatus
==
MME_PROCESS_FAILED
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - MME process not found</td>
\n
'
)
elif
(
processesStatus
==
SPGW_PROCESS_FAILED
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - SPGW process not found</td>
\n
'
)
elif
(
processesStatus
==
UE_IP_ADDRESS_ISSUE
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - Could not retrieve UE IP address</td>
\n
'
)
else
:
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >'
+
str
(
status
)
+
'</td>
\n
'
)
print
(
'RD: calling CreateHtmlTestRow'
)
self
.
htmlFile
=
open
(
'test_results.html'
,
'a'
)
currentTime
=
int
(
round
(
time
.
time
()
*
1000
))
-
self
.
startTime
self
.
htmlFile
.
write
(
' <tr>
\n
'
)
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcyan" >'
+
format
(
currentTime
/
1000
,
'.1f'
)
+
'</td>
\n
'
)
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcyan" >'
+
self
.
testCase_id
+
'</td>
\n
'
)
self
.
htmlFile
.
write
(
' <td>'
+
self
.
desc
+
'</td>
\n
'
)
self
.
htmlFile
.
write
(
' <td>'
+
str
(
options
)
+
'</td>
\n
'
)
if
(
str
(
status
)
==
'OK'
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightgreen" >'
+
str
(
status
)
+
'</td>
\n
'
)
elif
(
str
(
status
)
==
'KO'
):
if
(
processesStatus
==
0
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >'
+
str
(
status
)
+
'</td>
\n
'
)
elif
(
processesStatus
==
ENB_PROCESS_FAILED
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - eNB process not found</td>
\n
'
)
elif
(
processesStatus
==
OAI_UE_PROCESS_FAILED
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - OAI UE process not found</td>
\n
'
)
elif
(
processesStatus
==
ENB_PROCESS_SEG_FAULT
)
or
(
processesStatus
==
OAI_UE_PROCESS_SEG_FAULT
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - '
+
machine
+
' process ended in Segmentation Fault</td>
\n
'
)
elif
(
processesStatus
==
ENB_PROCESS_ASSERTION
)
or
(
processesStatus
==
OAI_UE_PROCESS_ASSERTION
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - '
+
machine
+
' process ended in Assertion</td>
\n
'
)
elif
(
processesStatus
==
ENB_PROCESS_REALTIME_ISSUE
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - '
+
machine
+
' process faced Real Time issue(s)</td>
\n
'
)
elif
(
processesStatus
==
ENB_PROCESS_NOLOGFILE_TO_ANALYZE
)
or
(
processesStatus
==
OAI_UE_PROCESS_NOLOGFILE_TO_ANALYZE
):
self
.
htmlFile
.
write
(
' <td bgcolor = "orange" >OK?</td>
\n
'
)
elif
(
processesStatus
==
ENB_PROCESS_SLAVE_RRU_NOT_SYNCED
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - '
+
machine
+
' Slave RRU could not synch</td>
\n
'
)
elif
(
processesStatus
==
OAI_UE_PROCESS_COULD_NOT_SYNC
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - UE could not sync</td>
\n
'
)
elif
(
processesStatus
==
HSS_PROCESS_FAILED
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - HSS process not found</td>
\n
'
)
elif
(
processesStatus
==
MME_PROCESS_FAILED
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - MME process not found</td>
\n
'
)
elif
(
processesStatus
==
SPGW_PROCESS_FAILED
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - SPGW process not found</td>
\n
'
)
elif
(
processesStatus
==
UE_IP_ADDRESS_ISSUE
):
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >KO - Could not retrieve UE IP address</td>
\n
'
)
else
:
self
.
htmlFile
.
write
(
' <td bgcolor = "orange" >'
+
str
(
status
)
+
'</td>
\n
'
)
if
(
len
(
str
(
self
.
htmleNBFailureMsg
))
>
2
):
cellBgColor
=
'white'
result
=
re
.
search
(
'ended with|faced real time issues'
,
self
.
htmleNBFailureMsg
)
if
result
is
not
None
:
cellBgColor
=
'red'
else
:
result
=
re
.
search
(
'showed|Reestablishment|Could not copy eNB logfile'
,
self
.
htmleNBFailureMsg
)
if
result
is
not
None
:
cellBgColor
=
'orange'
self
.
htmlFile
.
write
(
' <td bgcolor = "'
+
cellBgColor
+
'" colspan='
+
str
(
self
.
htmlUEConnected
)
+
'><pre style="background-color:'
+
cellBgColor
+
'">'
+
self
.
htmleNBFailureMsg
+
'</pre></td>
\n
'
)
self
.
htmleNBFailureMsg
=
''
elif
(
len
(
str
(
self
.
htmlUEFailureMsg
))
>
2
):
cellBgColor
=
'white'
result
=
re
.
search
(
'ended with|faced real time issues'
,
self
.
htmlUEFailureMsg
)
self
.
htmlFile
.
write
(
' <td bgcolor = "lightcoral" >'
+
str
(
status
)
+
'</td>
\n
'
)
else
:
self
.
htmlFile
.
write
(
' <td bgcolor = "orange" >'
+
str
(
status
)
+
'</td>
\n
'
)
if
(
len
(
str
(
self
.
htmleNBFailureMsg
))
>
2
):
cellBgColor
=
'white'
result
=
re
.
search
(
'ended with|faced real time issues'
,
self
.
htmleNBFailureMsg
)
if
result
is
not
None
:
cellBgColor
=
'red'
else
:
result
=
re
.
search
(
'showed|Reestablishment|Could not copy eNB logfile'
,
self
.
htmleNBFailureMsg
)
if
result
is
not
None
:
cellBgColor
=
'red'
else
:
result
=
re
.
search
(
'showed|Could not copy UE logfile|oaitun_ue1 interface is either NOT mounted or NOT configured'
,
self
.
htmlUEFailureMsg
)
if
result
is
not
None
:
cellBgColor
=
'orange'
self
.
htmlFile
.
write
(
' <td bgcolor = "'
+
cellBgColor
+
'" colspan='
+
str
(
self
.
htmlUEConnected
)
+
'><pre style="background-color:'
+
cellBgColor
+
'">'
+
self
.
htmlUEFailureMsg
+
'</pre></td>
\n
'
)
self
.
htmlUEFailureMsg
=
''
cellBgColor
=
'orange'
self
.
htmlFile
.
write
(
' <td bgcolor = "'
+
cellBgColor
+
'" colspan='
+
str
(
self
.
htmlUEConnected
)
+
'><pre style="background-color:'
+
cellBgColor
+
'">'
+
self
.
htmleNBFailureMsg
+
'</pre></td>
\n
'
)
self
.
htmleNBFailureMsg
=
''
elif
(
len
(
str
(
self
.
htmlUEFailureMsg
))
>
2
):
cellBgColor
=
'white'
result
=
re
.
search
(
'ended with|faced real time issues'
,
self
.
htmlUEFailureMsg
)
if
result
is
not
None
:
cellBgColor
=
'red'
else
:
i
=
0
while
(
i
<
self
.
htmlUEConnected
):
self
.
htmlFile
.
write
(
' <td>-</td>
\n
'
)
i
+=
1
self
.
htmlFile
.
write
(
' </tr>
\n
'
)
self
.
htmlFile
.
close
()
result
=
re
.
search
(
'showed|Could not copy UE logfile|oaitun_ue1 interface is either NOT mounted or NOT configured'
,
self
.
htmlUEFailureMsg
)
if
result
is
not
None
:
cellBgColor
=
'orange'
self
.
htmlFile
.
write
(
' <td bgcolor = "'
+
cellBgColor
+
'" colspan='
+
str
(
self
.
htmlUEConnected
)
+
'><pre style="background-color:'
+
cellBgColor
+
'">'
+
self
.
htmlUEFailureMsg
+
'</pre></td>
\n
'
)
self
.
htmlUEFailureMsg
=
''
else
:
i
=
0
while
(
i
<
self
.
htmlUEConnected
):
self
.
htmlFile
.
write
(
' <td>-</td>
\n
'
)
i
+=
1
self
.
htmlFile
.
write
(
' </tr>
\n
'
)
self
.
htmlFile
.
close
()
def
CreateHtmlTestRowQueue
(
self
,
options
,
status
,
ue_status
,
ue_queue
):
if
((
not
self
.
htmlFooterCreated
)
and
(
self
.
htmlHeaderCreated
)):
...
...
ci-scripts/main.py
View file @
92ce0e8d
...
...
@@ -760,7 +760,6 @@ class OaiCiTest():
else
:
SSH
.
command
(
'ssh '
+
self
.
UEDevicesRemoteUser
[
idx
]
+
'@'
+
self
.
UEDevicesRemoteServer
[
idx
]
+
'
\'
adb -s '
+
device_id
+
' shell "dumpsys telephony.registry"
\'
| grep -m 1 mDataConnectionState'
,
'\$'
,
60
)
result
=
re
.
search
(
'mDataConnectionState.*=(?P<state>[0-9\-]+)'
,
SSH
.
getBefore
())
print
(
SSH
.
getBefore
())
#GP debugging
if
result
is
None
:
logging
.
debug
(
'
\u001B
[1;37;41m mDataConnectionState Not Found!
\u001B
[0m'
)
lock
.
acquire
()
...
...
@@ -1069,12 +1068,10 @@ class OaiCiTest():
phone_list_file
.
close
()
if
terminate_ue_flag
==
True
:
print
(
'terminate_ue_flag == True'
)
if
len
(
self
.
UEDevices
)
==
0
:
logging
.
debug
(
'
\u001B
[1;37;41m UE Not Found!
\u001B
[0m'
)
sys
.
exit
(
1
)
if
len
(
self
.
UEDevicesStatus
)
==
0
:
print
(
'len(self.UEDevicesStatus) == 0'
)
cnt
=
0
while
cnt
<
len
(
self
.
UEDevices
):
self
.
UEDevicesStatus
.
append
(
CONST
.
UE_STATUS_DETACHED
)
...
...
@@ -3250,6 +3247,7 @@ while len(argvs) > 1:
else
:
matchReg
=
re
.
match
(
'^\-\-ranTargetBranch=(.*)$'
,
myArgv
,
re
.
IGNORECASE
)
RAN
.
SetranTargetBranch
(
matchReg
.
group
(
1
))
HTML
.
SetranTargetBranch
(
matchReg
.
group
(
1
))
elif
re
.
match
(
'^\-\-eNBIPAddress=(.+)$|^\-\-eNB[1-2]IPAddress=(.+)$'
,
myArgv
,
re
.
IGNORECASE
):
if
re
.
match
(
'^\-\-eNBIPAddress=(.+)$'
,
myArgv
,
re
.
IGNORECASE
):
matchReg
=
re
.
match
(
'^\-\-eNBIPAddress=(.+)$'
,
myArgv
,
re
.
IGNORECASE
)
...
...
@@ -3447,7 +3445,7 @@ elif re.match('^InitiateHtml$', mode, re.IGNORECASE):
print
(
"Error while parsing file: "
+
xml_test_file
)
xmlRoot
=
xmlTree
.
getroot
()
HTML
.
SethtmlTabRefs
(
xmlRoot
.
findtext
(
'htmlTabRef'
,
default
=
'test-tab-'
+
str
(
count
)))
HTML
.
SethtmlTabNames
(
xmlRoot
.
findtext
(
'htmlTab
Ref
'
,
default
=
'test-tab-'
+
str
(
count
)))
HTML
.
SethtmlTabNames
(
xmlRoot
.
findtext
(
'htmlTab
Name
'
,
default
=
'test-tab-'
+
str
(
count
)))
HTML
.
SethtmlTabIcons
(
xmlRoot
.
findtext
(
'htmlTabIcon'
,
default
=
'info-sign'
))
#CiTestObj.htmlTabRefs.append(xmlRoot.findtext('htmlTabRef',default='test-tab-' + str(count)))
#CiTestObj.htmlTabNames.append(xmlRoot.findtext('htmlTabName',default='Test-' + str(count)))
...
...
ci-scripts/ran.py
View file @
92ce0e8d
...
...
@@ -386,6 +386,7 @@ class RANManagement():
def
checkBuildeNB
(
self
,
lIpAddr
,
lUserName
,
lPassWord
,
lSourcePath
,
testcaseId
):
myHTML
=
HTML
.
HTMLManagement
()
myHTML
.
SettestCase_id
(
testcaseId
)
mySSH
=
SSH
.
SSHConnection
()
mySSH
.
open
(
lIpAddr
,
lUserName
,
lPassWord
)
mySSH
.
command
(
'cd '
+
lSourcePath
+
'/cmake_targets'
,
'\$'
,
3
)
...
...
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