Commit e120cabd authored by Raphael Defosseux's avatar Raphael Defosseux

CI: fix HTML footer generation

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent 8e8e9d67
...@@ -69,6 +69,14 @@ class HTMLManagement(): ...@@ -69,6 +69,14 @@ class HTMLManagement():
self.testCase_id = '' self.testCase_id = ''
self.desc = '' self.desc = ''
self.OsVersion = ['', '']
self.KernelVersion = ['', '']
self.UhdVersion = ['', '']
self.UsrpBoard = ['', '']
self.CpuNb = ['', '']
self.CpuModel = ['', '']
self.CpuMHz = ['', '']
#----------------------------------------------------------- #-----------------------------------------------------------
# Setters and Getters # Setters and Getters
#----------------------------------------------------------- #-----------------------------------------------------------
...@@ -90,7 +98,8 @@ class HTMLManagement(): ...@@ -90,7 +98,8 @@ class HTMLManagement():
def SettestCase_id(self, tcid): def SettestCase_id(self, tcid):
self.testCase_id = tcid self.testCase_id = tcid
def GettestCase_id(self):
return self.testCase_id
def SetranRepository(self, repository): def SetranRepository(self, repository):
self.ranRepository = repository self.ranRepository = repository
...@@ -102,7 +111,6 @@ class HTMLManagement(): ...@@ -102,7 +111,6 @@ class HTMLManagement():
def GetranAllowMerge(self): def GetranAllowMerge(self):
return self.ranAllowMerge return self.ranAllowMerge
def SetranBranch(self, branch): def SetranBranch(self, branch):
self.ranBranch = branch self.ranBranch = branch
def GetranBranch(self): def GetranBranch(self):
...@@ -132,19 +140,29 @@ class HTMLManagement(): ...@@ -132,19 +140,29 @@ class HTMLManagement():
def GetnbTestXMLfiles(self): def GetnbTestXMLfiles(self):
return self.nbTestXMLfiles return self.nbTestXMLfiles
def SettestXMLfiles(self, xmlFile): def SettestXMLfiles(self, xmlFile):
self.testXMLfiles.append(xmlFile) self.testXMLfiles.append(xmlFile)
def SethtmlTabRefs(self, tabRef): def SethtmlTabRefs(self, tabRef):
self.htmlTabRefs.append(tabRef) self.htmlTabRefs.append(tabRef)
def SethtmlTabNames(self, tabName): def SethtmlTabNames(self, tabName):
self.htmlTabNames.append(tabName) self.htmlTabNames.append(tabName)
def SethtmlTabIcons(self, tabIcon): def SethtmlTabIcons(self, tabIcon):
self.htmlTabIcons.append(tabIcon) self.htmlTabIcons.append(tabIcon)
def SetOsVersion(self, version, idx):
self.OsVersion[idx] = version
def SetKernelVersion(self, version, idx):
self.KernelVersion[idx] = version
def SetUhdVersion(self, version, idx):
self.UhdVersion[idx] = version
def SetUsrpBoard(self, version, idx):
self.UsrpBoard[idx] = version
def SetCpuNb(self, nb, idx):
self.CpuNb[idx] = nb
def SetCpuModel(self, model, idx):
self.CpuModel[idx] = model
def SetCpuMHz(self, freq, idx):
self.CpuMHz[idx] = freq
#----------------------------------------------------------- #-----------------------------------------------------------
# HTML structure creation functions # HTML structure creation functions
...@@ -307,68 +325,40 @@ class HTMLManagement(): ...@@ -307,68 +325,40 @@ class HTMLManagement():
def CreateHtmlFooter(self, passStatus): def CreateHtmlFooter(self, passStatus):
if (os.path.isfile('test_results.html')): if (os.path.isfile('test_results.html')):
logging.debug('\u001B[1m----------------------------------------\u001B[0m')
logging.debug('\u001B[1m Creating HTML footer \u001B[0m')
logging.debug('\u001B[1m----------------------------------------\u001B[0m')
self.htmlFile = open('test_results.html', 'a') self.htmlFile = open('test_results.html', 'a')
self.htmlFile.write('</div>\n') self.htmlFile.write('</div>\n')
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')
# GP machines = [ 'eNB', 'UE' ] machines = [ 'eNB', 'UE' ]
# GP for machine in machines: for machine in machines:
#GP This needs to move back to main and be called before CreateHtmlFooter if machine == 'eNB':
idx = 0
else:
idx = 1
if self.OsVersion[idx] == '':
continue
res = self.reseNB
if res != -1:
self.htmlFile.write(' <tr>\n') self.htmlFile.write(' <tr>\n')
self.htmlFile.write(' <th colspan=8>' + str('eNB') + ' Server Characteristics</th>\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(' <tr>\n') self.htmlFile.write(' <tr>\n')
self.htmlFile.write(' <td>OS Version</td>\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><span class="label label-default">' + self.OsVersion[idx] + '</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(' <th colspan=8>' + str('UE') + ' 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>Kernel Version</td>\n')
self.htmlFile.write(' <td><span class="label label-default">' + self.KernelVersion + '</span></td>\n') self.htmlFile.write(' <td><span class="label label-default">' + self.KernelVersion[idx] + '</span></td>\n')
self.htmlFile.write(' <td>UHD Version</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><span class="label label-default">' + self.UhdVersion[idx] + '</span></td>\n')
self.htmlFile.write(' <td>USRP Board</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(' <td><span class="label label-default">' + self.UsrpBoard[idx] + '</span></td>\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>Nb CPUs</td>\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><span class="label label-default">' + self.CpuNb[idx] + '</span></td>\n')
self.htmlFile.write(' <td>CPU Model Name</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><span class="label label-default">' + self.CpuModel[idx] + '</span></td>\n')
self.htmlFile.write(' <td>CPU Frequency</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><span class="label label-default">' + self.CpuMHz[idx] + '</span></td>\n')
self.htmlFile.write(' <td></td>\n') self.htmlFile.write(' <td></td>\n')
self.htmlFile.write(' <td></td>\n') self.htmlFile.write(' <td></td>\n')
self.htmlFile.write(' </tr>\n') self.htmlFile.write(' </tr>\n')
......
...@@ -94,13 +94,6 @@ class OaiCiTest(): ...@@ -94,13 +94,6 @@ class OaiCiTest():
self.x2ENBConnectedUEs = [] self.x2ENBConnectedUEs = []
self.repeatCounts = [] self.repeatCounts = []
self.finalStatus = False self.finalStatus = False
self.OsVersion = ''
self.KernelVersion = ''
self.UhdVersion = ''
self.UsrpBoard = ''
self.CpuNb = ''
self.CpuModel = ''
self.CpuMHz = ''
self.UEIPAddress = '' self.UEIPAddress = ''
self.UEUserName = '' self.UEUserName = ''
self.UEPassword = '' self.UEPassword = ''
...@@ -2747,26 +2740,26 @@ class OaiCiTest(): ...@@ -2747,26 +2740,26 @@ class OaiCiTest():
def AutoTerminateUEandeNB(self): def AutoTerminateUEandeNB(self):
if (self.ADBIPAddress != 'none'): if (self.ADBIPAddress != 'none'):
self.testCase_id = 'AUTO-KILL-UE' self.testCase_id = 'AUTO-KILL-UE'
RAN.SettestCase_id(self.testCase_id) HTML.SettestCase_id(self.testCase_id)
self.desc = 'Automatic Termination of UE' self.desc = 'Automatic Termination of UE'
self.ShowTestID() self.ShowTestID()
self.TerminateUE() self.TerminateUE()
if (self.Initialize_OAI_UE_args != ''): if (self.Initialize_OAI_UE_args != ''):
self.testCase_id = 'AUTO-KILL-UE' self.testCase_id = 'AUTO-KILL-UE'
RAN.SettestCase_id(self.testCase_id) HTML.SettestCase_id(self.testCase_id)
self.desc = 'Automatic Termination of UE' self.desc = 'Automatic Termination of UE'
self.ShowTestID() self.ShowTestID()
self.TerminateOAIUE() self.TerminateOAIUE()
if (RAN.GetInitialize_eNB_args() != ''): if (RAN.GetInitialize_eNB_args() != ''):
self.testCase_id = 'AUTO-KILL-eNB' self.testCase_id = 'AUTO-KILL-eNB'
RAN.SettestCase_id(self.testCase_id) HTML.SettestCase_id(self.testCase_id)
self.desc = 'Automatic Termination of eNB' self.desc = 'Automatic Termination of eNB'
self.ShowTestID() self.ShowTestID()
RAN.SeteNB_instance('0') RAN.SeteNB_instance('0')
RAN.TerminateeNB() RAN.TerminateeNB()
if RAN.GetflexranCtrlInstalled() and RAN.GetflexranCtrlStarted(): if RAN.GetflexranCtrlInstalled() and RAN.GetflexranCtrlStarted():
self.testCase_id = 'AUTO-KILL-flexran-ctl' self.testCase_id = 'AUTO-KILL-flexran-ctl'
RAN.SettestCase_id(self.testCase_id) HTML.SettestCase_id(self.testCase_id)
self.desc = 'Automatic Termination of FlexRan CTL' self.desc = 'Automatic Termination of FlexRan CTL'
self.ShowTestID() self.ShowTestID()
self.TerminateFlexranCtrl() self.TerminateFlexranCtrl()
...@@ -2934,19 +2927,20 @@ class OaiCiTest(): ...@@ -2934,19 +2927,20 @@ class OaiCiTest():
def RetrieveSystemVersion(self, machine): def RetrieveSystemVersion(self, machine):
if RAN.GeteNBIPAddress() == 'none' or self.UEIPAddress == 'none': if RAN.GeteNBIPAddress() == 'none' or self.UEIPAddress == 'none':
self.OsVersion = 'Ubuntu 16.04.5 LTS' HTML.SetOsVersion('Ubuntu 16.04.5 LTS', 0)
self.KernelVersion = '4.15.0-45-generic' HTML.SetKernelVersion('4.15.0-45-generic', 0)
self.UhdVersion = '3.13.0.1-0' HTML.SetUhdVersion('3.13.0.1-0', 0)
self.UsrpBoard = 'B210' HTML.SetUsrpBoard('B210', 0)
self.CpuNb = '4' HTML.SetCpuNb('4', 0)
self.CpuModel = 'Intel(R) Core(TM) i5-6200U' HTML.SetCpuModel('Intel(R) Core(TM) i5-6200U', 0)
self.CpuMHz = '2399.996 MHz' HTML.SetCpuMHz('2399.996 MHz', 0)
return 0 return 0
if machine == 'eNB': if machine == 'eNB':
if RAN.GeteNBIPAddress() != '' and RAN.GeteNBUserName() != '' and RAN.GeteNBPassword() != '': if RAN.GeteNBIPAddress() != '' and RAN.GeteNBUserName() != '' and RAN.GeteNBPassword() != '':
IPAddress = RAN.GeteNBIPAddress() IPAddress = RAN.GeteNBIPAddress()
UserName = RAN.GeteNBUserName() UserName = RAN.GeteNBUserName()
Password = RAN.GeteNBPassword() Password = RAN.GeteNBPassword()
idx = 0
else: else:
return -1 return -1
if machine == 'UE': if machine == 'UE':
...@@ -2954,6 +2948,7 @@ class OaiCiTest(): ...@@ -2954,6 +2948,7 @@ class OaiCiTest():
IPAddress = self.UEIPAddress IPAddress = self.UEIPAddress
UserName = self.UEUserName UserName = self.UEUserName
Password = self.UEPassword Password = self.UEPassword
idx = 1
else: else:
return -1 return -1
...@@ -2961,55 +2956,64 @@ class OaiCiTest(): ...@@ -2961,55 +2956,64 @@ class OaiCiTest():
SSH.command('lsb_release -a', '\$', 5) SSH.command('lsb_release -a', '\$', 5)
result = re.search('Description:\\\\t(?P<os_type>[a-zA-Z0-9\-\_\.\ ]+)', SSH.getBefore()) result = re.search('Description:\\\\t(?P<os_type>[a-zA-Z0-9\-\_\.\ ]+)', SSH.getBefore())
if result is not None: if result is not None:
self.OsVersion = result.group('os_type') OsVersion = result.group('os_type')
logging.debug('OS is: ' + self.OsVersion) logging.debug('OS is: ' + OsVersion)
HTML.SetOsVersion(OsVersion, idx)
else: else:
SSH.command('hostnamectl', '\$', 5) SSH.command('hostnamectl', '\$', 5)
result = re.search('Operating System: (?P<os_type>[a-zA-Z0-9\-\_\.\ ]+)', SSH.getBefore()) result = re.search('Operating System: (?P<os_type>[a-zA-Z0-9\-\_\.\ ]+)', SSH.getBefore())
if result is not None: if result is not None:
self.OsVersion = result.group('os_type') OsVersion = result.group('os_type')
if self.OsVersion == 'CentOS Linux 7 ': if OsVersion == 'CentOS Linux 7 ':
SSH.command('cat /etc/redhat-release', '\$', 5) SSH.command('cat /etc/redhat-release', '\$', 5)
result = re.search('CentOS Linux release (?P<os_version>[0-9\.]+)', SSH.getBefore()) result = re.search('CentOS Linux release (?P<os_version>[0-9\.]+)', SSH.getBefore())
if result is not None: if result is not None:
self.OsVersion = self.OsVersion.replace('7 ', result.group('os_version')) OsVersion = OsVersion.replace('7 ', result.group('os_version'))
logging.debug('OS is: ' + self.OsVersion) logging.debug('OS is: ' + OsVersion)
HTML.SetOsVersion(OsVersion, idx)
SSH.command('uname -r', '\$', 5) SSH.command('uname -r', '\$', 5)
result = re.search('uname -r\\\\r\\\\n(?P<kernel_version>[a-zA-Z0-9\-\_\.]+)', SSH.getBefore()) result = re.search('uname -r\\\\r\\\\n(?P<kernel_version>[a-zA-Z0-9\-\_\.]+)', SSH.getBefore())
if result is not None: if result is not None:
self.KernelVersion = result.group('kernel_version') KernelVersion = result.group('kernel_version')
logging.debug('Kernel Version is: ' + self.KernelVersion) logging.debug('Kernel Version is: ' + KernelVersion)
HTML.SetKernelVersion(KernelVersion, idx)
SSH.command('dpkg --list | egrep --color=never libuhd003', '\$', 5) SSH.command('dpkg --list | egrep --color=never libuhd003', '\$', 5)
result = re.search('libuhd003:amd64 *(?P<uhd_version>[0-9\.]+)', SSH.getBefore()) result = re.search('libuhd003:amd64 *(?P<uhd_version>[0-9\.]+)', SSH.getBefore())
if result is not None: if result is not None:
self.UhdVersion = result.group('uhd_version') UhdVersion = result.group('uhd_version')
logging.debug('UHD Version is: ' + self.UhdVersion) logging.debug('UHD Version is: ' + UhdVersion)
HTML.SetUhdVersion(UhdVersion, idx)
else: else:
SSH.command('uhd_config_info --version', '\$', 5) SSH.command('uhd_config_info --version', '\$', 5)
result = re.search('UHD (?P<uhd_version>[a-zA-Z0-9\.\-]+)', SSH.getBefore()) result = re.search('UHD (?P<uhd_version>[a-zA-Z0-9\.\-]+)', SSH.getBefore())
if result is not None: if result is not None:
self.UhdVersion = result.group('uhd_version') UhdVersion = result.group('uhd_version')
logging.debug('UHD Version is: ' + self.UhdVersion) logging.debug('UHD Version is: ' + UhdVersion)
HTML.SetUhdVersion(UhdVersion, idx)
SSH.command('echo ' + Password + ' | sudo -S uhd_find_devices', '\$', 60) SSH.command('echo ' + Password + ' | sudo -S uhd_find_devices', '\$', 60)
usrp_boards = re.findall('product: ([0-9A-Za-z]+)\\\\r\\\\n', SSH.getBefore()) usrp_boards = re.findall('product: ([0-9A-Za-z]+)\\\\r\\\\n', SSH.getBefore())
count = 0 count = 0
for board in usrp_boards: for board in usrp_boards:
if count == 0: if count == 0:
self.UsrpBoard = board UsrpBoard = board
else: else:
self.UsrpBoard += ',' + board UsrpBoard += ',' + board
count += 1 count += 1
if count > 0: if count > 0:
logging.debug('USRP Board(s) : ' + self.UsrpBoard) logging.debug('USRP Board(s) : ' + UsrpBoard)
HTML.SetUsrpBoard(UsrpBoard, idx)
SSH.command('lscpu', '\$', 5) SSH.command('lscpu', '\$', 5)
result = re.search('CPU\(s\): *(?P<nb_cpus>[0-9]+).*Model name: *(?P<model>[a-zA-Z0-9\-\_\.\ \(\)]+).*CPU MHz: *(?P<cpu_mhz>[0-9\.]+)', SSH.getBefore()) result = re.search('CPU\(s\): *(?P<nb_cpus>[0-9]+).*Model name: *(?P<model>[a-zA-Z0-9\-\_\.\ \(\)]+).*CPU MHz: *(?P<cpu_mhz>[0-9\.]+)', SSH.getBefore())
if result is not None: if result is not None:
self.CpuNb = result.group('nb_cpus') CpuNb = result.group('nb_cpus')
logging.debug('nb_cpus: ' + self.CpuNb) logging.debug('nb_cpus: ' + CpuNb)
self.CpuModel = result.group('model') HTML.SetCpuNb(CpuNb, idx)
logging.debug('model: ' + self.CpuModel) CpuModel = result.group('model')
self.CpuMHz = result.group('cpu_mhz') + ' MHz' logging.debug('model: ' + CpuModel)
logging.debug('cpu_mhz: ' + self.CpuMHz) HTML.SetCpuModel(CpuModel, idx)
CpuMHz = result.group('cpu_mhz') + ' MHz'
logging.debug('cpu_mhz: ' + CpuMHz)
HTML.SetCpuMHz(CpuMHz, idx)
SSH.close() SSH.close()
#----------------------------------------------------------- #-----------------------------------------------------------
...@@ -3199,6 +3203,8 @@ RAN = ran.RANManagement() ...@@ -3199,6 +3203,8 @@ RAN = ran.RANManagement()
HTML = html.HTMLManagement() HTML = html.HTMLManagement()
EPC.SetHtmlObj(HTML) EPC.SetHtmlObj(HTML)
RAN.SetHtmlObj(HTML)
RAN.SetEpcObj(EPC)
argvs = sys.argv argvs = sys.argv
argc = len(argvs) argc = len(argvs)
...@@ -3293,19 +3299,15 @@ while len(argvs) > 1: ...@@ -3293,19 +3299,15 @@ while len(argvs) > 1:
elif re.match('^\-\-EPCIPAddress=(.+)$', myArgv, re.IGNORECASE): elif re.match('^\-\-EPCIPAddress=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-EPCIPAddress=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-EPCIPAddress=(.+)$', myArgv, re.IGNORECASE)
EPC.SetIPAddress(matchReg.group(1)) EPC.SetIPAddress(matchReg.group(1))
RAN.SetIPAddress(matchReg.group(1))
elif re.match('^\-\-EPCUserName=(.+)$', myArgv, re.IGNORECASE): elif re.match('^\-\-EPCUserName=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-EPCUserName=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-EPCUserName=(.+)$', myArgv, re.IGNORECASE)
EPC.SetUserName(matchReg.group(1)) EPC.SetUserName(matchReg.group(1))
RAN.SetUserName(matchReg.group(1))
elif re.match('^\-\-EPCPassword=(.+)$', myArgv, re.IGNORECASE): elif re.match('^\-\-EPCPassword=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-EPCPassword=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-EPCPassword=(.+)$', myArgv, re.IGNORECASE)
EPC.SetPassword(matchReg.group(1)) EPC.SetPassword(matchReg.group(1))
RAN.SetPassword(matchReg.group(1))
elif re.match('^\-\-EPCSourceCodePath=(.+)$', myArgv, re.IGNORECASE): elif re.match('^\-\-EPCSourceCodePath=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-EPCSourceCodePath=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-EPCSourceCodePath=(.+)$', myArgv, re.IGNORECASE)
EPC.SetSourceCodePath(matchReg.group(1)) EPC.SetSourceCodePath(matchReg.group(1))
RAN.SetSourceCodePath(matchReg.group(1))
elif re.match('^\-\-EPCType=(.+)$', myArgv, re.IGNORECASE): elif re.match('^\-\-EPCType=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-EPCType=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-EPCType=(.+)$', myArgv, re.IGNORECASE)
if re.match('OAI', matchReg.group(1), re.IGNORECASE) or re.match('ltebox', matchReg.group(1), re.IGNORECASE) or re.match('OAI-Rel14-CUPS', matchReg.group(1), re.IGNORECASE): if re.match('OAI', matchReg.group(1), re.IGNORECASE) or re.match('ltebox', matchReg.group(1), re.IGNORECASE) or re.match('OAI-Rel14-CUPS', matchReg.group(1), re.IGNORECASE):
...@@ -3466,8 +3468,12 @@ elif re.match('^InitiateHtml$', mode, re.IGNORECASE): ...@@ -3466,8 +3468,12 @@ 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')) logging.debug('\u001B[1m----------------------------------------\u001B[0m')
HTML.SetresUE(RetrieveSystemVersion('UE')) logging.debug('\u001B[1m Creating HTML footer \u001B[0m')
logging.debug('\u001B[1m----------------------------------------\u001B[0m')
CiTestObj.RetrieveSystemVersion('eNB')
CiTestObj.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):
...@@ -3575,7 +3581,6 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re ...@@ -3575,7 +3581,6 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
if test_case_id != id: if test_case_id != id:
continue continue
CiTestObj.testCase_id = id CiTestObj.testCase_id = id
RAN.SettestCase_id(CiTestObj.testCase_id)
HTML.SettestCase_id(CiTestObj.testCase_id) HTML.SettestCase_id(CiTestObj.testCase_id)
CiTestObj.desc = test.findtext('desc') CiTestObj.desc = test.findtext('desc')
HTML.Setdesc(CiTestObj.desc) HTML.Setdesc(CiTestObj.desc)
......
...@@ -46,10 +46,7 @@ import sshconnection as SSH ...@@ -46,10 +46,7 @@ import sshconnection as SSH
import epc import epc
import helpreadme as HELP import helpreadme as HELP
import constants as CONST import constants as CONST
import html as HTML import html
EPC = epc.EPCManagement()
#----------------------------------------------------------- #-----------------------------------------------------------
# Class Declaration # Class Declaration
...@@ -90,23 +87,19 @@ class RANManagement(): ...@@ -90,23 +87,19 @@ class RANManagement():
self.eNBstatuses = [-1, -1, -1] self.eNBstatuses = [-1, -1, -1]
self.flexranCtrlInstalled = False self.flexranCtrlInstalled = False
self.flexranCtrlStarted = False self.flexranCtrlStarted = False
self.epcPcapFile = ''
self.htmlObj = None
self.epcObj = None
#----------------------------------------------------------- #-----------------------------------------------------------
# Setters and Getters # Setters and Getters on Public members
#----------------------------------------------------------- #-----------------------------------------------------------
def SetIPAddress(self, ipaddress): def SetHtmlObj(self, obj):
self.EPCIPAddress = ipaddress self.htmlObj = obj
def SetUserName(self, username): def SetEpcObj(self, obj):
self.EPCUserName = username self.epcObj = obj
def SetPassword(self, password):
self.EPCPassword = password
def SetSourceCodePath(self, sourcecodepath):
self.EPCSourceCodePath = sourcecodepath
def SettestCase_id(self,tcid):
self.testCase_id = tcid
def SetflexranCtrlInstalled(self,fxrctin): def SetflexranCtrlInstalled(self,fxrctin):
self.flexranCtrlInstalled = fxrctin self.flexranCtrlInstalled = fxrctin
def GetflexranCtrlInstalled(self): def GetflexranCtrlInstalled(self):
...@@ -242,7 +235,6 @@ class RANManagement(): ...@@ -242,7 +235,6 @@ class RANManagement():
def BuildeNB(self): def BuildeNB(self):
myHTML = HTML.HTMLManagement()
if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '': if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '':
GenericHelp(Version) GenericHelp(Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
...@@ -315,7 +307,8 @@ class RANManagement(): ...@@ -315,7 +307,8 @@ class RANManagement():
mismatch = True mismatch = True
if not mismatch: if not mismatch:
mySSH.close() mySSH.close()
myHTML.CreateHtmlTestRow(self.Build_eNB_args, 'OK', CONST.ALL_PROCESSES_OK) if self.htmlObj is not None:
self.htmlObj.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)
...@@ -341,12 +334,17 @@ class RANManagement(): ...@@ -341,12 +334,17 @@ 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', CONST.ALL_PROCESSES_OK) if self.htmlObj is not None:
self.backgroundBuildTestId[int(self.eNB_instance)] = self.testCase_id self.htmlObj.CreateHtmlTestRow(self.Build_eNB_args, 'OK', CONST.ALL_PROCESSES_OK)
self.backgroundBuildTestId[int(self.eNB_instance)] = self.htmlObj.GettestCase_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)
mySSH.close() mySSH.close()
self.checkBuildeNB(lIpAddr, lUserName, lPassWord, lSourcePath, self.testCase_id) if self.htmlObj is not None:
tId = self.htmlObj.GettestCase_id()
else:
tId = '0000'
self.checkBuildeNB(lIpAddr, lUserName, lPassWord, lSourcePath, tId)
...@@ -385,8 +383,8 @@ class RANManagement(): ...@@ -385,8 +383,8 @@ class RANManagement():
self.checkBuildeNB(lIpAddr, lUserName, lPassWord, lSourcePath, self.backgroundBuildTestId[int(self.eNB_instance)]) self.checkBuildeNB(lIpAddr, lUserName, lPassWord, lSourcePath, self.backgroundBuildTestId[int(self.eNB_instance)])
def checkBuildeNB(self, lIpAddr, lUserName, lPassWord, lSourcePath, testcaseId): def checkBuildeNB(self, lIpAddr, lUserName, lPassWord, lSourcePath, testcaseId):
myHTML = HTML.HTMLManagement() if self.htmlObj is not None:
myHTML.SettestCase_id(testcaseId) self.htmlObj.SettestCase_id(testcaseId)
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.open(lIpAddr, lUserName, lPassWord)
mySSH.command('cd ' + lSourcePath + '/cmake_targets', '\$', 3) mySSH.command('cd ' + lSourcePath + '/cmake_targets', '\$', 3)
...@@ -436,16 +434,17 @@ class RANManagement(): ...@@ -436,16 +434,17 @@ 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', CONST.ALL_PROCESSES_OK) if self.htmlObj is not None:
self.htmlObj.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', CONST.ALL_PROCESSES_OK) if self.htmlObj is not None:
myHTML.CreateHtmlTabFooter(False) self.htmlObj.CreateHtmlTestRow(self.Build_eNB_args, 'KO', CONST.ALL_PROCESSES_OK)
self.htmlObj.CreateHtmlTabFooter(False)
sys.exit(1) sys.exit(1)
def InitializeeNB(self): def InitializeeNB(self):
myHTML = HTML.HTMLManagement()
if self.eNB_serverId == '0': if self.eNB_serverId == '0':
lIpAddr = self.eNBIPAddress lIpAddr = self.eNBIPAddress
lUserName = self.eNBUserName lUserName = self.eNBUserName
...@@ -467,21 +466,25 @@ class RANManagement(): ...@@ -467,21 +466,25 @@ class RANManagement():
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
if (self.pStatus < 0): if (self.pStatus < 0):
myHTML.CreateHtmlTestRow(self.Initialize_eNB_args, 'KO', self.pStatus) if self.htmlObj is not None:
myHTML.CreateHtmlTabFooter(False) self.htmlObj.CreateHtmlTestRow(self.Initialize_eNB_args, 'KO', self.pStatus)
self.htmlObj.CreateHtmlTabFooter(False)
sys.exit(1) sys.exit(1)
# If tracer options is on, running tshark on EPC side and capture traffic b/ EPC and eNB # If tracer options is on, running tshark on EPC side and capture traffic b/ EPC and eNB
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) and (self.epcObj is not None):
mySSH.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) localEpcIpAddr = self.epcObj.GetIPAddress()
localEpcUserName = self.epcObj.GetUserName()
localEpcPassword = self.epcObj.GetPassword()
mySSH.open(localEpcIpAddr, localEpcUserName, localEpcPassword)
mySSH.command('ip addr show | awk -f /tmp/active_net_interfaces.awk | egrep -v "lo|tun"', '\$', 5) mySSH.command('ip addr show | awk -f /tmp/active_net_interfaces.awk | egrep -v "lo|tun"', '\$', 5)
result = re.search('interfaceToUse=(?P<eth_interface>[a-zA-Z0-9\-\_]+)done', mySSH.getBefore()) result = re.search('interfaceToUse=(?P<eth_interface>[a-zA-Z0-9\-\_]+)done', mySSH.getBefore())
if result is not None: if result is not None:
eth_interface = result.group('eth_interface') eth_interface = result.group('eth_interface')
logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + '\u001B[0m') logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + '\u001B[0m')
EPC.Set_PcapFileName('enb_' + self.testCase_id + '_s1log.pcap') self.epcPcapFile = 'enb_' + self.testCase_id + '_s1log.pcap'
mySSH.command('echo ' + self.EPCPassword + ' | sudo -S rm -f /tmp/' + EPC.Get_PcapFileName() , '\$', 5) mySSH.command('echo ' + localEpcPassword + ' | sudo -S rm -f /tmp/' + self.epcPcapFile , '\$', 5)
mySSH.command('echo $USER; nohup sudo tshark -f "host ' + lIpAddr +'" -i ' + eth_interface + ' -w /tmp/' + EPC.Get_PcapFileName() + ' > /tmp/tshark.log 2>&1 &', self.EPCUserName, 5) mySSH.command('echo $USER; nohup sudo tshark -f "host ' + lIpAddr +'" -i ' + eth_interface + ' -w /tmp/' + self.epcPcapFile + ' > /tmp/tshark.log 2>&1 &', localEpcUserName, 5)
mySSH.close() mySSH.close()
mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.open(lIpAddr, lUserName, lPassWord)
mySSH.command('cd ' + lSourcePath, '\$', 5) mySSH.command('cd ' + lSourcePath, '\$', 5)
...@@ -520,7 +523,9 @@ class RANManagement(): ...@@ -520,7 +523,9 @@ class RANManagement():
mySSH.command('echo ' + lPassWord + ' | sudo -S uhd_find_devices', '\$', 60) mySSH.command('echo ' + lPassWord + ' | sudo -S uhd_find_devices', '\$', 60)
# Make a copy and adapt to EPC / eNB IP addresses # Make a copy and adapt to EPC / eNB IP addresses
mySSH.command('cp ' + full_config_file + ' ' + ci_full_config_file, '\$', 5) mySSH.command('cp ' + full_config_file + ' ' + ci_full_config_file, '\$', 5)
mySSH.command('sed -i -e \'s/CI_MME_IP_ADDR/' + self.EPCIPAddress + '/\' ' + ci_full_config_file, '\$', 2); if self.epcObj is not None:
localEpcIpAddr = self.epcObj.GetIPAddress()
mySSH.command('sed -i -e \'s/CI_MME_IP_ADDR/' + localEpcIpAddr + '/\' ' + ci_full_config_file, '\$', 2);
mySSH.command('sed -i -e \'s/CI_ENB_IP_ADDR/' + lIpAddr + '/\' ' + ci_full_config_file, '\$', 2); mySSH.command('sed -i -e \'s/CI_ENB_IP_ADDR/' + lIpAddr + '/\' ' + ci_full_config_file, '\$', 2);
mySSH.command('sed -i -e \'s/CI_RCC_IP_ADDR/' + self.eNBIPAddress + '/\' ' + ci_full_config_file, '\$', 2); mySSH.command('sed -i -e \'s/CI_RCC_IP_ADDR/' + self.eNBIPAddress + '/\' ' + ci_full_config_file, '\$', 2);
mySSH.command('sed -i -e \'s/CI_RRU1_IP_ADDR/' + self.eNB1IPAddress + '/\' ' + ci_full_config_file, '\$', 2); mySSH.command('sed -i -e \'s/CI_RRU1_IP_ADDR/' + self.eNB1IPAddress + '/\' ' + ci_full_config_file, '\$', 2);
...@@ -569,22 +574,26 @@ class RANManagement(): ...@@ -569,22 +574,26 @@ 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', CONST.ALL_PROCESSES_OK) if self.htmlObj is not None:
self.htmlObj.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) and (self.epcObj is not None):
mySSH.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) localEpcIpAddr = self.epcObj.GetIPAddress()
localEpcUserName = self.epcObj.GetUserName()
localEpcPassword = self.epcObj.GetPassword()
mySSH.open(localEpcIpAddr, localEpcUserName, localEpcPassword)
logging.debug('\u001B[1m Stopping tshark \u001B[0m') logging.debug('\u001B[1m Stopping tshark \u001B[0m')
mySSH.command('echo ' + self.EPCPassword + ' | sudo -S killall --signal SIGKILL tshark', '\$', 5) mySSH.command('echo ' + localEpcPassword + ' | sudo -S killall --signal SIGKILL tshark', '\$', 5)
if EPC.Get_PcapFileName() != '': if self.epcPcapFile != '':
time.sleep(0.5) time.sleep(0.5)
mySSH.command('echo ' + self.EPCPassword + ' | sudo -S chmod 666 /tmp/' + EPC.Get_PcapFileName() , '\$', 5) mySSH.command('echo ' + localEpcPassword + ' | sudo -S chmod 666 /tmp/' + self.epcPcapFile, '\$', 5)
mySSH.close() mySSH.close()
time.sleep(1) time.sleep(1)
if EPC.Get_PcapFileName() != '': if self.epcPcapFile != '':
copyin_res = mySSH.copyin(self.EPCIPAddress, self.EPCUserName, self.EPCPassword, '/tmp/' + EPC.Get_PcapFileName() , '.') copyin_res = mySSH.copyin(localEpcIpAddr, localEpcUserName, localEpcPassword, '/tmp/' + self.epcPcapFile, '.')
if (copyin_res == 0): if (copyin_res == 0):
mySSH.copyout(lIpAddr, lUserName, lPassWord, EPC.Get_PcapFileName() , lSourcePath + '/cmake_targets/.') mySSH.copyout(lIpAddr, lUserName, lPassWord, self.epcPcapFile, lSourcePath + '/cmake_targets/.')
self.prematureExit = True self.prematureExit = True
return return
else: else:
...@@ -619,7 +628,8 @@ class RANManagement(): ...@@ -619,7 +628,8 @@ 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', CONST.ALL_PROCESSES_OK) if self.htmlObj is not None:
self.htmlObj.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')
...@@ -659,7 +669,6 @@ class RANManagement(): ...@@ -659,7 +669,6 @@ class RANManagement():
def TerminateeNB(self): def TerminateeNB(self):
myHTML = HTML.HTMLManagement()
if self.eNB_serverId == '0': if self.eNB_serverId == '0':
lIpAddr = self.eNBIPAddress lIpAddr = self.eNBIPAddress
lUserName = self.eNBUserName lUserName = self.eNBUserName
...@@ -700,15 +709,18 @@ class RANManagement(): ...@@ -700,15 +709,18 @@ class RANManagement():
mySSH.close() mySSH.close()
# If tracer options is on, stopping tshark on EPC side # If tracer options is on, stopping 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) and (self.epcObj is not None):
mySSH.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) localEpcIpAddr = self.epcObj.GetIPAddress()
localEpcUserName = self.epcObj.GetUserName()
localEpcPassword = self.epcObj.GetPassword()
mySSH.open(localEpcIpAddr, localEpcUserName, localEpcPassword)
logging.debug('\u001B[1m Stopping tshark \u001B[0m') logging.debug('\u001B[1m Stopping tshark \u001B[0m')
mySSH.command('echo ' + self.EPCPassword + ' | sudo -S killall --signal SIGKILL tshark', '\$', 5) mySSH.command('echo ' + localEpcPassword + ' | sudo -S killall --signal SIGKILL tshark', '\$', 5)
time.sleep(1) time.sleep(1)
if EPC.Get_PcapFileName() != '': if self.epcPcapFile != '':
mySSH.command('echo ' + self.EPCPassword + ' | sudo -S chmod 666 /tmp/' + EPC.Get_PcapFileName() , '\$', 5) mySSH.command('echo ' + localEpcPassword + ' | sudo -S chmod 666 /tmp/' + self.epcPcapFile, '\$', 5)
mySSH.copyin(self.EPCIPAddress, self.EPCUserName, self.EPCPassword, '/tmp/' + EPC.Get_PcapFileName() , '.') mySSH.copyin(localEpcIpAddr, localEpcUserName, localEpcPassword, '/tmp/' + self.epcPcapFile, '.')
mySSH.copyout(lIpAddr, lUserName, lPassWord, EPC.Get_PcapFileName() , lSourcePath + '/cmake_targets/.') mySSH.copyout(lIpAddr, lUserName, lPassWord, self.epcPcapFile, lSourcePath + '/cmake_targets/.')
mySSH.close() mySSH.close()
logging.debug('\u001B[1m Replaying RAW record file\u001B[0m') logging.debug('\u001B[1m Replaying RAW record file\u001B[0m')
mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.open(lIpAddr, lUserName, lPassWord)
...@@ -725,7 +737,8 @@ class RANManagement(): ...@@ -725,7 +737,8 @@ 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', CONST.ALL_PROCESSES_OK) if self.htmlObj is not None:
self.htmlObj.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
...@@ -738,7 +751,8 @@ class RANManagement(): ...@@ -738,7 +751,8 @@ 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', CONST.ENB_PROCESS_NOLOGFILE_TO_ANALYZE) if self.htmlObj is not None:
self.htmlObj.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':
...@@ -746,14 +760,17 @@ class RANManagement(): ...@@ -746,14 +760,17 @@ class RANManagement():
logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + fileToAnalyze) logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + fileToAnalyze)
logStatus = self.AnalyzeLogFile_eNB(fileToAnalyze) logStatus = self.AnalyzeLogFile_eNB(fileToAnalyze)
if (logStatus < 0): if (logStatus < 0):
myHTML.CreateHtmlTestRow('N/A', 'KO', logStatus) if self.htmlObj is not None:
self.htmlObj.CreateHtmlTestRow('N/A', 'KO', logStatus)
self.preamtureExit = True self.preamtureExit = True
self.eNBmbmsEnables[int(self.eNB_instance)] = False self.eNBmbmsEnables[int(self.eNB_instance)] = False
return return
else: else:
myHTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) if self.htmlObj is not None:
self.htmlObj.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
else: else:
myHTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) if self.htmlObj is not None:
self.htmlObj.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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment