Commit 27a8abfe authored by Boris Djalal's avatar Boris Djalal

Removing a wrong change in match TerminateUE. Code cleaning.

Signed-off-by: default avatarBoris Djalal <boris.djalal@eurecom.fr>
parent dac4ceb7
...@@ -42,6 +42,7 @@ ENB_PROCESS_SEG_FAULT = -11 ...@@ -42,6 +42,7 @@ ENB_PROCESS_SEG_FAULT = -11
ENB_PROCESS_ASSERTION = -12 ENB_PROCESS_ASSERTION = -12
ENB_PROCESS_REALTIME_ISSUE = -13 ENB_PROCESS_REALTIME_ISSUE = -13
ENB_PROCESS_NOLOGFILE_TO_ANALYZE = -14 ENB_PROCESS_NOLOGFILE_TO_ANALYZE = -14
UE_PROCESS_NOLOGFILE_TO_ANALYZE = -20
HSS_PROCESS_FAILED = -2 HSS_PROCESS_FAILED = -2
HSS_PROCESS_OK = +2 HSS_PROCESS_OK = +2
MME_PROCESS_FAILED = -3 MME_PROCESS_FAILED = -3
...@@ -129,24 +130,13 @@ class SSHConnection(): ...@@ -129,24 +130,13 @@ class SSHConnection():
self.CpuModel = '' self.CpuModel = ''
self.CpuMHz = '' self.CpuMHz = ''
self.UEIPAddress = '' self.UEIPAddress = ''
self.UEBranch = ''
#self.UE_AllowMerge = False
self.UECommitID = ''
#self.UETargetBranch = ''
self.UEUserName = '' self.UEUserName = ''
self.UEPassword = '' self.UEPassword = ''
self.UE_instance = '' self.UE_instance = ''
#self.UESourceCodePath = '' self.UESourceCodePath = ''
#self.UECpuMHz = ''
self.Build_OAI_UE_args = '' self.Build_OAI_UE_args = ''
self.Initialize_OAI_UE_args = '' self.Initialize_OAI_UE_args = ''
self.eNBOsVersion = '' self.eNBOsVersion = ''
#self.eNBKernelVersion = ''
#self.eNBUsrpBoard = ''
#self.eNBUhdVersion = ''
#self.eNBCpuNb = ''
#self.eNBCpuModel = ''
#self.eNBCpuMHz = ''
def open(self, ipaddress, username, password): def open(self, ipaddress, username, password):
count = 0 count = 0
...@@ -610,7 +600,7 @@ class SSHConnection(): ...@@ -610,7 +600,7 @@ class SSHConnection():
# Reloading FGPA bin firmware # Reloading FGPA bin firmware
self.command('echo ' + self.UEPassword + ' | sudo -S uhd_find_devices', '\$', 5) self.command('echo ' + self.UEPassword + ' | sudo -S uhd_find_devices', '\$', 5)
else: else:
logging.debug('Did not find any B2xx device') logging.debug('Did not find any B2xx device')
self.command('cd ' + self.UESourceCodePath, '\$', 5) self.command('cd ' + self.UESourceCodePath, '\$', 5)
# Initialize_OAI_UE_args usually start with -C and followed by the location in repository # Initialize_OAI_UE_args usually start with -C and followed by the location in repository
#full_config_file = self.Initialize_OAI_UE_args.replace('-O ','') #full_config_file = self.Initialize_OAI_UE_args.replace('-O ','')
...@@ -2044,7 +2034,7 @@ class SSHConnection(): ...@@ -2044,7 +2034,7 @@ class SSHConnection():
self.htmleNBFailureMsg += rrcMsg + '\n' self.htmleNBFailureMsg += rrcMsg + '\n'
if rrcReconfigRequest > 0 or rrcReconfigComplete > 0: if rrcReconfigRequest > 0 or rrcReconfigComplete > 0:
rrcMsg = 'eNB requested ' + str(rrcReconfigRequest) + ' RRC Connection Reconfiguration(s)' rrcMsg = 'eNB requested ' + str(rrcReconfigRequest) + ' RRC Connection Reconfiguration(s)'
logging.debug('\u001B[1;30;43m ' + rrcMsig + ' \u001B[0m') logging.debug('\u001B[1;30;43m ' + rrcMsg + ' \u001B[0m')
self.htmleNBFailureMsg += rrcMsg + '\n' self.htmleNBFailureMsg += rrcMsg + '\n'
rrcMsg = ' -- ' + str(rrcReconfigComplete) + ' were completed' rrcMsg = ' -- ' + str(rrcReconfigComplete) + ' were completed'
logging.debug('\u001B[1;30;43m ' + rrcMsg + ' \u001B[0m') logging.debug('\u001B[1;30;43m ' + rrcMsg + ' \u001B[0m')
...@@ -2397,7 +2387,7 @@ class SSHConnection(): ...@@ -2397,7 +2387,7 @@ class SSHConnection():
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!'
self.CreateHtmlTestRow('N/A', 'KO', ENB_PROCESS_NOLOGFILE_TO_ANALYZE) self.CreateHtmlTestRow('N/A', 'KO', UE_PROCESS_NOLOGFILE_TO_ANALYZE)
self.UELogFile = '' self.UELogFile = ''
return return
logging.debug('\u001B[1m Analyzing UE logfile \u001B[0m') logging.debug('\u001B[1m Analyzing UE logfile \u001B[0m')
...@@ -2429,23 +2419,23 @@ class SSHConnection(): ...@@ -2429,23 +2419,23 @@ class SSHConnection():
def LogCollectBuild(self): def LogCollectBuild(self):
if (self.eNBIPAddress != '' and self.eNBUserName != '' and self.eNBPassword != ''): if (self.eNBIPAddress != '' and self.eNBUserName != '' and self.eNBPassword != ''):
self.IPAddress = self.eNBIPAddress IPAddress = self.eNBIPAddress
self.UserName = self.eNBUserName UserName = self.eNBUserName
self.Password = self.eNBPassword Password = self.eNBPassword
self.SourceCodePath = self.eNBSourceCodePath SourceCodePath = self.eNBSourceCodePath
elif (self.UEIPAddress != '' and self.UEUserName != '' and self.UEPassword != ''): elif (self.UEIPAddress != '' and self.UEUserName != '' and self.UEPassword != ''):
self.IPAddress = self.UEIPAddress IPAddress = self.UEIPAddress
self.UserName = self.UEUserName UserName = self.UEUserName
self.Password = self.UEPassword Password = self.UEPassword
self.SourceCodePath = self.UESourceCodePath SourceCodePath = self.UESourceCodePath
else: else:
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
self.open(self.IPAddress, self.UserName, self.Password) self.open(IPAddress, UserName, Password)
self.command('cd ' + self.SourceCodePath, '\$', 5) self.command('cd ' + SourceCodePath, '\$', 5)
self.command('cd cmake_targets', '\$', 5) self.command('cd cmake_targets', '\$', 5)
self.command('rm -f build.log.zip', '\$', 5) self.command('rm -f build.log.zip', '\$', 5)
self.command('zip build.log.zip build_log_*/*', '\$', 60) self.command('zip build.log.zip build_log_*/*', '\$', 60)
self.command('echo ' + self.Password + ' | sudo -S rm -rf build_log_*', '\$', 5) self.command('echo ' + Password + ' | sudo -S rm -rf build_log_*', '\$', 5)
self.close() self.close()
def LogCollecteNB(self): def LogCollecteNB(self):
...@@ -2536,18 +2526,18 @@ class SSHConnection(): ...@@ -2536,18 +2526,18 @@ class SSHConnection():
machine = None machine = None
if self.eNBIPAddress != '' and self.eNBUserName != '' and self.eNBPassword != '': if self.eNBIPAddress != '' and self.eNBUserName != '' and self.eNBPassword != '':
machine = 'eNB' machine = 'eNB'
self.IPAddress = self.eNBIPAddress IPAddress = self.eNBIPAddress
self.UserName = self.eNBUserName UserName = self.eNBUserName
self.Password = self.eNBPassword Password = self.eNBPassword
if self.UEIPAddress != '' and self.UEUserName != '' and self.UEPassword != '': elif self.UEIPAddress != '' and self.UEUserName != '' and self.UEPassword != '':
machine = 'UE' machine = 'UE'
self.IPAddress = self.UEIPAddress IPAddress = self.UEIPAddress
self.UserName = self.UEUserName UserName = self.UEUserName
self.Password = self.UEPassword Password = self.UEPassword
if machine is None: if machine is None:
Usage() Usage()
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
self.open(self.IPAddress, self.UserName, self.Password) self.open(IPAddress, UserName, Password)
self.command('lsb_release -a', '\$', 5) self.command('lsb_release -a', '\$', 5)
result = re.search('Description:\\\\t(?P<os_type>[a-zA-Z0-9\-\_\.\ ]+)', str(self.ssh.before)) result = re.search('Description:\\\\t(?P<os_type>[a-zA-Z0-9\-\_\.\ ]+)', str(self.ssh.before))
if result is not None: if result is not None:
...@@ -2563,7 +2553,7 @@ class SSHConnection(): ...@@ -2563,7 +2553,7 @@ class SSHConnection():
if result is not None: if result is not None:
self.UhdVersion = result.group('uhd_version') self.UhdVersion = result.group('uhd_version')
logging.debug('UHD Version is: ' + self.UhdVersion) logging.debug('UHD Version is: ' + self.UhdVersion)
self.command('echo ' + self.Password + ' | sudo -S uhd_find_devices', '\$', 5) self.command('echo ' + Password + ' | sudo -S uhd_find_devices', '\$', 5)
result = re.search('product: (?P<usrp_board>[0-9A-Za-z]+)\\\\r\\\\n', str(self.ssh.before)) result = re.search('product: (?P<usrp_board>[0-9A-Za-z]+)\\\\r\\\\n', str(self.ssh.before))
if result is not None: if result is not None:
self.UsrpBoard = result.group('usrp_board') self.UsrpBoard = result.group('usrp_board')
...@@ -2791,7 +2781,7 @@ class SSHConnection(): ...@@ -2791,7 +2781,7 @@ class SSHConnection():
self.htmlFile.write(' <td bgcolor = "lightcoral" >KO - ' + machine + ' process ended in Assertion</td>\n') self.htmlFile.write(' <td bgcolor = "lightcoral" >KO - ' + machine + ' process ended in Assertion</td>\n')
elif (processesStatus == ENB_PROCESS_REALTIME_ISSUE): elif (processesStatus == ENB_PROCESS_REALTIME_ISSUE):
self.htmlFile.write(' <td bgcolor = "lightcoral" >KO - ' + machine + ' process faced Real Time issue(s)</td>\n') self.htmlFile.write(' <td bgcolor = "lightcoral" >KO - ' + machine + ' process faced Real Time issue(s)</td>\n')
elif (processesStatus == ENB_PROCESS_NOLOGFILE_TO_ANALYZE): elif (processesStatus == ENB_PROCESS_NOLOGFILE_TO_ANALYZE) or (processesStatus == UE_PROCESS_NOLOGFILE_TO_ANALYZE):
self.htmlFile.write(' <td bgcolor = "orange" >OK</td>\n') self.htmlFile.write(' <td bgcolor = "orange" >OK</td>\n')
elif (processesStatus == HSS_PROCESS_FAILED): elif (processesStatus == HSS_PROCESS_FAILED):
self.htmlFile.write(' <td bgcolor = "lightcoral" >KO - HSS process not found</td>\n') self.htmlFile.write(' <td bgcolor = "lightcoral" >KO - HSS process not found</td>\n')
...@@ -3080,7 +3070,7 @@ if re.match('^TerminateeNB$', mode, re.IGNORECASE): ...@@ -3080,7 +3070,7 @@ if re.match('^TerminateeNB$', mode, re.IGNORECASE):
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
SSH.TerminateeNB() SSH.TerminateeNB()
elif re.match('^TerminateUE$', mode, re.IGNORECASE): elif re.match('^TerminateUE$', mode, re.IGNORECASE):
if SSH.UEIPAddress == '' or SSH.UEUserName == '' or SSH.UEPassword == '': if (SSH.ADBIPAddress == '' or SSH.ADBUserName == '' or SSH.ADBPassword == ''):
Usage() Usage()
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
signal.signal(signal.SIGUSR1, receive_signal) signal.signal(signal.SIGUSR1, receive_signal)
......
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