diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index d3d1d70c13..7283fba5af 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -994,38 +994,55 @@ class OaiCiTest(): for job in multi_jobs: job.join() - if (status_queue.empty()): - HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ALL_PROCESSES_OK) - self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC,InfraUE) - return - else: - attach_status = True - html_queue = SimpleQueue() - while (not status_queue.empty()): - count = status_queue.get() - if (count < 0): - attach_status = False - device_id = status_queue.get() - message = status_queue.get() - if (count < 0): - html_cell = '
UE (' + device_id + ')\n' + message + ''
- else:
- html_cell = 'UE (' + device_id + ')\n' + message + ' in ' + str(count + 2) + ' seconds'
- html_queue.put(html_cell)
- if (attach_status):
- cnt = 0
- while cnt < len(self.UEDevices):
- if self.UEDevicesStatus[cnt] == CONST.UE_STATUS_ATTACHING:
- self.UEDevicesStatus[cnt] = CONST.UE_STATUS_ATTACHED
- cnt += 1
- HTML.CreateHtmlTestRowQueue('N/A', 'OK', len(self.UEDevices), html_queue)
- result = re.search('T_stdout', str(RAN.Initialize_eNB_args))
- if result is not None:
- logging.debug('Waiting 5 seconds to fill up record file')
- time.sleep(5)
- else:
- HTML.CreateHtmlTestRowQueue('N/A', 'KO', len(self.UEDevices), html_queue)
+ if (status_queue.empty()):
+ HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ALL_PROCESSES_OK)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC,InfraUE)
+ return
+ else:
+ attach_status = True
+ html_queue = SimpleQueue()
+ while (not status_queue.empty()):
+ count = status_queue.get()
+ if (count < 0):
+ attach_status = False
+ device_id = status_queue.get()
+ message = status_queue.get()
+ if (count < 0):
+ html_cell = 'UE (' + device_id + ')\n' + message + ''
+ else:
+ html_cell = 'UE (' + device_id + ')\n' + message + ' in ' + str(count + 2) + ' seconds'
+ html_queue.put(html_cell)
+ if (attach_status):
+ cnt = 0
+ while cnt < len(self.UEDevices):
+ if self.UEDevicesStatus[cnt] == CONST.UE_STATUS_ATTACHING:
+ self.UEDevicesStatus[cnt] = CONST.UE_STATUS_ATTACHED
+ cnt += 1
+ HTML.CreateHtmlTestRowQueue('N/A', 'OK', len(self.UEDevices), html_queue)
+ result = re.search('T_stdout', str(RAN.Initialize_eNB_args))
+ if result is not None:
+ logging.debug('Waiting 5 seconds to fill up record file')
+ time.sleep(5)
+ else:
+ HTML.CreateHtmlTestRowQueue('N/A', 'KO', len(self.UEDevices), html_queue)
+ self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC,InfraUE)
+
+ else: #if an ID is specified, it is a module from the yaml infrastructure file
+ #Attention, as opposed to InitializeUE, the connect manager process is not checked as it is supposed to be active already
+ #only 1- module wakeup, 2- check IP address
+ Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id])
+ Module_UE.Command("wup")
+ logging.debug("Waiting for IP address to be assigned")
+ time.sleep(20)
+ logging.debug("Retrieve IP address")
+ status=Module_UE.GetModuleIPAddress()
+ if status==0:
+ HTML.CreateHtmlTestRow(Module_UE.UEIPAddress, 'OK', CONST.ALL_PROCESSES_OK)
+ logging.debug('UE IP addresss : '+ Module_UE.UEIPAddress)
+ else: #status==-1 failed to retrieve IP address
+ HTML.CreateHtmlTestRow('N/A', 'KO', CONST.UE_IP_ADDRESS_ISSUE)
+ self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC,InfraUE)
+ return
def DetachUE_common(self, device_id, idx,COTS_UE):
try:
@@ -1084,10 +1101,7 @@ class OaiCiTest():
else:#if an ID is specified, it is a module from the yaml infrastructure file
Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id])
Module_UE.Command("detach")
- Module_UE.DisableTrace()
- Module_UE.DisableCM()
- archive_destination=Module_UE.LogCollect()
- HTML.CreateHtmlTestRow('QLog at : '+archive_destination, 'OK', CONST.ALL_PROCESSES_OK)
+ HTML.CreateHtmlTestRow('NA', 'OK', CONST.ALL_PROCESSES_OK)
@@ -3089,19 +3103,27 @@ class OaiCiTest():
os.kill(os.getppid(),signal.SIGUSR1)
def TerminateUE(self,HTML,COTS_UE):
- terminate_ue_flag = False
- self.GetAllUEDevices(terminate_ue_flag)
- multi_jobs = []
- i = 0
- for device_id in self.UEDevices:
- p = Process(target= self.TerminateUE_common, args = (device_id,i,COTS_UE,))
- p.daemon = True
- p.start()
- multi_jobs.append(p)
- i += 1
- for job in multi_jobs:
- job.join()
- HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
+ if self.ue_id=='':#no ID specified, then it is a COTS controlled by ADB
+ terminate_ue_flag = False
+ self.GetAllUEDevices(terminate_ue_flag)
+ multi_jobs = []
+ i = 0
+ for device_id in self.UEDevices:
+ p = Process(target= self.TerminateUE_common, args = (device_id,i,COTS_UE,))
+ p.daemon = True
+ p.start()
+ multi_jobs.append(p)
+ i += 1
+ for job in multi_jobs:
+ job.join()
+ HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
+ else: #if an ID is specified, it is a module from the yaml infrastructure file
+ Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id])
+ Module_UE.Command("detach")
+ Module_UE.DisableTrace()
+ Module_UE.DisableCM()
+ archive_destination=Module_UE.LogCollect()
+ HTML.CreateHtmlTestRow('QLog at : '+archive_destination, 'OK', CONST.ALL_PROCESSES_OK)
def TerminateOAIUE(self,HTML,RAN,COTS_UE,EPC, InfraUE):
SSH = sshconnection.SSHConnection()
diff --git a/ci-scripts/main.py b/ci-scripts/main.py
index cbd323366b..142ecdf202 100644
--- a/ci-scripts/main.py
+++ b/ci-scripts/main.py
@@ -210,12 +210,25 @@ def GetParametersFromXML(action):
CiTestObj.ue_id = ue_id
elif action == 'Attach_UE':
+ ue_id = test.findtext('id')
+ if (ue_id is None):
+ CiTestObj.ue_id = ""
+ else:
+ CiTestObj.ue_id = ue_id
nbMaxUEtoAttach = test.findtext('nbMaxUEtoAttach')
if (nbMaxUEtoAttach is None):
CiTestObj.nbMaxUEtoAttach = -1
else:
CiTestObj.nbMaxUEtoAttach = int(nbMaxUEtoAttach)
+ elif action == 'Terminate_UE':
+ ue_id = test.findtext('id')
+ if (ue_id is None):
+ CiTestObj.ue_id = ""
+ else:
+ CiTestObj.ue_id = ue_id
+
+
elif action == 'CheckStatusUE':
expectedNBUE = test.findtext('expectedNbOfConnectedUEs')
if (expectedNBUE is None):
diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml
index 2e8c07968d..980b55c30c 100644
--- a/ci-scripts/xml_files/fr1_nsa_quectel.xml
+++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml
@@ -52,8 +52,8 @@