Commit 61989549 authored by Raphael Defosseux's avatar Raphael Defosseux

CI: better handling of the case when no UE is connected to ADB server

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent 0a4cfc21
...@@ -1157,15 +1157,18 @@ class OaiCiTest(): ...@@ -1157,15 +1157,18 @@ class OaiCiTest():
self.UEDevicesRebootCmd.append(comma_split[5]) self.UEDevicesRebootCmd.append(comma_split[5])
phone_list_file.close() phone_list_file.close()
# better handling of the case when no UE detected
# Sys-exit is now dealt by the calling function
if terminate_ue_flag == True: if terminate_ue_flag == True:
if len(self.UEDevices) == 0: if len(self.UEDevices) == 0:
logging.debug('\u001B[1;37;41m UE Not Found! \u001B[0m') logging.debug('\u001B[1;37;41m UE Not Found! \u001B[0m')
sys.exit(1) return False
if len(self.UEDevicesStatus) == 0: if len(self.UEDevicesStatus) == 0:
cnt = 0 cnt = 0
while cnt < len(self.UEDevices): while cnt < len(self.UEDevices):
self.UEDevicesStatus.append(CONST.UE_STATUS_DETACHED) self.UEDevicesStatus.append(CONST.UE_STATUS_DETACHED)
cnt += 1 cnt += 1
return True
def GetAllCatMDevices(self, terminate_ue_flag): def GetAllCatMDevices(self, terminate_ue_flag):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
......
...@@ -620,7 +620,11 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re ...@@ -620,7 +620,11 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
if (CiTestObj.ADBIPAddress != 'none'): if (CiTestObj.ADBIPAddress != 'none'):
#in these cases, having no devices is critical, GetAllUEDevices function has to manage it as a critical error, reason why terminate_ue_flag is set to True #in these cases, having no devices is critical, GetAllUEDevices function has to manage it as a critical error, reason why terminate_ue_flag is set to True
terminate_ue_flag = True terminate_ue_flag = True
CiTestObj.GetAllUEDevices(terminate_ue_flag) # Now we stop properly the test-suite --> clean reporting
status = CiTestObj.GetAllUEDevices(terminate_ue_flag)
if not status:
RAN.prematureExit = True
break
if action == 'Build_eNB': if action == 'Build_eNB':
RAN.BuildeNB() RAN.BuildeNB()
elif action == 'WaitEndBuild_eNB': elif action == 'WaitEndBuild_eNB':
......
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