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
c286b2a9
Commit
c286b2a9
authored
Mar 17, 2020
by
Gabriele Perrone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
to switch to develop
parent
70633682
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
320 additions
and
404 deletions
+320
-404
ci-scripts/epc.py
ci-scripts/epc.py
+52
-12
ci-scripts/helpreadme.py
ci-scripts/helpreadme.py
+30
-0
ci-scripts/html.py
ci-scripts/html.py
+77
-129
ci-scripts/main_enb.py
ci-scripts/main_enb.py
+54
-126
ci-scripts/ran.py
ci-scripts/ran.py
+76
-137
ci-scripts/sshconnection.py
ci-scripts/sshconnection.py
+31
-0
No files found.
ci-scripts/epc.py
View file @
c286b2a9
# * 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
# */
#---------------------------------------------------------------------
# Python for CI of OAI-eNB + COTS-UE
#
# Required Python Version
# Python 3.x
#
# Required Python Package
# pexpect
#---------------------------------------------------------------------
#-----------------------------------------------------------
#-----------------------------------------------------------
# Import
# Import
#-----------------------------------------------------------
#-----------------------------------------------------------
...
@@ -14,22 +44,28 @@ from multiprocessing import Process, Lock, SimpleQueue
...
@@ -14,22 +44,28 @@ from multiprocessing import Process, Lock, SimpleQueue
# OAI Testing modules
# OAI Testing modules
#-----------------------------------------------------------
#-----------------------------------------------------------
import
sshconnection
as
SSH
import
sshconnection
as
SSH
#from sshconnection import SSHConnection as SSH
import
helpreadme
as
HELP
import
helpreadme
as
HELP
import
constants
as
CONST
import
constants
as
CONST
import
html
as
HTML
#-----------------------------------------------------------
#-----------------------------------------------------------
# Class Declaration
# Class Declaration
#-----------------------------------------------------------
#-----------------------------------------------------------
class
EPCManagement
():
class
EPCManagement
():
def
__init__
(
self
):
def
__init__
(
self
):
self
.
EPCIPAddress
=
''
self
.
EPCUserName
=
''
self
.
IPAddress
=
''
self
.
EPCPassword
=
''
self
.
UserName
=
''
self
.
EPCSourceCodePath
=
''
self
.
Password
=
''
self
.
EPCType
=
''
self
.
SourceCodePath
=
''
self
.
Type
=
''
self
.
EPC_PcapFileName
=
''
self
.
EPC_PcapFileName
=
''
#-----------------------------------------------------------
# Setter and Getters
#-----------------------------------------------------------
def
SetIPAddress
(
self
,
ipaddress
):
def
SetIPAddress
(
self
,
ipaddress
):
self
.
EPCIPAddress
=
ipaddress
self
.
EPCIPAddress
=
ipaddress
def
GetIPAddress
(
self
):
def
GetIPAddress
(
self
):
...
@@ -55,6 +91,10 @@ class EPCManagement():
...
@@ -55,6 +91,10 @@ class EPCManagement():
def
Get_PcapFileName
(
self
):
def
Get_PcapFileName
(
self
):
return
self
.
EPC_PcapFileName
return
self
.
EPC_PcapFileName
#-----------------------------------------------------------
# EPC management functions
#-----------------------------------------------------------
def
InitializeHSS
(
self
):
def
InitializeHSS
(
self
):
if
self
.
EPCIPAddress
==
''
or
self
.
EPCUserName
==
''
or
self
.
EPCPassword
==
''
or
self
.
EPCSourceCodePath
==
''
or
self
.
EPCType
==
''
:
if
self
.
EPCIPAddress
==
''
or
self
.
EPCUserName
==
''
or
self
.
EPCPassword
==
''
or
self
.
EPCSourceCodePath
==
''
or
self
.
EPCType
==
''
:
HELP
.
GenericHelp
(
Version
)
HELP
.
GenericHelp
(
Version
)
...
@@ -91,7 +131,7 @@ class EPCManagement():
...
@@ -91,7 +131,7 @@ class EPCManagement():
else
:
else
:
logging
.
error
(
'This option should not occur!'
)
logging
.
error
(
'This option should not occur!'
)
mySSH
.
close
()
mySSH
.
close
()
#self
.CreateHtmlTestRow(self.EPCType, 'OK', CONST.ALL_PROCESSES_OK)
HTML
.
CreateHtmlTestRow
(
self
.
EPCType
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
def
InitializeMME
(
self
):
def
InitializeMME
(
self
):
if
self
.
EPCIPAddress
==
''
or
self
.
EPCUserName
==
''
or
self
.
EPCPassword
==
''
or
self
.
EPCSourceCodePath
==
''
or
self
.
EPCType
==
''
:
if
self
.
EPCIPAddress
==
''
or
self
.
EPCUserName
==
''
or
self
.
EPCPassword
==
''
or
self
.
EPCSourceCodePath
==
''
or
self
.
EPCType
==
''
:
...
@@ -124,7 +164,7 @@ class EPCManagement():
...
@@ -124,7 +164,7 @@ class EPCManagement():
else
:
else
:
logging
.
error
(
'This option should not occur!'
)
logging
.
error
(
'This option should not occur!'
)
mySSH
.
close
()
mySSH
.
close
()
#self
.CreateHtmlTestRow(self.EPCType, 'OK', ALL_PROCESSES_OK)
HTML
.
CreateHtmlTestRow
(
self
.
EPCType
,
'OK'
,
ALL_PROCESSES_OK
)
def
InitializeSPGW
(
self
):
def
InitializeSPGW
(
self
):
if
self
.
EPCIPAddress
==
''
or
self
.
EPCUserName
==
''
or
self
.
EPCPassword
==
''
or
self
.
EPCSourceCodePath
==
''
or
self
.
EPCType
==
''
:
if
self
.
EPCIPAddress
==
''
or
self
.
EPCUserName
==
''
or
self
.
EPCPassword
==
''
or
self
.
EPCSourceCodePath
==
''
or
self
.
EPCType
==
''
:
...
@@ -155,7 +195,7 @@ class EPCManagement():
...
@@ -155,7 +195,7 @@ class EPCManagement():
else
:
else
:
logging
.
error
(
'This option should not occur!'
)
logging
.
error
(
'This option should not occur!'
)
mySSH
.
close
()
mySSH
.
close
()
#self
.CreateHtmlTestRow(self.EPCType, 'OK', ALL_PROCESSES_OK)
HTML
.
CreateHtmlTestRow
(
self
.
EPCType
,
'OK'
,
ALL_PROCESSES_OK
)
def
CheckHSSProcess
(
self
,
status_queue
):
def
CheckHSSProcess
(
self
,
status_queue
):
...
@@ -255,7 +295,7 @@ class EPCManagement():
...
@@ -255,7 +295,7 @@ class EPCManagement():
else
:
else
:
logging
.
error
(
'This should not happen!'
)
logging
.
error
(
'This should not happen!'
)
mySSH
.
close
()
mySSH
.
close
()
#self
.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
def
TerminateMME
(
self
):
def
TerminateMME
(
self
):
mySSH
=
SSH
.
SSHConnection
()
mySSH
=
SSH
.
SSHConnection
()
...
@@ -274,7 +314,7 @@ class EPCManagement():
...
@@ -274,7 +314,7 @@ class EPCManagement():
else
:
else
:
logging
.
error
(
'This should not happen!'
)
logging
.
error
(
'This should not happen!'
)
mySSH
.
close
()
mySSH
.
close
()
#self
.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK)
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
ALL_PROCESSES_OK
)
def
TerminateSPGW
(
self
):
def
TerminateSPGW
(
self
):
mySSH
=
SSH
.
SSHConnection
()
mySSH
=
SSH
.
SSHConnection
()
...
@@ -305,7 +345,7 @@ class EPCManagement():
...
@@ -305,7 +345,7 @@ class EPCManagement():
else
:
else
:
logging
.
error
(
'This should not happen!'
)
logging
.
error
(
'This should not happen!'
)
mySSH
.
close
()
mySSH
.
close
()
#self
.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
def
LogCollectHSS
(
self
):
def
LogCollectHSS
(
self
):
...
...
ci-scripts/helpreadme.py
View file @
c286b2a9
# * 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
# */
#---------------------------------------------------------------------
# Python for CI of OAI-eNB + COTS-UE
#
# Required Python Version
# Python 3.x
#
# Required Python Package
# pexpect
#---------------------------------------------------------------------
#-----------------------------------------------------------
#-----------------------------------------------------------
# Functions Declaration
# Functions Declaration
#-----------------------------------------------------------
#-----------------------------------------------------------
...
...
ci-scripts/html.py
View file @
c286b2a9
# * 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
# */
#---------------------------------------------------------------------
# Python for CI of OAI-eNB + COTS-UE
#
# Required Python Version
# Python 3.x
#
# Required Python Package
# pexpect
#---------------------------------------------------------------------
#-----------------------------------------------------------
#-----------------------------------------------------------
# Import
# Import
...
@@ -10,117 +39,24 @@ import time
...
@@ -10,117 +39,24 @@ import time
import
subprocess
import
subprocess
from
multiprocessing
import
Process
,
Lock
,
SimpleQueue
from
multiprocessing
import
Process
,
Lock
,
SimpleQueue
#-----------------------------------------------------------
# OAI Testing modules
#-----------------------------------------------------------
#import main_enb
#MAIN = main_enb.OaiCiTest()
#-----------------------------------------------------------
#-----------------------------------------------------------
# Class Declaration
# Class Declaration
#-----------------------------------------------------------
#-----------------------------------------------------------
class
HTMLManagement
():
class
HTMLManagement
():
def
__init__
(
self
):
def
__init__
(
self
):
# self.FailReportCnt = 0
# self.prematureExit = False
self
.
ranRepository
=
''
self
.
ranBranch
=
''
self
.
ranAllowMerge
=
False
self
.
ranCommitID
=
''
self
.
ranTargetBranch
=
''
#self.eNBIPAddress = ''
#self.eNBUserName = ''
#self.eNBPassword = ''
#self.eNBSourceCodePath = ''
#self.eNB1IPAddress = ''
#self.eNB1UserName = ''
#self.eNB1Password = ''
#self.eNB1SourceCodePath = ''
#self.eNB2IPAddress = ''
#self.eNB2UserName = ''
#self.eNB2Password = ''
#self.eNB2SourceCodePath = ''
#self.ADBIPAddress = ''
#self.ADBUserName = ''
#self.ADBPassword = ''
#self.ADBCentralized = True
#self.testCase_id = ''
self
.
testXMLfiles
=
[]
self
.
nbTestXMLfiles
=
0
#self.desc = ''
#self.Build_eNB_args = ''
#self.backgroundBuild = False
#self.backgroundBuildTestId = ['', '', '']
#self.Build_eNB_forced_workspace_cleanup = False
#self.Initialize_eNB_args = ''
#self.air_interface = 'lte'
#self.eNB_instance = ''
#self.eNB_serverId = ''
#self.eNBLogFiles = ['', '', '']
#self.eNBOptions = ['', '', '']
#self.eNBmbmsEnables = [False, False, False]
#self.eNBstatuses = [-1, -1, -1]
#self.ping_args = ''
#self.ping_packetloss_threshold = ''
#self.iperf_args = ''
#self.iperf_packetloss_threshold = ''
#self.iperf_profile = ''
#self.iperf_options = ''
#self.nbMaxUEtoAttach = -1
#self.UEDevices = []
#self.UEDevicesStatus = []
#self.UEDevicesRemoteServer = []
#self.UEDevicesRemoteUser = []
#self.UEDevicesOffCmd = []
#self.UEDevicesOnCmd = []
#self.UEDevicesRebootCmd = []
#self.CatMDevices = []
#self.UEIPAddresses = []
self
.
htmlFile
=
''
self
.
htmlHeaderCreated
=
False
self
.
htmlFooterCreated
=
False
self
.
htmlUEConnected
=
-
1
self
.
htmlNb_Smartphones
=
0
self
.
htmlNb_CATM_Modules
=
0
self
.
htmleNBFailureMsg
=
''
self
.
htmlUEFailureMsg
=
''
#self.picocom_closure = False
#self.idle_sleep_time = 0
#self.x2_ho_options = 'network'
#self.x2NbENBs = 0
#self.x2ENBBsIds = []
#self.x2ENBConnectedUEs = []
self
.
htmlTabRefs
=
[]
self
.
htmlTabRefs
=
[]
self
.
htmlTabNames
=
[]
self
.
htmlTabNames
=
[]
self
.
htmlTabIcons
=
[]
self
.
htmlTabIcons
=
[]
#self.repeatCounts = []
self
.
testXMLfiles
=
[]
#self.finalStatus = False
#self.OsVersion = ''
#self.KernelVersion = ''
#self.UhdVersion = ''
#self.UsrpBoard = ''
#self.CpuNb = ''
#self.CpuModel = ''
#self.CpuMHz = ''
#self.UEIPAddress = ''
#self.UEUserName = ''
#self.UEPassword = ''
#self.UE_instance = ''
#self.UESourceCodePath = ''
#self.UELogFile = ''
#self.Build_OAI_UE_args = ''
#self.Initialize_OAI_UE_args = ''
#self.clean_repository = True
#self.flexranCtrlInstalled = False
#self.flexranCtrlStarted = False
#self.expectedNbOfConnectedUEs = 0
#self.startTime = 0
#-----------------------------------------------------------
#-----------------------------------------------------------
#
HTML Reporting....
#
Setters and Getters
#-----------------------------------------------------------
#-----------------------------------------------------------
def
SetreseNB
(
self
,
rsenb
):
self
.
reseNB
=
rsenb
def
SetresUE
(
self
,
rsue
):
self
.
resUE
=
rsue
def
Setdesc
(
self
,
dsc
):
def
Setdesc
(
self
,
dsc
):
self
.
desc
=
dsc
self
.
desc
=
dsc
...
@@ -158,11 +94,6 @@ class HTMLManagement():
...
@@ -158,11 +94,6 @@ class HTMLManagement():
def
GetranTargetBranch
(
self
):
def
GetranTargetBranch
(
self
):
return
self
.
ranTargetBranch
return
self
.
ranTargetBranch
# def SetADBIPAddress(self, adbip):
# self.ADBIPAddress = adbip
# def GetADBIPAddress(self):
# return self.ADBIPAddress
def
SethtmlUEConnected
(
self
,
nbUEs
):
def
SethtmlUEConnected
(
self
,
nbUEs
):
self
.
htmlUEConnected
=
nbUEs
self
.
htmlUEConnected
=
nbUEs
...
@@ -187,6 +118,12 @@ class HTMLManagement():
...
@@ -187,6 +118,12 @@ class HTMLManagement():
def
SethtmlTabIcons
(
self
,
tabIcon
):
def
SethtmlTabIcons
(
self
,
tabIcon
):
self
.
htmlTabIcons
.
append
(
tabIcon
)
self
.
htmlTabIcons
.
append
(
tabIcon
)
#-----------------------------------------------------------
# HTML structure creation functions
#-----------------------------------------------------------
def
CreateHtmlHeader
(
self
,
ADBIPAddress
):
def
CreateHtmlHeader
(
self
,
ADBIPAddress
):
if
(
not
self
.
htmlHeaderCreated
):
if
(
not
self
.
htmlHeaderCreated
):
logging
.
debug
(
'
\u001B
[1m----------------------------------------
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1m----------------------------------------
\u001B
[0m'
)
...
@@ -270,15 +207,9 @@ class HTMLManagement():
...
@@ -270,15 +207,9 @@ class HTMLManagement():
self
.
htmlFile
.
write
(
' </table>
\n
'
)
self
.
htmlFile
.
write
(
' </table>
\n
'
)
if
(
ADBIPAddress
!=
'none'
):
if
(
ADBIPAddress
!=
'none'
):
#terminate_ue_flag = True
#MAIN.GetAllUEDevices(terminate_ue_flag)
#self.GetAllCatMDevices(terminate_ue_flag)
#self.htmlUEConnected = len(self.UEDevices)
self
.
htmlFile
.
write
(
' <h2><span class="glyphicon glyphicon-phone"></span> <span class="glyphicon glyphicon-menu-right"></span> '
+
str
(
self
.
htmlNb_Smartphones
)
+
' UE(s) is(are) connected to ADB bench server</h2>
\n
'
)
self
.
htmlFile
.
write
(
' <h2><span class="glyphicon glyphicon-phone"></span> <span class="glyphicon glyphicon-menu-right"></span> '
+
str
(
self
.
htmlNb_Smartphones
)
+
' UE(s) is(are) connected to ADB bench server</h2>
\n
'
)
self
.
htmlFile
.
write
(
' <h2><span class="glyphicon glyphicon-phone"></span> <span class="glyphicon glyphicon-menu-right"></span> '
+
str
(
self
.
htmlNb_CATM_Modules
)
+
' CAT-M UE(s) is(are) connected to bench server</h2>
\n
'
)
self
.
htmlFile
.
write
(
' <h2><span class="glyphicon glyphicon-phone"></span> <span class="glyphicon glyphicon-menu-right"></span> '
+
str
(
self
.
htmlNb_CATM_Modules
)
+
' CAT-M UE(s) is(are) connected to bench server</h2>
\n
'
)
else
:
else
:
#self.UEDevices.append('OAI-UE')
#self.htmlUEConnected = len(self.UEDevices)
self
.
htmlUEConnected
=
1
self
.
htmlUEConnected
=
1
self
.
htmlFile
.
write
(
' <h2><span class="glyphicon glyphicon-phone"></span> <span class="glyphicon glyphicon-menu-right"></span> 1 OAI UE(s) is(are) connected to CI bench</h2>
\n
'
)
self
.
htmlFile
.
write
(
' <h2><span class="glyphicon glyphicon-phone"></span> <span class="glyphicon glyphicon-menu-right"></span> 1 OAI UE(s) is(are) connected to CI bench</h2>
\n
'
)
self
.
htmlFile
.
write
(
' <br>
\n
'
)
self
.
htmlFile
.
write
(
' <br>
\n
'
)
...
@@ -316,14 +247,6 @@ class HTMLManagement():
...
@@ -316,14 +247,6 @@ class HTMLManagement():
self
.
htmlFile
.
write
(
' <th>Test Desc</th>
\n
'
)
self
.
htmlFile
.
write
(
' <th>Test Desc</th>
\n
'
)
self
.
htmlFile
.
write
(
' <th>Test Options</th>
\n
'
)
self
.
htmlFile
.
write
(
' <th>Test Options</th>
\n
'
)
self
.
htmlFile
.
write
(
' <th>Test Status</th>
\n
'
)
self
.
htmlFile
.
write
(
' <th>Test Status</th>
\n
'
)
#if (self.htmlUEConnected == -1):
# terminate_ue_flag = True
# if (self.ADBIPAddress != 'none'):
# self.GetAllUEDevices(terminate_ue_flag)
# self.GetAllCatMDevices(terminate_ue_flag)
# else:
# self.UEDevices.append('OAI-UE')
# self.htmlUEConnected = len(self.UEDevices)
i
=
0
i
=
0
while
(
i
<
self
.
htmlUEConnected
):
while
(
i
<
self
.
htmlUEConnected
):
...
@@ -366,14 +289,41 @@ class HTMLManagement():
...
@@ -366,14 +289,41 @@ class HTMLManagement():
self
.
htmlFile
.
write
(
' <p></p>
\n
'
)
self
.
htmlFile
.
write
(
' <p></p>
\n
'
)
self
.
htmlFile
.
write
(
' <table class="table table-condensed">
\n
'
)
self
.
htmlFile
.
write
(
' <table class="table table-condensed">
\n
'
)
machines
=
[
'eNB'
,
'UE'
]
# GP machines = [ 'eNB', 'UE' ]
for
machine
in
machines
:
# GP for machine in machines:
#This needs to move back to main and be called before CreateHtmlFooter
#GP This needs to move back to main and be called before CreateHtmlFooter
res
=
self
.
RetrieveSystemVersion
(
machine
)
if
res
==
-
1
:
res
=
self
.
reseNB
continue
if
res
!=
-
1
:
self
.
htmlFile
.
write
(
' <tr>
\n
'
)
self
.
htmlFile
.
write
(
' <th colspan=8>'
+
str
(
'eNB'
)
+
' Server Characteristics</th>
\n
'
)
self
.
htmlFile
.
write
(
' </tr>
\n
'
)
self
.
htmlFile
.
write
(
' <tr>
\n
'
)
self
.
htmlFile
.
write
(
' <td>OS Version</td>
\n
'
)
self
.
htmlFile
.
write
(
' <td><span class="label label-default">'
+
self
.
OsVersion
+
'</span></td>
\n
'
)
self
.
htmlFile
.
write
(
' <td>Kernel Version</td>
\n
'
)
self
.
htmlFile
.
write
(
' <td><span class="label label-default">'
+
self
.
KernelVersion
+
'</span></td>
\n
'
)
self
.
htmlFile
.
write
(
' <td>UHD Version</td>
\n
'
)
self
.
htmlFile
.
write
(
' <td><span class="label label-default">'
+
self
.
UhdVersion
+
'</span></td>
\n
'
)
self
.
htmlFile
.
write
(
' <td>USRP Board</td>
\n
'
)
self
.
htmlFile
.
write
(
' <td><span class="label label-default">'
+
self
.
UsrpBoard
+
'</span></td>
\n
'
)
self
.
htmlFile
.
write
(
' </tr>
\n
'
)
self
.
htmlFile
.
write
(
' <tr>
\n
'
)
self
.
htmlFile
.
write
(
' <td>Nb CPUs</td>
\n
'
)
self
.
htmlFile
.
write
(
' <td><span class="label label-default">'
+
self
.
CpuNb
+
'</span></td>
\n
'
)
self
.
htmlFile
.
write
(
' <td>CPU Model Name</td>
\n
'
)
self
.
htmlFile
.
write
(
' <td><span class="label label-default">'
+
self
.
CpuModel
+
'</span></td>
\n
'
)
self
.
htmlFile
.
write
(
' <td>CPU Frequency</td>
\n
'
)
self
.
htmlFile
.
write
(
' <td><span class="label label-default">'
+
self
.
CpuMHz
+
'</span></td>
\n
'
)
self
.
htmlFile
.
write
(
' <td></td>
\n
'
)
self
.
htmlFile
.
write
(
' <td></td>
\n
'
)
self
.
htmlFile
.
write
(
' </tr>
\n
'
)
res
=
self
.
resUE
if
res
!=
-
1
:
self
.
htmlFile
.
write
(
' <tr>
\n
'
)
self
.
htmlFile
.
write
(
' <tr>
\n
'
)
self
.
htmlFile
.
write
(
' <th colspan=8>'
+
str
(
machine
)
+
' Server Characteristics</th>
\n
'
)
self
.
htmlFile
.
write
(
' <th colspan=8>'
+
str
(
'UE'
)
+
' Server Characteristics</th>
\n
'
)
self
.
htmlFile
.
write
(
' </tr>
\n
'
)
self
.
htmlFile
.
write
(
' </tr>
\n
'
)
self
.
htmlFile
.
write
(
' <tr>
\n
'
)
self
.
htmlFile
.
write
(
' <tr>
\n
'
)
self
.
htmlFile
.
write
(
' <td>OS Version</td>
\n
'
)
self
.
htmlFile
.
write
(
' <td>OS Version</td>
\n
'
)
...
@@ -410,8 +360,6 @@ class HTMLManagement():
...
@@ -410,8 +360,6 @@ class HTMLManagement():
self
.
htmlFile
.
write
(
'</html>
\n
'
)
self
.
htmlFile
.
write
(
'</html>
\n
'
)
self
.
htmlFile
.
close
()
self
.
htmlFile
.
close
()
#FailReportCnt should be passed as a parameter of CreateHtmlRetrySeparator method
# no need for a setter and be a member of html class
def
CreateHtmlRetrySeparator
(
self
,
cntnumfails
):
def
CreateHtmlRetrySeparator
(
self
,
cntnumfails
):
if
((
not
self
.
htmlFooterCreated
)
and
(
self
.
htmlHeaderCreated
)):
if
((
not
self
.
htmlFooterCreated
)
and
(
self
.
htmlHeaderCreated
)):
self
.
htmlFile
=
open
(
'test_results.html'
,
'a'
)
self
.
htmlFile
=
open
(
'test_results.html'
,
'a'
)
...
...
ci-scripts/main_enb.py
View file @
c286b2a9
...
@@ -35,43 +35,6 @@ import constants as CONST
...
@@ -35,43 +35,6 @@ import constants as CONST
#-----------------------------------------------------------
#-----------------------------------------------------------
Version
=
'0.1'
Version
=
'0.1'
#-----------------------------------------------------------
# Constants
#-----------------------------------------------------------
ALL_PROCESSES_OK
=
CONST
.
ALL_PROCESSES_OK
ENB_PROCESS_FAILED
=
CONST
.
ENB_PROCESS_FAILED
ENB_PROCESS_OK
=
CONST
.
ENB_PROCESS_OK
ENB_PROCESS_SEG_FAULT
=
CONST
.
ENB_PROCESS_SEG_FAULT
ENB_PROCESS_ASSERTION
=
CONST
.
ENB_PROCESS_ASSERTION
ENB_PROCESS_REALTIME_ISSUE
=
CONST
.
ENB_PROCESS_REALTIME_ISSUE
ENB_PROCESS_NOLOGFILE_TO_ANALYZE
=
CONST
.
ENB_PROCESS_NOLOGFILE_TO_ANALYZE
ENB_PROCESS_SLAVE_RRU_NOT_SYNCED
=
CONST
.
ENB_PROCESS_SLAVE_RRU_NOT_SYNCED
HSS_PROCESS_FAILED
=
CONST
.
HSS_PROCESS_FAILED
HSS_PROCESS_OK
=
CONST
.
HSS_PROCESS_OK
MME_PROCESS_FAILED
=
CONST
.
MME_PROCESS_FAILED
MME_PROCESS_OK
=
CONST
.
MME_PROCESS_OK
SPGW_PROCESS_FAILED
=
CONST
.
SPGW_PROCESS_FAILED
SPGW_PROCESS_OK
=
CONST
.
SPGW_PROCESS_OK
UE_IP_ADDRESS_ISSUE
=
CONST
.
UE_IP_ADDRESS_ISSUE
OAI_UE_PROCESS_NOLOGFILE_TO_ANALYZE
=
CONST
.
OAI_UE_PROCESS_NOLOGFILE_TO_ANALYZE
OAI_UE_PROCESS_COULD_NOT_SYNC
=
CONST
.
OAI_UE_PROCESS_COULD_NOT_SYNC
OAI_UE_PROCESS_ASSERTION
=
CONST
.
OAI_UE_PROCESS_ASSERTION
OAI_UE_PROCESS_FAILED
=
CONST
.
OAI_UE_PROCESS_FAILED
OAI_UE_PROCESS_NO_TUNNEL_INTERFACE
=
CONST
.
OAI_UE_PROCESS_NO_TUNNEL_INTERFACE
OAI_UE_PROCESS_SEG_FAULT
=
CONST
.
OAI_UE_PROCESS_SEG_FAULT
OAI_UE_PROCESS_OK
=
CONST
.
OAI_UE_PROCESS_OK
UE_STATUS_DETACHED
=
CONST
.
UE_STATUS_DETACHED
UE_STATUS_DETACHING
=
CONST
.
UE_STATUS_DETACHING
UE_STATUS_ATTACHING
=
CONST
.
UE_STATUS_ATTACHING
UE_STATUS_ATTACHED
=
CONST
.
UE_STATUS_ATTACHED
X2_HO_REQ_STATE__IDLE
=
CONST
.
X2_HO_REQ_STATE__IDLE
X2_HO_REQ_STATE__TARGET_RECEIVES_REQ
=
CONST
.
X2_HO_REQ_STATE__TARGET_RECEIVES_REQ
X2_HO_REQ_STATE__TARGET_RRC_RECFG_COMPLETE
=
CONST
.
X2_HO_REQ_STATE__TARGET_RRC_RECFG_COMPLETE
X2_HO_REQ_STATE__TARGET_SENDS_SWITCH_REQ
=
CONST
.
X2_HO_REQ_STATE__TARGET_SENDS_SWITCH_REQ
X2_HO_REQ_STATE__SOURCE_RECEIVES_REQ_ACK
=
CONST
.
X2_HO_REQ_STATE__SOURCE_RECEIVES_REQ_ACK
#-----------------------------------------------------------
#-----------------------------------------------------------
# Import
# Import
#-----------------------------------------------------------
#-----------------------------------------------------------
...
@@ -91,36 +54,14 @@ logging.basicConfig(
...
@@ -91,36 +54,14 @@ logging.basicConfig(
format
=
"[%(asctime)s] %(name)s:%(levelname)s: %(message)s"
format
=
"[%(asctime)s] %(name)s:%(levelname)s: %(message)s"
)
)
#-----------------------------------------------------------
#-----------------------------------------------------------
# Class Declaration
# Class Declaration
#-----------------------------------------------------------
#-----------------------------------------------------------
class
OaiCiTest
():
class
OaiCiTest
():
def
__init__
(
self
):
def
__init__
(
self
):
self
.
FailReportCnt
=
0
self
.
FailReportCnt
=
0
self
.
prematureExit
=
False
#self.ranRepository = ''
#self.ranBranch = ''
#RAN.GetranAllowMerge() = False
#self.ranCommitID = ''
#RAN.GetranTargetBranch() = ''
#self.eNBIPAddress = ''
#self.eNBUserName = ''
#self.eNBPassword = ''
#RAN.GeteNBSourceCodePath() = ''
#self.EPCIPAddress = ''
#self.EPCUserName = ''
#self.EPCPassword = ''
#self.eNB1IPAddress = ''
#self.eNB1UserName = ''
#self.eNB1Password = ''
#self.eNB1SourceCodePath = ''
#self.eNB2IPAddress = ''
#self.eNB2UserName = ''
#self.eNB2Password = ''
#self.eNB2SourceCodePath = ''
#self.EPCSourceCodePath = ''
#self.EPCType = ''
#self.EPC_PcapFileName = ''
self
.
ADBIPAddress
=
''
self
.
ADBIPAddress
=
''
self
.
ADBUserName
=
''
self
.
ADBUserName
=
''
self
.
ADBPassword
=
''
self
.
ADBPassword
=
''
...
@@ -129,18 +70,6 @@ class OaiCiTest():
...
@@ -129,18 +70,6 @@ class OaiCiTest():
self
.
testXMLfiles
=
[]
self
.
testXMLfiles
=
[]
self
.
nbTestXMLfiles
=
0
self
.
nbTestXMLfiles
=
0
self
.
desc
=
''
self
.
desc
=
''
#RAN.GetBuild_eNB_args() = ''
#self.backgroundBuild = False
#self.backgroundBuildTestId = ['', '', '']
#self.Build_eNB_forced_workspace_cleanup = False
#RAN.GetInitialize_eNB_args() = ''
self
.
air_interface
=
'lte'
#self.eNB_instance = ''
#self.eNB_serverId = ''
#self.eNBLogFiles = ['', '', '']
#self.eNBOptions = ['', '', '']
#self.eNBmbmsEnables = [False, False, False]
#self.eNBstatuses = [-1, -1, -1]
self
.
ping_args
=
''
self
.
ping_args
=
''
self
.
ping_packetloss_threshold
=
''
self
.
ping_packetloss_threshold
=
''
self
.
iperf_args
=
''
self
.
iperf_args
=
''
...
@@ -169,9 +98,6 @@ class OaiCiTest():
...
@@ -169,9 +98,6 @@ class OaiCiTest():
self
.
x2NbENBs
=
0
self
.
x2NbENBs
=
0
self
.
x2ENBBsIds
=
[]
self
.
x2ENBBsIds
=
[]
self
.
x2ENBConnectedUEs
=
[]
self
.
x2ENBConnectedUEs
=
[]
#self.htmlTabRefs = []
#self.htmlTabNames = []
#self.htmlTabIcons = []
self
.
repeatCounts
=
[]
self
.
repeatCounts
=
[]
self
.
finalStatus
=
False
self
.
finalStatus
=
False
self
.
OsVersion
=
''
self
.
OsVersion
=
''
...
@@ -246,7 +172,7 @@ class OaiCiTest():
...
@@ -246,7 +172,7 @@ class OaiCiTest():
mismatch
=
True
mismatch
=
True
if
not
mismatch
:
if
not
mismatch
:
SSH
.
close
()
SSH
.
close
()
HTML
.
CreateHtmlTestRow
(
RAN
.
GetBuild_eNB_args
(),
'OK'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
RAN
.
GetBuild_eNB_args
(),
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
return
return
SSH
.
command
(
'echo '
+
self
.
UEPassword
+
' | sudo -S git clean -x -d -ff'
,
'\$'
,
30
)
SSH
.
command
(
'echo '
+
self
.
UEPassword
+
' | sudo -S git clean -x -d -ff'
,
'\$'
,
30
)
...
@@ -291,11 +217,11 @@ class OaiCiTest():
...
@@ -291,11 +217,11 @@ class OaiCiTest():
else
:
else
:
SSH
.
command
(
'echo "MERGED_W_TGT_BRANCH: NO" >> ../LAST_BUILD_INFO.txt'
,
'\$'
,
2
)
SSH
.
command
(
'echo "MERGED_W_TGT_BRANCH: NO" >> ../LAST_BUILD_INFO.txt'
,
'\$'
,
2
)
SSH
.
close
()
SSH
.
close
()
HTML
.
CreateHtmlTestRow
(
self
.
Build_OAI_UE_args
,
'OK'
,
ALL_PROCESSES_OK
,
'OAI UE'
)
HTML
.
CreateHtmlTestRow
(
self
.
Build_OAI_UE_args
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
,
'OAI UE'
)
else
:
else
:
SSH
.
close
()
SSH
.
close
()
logging
.
error
(
'
\u001B
[1m Building OAI UE Failed
\u001B
[0m'
)
logging
.
error
(
'
\u001B
[1m Building OAI UE Failed
\u001B
[0m'
)
HTML
.
CreateHtmlTestRow
(
self
.
Build_OAI_UE_args
,
'KO'
,
ALL_PROCESSES_OK
,
'OAI UE'
)
HTML
.
CreateHtmlTestRow
(
self
.
Build_OAI_UE_args
,
'KO'
,
CONST
.
ALL_PROCESSES_OK
,
'OAI UE'
)
HTML
.
CreateHtmlTabFooter
(
False
)
HTML
.
CreateHtmlTabFooter
(
False
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
@@ -330,7 +256,7 @@ class OaiCiTest():
...
@@ -330,7 +256,7 @@ class OaiCiTest():
self
.
flexranCtrlStarted
=
True
self
.
flexranCtrlStarted
=
True
RAN
.
SetflexranCtrlStarted
(
True
)
RAN
.
SetflexranCtrlStarted
(
True
)
SSH
.
close
()
SSH
.
close
()
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
def
InitializeUE_common
(
self
,
device_id
,
idx
):
def
InitializeUE_common
(
self
,
device_id
,
idx
):
try
:
try
:
...
@@ -393,7 +319,7 @@ class OaiCiTest():
...
@@ -393,7 +319,7 @@ class OaiCiTest():
i
+=
1
i
+=
1
for
job
in
multi_jobs
:
for
job
in
multi_jobs
:
job
.
join
()
job
.
join
()
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
def
InitializeOAIUE
(
self
):
def
InitializeOAIUE
(
self
):
if
self
.
UEIPAddress
==
''
or
self
.
UEUserName
==
''
or
self
.
UEPassword
==
''
or
self
.
UESourceCodePath
==
''
:
if
self
.
UEIPAddress
==
''
or
self
.
UEUserName
==
''
or
self
.
UEPassword
==
''
or
self
.
UESourceCodePath
==
''
:
...
@@ -551,23 +477,23 @@ class OaiCiTest():
...
@@ -551,23 +477,23 @@ class OaiCiTest():
SSH
.
close
()
SSH
.
close
()
if
fullSyncStatus
and
gotSyncStatus
and
tunnelInterfaceStatus
:
if
fullSyncStatus
and
gotSyncStatus
and
tunnelInterfaceStatus
:
HTML
.
CreateHtmlTestRow
(
self
.
Initialize_OAI_UE_args
,
'OK'
,
ALL_PROCESSES_OK
,
'OAI UE'
)
HTML
.
CreateHtmlTestRow
(
self
.
Initialize_OAI_UE_args
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
,
'OAI UE'
)
logging
.
debug
(
'
\u001B
[1m Initialize OAI UE Completed
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1m Initialize OAI UE Completed
\u001B
[0m'
)
if
(
self
.
ADBIPAddress
!=
'none'
):
if
(
self
.
ADBIPAddress
!=
'none'
):
self
.
UEDevices
=
[]
self
.
UEDevices
=
[]
self
.
UEDevices
.
append
(
'OAI-UE'
)
self
.
UEDevices
.
append
(
'OAI-UE'
)
self
.
UEDevicesStatus
=
[]
self
.
UEDevicesStatus
=
[]
self
.
UEDevicesStatus
.
append
(
UE_STATUS_DETACHED
)
self
.
UEDevicesStatus
.
append
(
CONST
.
UE_STATUS_DETACHED
)
else
:
else
:
if
RAN
.
Getair_interface
()
==
'lte'
:
if
RAN
.
Getair_interface
()
==
'lte'
:
if
RAN
.
GeteNBmbmsEnables
[
0
]:
if
RAN
.
GeteNBmbmsEnables
[
0
]:
self
.
htmlUEFailureMsg
=
'oaitun_ue1/oaitun_uem1 interfaces are either NOT mounted or NOT configured'
self
.
htmlUEFailureMsg
=
'oaitun_ue1/oaitun_uem1 interfaces are either NOT mounted or NOT configured'
else
:
else
:
self
.
htmlUEFailureMsg
=
'oaitun_ue1 interface is either NOT mounted or NOT configured'
self
.
htmlUEFailureMsg
=
'oaitun_ue1 interface is either NOT mounted or NOT configured'
HTML
.
CreateHtmlTestRow
(
self
.
Initialize_OAI_UE_args
,
'KO'
,
OAI_UE_PROCESS_NO_TUNNEL_INTERFACE
,
'OAI UE'
)
HTML
.
CreateHtmlTestRow
(
self
.
Initialize_OAI_UE_args
,
'KO'
,
CONST
.
OAI_UE_PROCESS_NO_TUNNEL_INTERFACE
,
'OAI UE'
)
else
:
else
:
self
.
htmlUEFailureMsg
=
'nr-uesoftmodem did NOT synced'
self
.
htmlUEFailureMsg
=
'nr-uesoftmodem did NOT synced'
HTML
.
CreateHtmlTestRow
(
self
.
Initialize_OAI_UE_args
,
'KO'
,
OAI_UE_PROCESS_COULD_NOT_SYNC
,
'OAI UE'
)
HTML
.
CreateHtmlTestRow
(
self
.
Initialize_OAI_UE_args
,
'KO'
,
CONST
.
OAI_UE_PROCESS_COULD_NOT_SYNC
,
'OAI UE'
)
logging
.
error
(
'
\033
[91mInitialize OAI UE Failed!
\033
[0m'
)
logging
.
error
(
'
\033
[91mInitialize OAI UE Failed!
\033
[0m'
)
self
.
AutoTerminateUEandeNB
()
self
.
AutoTerminateUEandeNB
()
...
@@ -620,7 +546,7 @@ class OaiCiTest():
...
@@ -620,7 +546,7 @@ class OaiCiTest():
# Force closure of picocom but device might still be locked
# Force closure of picocom but device might still be locked
SSH
.
close
()
SSH
.
close
()
self
.
picocom_closure
=
False
self
.
picocom_closure
=
False
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
self
.
checkDevTTYisUnlocked
()
self
.
checkDevTTYisUnlocked
()
def
TerminateCatM
(
self
):
def
TerminateCatM
(
self
):
...
@@ -641,7 +567,7 @@ class OaiCiTest():
...
@@ -641,7 +567,7 @@ class OaiCiTest():
logging
.
debug
(
'
\u001B
[1m Cellular Functionality disabled
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1m Cellular Functionality disabled
\u001B
[0m'
)
SSH
.
close
()
SSH
.
close
()
self
.
picocom_closure
=
False
self
.
picocom_closure
=
False
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
self
.
checkDevTTYisUnlocked
()
self
.
checkDevTTYisUnlocked
()
def
AttachCatM
(
self
):
def
AttachCatM
(
self
):
...
@@ -902,7 +828,7 @@ class OaiCiTest():
...
@@ -902,7 +828,7 @@ class OaiCiTest():
nb_ue_to_connect
=
0
nb_ue_to_connect
=
0
for
device_id
in
self
.
UEDevices
:
for
device_id
in
self
.
UEDevices
:
if
(
self
.
nbMaxUEtoAttach
==
-
1
)
or
(
nb_ue_to_connect
<
self
.
nbMaxUEtoAttach
):
if
(
self
.
nbMaxUEtoAttach
==
-
1
)
or
(
nb_ue_to_connect
<
self
.
nbMaxUEtoAttach
):
self
.
UEDevicesStatus
[
nb_ue_to_connect
]
=
UE_STATUS_ATTACHING
self
.
UEDevicesStatus
[
nb_ue_to_connect
]
=
CONST
.
UE_STATUS_ATTACHING
p
=
Process
(
target
=
self
.
AttachUE_common
,
args
=
(
device_id
,
status_queue
,
lock
,
nb_ue_to_connect
,))
p
=
Process
(
target
=
self
.
AttachUE_common
,
args
=
(
device_id
,
status_queue
,
lock
,
nb_ue_to_connect
,))
p
.
daemon
=
True
p
.
daemon
=
True
p
.
start
()
p
.
start
()
...
@@ -912,7 +838,7 @@ class OaiCiTest():
...
@@ -912,7 +838,7 @@ class OaiCiTest():
job
.
join
()
job
.
join
()
if
(
status_queue
.
empty
()):
if
(
status_queue
.
empty
()):
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'KO'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'KO'
,
CONST
.
ALL_PROCESSES_OK
)
self
.
AutoTerminateUEandeNB
()
self
.
AutoTerminateUEandeNB
()
return
return
else
:
else
:
...
@@ -932,8 +858,8 @@ class OaiCiTest():
...
@@ -932,8 +858,8 @@ class OaiCiTest():
if
(
attach_status
):
if
(
attach_status
):
cnt
=
0
cnt
=
0
while
cnt
<
len
(
self
.
UEDevices
):
while
cnt
<
len
(
self
.
UEDevices
):
if
self
.
UEDevicesStatus
[
cnt
]
==
UE_STATUS_ATTACHING
:
if
self
.
UEDevicesStatus
[
cnt
]
==
CONST
.
UE_STATUS_ATTACHING
:
self
.
UEDevicesStatus
[
cnt
]
=
UE_STATUS_ATTACHED
self
.
UEDevicesStatus
[
cnt
]
=
CONST
.
UE_STATUS_ATTACHED
cnt
+=
1
cnt
+=
1
HTML
.
CreateHtmlTestRowQueue
(
'N/A'
,
'OK'
,
len
(
self
.
UEDevices
),
html_queue
)
HTML
.
CreateHtmlTestRowQueue
(
'N/A'
,
'OK'
,
len
(
self
.
UEDevices
),
html_queue
)
result
=
re
.
search
(
'T_stdout'
,
str
(
RAN
.
GetInitialize_eNB_args
()))
result
=
re
.
search
(
'T_stdout'
,
str
(
RAN
.
GetInitialize_eNB_args
()))
...
@@ -973,7 +899,7 @@ class OaiCiTest():
...
@@ -973,7 +899,7 @@ class OaiCiTest():
multi_jobs
=
[]
multi_jobs
=
[]
cnt
=
0
cnt
=
0
for
device_id
in
self
.
UEDevices
:
for
device_id
in
self
.
UEDevices
:
self
.
UEDevicesStatus
[
cnt
]
=
UE_STATUS_DETACHING
self
.
UEDevicesStatus
[
cnt
]
=
CONST
.
UE_STATUS_DETACHING
p
=
Process
(
target
=
self
.
DetachUE_common
,
args
=
(
device_id
,
cnt
,))
p
=
Process
(
target
=
self
.
DetachUE_common
,
args
=
(
device_id
,
cnt
,))
p
.
daemon
=
True
p
.
daemon
=
True
p
.
start
()
p
.
start
()
...
@@ -981,14 +907,14 @@ class OaiCiTest():
...
@@ -981,14 +907,14 @@ class OaiCiTest():
cnt
+=
1
cnt
+=
1
for
job
in
multi_jobs
:
for
job
in
multi_jobs
:
job
.
join
()
job
.
join
()
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
result
=
re
.
search
(
'T_stdout'
,
str
(
RAN
.
GetInitialize_eNB_args
()))
result
=
re
.
search
(
'T_stdout'
,
str
(
RAN
.
GetInitialize_eNB_args
()))
if
result
is
not
None
:
if
result
is
not
None
:
logging
.
debug
(
'Waiting 5 seconds to fill up record file'
)
logging
.
debug
(
'Waiting 5 seconds to fill up record file'
)
time
.
sleep
(
5
)
time
.
sleep
(
5
)
cnt
=
0
cnt
=
0
while
cnt
<
len
(
self
.
UEDevices
):
while
cnt
<
len
(
self
.
UEDevices
):
self
.
UEDevicesStatus
[
cnt
]
=
UE_STATUS_DETACHED
self
.
UEDevicesStatus
[
cnt
]
=
CONST
.
UE_STATUS_DETACHED
cnt
+=
1
cnt
+=
1
def
RebootUE_common
(
self
,
device_id
):
def
RebootUE_common
(
self
,
device_id
):
...
@@ -1049,7 +975,7 @@ class OaiCiTest():
...
@@ -1049,7 +975,7 @@ class OaiCiTest():
multi_jobs
.
append
(
p
)
multi_jobs
.
append
(
p
)
for
job
in
multi_jobs
:
for
job
in
multi_jobs
:
job
.
join
()
job
.
join
()
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
def
DataDisableUE_common
(
self
,
device_id
,
idx
):
def
DataDisableUE_common
(
self
,
device_id
,
idx
):
try
:
try
:
...
@@ -1078,7 +1004,7 @@ class OaiCiTest():
...
@@ -1078,7 +1004,7 @@ class OaiCiTest():
i
+=
1
i
+=
1
for
job
in
multi_jobs
:
for
job
in
multi_jobs
:
job
.
join
()
job
.
join
()
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
def
DataEnableUE_common
(
self
,
device_id
,
idx
):
def
DataEnableUE_common
(
self
,
device_id
,
idx
):
try
:
try
:
...
@@ -1107,7 +1033,7 @@ class OaiCiTest():
...
@@ -1107,7 +1033,7 @@ class OaiCiTest():
i
+=
1
i
+=
1
for
job
in
multi_jobs
:
for
job
in
multi_jobs
:
job
.
join
()
job
.
join
()
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
def
GetAllUEDevices
(
self
,
terminate_ue_flag
):
def
GetAllUEDevices
(
self
,
terminate_ue_flag
):
if
self
.
ADBIPAddress
==
''
or
self
.
ADBUserName
==
''
or
self
.
ADBPassword
==
''
:
if
self
.
ADBIPAddress
==
''
or
self
.
ADBUserName
==
''
or
self
.
ADBPassword
==
''
:
...
@@ -1152,7 +1078,7 @@ class OaiCiTest():
...
@@ -1152,7 +1078,7 @@ class OaiCiTest():
print
(
'len(self.UEDevicesStatus) == 0'
)
print
(
'len(self.UEDevicesStatus) == 0'
)
cnt
=
0
cnt
=
0
while
cnt
<
len
(
self
.
UEDevices
):
while
cnt
<
len
(
self
.
UEDevices
):
self
.
UEDevicesStatus
.
append
(
UE_STATUS_DETACHED
)
self
.
UEDevicesStatus
.
append
(
CONST
.
UE_STATUS_DETACHED
)
cnt
+=
1
cnt
+=
1
def
GetAllCatMDevices
(
self
,
terminate_ue_flag
):
def
GetAllCatMDevices
(
self
,
terminate_ue_flag
):
...
@@ -1272,7 +1198,7 @@ class OaiCiTest():
...
@@ -1272,7 +1198,7 @@ class OaiCiTest():
htmlOptions
=
'N/A'
htmlOptions
=
'N/A'
if
(
status_queue
.
empty
()):
if
(
status_queue
.
empty
()):
HTML
.
CreateHtmlTestRow
(
htmlOptions
,
'KO'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
htmlOptions
,
'KO'
,
CONST
.
ALL_PROCESSES_OK
)
self
.
AutoTerminateUEandeNB
()
self
.
AutoTerminateUEandeNB
()
else
:
else
:
check_status
=
True
check_status
=
True
...
@@ -1319,8 +1245,8 @@ class OaiCiTest():
...
@@ -1319,8 +1245,8 @@ class OaiCiTest():
SSH
.
open
(
self
.
ADBIPAddress
,
self
.
ADBUserName
,
self
.
ADBPassword
)
SSH
.
open
(
self
.
ADBIPAddress
,
self
.
ADBUserName
,
self
.
ADBPassword
)
idx
=
0
idx
=
0
for
device_id
in
self
.
UEDevices
:
for
device_id
in
self
.
UEDevices
:
print
(
'UE status attched'
+
UE_STATUS_ATTACHED
)
print
(
'UE status attched'
+
CONST
.
UE_STATUS_ATTACHED
)
if
self
.
UEDevicesStatus
[
idx
]
!=
UE_STATUS_ATTACHED
:
if
self
.
UEDevicesStatus
[
idx
]
!=
CONST
.
UE_STATUS_ATTACHED
:
idx
+=
1
idx
+=
1
continue
continue
count
=
0
count
=
0
...
@@ -1563,7 +1489,7 @@ class OaiCiTest():
...
@@ -1563,7 +1489,7 @@ class OaiCiTest():
return
return
ueIpStatus
=
self
.
GetAllUEIPAddresses
()
ueIpStatus
=
self
.
GetAllUEIPAddresses
()
if
(
ueIpStatus
<
0
):
if
(
ueIpStatus
<
0
):
HTML
.
CreateHtmlTestRow
(
self
.
ping_args
,
'KO'
,
UE_IP_ADDRESS_ISSUE
)
HTML
.
CreateHtmlTestRow
(
self
.
ping_args
,
'KO'
,
CONST
.
UE_IP_ADDRESS_ISSUE
)
self
.
AutoTerminateUEandeNB
()
self
.
AutoTerminateUEandeNB
()
return
return
multi_jobs
=
[]
multi_jobs
=
[]
...
@@ -1581,7 +1507,7 @@ class OaiCiTest():
...
@@ -1581,7 +1507,7 @@ class OaiCiTest():
job
.
join
()
job
.
join
()
if
(
status_queue
.
empty
()):
if
(
status_queue
.
empty
()):
HTML
.
CreateHtmlTestRow
(
self
.
ping_args
,
'KO'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
self
.
ping_args
,
'KO'
,
CONST
.
ALL_PROCESSES_OK
)
self
.
AutoTerminateUEandeNB
()
self
.
AutoTerminateUEandeNB
()
else
:
else
:
ping_status
=
True
ping_status
=
True
...
@@ -1998,7 +1924,7 @@ class OaiCiTest():
...
@@ -1998,7 +1924,7 @@ class OaiCiTest():
if
(
device_id
!=
'OAI-UE'
):
if
(
device_id
!=
'OAI-UE'
):
SSH
.
open
(
self
.
ADBIPAddress
,
self
.
ADBUserName
,
self
.
ADBPassword
)
SSH
.
open
(
self
.
ADBIPAddress
,
self
.
ADBUserName
,
self
.
ADBPassword
)
# if by chance ADB server and EPC are on the same remote host, at least log collection will take care of it
# if by chance ADB server and EPC are on the same remote host, at least log collection will take care of it
SSH
.
command
(
'if [ ! -d '
+
EPC
.
GetSourceCodePath
()
+
'/scripts ]; then mkdir -p '
+
self
.
EPCSourceCodePath
+
'/scripts ; fi'
,
'\$'
,
5
)
SSH
.
command
(
'if [ ! -d '
+
EPC
.
GetSourceCodePath
()
+
'/scripts ]; then mkdir -p '
+
EPC
.
GetSourceCodePath
()
+
'/scripts ; fi'
,
'\$'
,
5
)
SSH
.
command
(
'cd '
+
EPC
.
GetSourceCodePath
()
+
'/scripts'
,
'\$'
,
5
)
SSH
.
command
(
'cd '
+
EPC
.
GetSourceCodePath
()
+
'/scripts'
,
'\$'
,
5
)
# Checking if iperf / iperf3 are installed
# Checking if iperf / iperf3 are installed
if
self
.
ADBCentralized
:
if
self
.
ADBCentralized
:
...
@@ -2306,7 +2232,7 @@ class OaiCiTest():
...
@@ -2306,7 +2232,7 @@ class OaiCiTest():
ueIpStatus
=
self
.
GetAllUEIPAddresses
()
ueIpStatus
=
self
.
GetAllUEIPAddresses
()
if
(
ueIpStatus
<
0
):
if
(
ueIpStatus
<
0
):
logging
.
debug
(
'going here'
)
logging
.
debug
(
'going here'
)
HTML
.
CreateHtmlTestRow
(
self
.
iperf_args
,
'KO'
,
UE_IP_ADDRESS_ISSUE
)
HTML
.
CreateHtmlTestRow
(
self
.
iperf_args
,
'KO'
,
CONST
.
UE_IP_ADDRESS_ISSUE
)
self
.
AutoTerminateUEandeNB
()
self
.
AutoTerminateUEandeNB
()
return
return
...
@@ -2338,7 +2264,7 @@ class OaiCiTest():
...
@@ -2338,7 +2264,7 @@ class OaiCiTest():
job
.
join
()
job
.
join
()
if
(
status_queue
.
empty
()):
if
(
status_queue
.
empty
()):
HTML
.
CreateHtmlTestRow
(
self
.
iperf_args
,
'KO'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
self
.
iperf_args
,
'KO'
,
CONST
.
ALL_PROCESSES_OK
)
self
.
AutoTerminateUEandeNB
()
self
.
AutoTerminateUEandeNB
()
else
:
else
:
iperf_status
=
True
iperf_status
=
True
...
@@ -2406,7 +2332,7 @@ class OaiCiTest():
...
@@ -2406,7 +2332,7 @@ class OaiCiTest():
status
=
status_queue
.
get
()
status
=
status_queue
.
get
()
if
(
status
<
0
):
if
(
status
<
0
):
result
=
status
result
=
status
if
result
==
ENB_PROCESS_FAILED
:
if
result
==
CONST
.
ENB_PROCESS_FAILED
:
fileCheck
=
re
.
search
(
'enb_'
,
str
(
RAN
.
GeteNBLogFiles
[
0
]))
fileCheck
=
re
.
search
(
'enb_'
,
str
(
RAN
.
GeteNBLogFiles
[
0
]))
if
fileCheck
is
not
None
:
if
fileCheck
is
not
None
:
SSH
.
copyin
(
RAN
.
GeteNBIPAddress
(),
RAN
.
GeteNBUserName
(),
RAN
.
GeteNBPassword
(),
RAN
.
GeteNBSourceCodePath
()
+
'/cmake_targets/'
+
RAN
.
GeteNBLogFiles
[
0
],
'.'
)
SSH
.
copyin
(
RAN
.
GeteNBIPAddress
(),
RAN
.
GeteNBUserName
(),
RAN
.
GeteNBPassword
(),
RAN
.
GeteNBSourceCodePath
()
+
'/cmake_targets/'
+
RAN
.
GeteNBLogFiles
[
0
],
'.'
)
...
@@ -2437,7 +2363,7 @@ class OaiCiTest():
...
@@ -2437,7 +2363,7 @@ class OaiCiTest():
status
=
status_queue
.
get
()
status
=
status_queue
.
get
()
if
(
status
<
0
):
if
(
status
<
0
):
result
=
status
result
=
status
if
result
==
OAI_UE_PROCESS_FAILED
:
if
result
==
CONST
.
OAI_UE_PROCESS_FAILED
:
fileCheck
=
re
.
search
(
'ue_'
,
str
(
self
.
UELogFile
))
fileCheck
=
re
.
search
(
'ue_'
,
str
(
self
.
UELogFile
))
if
fileCheck
is
not
None
:
if
fileCheck
is
not
None
:
SSH
.
copyin
(
self
.
UEIPAddress
,
self
.
UEUserName
,
self
.
UEPassword
,
self
.
UESourceCodePath
+
'/cmake_targets/'
+
self
.
UELogFile
,
'.'
)
SSH
.
copyin
(
self
.
UEIPAddress
,
self
.
UEUserName
,
self
.
UEPassword
,
self
.
UESourceCodePath
+
'/cmake_targets/'
+
self
.
UELogFile
,
'.'
)
...
@@ -2453,9 +2379,9 @@ class OaiCiTest():
...
@@ -2453,9 +2379,9 @@ class OaiCiTest():
result
=
re
.
search
(
RAN
.
Getair_interface
()
+
'-uesoftmodem'
,
SSH
.
getBefore
())
result
=
re
.
search
(
RAN
.
Getair_interface
()
+
'-uesoftmodem'
,
SSH
.
getBefore
())
if
result
is
None
:
if
result
is
None
:
logging
.
debug
(
'
\u001B
[1;37;41m OAI UE Process Not Found!
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1;37;41m OAI UE Process Not Found!
\u001B
[0m'
)
status_queue
.
put
(
OAI_UE_PROCESS_FAILED
)
status_queue
.
put
(
CONST
.
OAI_UE_PROCESS_FAILED
)
else
:
else
:
status_queue
.
put
(
OAI_UE_PROCESS_OK
)
status_queue
.
put
(
CONST
.
OAI_UE_PROCESS_OK
)
SSH
.
close
()
SSH
.
close
()
except
:
except
:
os
.
kill
(
os
.
getppid
(),
signal
.
SIGUSR1
)
os
.
kill
(
os
.
getppid
(),
signal
.
SIGUSR1
)
...
@@ -2688,31 +2614,31 @@ class OaiCiTest():
...
@@ -2688,31 +2614,31 @@ class OaiCiTest():
if
foundSegFault
:
if
foundSegFault
:
logging
.
debug
(
'
\u001B
[1;37;41m UE ended with a Segmentation Fault!
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1;37;41m UE ended with a Segmentation Fault!
\u001B
[0m'
)
if
not
nrUEFlag
:
if
not
nrUEFlag
:
return
OAI_UE_PROCESS_SEG_FAULT
return
CONST
.
OAI_UE_PROCESS_SEG_FAULT
else
:
else
:
if
not
frequency_found
:
if
not
frequency_found
:
return
OAI_UE_PROCESS_SEG_FAULT
return
CONST
.
OAI_UE_PROCESS_SEG_FAULT
if
foundAssertion
:
if
foundAssertion
:
logging
.
debug
(
'
\u001B
[1;30;43m UE showed an assertion!
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1;30;43m UE showed an assertion!
\u001B
[0m'
)
self
.
htmlUEFailureMsg
+=
'UE showed an assertion!
\n
'
self
.
htmlUEFailureMsg
+=
'UE showed an assertion!
\n
'
if
not
nrUEFlag
:
if
not
nrUEFlag
:
if
not
mib_found
or
not
frequency_found
:
if
not
mib_found
or
not
frequency_found
:
return
OAI_UE_PROCESS_ASSERTION
return
CONST
.
OAI_UE_PROCESS_ASSERTION
else
:
else
:
if
not
frequency_found
:
if
not
frequency_found
:
return
OAI_UE_PROCESS_ASSERTION
return
CONST
.
OAI_UE_PROCESS_ASSERTION
if
foundRealTimeIssue
:
if
foundRealTimeIssue
:
logging
.
debug
(
'
\u001B
[1;37;41m UE faced real time issues!
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1;37;41m UE faced real time issues!
\u001B
[0m'
)
self
.
htmlUEFailureMsg
+=
'UE faced real time issues!
\n
'
self
.
htmlUEFailureMsg
+=
'UE faced real time issues!
\n
'
#return ENB_PROCESS_REALTIME_ISSUE
#return
CONST.
ENB_PROCESS_REALTIME_ISSUE
if
nrUEFlag
:
if
nrUEFlag
:
if
not
frequency_found
:
if
not
frequency_found
:
return
OAI_UE_PROCESS_COULD_NOT_SYNC
return
CONST
.
OAI_UE_PROCESS_COULD_NOT_SYNC
else
:
else
:
if
no_cell_sync_found
and
not
mib_found
:
if
no_cell_sync_found
and
not
mib_found
:
logging
.
debug
(
'
\u001B
[1;37;41m UE could not synchronize !
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1;37;41m UE could not synchronize !
\u001B
[0m'
)
self
.
htmlUEFailureMsg
+=
'UE could not synchronize!
\n
'
self
.
htmlUEFailureMsg
+=
'UE could not synchronize!
\n
'
return
OAI_UE_PROCESS_COULD_NOT_SYNC
return
CONST
.
OAI_UE_PROCESS_COULD_NOT_SYNC
return
0
return
0
...
@@ -2729,7 +2655,7 @@ class OaiCiTest():
...
@@ -2729,7 +2655,7 @@ class OaiCiTest():
time
.
sleep
(
1
)
time
.
sleep
(
1
)
SSH
.
close
()
SSH
.
close
()
self
.
flexranCtrlStarted
=
False
self
.
flexranCtrlStarted
=
False
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
def
TerminateUE_common
(
self
,
device_id
,
idx
):
def
TerminateUE_common
(
self
,
device_id
,
idx
):
try
:
try
:
...
@@ -2772,7 +2698,7 @@ class OaiCiTest():
...
@@ -2772,7 +2698,7 @@ class OaiCiTest():
i
+=
1
i
+=
1
for
job
in
multi_jobs
:
for
job
in
multi_jobs
:
job
.
join
()
job
.
join
()
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
def
TerminateOAIUE
(
self
):
def
TerminateOAIUE
(
self
):
SSH
.
open
(
self
.
UEIPAddress
,
self
.
UEUserName
,
self
.
UEPassword
)
SSH
.
open
(
self
.
UEIPAddress
,
self
.
UEUserName
,
self
.
UEPassword
)
...
@@ -2795,7 +2721,7 @@ class OaiCiTest():
...
@@ -2795,7 +2721,7 @@ class OaiCiTest():
if
(
copyin_res
==
-
1
):
if
(
copyin_res
==
-
1
):
logging
.
debug
(
'
\u001B
[1;37;41m Could not copy UE logfile to analyze it!
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1;37;41m Could not copy UE logfile to analyze it!
\u001B
[0m'
)
self
.
htmlUEFailureMsg
=
'Could not copy UE logfile to analyze it!'
self
.
htmlUEFailureMsg
=
'Could not copy UE logfile to analyze it!'
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'KO'
,
OAI_UE_PROCESS_NOLOGFILE_TO_ANALYZE
,
'UE'
)
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'KO'
,
CONST
.
OAI_UE_PROCESS_NOLOGFILE_TO_ANALYZE
,
'UE'
)
self
.
UELogFile
=
''
self
.
UELogFile
=
''
return
return
logging
.
debug
(
'
\u001B
[1m Analyzing UE logfile
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1m Analyzing UE logfile
\u001B
[0m'
)
...
@@ -2812,20 +2738,20 @@ class OaiCiTest():
...
@@ -2812,20 +2738,20 @@ class OaiCiTest():
if
RAN
.
Getair_interface
()
==
'lte'
:
if
RAN
.
Getair_interface
()
==
'lte'
:
# In case of sniffing on commercial eNBs we have random results
# In case of sniffing on commercial eNBs we have random results
# Not an error then
# Not an error then
if
(
logStatus
!=
OAI_UE_PROCESS_COULD_NOT_SYNC
)
or
(
ueAction
!=
'Sniffing'
):
if
(
logStatus
!=
CONST
.
OAI_UE_PROCESS_COULD_NOT_SYNC
)
or
(
ueAction
!=
'Sniffing'
):
self
.
Initialize_OAI_UE_args
=
''
self
.
Initialize_OAI_UE_args
=
''
self
.
AutoTerminateUEandeNB
()
self
.
AutoTerminateUEandeNB
()
else
:
else
:
if
(
logStatus
==
OAI_UE_PROCESS_COULD_NOT_SYNC
):
if
(
logStatus
==
CONST
.
OAI_UE_PROCESS_COULD_NOT_SYNC
):
self
.
Initialize_OAI_UE_args
=
''
self
.
Initialize_OAI_UE_args
=
''
self
.
AutoTerminateUEandeNB
()
self
.
AutoTerminateUEandeNB
()
else
:
else
:
logging
.
debug
(
'
\u001B
[1m'
+
ueAction
+
' Completed
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1m'
+
ueAction
+
' Completed
\u001B
[0m'
)
self
.
htmlUEFailureMsg
=
'<b>'
+
ueAction
+
' Completed</b>
\n
'
+
self
.
htmlUEFailureMsg
self
.
htmlUEFailureMsg
=
'<b>'
+
ueAction
+
' Completed</b>
\n
'
+
self
.
htmlUEFailureMsg
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
self
.
UELogFile
=
''
self
.
UELogFile
=
''
else
:
else
:
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
def
AutoTerminateUEandeNB
(
self
):
def
AutoTerminateUEandeNB
(
self
):
if
(
self
.
ADBIPAddress
!=
'none'
):
if
(
self
.
ADBIPAddress
!=
'none'
):
...
@@ -2857,7 +2783,7 @@ class OaiCiTest():
...
@@ -2857,7 +2783,7 @@ class OaiCiTest():
def
IdleSleep
(
self
):
def
IdleSleep
(
self
):
time
.
sleep
(
self
.
idle_sleep_time
)
time
.
sleep
(
self
.
idle_sleep_time
)
HTML
.
CreateHtmlTestRow
(
str
(
self
.
idle_sleep_time
)
+
' sec'
,
'OK'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
str
(
self
.
idle_sleep_time
)
+
' sec'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
def
X2_Status
(
self
,
idx
,
fileName
):
def
X2_Status
(
self
,
idx
,
fileName
):
cmd
=
"curl --silent http://"
+
EPC
.
GetIPAddress
()
+
":9999/stats | jq '.' > "
+
fileName
cmd
=
"curl --silent http://"
+
EPC
.
GetIPAddress
()
+
":9999/stats | jq '.' > "
+
fileName
...
@@ -2967,7 +2893,7 @@ class OaiCiTest():
...
@@ -2967,7 +2893,7 @@ class OaiCiTest():
html_queue
.
put
(
fullMessage
)
html_queue
.
put
(
fullMessage
)
HTML
.
CreateHtmlTestRowQueue
(
'N/A'
,
'OK'
,
len
(
self
.
UEDevices
),
html_queue
)
HTML
.
CreateHtmlTestRowQueue
(
'N/A'
,
'OK'
,
len
(
self
.
UEDevices
),
html_queue
)
else
:
else
:
HTML
.
CreateHtmlTestRow
(
'Cannot perform requested X2 Handover'
,
'KO'
,
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
'Cannot perform requested X2 Handover'
,
'KO'
,
CONST
.
ALL_PROCESSES_OK
)
def
LogCollectBuild
(
self
):
def
LogCollectBuild
(
self
):
if
(
RAN
.
GeteNBIPAddress
()
!=
''
and
RAN
.
GeteNBUserName
()
!=
''
and
RAN
.
GeteNBPassword
()
!=
''
):
if
(
RAN
.
GeteNBIPAddress
()
!=
''
and
RAN
.
GeteNBUserName
()
!=
''
and
RAN
.
GeteNBPassword
()
!=
''
):
...
@@ -3548,6 +3474,8 @@ elif re.match('^InitiateHtml$', mode, re.IGNORECASE):
...
@@ -3548,6 +3474,8 @@ elif re.match('^InitiateHtml$', mode, re.IGNORECASE):
HTML
.
SethtmlNb_CATM_Modules
(
len
(
CiTestObj
.
CatMDevices
))
HTML
.
SethtmlNb_CATM_Modules
(
len
(
CiTestObj
.
CatMDevices
))
HTML
.
CreateHtmlHeader
(
CiTestObj
.
ADBIPAddress
)
HTML
.
CreateHtmlHeader
(
CiTestObj
.
ADBIPAddress
)
elif
re
.
match
(
'^FinalizeHtml$'
,
mode
,
re
.
IGNORECASE
):
elif
re
.
match
(
'^FinalizeHtml$'
,
mode
,
re
.
IGNORECASE
):
HTML
.
SetreseNB
(
RetrieveSystemVersion
(
'eNB'
))
HTML
.
SetresUE
(
RetrieveSystemVersion
(
'UE'
))
HTML
.
CreateHtmlFooter
(
CiTestObj
.
finalStatus
)
HTML
.
CreateHtmlFooter
(
CiTestObj
.
finalStatus
)
elif
re
.
match
(
'^TesteNB$'
,
mode
,
re
.
IGNORECASE
)
or
re
.
match
(
'^TestUE$'
,
mode
,
re
.
IGNORECASE
):
elif
re
.
match
(
'^TesteNB$'
,
mode
,
re
.
IGNORECASE
)
or
re
.
match
(
'^TestUE$'
,
mode
,
re
.
IGNORECASE
):
if
re
.
match
(
'^TesteNB$'
,
mode
,
re
.
IGNORECASE
):
if
re
.
match
(
'^TesteNB$'
,
mode
,
re
.
IGNORECASE
):
...
...
ci-scripts/ran.py
View file @
c286b2a9
# * 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
# */
#---------------------------------------------------------------------
# Python for CI of OAI-eNB + COTS-UE
#
# Required Python Version
# Python 3.x
#
# Required Python Package
# pexpect
#---------------------------------------------------------------------
#-----------------------------------------------------------
#-----------------------------------------------------------
# Import
# Import
#-----------------------------------------------------------
#-----------------------------------------------------------
...
@@ -19,47 +50,15 @@ import html as HTML
...
@@ -19,47 +50,15 @@ import html as HTML
EPC
=
epc
.
EPCManagement
()
EPC
=
epc
.
EPCManagement
()
ALL_PROCESSES_OK
=
CONST
.
ALL_PROCESSES_OK
ENB_PROCESS_FAILED
=
CONST
.
ENB_PROCESS_FAILED
ENB_PROCESS_OK
=
CONST
.
ENB_PROCESS_OK
ENB_PROCESS_SEG_FAULT
=
CONST
.
ENB_PROCESS_SEG_FAULT
ENB_PROCESS_ASSERTION
=
CONST
.
ENB_PROCESS_ASSERTION
ENB_PROCESS_REALTIME_ISSUE
=
CONST
.
ENB_PROCESS_REALTIME_ISSUE
ENB_PROCESS_NOLOGFILE_TO_ANALYZE
=
CONST
.
ENB_PROCESS_NOLOGFILE_TO_ANALYZE
ENB_PROCESS_SLAVE_RRU_NOT_SYNCED
=
CONST
.
ENB_PROCESS_SLAVE_RRU_NOT_SYNCED
HSS_PROCESS_FAILED
=
CONST
.
HSS_PROCESS_FAILED
HSS_PROCESS_OK
=
CONST
.
HSS_PROCESS_OK
MME_PROCESS_FAILED
=
CONST
.
MME_PROCESS_FAILED
MME_PROCESS_OK
=
CONST
.
MME_PROCESS_OK
SPGW_PROCESS_FAILED
=
CONST
.
SPGW_PROCESS_FAILED
SPGW_PROCESS_OK
=
CONST
.
SPGW_PROCESS_OK
UE_IP_ADDRESS_ISSUE
=
CONST
.
UE_IP_ADDRESS_ISSUE
OAI_UE_PROCESS_NOLOGFILE_TO_ANALYZE
=
CONST
.
OAI_UE_PROCESS_NOLOGFILE_TO_ANALYZE
OAI_UE_PROCESS_COULD_NOT_SYNC
=
CONST
.
OAI_UE_PROCESS_COULD_NOT_SYNC
OAI_UE_PROCESS_ASSERTION
=
CONST
.
OAI_UE_PROCESS_ASSERTION
OAI_UE_PROCESS_FAILED
=
CONST
.
OAI_UE_PROCESS_FAILED
OAI_UE_PROCESS_NO_TUNNEL_INTERFACE
=
CONST
.
OAI_UE_PROCESS_NO_TUNNEL_INTERFACE
OAI_UE_PROCESS_SEG_FAULT
=
CONST
.
OAI_UE_PROCESS_SEG_FAULT
OAI_UE_PROCESS_OK
=
CONST
.
OAI_UE_PROCESS_OK
UE_STATUS_DETACHED
=
CONST
.
UE_STATUS_DETACHED
UE_STATUS_DETACHING
=
CONST
.
UE_STATUS_DETACHING
UE_STATUS_ATTACHING
=
CONST
.
UE_STATUS_ATTACHING
UE_STATUS_ATTACHED
=
CONST
.
UE_STATUS_ATTACHED
X2_HO_REQ_STATE__IDLE
=
CONST
.
X2_HO_REQ_STATE__IDLE
X2_HO_REQ_STATE__TARGET_RECEIVES_REQ
=
CONST
.
X2_HO_REQ_STATE__TARGET_RECEIVES_REQ
X2_HO_REQ_STATE__TARGET_RRC_RECFG_COMPLETE
=
CONST
.
X2_HO_REQ_STATE__TARGET_RRC_RECFG_COMPLETE
X2_HO_REQ_STATE__TARGET_SENDS_SWITCH_REQ
=
CONST
.
X2_HO_REQ_STATE__TARGET_SENDS_SWITCH_REQ
X2_HO_REQ_STATE__SOURCE_RECEIVES_REQ_ACK
=
CONST
.
X2_HO_REQ_STATE__SOURCE_RECEIVES_REQ_ACK
#-----------------------------------------------------------
#-----------------------------------------------------------
# Class Declaration
# Class Declaration
#-----------------------------------------------------------
#-----------------------------------------------------------
class
RANManagement
():
class
RANManagement
():
def
__init__
(
self
):
def
__init__
(
self
):
# self.FailReportCnt = 0
#
self.prematureExit = False
self
.
prematureExit
=
False
self
.
ranRepository
=
''
self
.
ranRepository
=
''
self
.
ranBranch
=
''
self
.
ranBranch
=
''
self
.
ranAllowMerge
=
False
self
.
ranAllowMerge
=
False
...
@@ -77,14 +76,6 @@ class RANManagement():
...
@@ -77,14 +76,6 @@ class RANManagement():
self
.
eNB2UserName
=
''
self
.
eNB2UserName
=
''
self
.
eNB2Password
=
''
self
.
eNB2Password
=
''
self
.
eNB2SourceCodePath
=
''
self
.
eNB2SourceCodePath
=
''
#self.ADBIPAddress = ''
#self.ADBUserName = ''
#self.ADBPassword = ''
#self.ADBCentralized = True
self
.
testCase_id
=
''
#self.testXMLfiles = []
#self.nbTestXMLfiles = 0
#self.desc = ''
self
.
Build_eNB_args
=
''
self
.
Build_eNB_args
=
''
self
.
backgroundBuild
=
False
self
.
backgroundBuild
=
False
self
.
backgroundBuildTestId
=
[
''
,
''
,
''
]
self
.
backgroundBuildTestId
=
[
''
,
''
,
''
]
...
@@ -96,60 +87,11 @@ class RANManagement():
...
@@ -96,60 +87,11 @@ class RANManagement():
self
.
eNBLogFiles
=
[
''
,
''
,
''
]
self
.
eNBLogFiles
=
[
''
,
''
,
''
]
self
.
eNBOptions
=
[
''
,
''
,
''
]
self
.
eNBOptions
=
[
''
,
''
,
''
]
self
.
eNBmbmsEnables
=
[
False
,
False
,
False
]
self
.
eNBmbmsEnables
=
[
False
,
False
,
False
]
self
.
eNBstatuses
=
[
-
1
,
-
1
,
-
1
]
#self.ping_args = ''
#-----------------------------------------------------------
#self.ping_packetloss_threshold = ''
# Setters and Getters
#self.iperf_args = ''
#-----------------------------------------------------------
#self.iperf_packetloss_threshold = ''
#self.iperf_profile = ''
#self.iperf_options = ''
#self.nbMaxUEtoAttach = -1
#self.UEDevices = []
#self.UEDevicesStatus = []
#self.UEDevicesRemoteServer = []
#self.UEDevicesRemoteUser = []
#self.UEDevicesOffCmd = []
#self.UEDevicesOnCmd = []
#self.UEDevicesRebootCmd = []
#self.CatMDevices = []
#self.UEIPAddresses = []
#self.htmlFile = ''
#self.htmlHeaderCreated = False
#self.htmlFooterCreated = False
#self.htmlUEConnected = -1
#self.htmleNBFailureMsg = ''
#self.htmlUEFailureMsg = ''
#self.picocom_closure = False
#self.idle_sleep_time = 0
#self.x2_ho_options = 'network'
#self.x2NbENBs = 0
#self.x2ENBBsIds = []
#self.x2ENBConnectedUEs = []
#self.htmlTabRefs = []
#self.htmlTabNames = []
#self.htmlTabIcons = []
#self.repeatCounts = []
#self.finalStatus = False
#self.OsVersion = ''
#self.KernelVersion = ''
#self.UhdVersion = ''
#self.UsrpBoard = ''
#self.CpuNb = ''
#self.CpuModel = ''
#self.CpuMHz = ''
#self.UEIPAddress = ''
#self.UEUserName = ''
#self.UEPassword = ''
#self.UE_instance = ''
#self.UESourceCodePath = ''
#self.UELogFile = ''
#self.Build_OAI_UE_args = ''
#self.Initialize_OAI_UE_args = ''
#self.clean_repository = True
self
.
flexranCtrlInstalled
=
False
self
.
flexranCtrlStarted
=
False
#self.expectedNbOfConnectedUEs = 0
#self.startTime = 0
def
SettestCase_id
(
self
,
tcid
):
def
SettestCase_id
(
self
,
tcid
):
self
.
testCase_id
=
tcid
self
.
testCase_id
=
tcid
...
@@ -247,10 +189,8 @@ class RANManagement():
...
@@ -247,10 +189,8 @@ class RANManagement():
self
.
eNBstatuses
=
enbstatus
self
.
eNBstatuses
=
enbstatus
def
GeteNBstatuses
(
self
):
def
GeteNBstatuses
(
self
):
return
self
.
eNBstatuses
return
self
.
eNBstatuses
self
.
eNB1IPAddress
=
enb1ip
def
SeteNB1IPAddress
(
self
,
enb1ip
):
def
SeteNB1IPAddress
(
self
,
enb1ip
):
self
.
eNB1IPAddress
=
enb1ip
self
.
eNB1IPAddress
=
enb1ip
def
GeteNB1IPAddress
(
self
):
def
GeteNB1IPAddress
(
self
):
return
self
.
eNB1IPAddress
return
self
.
eNB1IPAddress
...
@@ -267,7 +207,7 @@ class RANManagement():
...
@@ -267,7 +207,7 @@ class RANManagement():
def
GeteNB1SourceCodePath
(
self
):
def
GeteNB1SourceCodePath
(
self
):
return
self
.
eNB1SourceCodePath
return
self
.
eNB1SourceCodePath
def
SeteNB2IPAddress
(
self
,
enbip
):
def
SeteNB2IPAddress
(
self
,
enb
2
ip
):
self
.
eNB2IPAddress
=
enb2ip
self
.
eNB2IPAddress
=
enb2ip
def
GeteNB2IPAddress
(
self
):
def
GeteNB2IPAddress
(
self
):
return
self
.
eNB2IPAddress
return
self
.
eNB2IPAddress
...
@@ -289,6 +229,11 @@ class RANManagement():
...
@@ -289,6 +229,11 @@ class RANManagement():
def
GetprematureExit
(
self
):
def
GetprematureExit
(
self
):
return
self
.
prematureExit
return
self
.
prematureExit
#-----------------------------------------------------------
# RAN management functions
#-----------------------------------------------------------
def
BuildeNB
(
self
):
def
BuildeNB
(
self
):
myHTML
=
HTML
.
HTMLManagement
()
myHTML
=
HTML
.
HTMLManagement
()
...
@@ -296,10 +241,7 @@ class RANManagement():
...
@@ -296,10 +241,7 @@ class RANManagement():
GenericHelp
(
Version
)
GenericHelp
(
Version
)
sys
.
exit
(
'Insufficient Parameter'
)
sys
.
exit
(
'Insufficient Parameter'
)
if
self
.
eNB_serverId
==
'0'
:
if
self
.
eNB_serverId
==
'0'
:
#checkpoint enB_serverId
lIpAddr
=
self
.
eNBIPAddress
lIpAddr
=
self
.
eNBIPAddress
print
(
self
.
eNBIPAddress
+
'self.eNBIPAddress'
)
print
(
lIpAddr
+
'lIpAddr'
)
lUserName
=
self
.
eNBUserName
lUserName
=
self
.
eNBUserName
lPassWord
=
self
.
eNBPassword
lPassWord
=
self
.
eNBPassword
lSourcePath
=
self
.
eNBSourceCodePath
lSourcePath
=
self
.
eNBSourceCodePath
...
@@ -313,7 +255,6 @@ class RANManagement():
...
@@ -313,7 +255,6 @@ class RANManagement():
lUserName
=
self
.
eNB2UserName
lUserName
=
self
.
eNB2UserName
lPassWord
=
self
.
eNB2Password
lPassWord
=
self
.
eNB2Password
lSourcePath
=
self
.
eNB2SourceCodePath
lSourcePath
=
self
.
eNB2SourceCodePath
print
(
lIpAddr
+
'just before the error'
)
if
lIpAddr
==
''
or
lUserName
==
''
or
lPassWord
==
''
or
lSourcePath
==
''
:
if
lIpAddr
==
''
or
lUserName
==
''
or
lPassWord
==
''
or
lSourcePath
==
''
:
GenericHelp
(
Version
)
GenericHelp
(
Version
)
sys
.
exit
(
'Insufficient Parameter'
)
sys
.
exit
(
'Insufficient Parameter'
)
...
@@ -368,7 +309,7 @@ class RANManagement():
...
@@ -368,7 +309,7 @@ class RANManagement():
mismatch
=
True
mismatch
=
True
if
not
mismatch
:
if
not
mismatch
:
mySSH
.
close
()
mySSH
.
close
()
myHTML
.
CreateHtmlTestRow
(
self
.
Build_eNB_args
,
'OK'
,
ALL_PROCESSES_OK
)
myHTML
.
CreateHtmlTestRow
(
self
.
Build_eNB_args
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
return
return
mySSH
.
command
(
'echo '
+
lPassWord
+
' | sudo -S git clean -x -d -ff'
,
'\$'
,
30
)
mySSH
.
command
(
'echo '
+
lPassWord
+
' | sudo -S git clean -x -d -ff'
,
'\$'
,
30
)
...
@@ -394,7 +335,7 @@ class RANManagement():
...
@@ -394,7 +335,7 @@ class RANManagement():
mySSH
.
command
(
'chmod 775 ./my-lte-softmodem-build.sh'
,
'\$'
,
5
)
mySSH
.
command
(
'chmod 775 ./my-lte-softmodem-build.sh'
,
'\$'
,
5
)
mySSH
.
command
(
'echo '
+
lPassWord
+
' | sudo -S -E daemon --inherit --unsafe --name=build_enb_daemon --chdir='
+
lSourcePath
+
'/cmake_targets -o '
+
lSourcePath
+
'/cmake_targets/compile_oai_enb.log ./my-lte-softmodem-build.sh'
,
'\$'
,
5
)
mySSH
.
command
(
'echo '
+
lPassWord
+
' | sudo -S -E daemon --inherit --unsafe --name=build_enb_daemon --chdir='
+
lSourcePath
+
'/cmake_targets -o '
+
lSourcePath
+
'/cmake_targets/compile_oai_enb.log ./my-lte-softmodem-build.sh'
,
'\$'
,
5
)
mySSH
.
close
()
mySSH
.
close
()
myHTML
.
CreateHtmlTestRow
(
self
.
Build_eNB_args
,
'OK'
,
ALL_PROCESSES_OK
)
myHTML
.
CreateHtmlTestRow
(
self
.
Build_eNB_args
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
self
.
backgroundBuildTestId
[
int
(
self
.
eNB_instance
)]
=
self
.
testCase_id
self
.
backgroundBuildTestId
[
int
(
self
.
eNB_instance
)]
=
self
.
testCase_id
return
return
mySSH
.
command
(
'stdbuf -o0 ./build_oai '
+
self
.
Build_eNB_args
+
' 2>&1 | stdbuf -o0 tee compile_oai_enb.log'
,
'Bypassing the Tests|build have failed'
,
1500
)
mySSH
.
command
(
'stdbuf -o0 ./build_oai '
+
self
.
Build_eNB_args
+
' 2>&1 | stdbuf -o0 tee compile_oai_enb.log'
,
'Bypassing the Tests|build have failed'
,
1500
)
...
@@ -485,10 +426,10 @@ class RANManagement():
...
@@ -485,10 +426,10 @@ class RANManagement():
if
buildStatus
:
if
buildStatus
:
logging
.
info
(
'
\u001B
[1m Building OAI '
+
nodeB_prefix
+
'NB Pass
\u001B
[0m'
)
logging
.
info
(
'
\u001B
[1m Building OAI '
+
nodeB_prefix
+
'NB Pass
\u001B
[0m'
)
myHTML
.
CreateHtmlTestRow
(
self
.
Build_eNB_args
,
'OK'
,
ALL_PROCESSES_OK
)
myHTML
.
CreateHtmlTestRow
(
self
.
Build_eNB_args
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
else
:
else
:
logging
.
error
(
'
\u001B
[1m Building OAI '
+
nodeB_prefix
+
'NB Failed
\u001B
[0m'
)
logging
.
error
(
'
\u001B
[1m Building OAI '
+
nodeB_prefix
+
'NB Failed
\u001B
[0m'
)
myHTML
.
CreateHtmlTestRow
(
self
.
Build_eNB_args
,
'KO'
,
ALL_PROCESSES_OK
)
myHTML
.
CreateHtmlTestRow
(
self
.
Build_eNB_args
,
'KO'
,
CONST
.
ALL_PROCESSES_OK
)
myHTML
.
CreateHtmlTabFooter
(
False
)
myHTML
.
CreateHtmlTabFooter
(
False
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
@@ -514,9 +455,7 @@ class RANManagement():
...
@@ -514,9 +455,7 @@ class RANManagement():
GenericHelp
(
Version
)
GenericHelp
(
Version
)
sys
.
exit
(
'Insufficient Parameter'
)
sys
.
exit
(
'Insufficient Parameter'
)
mySSH
=
SSH
.
SSHConnection
()
mySSH
=
SSH
.
SSHConnection
()
#check_eNB = False
#check_OAI_UE = False
#pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE)
if
(
self
.
pStatus
<
0
):
if
(
self
.
pStatus
<
0
):
myHTML
.
CreateHtmlTestRow
(
self
.
Initialize_eNB_args
,
'KO'
,
self
.
pStatus
)
myHTML
.
CreateHtmlTestRow
(
self
.
Initialize_eNB_args
,
'KO'
,
self
.
pStatus
)
myHTML
.
CreateHtmlTabFooter
(
False
)
myHTML
.
CreateHtmlTabFooter
(
False
)
...
@@ -620,7 +559,7 @@ class RANManagement():
...
@@ -620,7 +559,7 @@ class RANManagement():
mySSH
.
close
()
mySSH
.
close
()
doLoop
=
False
doLoop
=
False
logging
.
error
(
'
\u001B
[1;37;41m eNB logging system did not show got sync!
\u001B
[0m'
)
logging
.
error
(
'
\u001B
[1;37;41m eNB logging system did not show got sync!
\u001B
[0m'
)
myHTML
.
CreateHtmlTestRow
(
'-O '
+
config_file
+
extra_options
,
'KO'
,
ALL_PROCESSES_OK
)
myHTML
.
CreateHtmlTestRow
(
'-O '
+
config_file
+
extra_options
,
'KO'
,
CONST
.
ALL_PROCESSES_OK
)
# In case of T tracer recording, we need to kill tshark on EPC side
# In case of T tracer recording, we need to kill tshark on EPC side
result
=
re
.
search
(
'T_stdout'
,
str
(
self
.
Initialize_eNB_args
))
result
=
re
.
search
(
'T_stdout'
,
str
(
self
.
Initialize_eNB_args
))
if
result
is
not
None
:
if
result
is
not
None
:
...
@@ -670,7 +609,7 @@ class RANManagement():
...
@@ -670,7 +609,7 @@ class RANManagement():
self
.
eNBstatuses
[
int
(
self
.
eNB_instance
)]
=
int
(
self
.
eNB_serverId
)
self
.
eNBstatuses
[
int
(
self
.
eNB_instance
)]
=
int
(
self
.
eNB_serverId
)
mySSH
.
close
()
mySSH
.
close
()
myHTML
.
CreateHtmlTestRow
(
'-O '
+
config_file
+
extra_options
,
'OK'
,
ALL_PROCESSES_OK
)
myHTML
.
CreateHtmlTestRow
(
'-O '
+
config_file
+
extra_options
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
logging
.
debug
(
'
\u001B
[1m Initialize eNB Completed
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1m Initialize eNB Completed
\u001B
[0m'
)
...
@@ -700,9 +639,9 @@ class RANManagement():
...
@@ -700,9 +639,9 @@ class RANManagement():
result
=
re
.
search
(
self
.
air_interface
+
'-softmodem'
,
mySSH
.
getBefore
())
result
=
re
.
search
(
self
.
air_interface
+
'-softmodem'
,
mySSH
.
getBefore
())
if
result
is
None
:
if
result
is
None
:
logging
.
debug
(
'
\u001B
[1;37;41m eNB Process Not Found!
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1;37;41m eNB Process Not Found!
\u001B
[0m'
)
status_queue
.
put
(
ENB_PROCESS_FAILED
)
status_queue
.
put
(
CONST
.
ENB_PROCESS_FAILED
)
else
:
else
:
status_queue
.
put
(
ENB_PROCESS_OK
)
status_queue
.
put
(
CONST
.
ENB_PROCESS_OK
)
mySSH
.
close
()
mySSH
.
close
()
except
:
except
:
os
.
kill
(
os
.
getppid
(),
signal
.
SIGUSR1
)
os
.
kill
(
os
.
getppid
(),
signal
.
SIGUSR1
)
...
@@ -776,7 +715,7 @@ class RANManagement():
...
@@ -776,7 +715,7 @@ class RANManagement():
mySSH
.
copyin
(
lIpAddr
,
lUserName
,
lPassWord
,
lSourcePath
+
'/cmake_targets/'
+
extracted_log_file
,
'.'
)
mySSH
.
copyin
(
lIpAddr
,
lUserName
,
lPassWord
,
lSourcePath
+
'/cmake_targets/'
+
extracted_log_file
,
'.'
)
logging
.
debug
(
'
\u001B
[1m Analyzing eNB replay logfile
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1m Analyzing eNB replay logfile
\u001B
[0m'
)
logStatus
=
self
.
AnalyzeLogFile_eNB
(
extracted_log_file
)
logStatus
=
self
.
AnalyzeLogFile_eNB
(
extracted_log_file
)
myHTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
ALL_PROCESSES_OK
)
myHTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
self
.
eNBLogFiles
[
int
(
self
.
eNB_instance
)]
=
''
self
.
eNBLogFiles
[
int
(
self
.
eNB_instance
)]
=
''
else
:
else
:
analyzeFile
=
False
analyzeFile
=
False
...
@@ -789,7 +728,7 @@ class RANManagement():
...
@@ -789,7 +728,7 @@ class RANManagement():
if
(
copyin_res
==
-
1
):
if
(
copyin_res
==
-
1
):
logging
.
debug
(
'
\u001B
[1;37;41m Could not copy '
+
nodeB_prefix
+
'NB logfile to analyze it!
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1;37;41m Could not copy '
+
nodeB_prefix
+
'NB logfile to analyze it!
\u001B
[0m'
)
self
.
htmleNBFailureMsg
=
'Could not copy '
+
nodeB_prefix
+
'NB logfile to analyze it!'
self
.
htmleNBFailureMsg
=
'Could not copy '
+
nodeB_prefix
+
'NB logfile to analyze it!'
myHTML
.
CreateHtmlTestRow
(
'N/A'
,
'KO'
,
ENB_PROCESS_NOLOGFILE_TO_ANALYZE
)
myHTML
.
CreateHtmlTestRow
(
'N/A'
,
'KO'
,
CONST
.
ENB_PROCESS_NOLOGFILE_TO_ANALYZE
)
self
.
eNBmbmsEnables
[
int
(
self
.
eNB_instance
)]
=
False
self
.
eNBmbmsEnables
[
int
(
self
.
eNB_instance
)]
=
False
return
return
if
self
.
eNB_serverId
!=
'0'
:
if
self
.
eNB_serverId
!=
'0'
:
...
@@ -802,9 +741,9 @@ class RANManagement():
...
@@ -802,9 +741,9 @@ class RANManagement():
self
.
eNBmbmsEnables
[
int
(
self
.
eNB_instance
)]
=
False
self
.
eNBmbmsEnables
[
int
(
self
.
eNB_instance
)]
=
False
return
return
else
:
else
:
myHTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
ALL_PROCESSES_OK
)
myHTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
else
:
else
:
myHTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
ALL_PROCESSES_OK
)
myHTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
self
.
eNBmbmsEnables
[
int
(
self
.
eNB_instance
)]
=
False
self
.
eNBmbmsEnables
[
int
(
self
.
eNB_instance
)]
=
False
self
.
eNBstatuses
[
int
(
self
.
eNB_instance
)]
=
-
1
self
.
eNBstatuses
[
int
(
self
.
eNB_instance
)]
=
-
1
...
@@ -849,34 +788,34 @@ class RANManagement():
...
@@ -849,34 +788,34 @@ class RANManagement():
isRRU
=
False
isRRU
=
False
isSlave
=
False
isSlave
=
False
slaveReceivesFrameResyncCmd
=
False
slaveReceivesFrameResyncCmd
=
False
X2HO_state
=
X2_HO_REQ_STATE__IDLE
X2HO_state
=
CONST
.
X2_HO_REQ_STATE__IDLE
X2HO_inNbProcedures
=
0
X2HO_inNbProcedures
=
0
X2HO_outNbProcedures
=
0
X2HO_outNbProcedures
=
0
for
line
in
enb_log_file
.
readlines
():
for
line
in
enb_log_file
.
readlines
():
if
X2HO_state
==
X2_HO_REQ_STATE__IDLE
:
if
X2HO_state
==
CONST
.
X2_HO_REQ_STATE__IDLE
:
result
=
re
.
search
(
'target eNB Receives X2 HO Req X2AP_HANDOVER_REQ'
,
str
(
line
))
result
=
re
.
search
(
'target eNB Receives X2 HO Req X2AP_HANDOVER_REQ'
,
str
(
line
))
if
result
is
not
None
:
if
result
is
not
None
:
X2HO_state
=
X2_HO_REQ_STATE__TARGET_RECEIVES_REQ
X2HO_state
=
CONST
.
X2_HO_REQ_STATE__TARGET_RECEIVES_REQ
result
=
re
.
search
(
'source eNB receives the X2 HO ACK X2AP_HANDOVER_REQ_ACK'
,
str
(
line
))
result
=
re
.
search
(
'source eNB receives the X2 HO ACK X2AP_HANDOVER_REQ_ACK'
,
str
(
line
))
if
result
is
not
None
:
if
result
is
not
None
:
X2HO_state
=
X2_HO_REQ_STATE__SOURCE_RECEIVES_REQ_ACK
X2HO_state
=
CONST
.
X2_HO_REQ_STATE__SOURCE_RECEIVES_REQ_ACK
if
X2HO_state
==
X2_HO_REQ_STATE__TARGET_RECEIVES_REQ
:
if
X2HO_state
==
CONST
.
X2_HO_REQ_STATE__TARGET_RECEIVES_REQ
:
result
=
re
.
search
(
'Received LTE_RRCConnectionReconfigurationComplete from UE'
,
str
(
line
))
result
=
re
.
search
(
'Received LTE_RRCConnectionReconfigurationComplete from UE'
,
str
(
line
))
if
result
is
not
None
:
if
result
is
not
None
:
X2HO_state
=
X2_HO_REQ_STATE__TARGET_RRC_RECFG_COMPLETE
X2HO_state
=
CONST
.
X2_HO_REQ_STATE__TARGET_RRC_RECFG_COMPLETE
if
X2HO_state
==
X2_HO_REQ_STATE__TARGET_RRC_RECFG_COMPLETE
:
if
X2HO_state
==
CONST
.
X2_HO_REQ_STATE__TARGET_RRC_RECFG_COMPLETE
:
result
=
re
.
search
(
'issue rrc_eNB_send_PATH_SWITCH_REQ'
,
str
(
line
))
result
=
re
.
search
(
'issue rrc_eNB_send_PATH_SWITCH_REQ'
,
str
(
line
))
if
result
is
not
None
:
if
result
is
not
None
:
X2HO_state
=
X2_HO_REQ_STATE__TARGET_SENDS_SWITCH_REQ
X2HO_state
=
CONST
.
X2_HO_REQ_STATE__TARGET_SENDS_SWITCH_REQ
if
X2HO_state
==
X2_HO_REQ_STATE__TARGET_SENDS_SWITCH_REQ
:
if
X2HO_state
==
CONST
.
X2_HO_REQ_STATE__TARGET_SENDS_SWITCH_REQ
:
result
=
re
.
search
(
'received path switch ack S1AP_PATH_SWITCH_REQ_ACK'
,
str
(
line
))
result
=
re
.
search
(
'received path switch ack S1AP_PATH_SWITCH_REQ_ACK'
,
str
(
line
))
if
result
is
not
None
:
if
result
is
not
None
:
X2HO_state
=
X2_HO_REQ_STATE__IDLE
X2HO_state
=
CONST
.
X2_HO_REQ_STATE__IDLE
X2HO_inNbProcedures
+=
1
X2HO_inNbProcedures
+=
1
if
X2HO_state
==
X2_HO_REQ_STATE__SOURCE_RECEIVES_REQ_ACK
:
if
X2HO_state
==
CONST
.
X2_HO_REQ_STATE__SOURCE_RECEIVES_REQ_ACK
:
result
=
re
.
search
(
'source eNB receives the X2 UE CONTEXT RELEASE X2AP_UE_CONTEXT_RELEASE'
,
str
(
line
))
result
=
re
.
search
(
'source eNB receives the X2 UE CONTEXT RELEASE X2AP_UE_CONTEXT_RELEASE'
,
str
(
line
))
if
result
is
not
None
:
if
result
is
not
None
:
X2HO_state
=
X2_HO_REQ_STATE__IDLE
X2HO_state
=
CONST
.
X2_HO_REQ_STATE__IDLE
X2HO_outNbProcedures
+=
1
X2HO_outNbProcedures
+=
1
if
self
.
eNBOptions
[
int
(
self
.
eNB_instance
)]
!=
''
:
if
self
.
eNBOptions
[
int
(
self
.
eNB_instance
)]
!=
''
:
...
@@ -1057,14 +996,14 @@ class RANManagement():
...
@@ -1057,14 +996,14 @@ class RANManagement():
logging
.
debug
(
'
\u001B
[1;37;41m '
+
rruMsg
+
'
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1;37;41m '
+
rruMsg
+
'
\u001B
[0m'
)
self
.
htmleNBFailureMsg
+=
rruMsg
+
'
\n
'
self
.
htmleNBFailureMsg
+=
rruMsg
+
'
\n
'
self
.
prematureExit
(
True
)
self
.
prematureExit
(
True
)
return
ENB_PROCESS_SLAVE_RRU_NOT_SYNCED
return
CONST
.
ENB_PROCESS_SLAVE_RRU_NOT_SYNCED
if
foundSegFault
:
if
foundSegFault
:
logging
.
debug
(
'
\u001B
[1;37;41m '
+
nodeB_prefix
+
'NB ended with a Segmentation Fault!
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1;37;41m '
+
nodeB_prefix
+
'NB ended with a Segmentation Fault!
\u001B
[0m'
)
return
ENB_PROCESS_SEG_FAULT
return
CONST
.
ENB_PROCESS_SEG_FAULT
if
foundAssertion
:
if
foundAssertion
:
logging
.
debug
(
'
\u001B
[1;37;41m '
+
nodeB_prefix
+
'NB ended with an assertion!
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1;37;41m '
+
nodeB_prefix
+
'NB ended with an assertion!
\u001B
[0m'
)
self
.
htmleNBFailureMsg
+=
msgAssertion
self
.
htmleNBFailureMsg
+=
msgAssertion
return
ENB_PROCESS_ASSERTION
return
CONST
.
ENB_PROCESS_ASSERTION
if
foundRealTimeIssue
:
if
foundRealTimeIssue
:
logging
.
debug
(
'
\u001B
[1;37;41m '
+
nodeB_prefix
+
'NB faced real time issues!
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1;37;41m '
+
nodeB_prefix
+
'NB faced real time issues!
\u001B
[0m'
)
self
.
htmleNBFailureMsg
+=
nodeB_prefix
+
'NB faced real time issues!
\n
'
self
.
htmleNBFailureMsg
+=
nodeB_prefix
+
'NB faced real time issues!
\n
'
...
@@ -1073,5 +1012,5 @@ class RANManagement():
...
@@ -1073,5 +1012,5 @@ class RANManagement():
rlcMsg
=
nodeB_prefix
+
'NB RLC discarded '
+
str
(
rlcDiscardBuffer
)
+
' buffer(s)'
rlcMsg
=
nodeB_prefix
+
'NB RLC discarded '
+
str
(
rlcDiscardBuffer
)
+
' buffer(s)'
logging
.
debug
(
'
\u001B
[1;37;41m '
+
rlcMsg
+
'
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1;37;41m '
+
rlcMsg
+
'
\u001B
[0m'
)
self
.
htmleNBFailureMsg
+=
rlcMsg
+
'
\n
'
self
.
htmleNBFailureMsg
+=
rlcMsg
+
'
\n
'
return
ENB_PROCESS_REALTIME_ISSUE
return
CONST
.
ENB_PROCESS_REALTIME_ISSUE
return
0
return
0
ci-scripts/sshconnection.py
View file @
c286b2a9
# * 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
# */
#---------------------------------------------------------------------
# Python for CI of OAI-eNB + COTS-UE
#
# Required Python Version
# Python 3.x
#
# Required Python Package
# pexpect
#---------------------------------------------------------------------
#-----------------------------------------------------------
#-----------------------------------------------------------
# Import
# Import
#-----------------------------------------------------------
#-----------------------------------------------------------
...
...
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