Commit 9eab72b2 authored by Gabriele Perrone's avatar Gabriele Perrone

aligning remote repository with local on starsky

parent 236b17ce
...@@ -55,7 +55,7 @@ class EPCManagement(): ...@@ -55,7 +55,7 @@ class EPCManagement():
def __init__(self): def __init__(self):
self.IPAddress = '' self.EPCIPAddress = ''
self.UserName = '' self.UserName = ''
self.Password = '' self.Password = ''
self.SourceCodePath = '' self.SourceCodePath = ''
...@@ -130,7 +130,8 @@ class EPCManagement(): ...@@ -130,7 +130,8 @@ class EPCManagement():
else: else:
logging.error('This option should not occur!') logging.error('This option should not occur!')
mySSH.close() mySSH.close()
HTML.CreateHtmlTestRow(self.EPCType, 'OK', CONST.ALL_PROCESSES_OK) myHTML = HTML.HTMLManagement()
myHTML.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 == '':
...@@ -163,7 +164,8 @@ class EPCManagement(): ...@@ -163,7 +164,8 @@ class EPCManagement():
else: else:
logging.error('This option should not occur!') logging.error('This option should not occur!')
mySSH.close() mySSH.close()
HTML.CreateHtmlTestRow(self.EPCType, 'OK', ALL_PROCESSES_OK) myHTML = HTML.HTMLManagement()
myHTML.CreateHtmlTestRow(self.EPCType, 'OK', CONST.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 == '':
...@@ -194,7 +196,8 @@ class EPCManagement(): ...@@ -194,7 +196,8 @@ class EPCManagement():
else: else:
logging.error('This option should not occur!') logging.error('This option should not occur!')
mySSH.close() mySSH.close()
HTML.CreateHtmlTestRow(self.EPCType, 'OK', ALL_PROCESSES_OK) myHTML = HTML.HTMLManagement()
myHTML.CreateHtmlTestRow(self.EPCType, 'OK', CONST.ALL_PROCESSES_OK)
def CheckHSSProcess(self, status_queue): def CheckHSSProcess(self, status_queue):
...@@ -294,7 +297,8 @@ class EPCManagement(): ...@@ -294,7 +297,8 @@ class EPCManagement():
else: else:
logging.error('This should not happen!') logging.error('This should not happen!')
mySSH.close() mySSH.close()
HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) myHTML = HTML.HTMLManagement()
myHTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
def TerminateMME(self): def TerminateMME(self):
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
...@@ -313,7 +317,8 @@ class EPCManagement(): ...@@ -313,7 +317,8 @@ class EPCManagement():
else: else:
logging.error('This should not happen!') logging.error('This should not happen!')
mySSH.close() mySSH.close()
HTML.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) myHTML = HTML.HTMLManagement()
myHTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
def TerminateSPGW(self): def TerminateSPGW(self):
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
...@@ -344,7 +349,8 @@ class EPCManagement(): ...@@ -344,7 +349,8 @@ class EPCManagement():
else: else:
logging.error('This should not happen!') logging.error('This should not happen!')
mySSH.close() mySSH.close()
HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) myHTML = HTML.HTMLManagement()
myHTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
def LogCollectHSS(self): def LogCollectHSS(self):
......
...@@ -46,6 +46,7 @@ class HTMLManagement(): ...@@ -46,6 +46,7 @@ class HTMLManagement():
def __init__(self): def __init__(self):
self.htmlFile = ''
self.htmlHeaderCreated = False self.htmlHeaderCreated = False
self.htmlFooterCreated = False self.htmlFooterCreated = False
self.ranAllowMerge = False self.ranAllowMerge = False
...@@ -54,10 +55,18 @@ class HTMLManagement(): ...@@ -54,10 +55,18 @@ class HTMLManagement():
self.htmlTabNames = [] self.htmlTabNames = []
self.htmlTabIcons = [] self.htmlTabIcons = []
self.testXMLfiles = [] self.testXMLfiles = []
self.htmleNBFailureMsg = ''
self.htmlUEFailureMsg = ''
#----------------------------------------------------------- #-----------------------------------------------------------
# Setters and Getters # Setters and Getters
#----------------------------------------------------------- #-----------------------------------------------------------
def SethtmlUEFailureMsg(self,huefa):
self.htmlUEFailureMsg = huefa
def GethtmlUEFailureMsg(self):
return huefa
def SetreseNB(self,rsenb): def SetreseNB(self,rsenb):
self.reseNB = rsenb self.reseNB = rsenb
def SetresUE(self,rsue): def SetresUE(self,rsue):
......
...@@ -68,7 +68,6 @@ class OaiCiTest(): ...@@ -68,7 +68,6 @@ class OaiCiTest():
self.ADBCentralized = True self.ADBCentralized = True
self.testCase_id = '' self.testCase_id = ''
self.testXMLfiles = [] self.testXMLfiles = []
#self.nbTestXMLfiles = 0
self.desc = '' self.desc = ''
self.ping_args = '' self.ping_args = ''
self.ping_packetloss_threshold = '' self.ping_packetloss_threshold = ''
...@@ -86,12 +85,7 @@ class OaiCiTest(): ...@@ -86,12 +85,7 @@ class OaiCiTest():
self.UEDevicesRebootCmd = [] self.UEDevicesRebootCmd = []
self.CatMDevices = [] self.CatMDevices = []
self.UEIPAddresses = [] self.UEIPAddresses = []
self.htmlFile = ''
# self.htmlHeaderCreated = False
# self.htmlFooterCreated = False
self.htmlUEConnected = -1 self.htmlUEConnected = -1
self.htmleNBFailureMsg = ''
self.htmlUEFailureMsg = ''
self.picocom_closure = False self.picocom_closure = False
self.idle_sleep_time = 0 self.idle_sleep_time = 0
self.x2_ho_options = 'network' self.x2_ho_options = 'network'
...@@ -116,8 +110,6 @@ class OaiCiTest(): ...@@ -116,8 +110,6 @@ class OaiCiTest():
self.Build_OAI_UE_args = '' self.Build_OAI_UE_args = ''
self.Initialize_OAI_UE_args = '' self.Initialize_OAI_UE_args = ''
self.clean_repository = True self.clean_repository = True
self.flexranCtrlInstalled = False
self.flexranCtrlStarted = False
self.expectedNbOfConnectedUEs = 0 self.expectedNbOfConnectedUEs = 0
self.startTime = 0 self.startTime = 0
...@@ -232,13 +224,12 @@ class OaiCiTest(): ...@@ -232,13 +224,12 @@ class OaiCiTest():
SSH.command('ls -ls /opt/flexran_rtc/*/rt_controller', '\$', 5) SSH.command('ls -ls /opt/flexran_rtc/*/rt_controller', '\$', 5)
result = re.search('/opt/flexran_rtc/build/rt_controller', SSH.getBefore()) result = re.search('/opt/flexran_rtc/build/rt_controller', SSH.getBefore())
if result is not None: if result is not None:
self.flexranCtrlInstalled = True
RAN.SetflexranCtrlInstalled(True) RAN.SetflexranCtrlInstalled(True)
logging.debug('Flexran Controller is installed') logging.debug('Flexran Controller is installed')
SSH.close() SSH.close()
def InitializeFlexranCtrl(self): def InitializeFlexranCtrl(self):
if self.flexranCtrlInstalled == False: if RAN.GetflexranCtrlInstalled() == False:
return return
if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '': if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '':
GenericHelp(Version) GenericHelp(Version)
...@@ -253,7 +244,6 @@ class OaiCiTest(): ...@@ -253,7 +244,6 @@ class OaiCiTest():
result = re.search('rt_controller -c ', SSH.getBefore()) result = re.search('rt_controller -c ', SSH.getBefore())
if result is not None: if result is not None:
logging.debug('\u001B[1m Initialize FlexRan Controller Completed\u001B[0m') logging.debug('\u001B[1m Initialize FlexRan Controller Completed\u001B[0m')
self.flexranCtrlStarted = True
RAN.SetflexranCtrlStarted(True) RAN.SetflexranCtrlStarted(True)
SSH.close() SSH.close()
HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
...@@ -487,12 +477,12 @@ class OaiCiTest(): ...@@ -487,12 +477,12 @@ class OaiCiTest():
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' HTML.SethtmlUEFailureMsg('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' HTML.SethtmlUEFailureMsg('oaitun_ue1 interface is either NOT mounted or NOT configured')
HTML.CreateHtmlTestRow(self.Initialize_OAI_UE_args, 'KO', CONST.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' HTML.SethtmlUEFailureMsg('nr-uesoftmodem did NOT synced')
HTML.CreateHtmlTestRow(self.Initialize_OAI_UE_args, 'KO', CONST.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()
...@@ -1176,7 +1166,7 @@ class OaiCiTest(): ...@@ -1176,7 +1166,7 @@ class OaiCiTest():
i += 1 i += 1
for job in multi_jobs: for job in multi_jobs:
job.join() job.join()
if self.flexranCtrlInstalled and self.flexranCtrlStarted: if RAN.GetflexranCtrlInstalled() and RAN.GetflexranCtrlStarted():
SSH.open(EPC.GetIPAddress(), EPC.GetUserName(), EPC.GetPassword()) SSH.open(EPC.GetIPAddress(), EPC.GetUserName(), EPC.GetPassword())
SSH.command('cd /opt/flexran_rtc', '\$', 5) SSH.command('cd /opt/flexran_rtc', '\$', 5)
SSH.command('curl http://localhost:9999/stats | jq \'.\' > log/check_status_' + self.testCase_id + '.log 2>&1', '\$', 5) SSH.command('curl http://localhost:9999/stats | jq \'.\' > log/check_status_' + self.testCase_id + '.log 2>&1', '\$', 5)
...@@ -2340,7 +2330,7 @@ class OaiCiTest(): ...@@ -2340,7 +2330,7 @@ class OaiCiTest():
if logStatus < 0: if logStatus < 0:
result = logStatus result = logStatus
RAN.SeteNBLogFiles[0] = '' RAN.SeteNBLogFiles[0] = ''
if self.flexranCtrlInstalled and self.flexranCtrlStarted: if RAN.GetflexranCtrlInstalled() and RAN.GetflexranCtrlStarted():
self.TerminateFlexranCtrl() self.TerminateFlexranCtrl()
return result return result
...@@ -2416,7 +2406,7 @@ class OaiCiTest(): ...@@ -2416,7 +2406,7 @@ class OaiCiTest():
nrFoundDCI = 0 nrFoundDCI = 0
nrCRCOK = 0 nrCRCOK = 0
mbms_messages = 0 mbms_messages = 0
self.htmlUEFailureMsg = '' HTML.SethtmlUEFailureMsg('')
for line in ue_log_file.readlines(): for line in ue_log_file.readlines():
result = re.search('nr_synchro_time', str(line)) result = re.search('nr_synchro_time', str(line))
if result is not None: if result is not None:
...@@ -2485,22 +2475,22 @@ class OaiCiTest(): ...@@ -2485,22 +2475,22 @@ class OaiCiTest():
if result is not None and (not mib_found): if result is not None and (not mib_found):
try: try:
mibMsg = "MIB Information: " + result.group(1) + ', ' + result.group(2) mibMsg = "MIB Information: " + result.group(1) + ', ' + result.group(2)
self.htmlUEFailureMsg += mibMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + mibMsg + '\n')
logging.debug('\033[94m' + mibMsg + '\033[0m') logging.debug('\033[94m' + mibMsg + '\033[0m')
mibMsg = " nidcell = " + result.group('nidcell') mibMsg = " nidcell = " + result.group('nidcell')
self.htmlUEFailureMsg += mibMsg HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + mibMsg)
logging.debug('\033[94m' + mibMsg + '\033[0m') logging.debug('\033[94m' + mibMsg + '\033[0m')
mibMsg = " n_rb_dl = " + result.group('n_rb_dl') mibMsg = " n_rb_dl = " + result.group('n_rb_dl')
self.htmlUEFailureMsg += mibMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + mibMsg + '\n')
logging.debug('\033[94m' + mibMsg + '\033[0m') logging.debug('\033[94m' + mibMsg + '\033[0m')
mibMsg = " phich_duration = " + result.group('phich_duration') mibMsg = " phich_duration = " + result.group('phich_duration')
self.htmlUEFailureMsg += mibMsg HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + mibMsg)
logging.debug('\033[94m' + mibMsg + '\033[0m') logging.debug('\033[94m' + mibMsg + '\033[0m')
mibMsg = " phich_resource = " + result.group('phich_resource') mibMsg = " phich_resource = " + result.group('phich_resource')
self.htmlUEFailureMsg += mibMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + mibMsg + '\n')
logging.debug('\033[94m' + mibMsg + '\033[0m') logging.debug('\033[94m' + mibMsg + '\033[0m')
mibMsg = " tx_ant = " + result.group('tx_ant') mibMsg = " tx_ant = " + result.group('tx_ant')
self.htmlUEFailureMsg += mibMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + mibMsg + '\n')
logging.debug('\033[94m' + mibMsg + '\033[0m') logging.debug('\033[94m' + mibMsg + '\033[0m')
mib_found = True mib_found = True
except Exception as e: except Exception as e:
...@@ -2509,7 +2499,7 @@ class OaiCiTest(): ...@@ -2509,7 +2499,7 @@ class OaiCiTest():
if result is not None and (not frequency_found): if result is not None and (not frequency_found):
try: try:
mibMsg = "Measured Carrier Frequency = " + result.group('measured_carrier_frequency') + ' Hz' mibMsg = "Measured Carrier Frequency = " + result.group('measured_carrier_frequency') + ' Hz'
self.htmlUEFailureMsg += mibMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + mibMsg + '\n')
logging.debug('\033[94m' + mibMsg + '\033[0m') logging.debug('\033[94m' + mibMsg + '\033[0m')
frequency_found = True frequency_found = True
except Exception as e: except Exception as e:
...@@ -2518,7 +2508,7 @@ class OaiCiTest(): ...@@ -2518,7 +2508,7 @@ class OaiCiTest():
if result is not None and (not plmn_found): if result is not None and (not plmn_found):
try: try:
mibMsg = 'PLMN MCC = ' + result.group('mcc') + ' MNC = ' + result.group('mnc') mibMsg = 'PLMN MCC = ' + result.group('mcc') + ' MNC = ' + result.group('mnc')
self.htmlUEFailureMsg += mibMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + mibMsg + '\n')
logging.debug('\033[94m' + mibMsg + '\033[0m') logging.debug('\033[94m' + mibMsg + '\033[0m')
plmn_found = True plmn_found = True
except Exception as e: except Exception as e:
...@@ -2527,7 +2517,7 @@ class OaiCiTest(): ...@@ -2527,7 +2517,7 @@ class OaiCiTest():
if result is not None: if result is not None:
try: try:
mibMsg = "The operator is: " + result.group('operator') mibMsg = "The operator is: " + result.group('operator')
self.htmlUEFailureMsg += mibMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + mibMsg + '\n')
logging.debug('\033[94m' + mibMsg + '\033[0m') logging.debug('\033[94m' + mibMsg + '\033[0m')
except Exception as e: except Exception as e:
logging.error('\033[91m' + "Operator name not found" + '\033[0m') logging.error('\033[91m' + "Operator name not found" + '\033[0m')
...@@ -2535,7 +2525,7 @@ class OaiCiTest(): ...@@ -2535,7 +2525,7 @@ class OaiCiTest():
if result is not None: if result is not None:
try: try:
mibMsg = "SIB5 InterFreqCarrierFreq element " + result.group(1) + '/' + result.group(2) mibMsg = "SIB5 InterFreqCarrierFreq element " + result.group(1) + '/' + result.group(2)
self.htmlUEFailureMsg += mibMsg + ' -> ' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + mibMsg + ' -> ')
logging.debug('\033[94m' + mibMsg + '\033[0m') logging.debug('\033[94m' + mibMsg + '\033[0m')
except Exception as e: except Exception as e:
logging.error('\033[91m' + "SIB5 InterFreqCarrierFreq element not found" + '\033[0m') logging.error('\033[91m' + "SIB5 InterFreqCarrierFreq element not found" + '\033[0m')
...@@ -2545,7 +2535,7 @@ class OaiCiTest(): ...@@ -2545,7 +2535,7 @@ class OaiCiTest():
freq = result.group('carrier_frequency') freq = result.group('carrier_frequency')
new_freq = re.sub('/[0-9]+','',freq) new_freq = re.sub('/[0-9]+','',freq)
float_freq = float(new_freq) / 1000000 float_freq = float(new_freq) / 1000000
self.htmlUEFailureMsg += 'DL Freq: ' + ('%.1f' % float_freq) + ' MHz' HTMLSethtmlUEFailureMsg(HTMLGethtmlUEFailureMsg() + 'DL Freq: ' + ('%.1f' % float_freq) + ' MHz')
logging.debug('\033[94m' + " DL Carrier Frequency is: " + freq + '\033[0m') logging.debug('\033[94m' + " DL Carrier Frequency is: " + freq + '\033[0m')
except Exception as e: except Exception as e:
logging.error('\033[91m' + " DL Carrier Frequency not found" + '\033[0m') logging.error('\033[91m' + " DL Carrier Frequency not found" + '\033[0m')
...@@ -2553,7 +2543,7 @@ class OaiCiTest(): ...@@ -2553,7 +2543,7 @@ class OaiCiTest():
if result is not None: if result is not None:
try: try:
prb = result.group('allowed_bandwidth') prb = result.group('allowed_bandwidth')
self.htmlUEFailureMsg += ' -- PRB: ' + prb + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + ' -- PRB: ' + prb + '\n')
logging.debug('\033[94m' + " AllowedMeasBandwidth: " + prb + '\033[0m') logging.debug('\033[94m' + " AllowedMeasBandwidth: " + prb + '\033[0m')
except Exception as e: except Exception as e:
logging.error('\033[91m' + " AllowedMeasBandwidth not found" + '\033[0m') logging.error('\033[91m' + " AllowedMeasBandwidth not found" + '\033[0m')
...@@ -2561,48 +2551,48 @@ class OaiCiTest(): ...@@ -2561,48 +2551,48 @@ class OaiCiTest():
if rrcConnectionRecfgComplete > 0: if rrcConnectionRecfgComplete > 0:
statMsg = 'UE connected to eNB (' + str(rrcConnectionRecfgComplete) + ' RRCConnectionReconfigurationComplete message(s) generated)' statMsg = 'UE connected to eNB (' + str(rrcConnectionRecfgComplete) + ' RRCConnectionReconfigurationComplete message(s) generated)'
logging.debug('\033[94m' + statMsg + '\033[0m') logging.debug('\033[94m' + statMsg + '\033[0m')
self.htmlUEFailureMsg += statMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + statMsg + '\n')
if nrUEFlag: if nrUEFlag:
if nrDecodeMib > 0: if nrDecodeMib > 0:
statMsg = 'UE showed ' + str(nrDecodeMib) + ' MIB decode message(s)' statMsg = 'UE showed ' + str(nrDecodeMib) + ' MIB decode message(s)'
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
self.htmlUEFailureMsg += statMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + statMsg + '\n')
if nrFoundDCI > 0: if nrFoundDCI > 0:
statMsg = 'UE showed ' + str(nrFoundDCI) + ' DCI found message(s)' statMsg = 'UE showed ' + str(nrFoundDCI) + ' DCI found message(s)'
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
self.htmlUEFailureMsg += statMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + statMsg + '\n')
if nrCRCOK > 0: if nrCRCOK > 0:
statMsg = 'UE showed ' + str(nrCRCOK) + ' PDSCH decoding message(s)' statMsg = 'UE showed ' + str(nrCRCOK) + ' PDSCH decoding message(s)'
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
self.htmlUEFailureMsg += statMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + statMsg + '\n')
if not frequency_found: if not frequency_found:
statMsg = 'NR-UE could NOT synch!' statMsg = 'NR-UE could NOT synch!'
logging.error('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') logging.error('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
self.htmlUEFailureMsg += statMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + statMsg + '\n')
if uciStatMsgCount > 0: if uciStatMsgCount > 0:
statMsg = 'UE showed ' + str(uciStatMsgCount) + ' "uci->stat" message(s)' statMsg = 'UE showed ' + str(uciStatMsgCount) + ' "uci->stat" message(s)'
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
self.htmlUEFailureMsg += statMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + statMsg + '\n')
if pdcpDataReqFailedCount > 0: if pdcpDataReqFailedCount > 0:
statMsg = 'UE showed ' + str(pdcpDataReqFailedCount) + ' "PDCP data request failed" message(s)' statMsg = 'UE showed ' + str(pdcpDataReqFailedCount) + ' "PDCP data request failed" message(s)'
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
self.htmlUEFailureMsg += statMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + statMsg + '\n')
if badDciCount > 0: if badDciCount > 0:
statMsg = 'UE showed ' + str(badDciCount) + ' "bad DCI 1(A)" message(s)' statMsg = 'UE showed ' + str(badDciCount) + ' "bad DCI 1(A)" message(s)'
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
self.htmlUEFailureMsg += statMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + statMsg + '\n')
if f1aRetransmissionCount > 0: if f1aRetransmissionCount > 0:
statMsg = 'UE showed ' + str(f1aRetransmissionCount) + ' "Format1A Retransmission but TBS are different" message(s)' statMsg = 'UE showed ' + str(f1aRetransmissionCount) + ' "Format1A Retransmission but TBS are different" message(s)'
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
self.htmlUEFailureMsg += statMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + statMsg + '\n')
if fatalErrorCount > 0: if fatalErrorCount > 0:
statMsg = 'UE showed ' + str(fatalErrorCount) + ' "FATAL ERROR:" message(s)' statMsg = 'UE showed ' + str(fatalErrorCount) + ' "FATAL ERROR:" message(s)'
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
self.htmlUEFailureMsg += statMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + statMsg + '\n')
if macBsrTimerExpiredCount > 0: if macBsrTimerExpiredCount > 0:
statMsg = 'UE showed ' + str(fatalErrorCount) + ' "MAC BSR Triggered ReTxBSR Timer expiry" message(s)' statMsg = 'UE showed ' + str(fatalErrorCount) + ' "MAC BSR Triggered ReTxBSR Timer expiry" message(s)'
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
self.htmlUEFailureMsg += statMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + statMsg + '\n')
if RAN.GeteNBmbmsEnables[0]: if RAN.GeteNBmbmsEnables[0]:
if mbms_messages > 0: if mbms_messages > 0:
statMsg = 'UE showed ' + str(mbms_messages) + ' "TRIED TO PUSH MBMS DATA" message(s)' statMsg = 'UE showed ' + str(mbms_messages) + ' "TRIED TO PUSH MBMS DATA" message(s)'
...@@ -2610,7 +2600,7 @@ class OaiCiTest(): ...@@ -2610,7 +2600,7 @@ class OaiCiTest():
else: else:
statMsg = 'UE did NOT SHOW "TRIED TO PUSH MBMS DATA" message(s)' statMsg = 'UE did NOT SHOW "TRIED TO PUSH MBMS DATA" message(s)'
logging.debug('\u001B[1;30;41m ' + statMsg + ' \u001B[0m') logging.debug('\u001B[1;30;41m ' + statMsg + ' \u001B[0m')
self.htmlUEFailureMsg += statMsg + '\n' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + statMsg + '\n')
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:
...@@ -2620,7 +2610,7 @@ class OaiCiTest(): ...@@ -2620,7 +2610,7 @@ class OaiCiTest():
return CONST.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' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + '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 CONST.OAI_UE_PROCESS_ASSERTION return CONST.OAI_UE_PROCESS_ASSERTION
...@@ -2629,7 +2619,7 @@ class OaiCiTest(): ...@@ -2629,7 +2619,7 @@ class OaiCiTest():
return CONST.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' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + 'UE faced real time issues!\n')
#return CONST.ENB_PROCESS_REALTIME_ISSUE #return CONST.ENB_PROCESS_REALTIME_ISSUE
if nrUEFlag: if nrUEFlag:
if not frequency_found: if not frequency_found:
...@@ -2637,13 +2627,13 @@ class OaiCiTest(): ...@@ -2637,13 +2627,13 @@ class OaiCiTest():
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' HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + 'UE could not synchronize!\n')
return CONST.OAI_UE_PROCESS_COULD_NOT_SYNC return CONST.OAI_UE_PROCESS_COULD_NOT_SYNC
return 0 return 0
def TerminateFlexranCtrl(self): def TerminateFlexranCtrl(self):
if self.flexranCtrlInstalled == False or self.flexranCtrlStarted == False: if RAN.GetflexranCtrlInstalled() == False or RAN.GetflexranCtrlStarted() == False:
return return
if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '': if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '':
GenericHelp(Version) GenericHelp(Version)
...@@ -2654,7 +2644,7 @@ class OaiCiTest(): ...@@ -2654,7 +2644,7 @@ class OaiCiTest():
SSH.command('echo ' + EPC.GetPassword() + ' | sudo -S killall --signal SIGKILL rt_controller', '\$', 5) SSH.command('echo ' + EPC.GetPassword() + ' | sudo -S killall --signal SIGKILL rt_controller', '\$', 5)
time.sleep(1) time.sleep(1)
SSH.close() SSH.close()
self.flexranCtrlStarted = False RAN.SetflexranCtrlStarted(False)
HTML.CreateHtmlTestRow('N/A', 'OK', CONST.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):
...@@ -2720,7 +2710,7 @@ class OaiCiTest(): ...@@ -2720,7 +2710,7 @@ class OaiCiTest():
copyin_res = SSH.copyin(self.UEIPAddress, self.UEUserName, self.UEPassword, self.UESourceCodePath + '/cmake_targets/' + self.UELogFile, '.') copyin_res = SSH.copyin(self.UEIPAddress, self.UEUserName, self.UEPassword, self.UESourceCodePath + '/cmake_targets/' + self.UELogFile, '.')
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!' HTML.SethtmlUEFailureMsg('Could not copy UE logfile to analyze it!')
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.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
...@@ -2733,7 +2723,7 @@ class OaiCiTest(): ...@@ -2733,7 +2723,7 @@ class OaiCiTest():
ueAction = 'Connection' ueAction = 'Connection'
if (logStatus < 0): if (logStatus < 0):
logging.debug('\u001B[1m' + ueAction + ' Failed \u001B[0m') logging.debug('\u001B[1m' + ueAction + ' Failed \u001B[0m')
self.htmlUEFailureMsg = '<b>' + ueAction + ' Failed</b>\n' + self.htmlUEFailureMsg HTML.SethtmlUEFailureMsg('<b>' + ueAction + ' Failed</b>\n' + HTML.GethtmlUEFailureMsg())
HTML.CreateHtmlTestRow('N/A', 'KO', logStatus, 'UE') HTML.CreateHtmlTestRow('N/A', 'KO', logStatus, 'UE')
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
...@@ -2747,7 +2737,7 @@ class OaiCiTest(): ...@@ -2747,7 +2737,7 @@ class OaiCiTest():
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 HTML.SethtmlUEFailureMsg('<b>' + ueAction + ' Completed</b>\n' + HTML.GethtmlUEFailureMsg())
HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
self.UELogFile = '' self.UELogFile = ''
else: else:
...@@ -2773,7 +2763,7 @@ class OaiCiTest(): ...@@ -2773,7 +2763,7 @@ class OaiCiTest():
self.ShowTestID() self.ShowTestID()
RAN.SeteNB_instance('0') RAN.SeteNB_instance('0')
RAN.TerminateeNB() RAN.TerminateeNB()
if self.flexranCtrlInstalled and self.flexranCtrlStarted: 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) RAN.SettestCase_id(self.testCase_id)
self.desc = 'Automatic Termination of FlexRan CTL' self.desc = 'Automatic Termination of FlexRan CTL'
...@@ -2835,7 +2825,7 @@ class OaiCiTest(): ...@@ -2835,7 +2825,7 @@ class OaiCiTest():
logging.debug(msg) logging.debug(msg)
fullMessage += msg + '\n' fullMessage += msg + '\n'
if self.x2_ho_options == 'network': if self.x2_ho_options == 'network':
if self.flexranCtrlInstalled and self.flexranCtrlStarted: if RAN.GetflexranCtrlInstalled() and RAN.GetflexranCtrlStarted():
self.x2ENBBsIds = [] self.x2ENBBsIds = []
self.x2ENBConnectedUEs = [] self.x2ENBConnectedUEs = []
self.x2ENBBsIds.append([]) self.x2ENBBsIds.append([])
...@@ -3207,7 +3197,6 @@ EPC = epc.EPCManagement() ...@@ -3207,7 +3197,6 @@ EPC = epc.EPCManagement()
RAN = ran.RANManagement() RAN = ran.RANManagement()
HTML = html.HTMLManagement() HTML = html.HTMLManagement()
argvs = sys.argv argvs = sys.argv
argc = len(argvs) argc = len(argvs)
cwd = os.getcwd() cwd = os.getcwd()
...@@ -3300,10 +3289,6 @@ while len(argvs) > 1: ...@@ -3300,10 +3289,6 @@ 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))
#GP250220: do we still need EPCBranch? it's not used anywhere
elif re.match('^\-\-EPCBranch=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-EPCBranch=(.+)$', myArgv, re.IGNORECASE)
CiTestObj.EPCBranch = 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))
...@@ -3370,7 +3355,7 @@ if re.match('^TerminateeNB$', mode, re.IGNORECASE): ...@@ -3370,7 +3355,7 @@ if re.match('^TerminateeNB$', mode, re.IGNORECASE):
RAN.SeteNB_serverId('0') RAN.SeteNB_serverId('0')
RAN.SeteNB_instance('0') RAN.SeteNB_instance('0')
RAN.SeteNBSourceCodePath('/tmp/') RAN.SeteNBSourceCodePath('/tmp/')
CiTestObj.TerminateeNB() RAN.TerminateeNB()
elif re.match('^TerminateUE$', mode, re.IGNORECASE): elif re.match('^TerminateUE$', mode, re.IGNORECASE):
if (CiTestObj.ADBIPAddress == '' or CiTestObj.ADBUserName == '' or CiTestObj.ADBPassword == ''): if (CiTestObj.ADBIPAddress == '' or CiTestObj.ADBUserName == '' or CiTestObj.ADBPassword == ''):
GenericHelp(Version) GenericHelp(Version)
......
...@@ -87,6 +87,9 @@ class RANManagement(): ...@@ -87,6 +87,9 @@ 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.flexranCtrlInstalled = False
self.flexranCtrlStarted = False
#----------------------------------------------------------- #-----------------------------------------------------------
# Setters and Getters # Setters and Getters
...@@ -97,8 +100,12 @@ class RANManagement(): ...@@ -97,8 +100,12 @@ class RANManagement():
self.testCase_id = tcid self.testCase_id = tcid
def SetflexranCtrlInstalled(self,fxrctin): def SetflexranCtrlInstalled(self,fxrctin):
self.flexranCtrlInstalled = fxrctin self.flexranCtrlInstalled = fxrctin
def GetflexranCtrlInstalled(self):
return self.flexranCtrlInstalled
def SetflexranCtrlStarted(self,fxrctst): def SetflexranCtrlStarted(self,fxrctst):
self.flexranCtrlStarted = fxrctst self.flexranCtrlStarted = fxrctst
def GetflexranCtrlStarted(self):
return self.flexranCtrlStarted
def SetpStatus(self, pSt): def SetpStatus(self, pSt):
self.pStatus = pSt self.pStatus = pSt
def SetranRepository(self, repository): def SetranRepository(self, repository):
...@@ -175,21 +182,11 @@ class RANManagement(): ...@@ -175,21 +182,11 @@ class RANManagement():
def GeteNBLogFiles(self): def GeteNBLogFiles(self):
return self.eNBLogFiles return self.eNBLogFiles
def SeteNBOptions(self, enbopt):
self.eNBOptions = enbopt
def GeteNBOptions(self):
return self.eNBOptions
def SeteNBmbmsEnables(self, enbmbms): def SeteNBmbmsEnables(self, enbmbms):
self.eNBmbmsEnables = enbmbms self.eNBmbmsEnables = enbmbms
def GeteNBmbmsEnables(self): def GeteNBmbmsEnables(self):
return self.eNBmbmsEnables return self.eNBmbmsEnables
def SeteNBstatuses(self, enbstatus):
self.eNBstatuses = enbstatus
def GeteNBstatuses(self):
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):
...@@ -339,6 +336,7 @@ class RANManagement(): ...@@ -339,6 +336,7 @@ class RANManagement():
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)
mySSH.close()
self.checkBuildeNB(lIpAddr, lUserName, lPassWord, lSourcePath, self.testCase_id) self.checkBuildeNB(lIpAddr, lUserName, lPassWord, lSourcePath, self.testCase_id)
...@@ -374,11 +372,13 @@ class RANManagement(): ...@@ -374,11 +372,13 @@ class RANManagement():
else: else:
count -= 1 count -= 1
time.sleep(30) time.sleep(30)
mySSH.close()
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() myHTML = HTML.HTMLManagement()
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
mySSH.open(lIpAddr, lUserName, lPassWord)
mySSH.command('cd ' + lSourcePath + '/cmake_targets', '\$', 3) mySSH.command('cd ' + lSourcePath + '/cmake_targets', '\$', 3)
mySSH.command('ls ran_build/build', '\$', 3) mySSH.command('ls ran_build/build', '\$', 3)
mySSH.command('ls ran_build/build', '\$', 3) mySSH.command('ls ran_build/build', '\$', 3)
...@@ -909,7 +909,7 @@ class RANManagement(): ...@@ -909,7 +909,7 @@ class RANManagement():
enb_log_file.close() enb_log_file.close()
logging.debug(' File analysis completed') logging.debug(' File analysis completed')
self.htmleNBFailureMsg = '' self.htmleNBFailureMsg = ''
if self.air_interface() == 'lte': if self.air_interface == 'lte':
nodeB_prefix = 'e' nodeB_prefix = 'e'
else: else:
nodeB_prefix = 'g' nodeB_prefix = 'g'
......
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