From 3afbf8e39aa6ce9ee29254857c89d76d115daacc Mon Sep 17 00:00:00 2001 From: Bipin Adhikari Date: Wed, 21 Aug 2024 11:35:38 +0200 Subject: [PATCH] Patch to resolve MR comments --- ci-scripts/cls_containerize.py | 10 +++-- ci-scripts/main.py | 38 +++++-------------- ...container_lte_b200_fdd_05Mhz_tm1_if4_5.xml | 7 ---- ...container_lte_b200_tdd_05Mhz_tm1_if4_5.xml | 7 ---- .../xml_files/container_sa_aerial_quectel.xml | 7 ---- .../container_sa_e1_b200_quectel.xml | 12 ------ .../container_sa_f1_b200_quectel.xml | 7 ---- .../xml_files/container_sa_fhi72_vvdn_up2.xml | 8 +++- 8 files changed, 23 insertions(+), 73 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index c4651766a7..abaf9044c1 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -234,7 +234,6 @@ def ReTagImages(mySSH,IMAGES,ranCommitID,ranBranch,ranAllowMerge,displayedNewTag if not displayedNewTags: logging.debug(f'\u001B[1m Using sanitized version of {image} with {imageTag}\u001B[0m') mySSH.run(f'sed -i -e "s@oaisoftwarealliance/{image}:develop@oai-ci/{imageTag}@" ci-docker-compose.yml',silent=True) - mySSH.run(f'sed -i -e "s@{image}:latest@oai-ci/{imageTag}@" ci-docker-compose.yml',silent=True) # temporary solution for not using the new branch def DeployServices(mySSH,svcName): allServices = [] @@ -979,7 +978,7 @@ class Containerize(): HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) return True - def Create_Workspace(self): + def Create_Workspace(self,HTML): if self.eNB_serverId[self.eNB_instance] == '0': lIpAddr = self.eNBIPAddress lUserName = self.eNBUserName @@ -1003,6 +1002,7 @@ class Containerize(): sshSession = cls_cmd.getConnection(lIpAddr) CreateWorkspace(sshSession, lSourcePath, self.ranRepository, self.ranCommitID, self.ranTargetBranch, self.ranAllowMerge) + HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) def DeployObject(self, HTML, EPC): lIpAddr, lUserName, lPassWord, lSourcePath = GetCredentials(self) @@ -1012,6 +1012,7 @@ class Containerize(): logging.debug('\u001B[1m Deploying OAI Object on server: ' + lIpAddr + '\u001B[0m') self.deployKind[self.eNB_instance] = True mySSH = cls_cmd.getConnection(lIpAddr, f'{lSourcePath}/{self.yamlPath[self.eNB_instance]}') + logging.info(f'Current working directory: {lSourcePath}/{self.yamlPath[self.eNB_instance]}') ReTagImages(mySSH,IMAGES,self.ranCommitID, self.ranBranch, self.ranAllowMerge, self.displayedNewTags) deployStatus,allServices = DeployServices(mySSH,self.services[self.eNB_instance]) if deployStatus != 0: @@ -1031,7 +1032,7 @@ class Containerize(): logging.warning(f"Deployment Failed: Trying to copy container logs {self.eNB_logFile[self.eNB_instance]}") CopyinContainerLog(mySSH,lSourcePath,self.yamlPath[0].split('/'),containerName,self.eNB_logFile[self.eNB_instance]) status = False - logging.debug(GetImageInfo(mySSH, containerName)) + HTML.CreateHtmlTestRowQueue('N/A', 'OK', [(GetImageInfo(mySSH, containerName))]) mySSH.close() if status: HTML.CreateHtmlTestRowQueue('N/A', 'OK', ['Healthy deployment!']) @@ -1057,7 +1058,8 @@ class Containerize(): HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ENB_PROCESS_NOLOGFILE_TO_ANALYZE) self.exitStatus = 1 else: - self.exitStatus = 1 if any(CheckLogs(self, mySSH, self.yamlPath[0].split('/'), service_name, HTML, RAN) for service_name, _ in services) else 0 + log_results = [CheckLogs(self, mySSH, self.yamlPath[0].split('/'), service_name, HTML, RAN) for service_name, _ in services] + self.exitStatus = 1 if any(log_results) else 0 logging.info('\u001B[1m Undeploying OAI Object Pass\u001B[0m') if self.exitStatus == 0 else logging.error('\u001B[1m Undeploying OAI Object Failed\u001B[0m') mySSH.close() diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 6e0c2f66a5..8d7ae9b9b4 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -219,6 +219,9 @@ def GetParametersFromXML(action): CiTestObj.ue_ids = test.findtext('id').split(' ') if test.findtext('nodes'): CiTestObj.nodes = test.findtext('nodes').split(' ') + if len(CiTestObj.ue_ids) != len(CiTestObj.nodes): + logging.error('Number of Nodes are not equal to the total number of UEs') + sys.exit("Mismatch in number of Nodes and UIs") elif action == 'Build_OAI_UE': CiTestObj.Build_OAI_UE_args = test.findtext('Build_OAI_UE_args') @@ -267,6 +270,9 @@ def GetParametersFromXML(action): CiTestObj.ue_ids = test.findtext('id').split(' ') if test.findtext('nodes'): CiTestObj.nodes = test.findtext('nodes').split(' ') + if len(CiTestObj.ue_ids) != len(CiTestObj.nodes): + logging.error('Number of Nodes are not equal to the total number of UEs') + sys.exit("Mismatch in number of Nodes and UIs") ping_rttavg_threshold = test.findtext('ping_rttavg_threshold') or '' elif action == 'Iperf' or action == 'Iperf2_Unidir': @@ -275,6 +281,9 @@ def GetParametersFromXML(action): CiTestObj.svr_id = test.findtext('svr_id') or None if test.findtext('nodes'): CiTestObj.nodes = test.findtext('nodes').split(' ') + if len(CiTestObj.ue_ids) != len(CiTestObj.nodes): + logging.error('Number of Nodes are not equal to the total number of UEs') + sys.exit("Mismatch in number of Nodes and UIs") if test.findtext('svr_node'): CiTestObj.svr_node = test.findtext('svr_node') CiTestObj.iperf_packetloss_threshold = test.findtext('iperf_packetloss_threshold') @@ -377,23 +386,6 @@ def GetParametersFromXML(action): if string_field is not None: CONTAINERS.services[CONTAINERS.eNB_instance] = string_field - elif action == 'DeployGenObject' or action == 'UndeployGenObject' or action == 'StatsFromGenObject': - string_field=test.findtext('yaml_path') - if (string_field is not None): - CONTAINERS.yamlPath[0] = string_field - string_field=test.findtext('services') - if (string_field is not None): - CONTAINERS.services[0] = string_field - string_field=test.findtext('nb_healthy') - if (string_field is not None): - CONTAINERS.nb_healthy[0] = int(string_field) - string_field=test.findtext('d_retx_th') - if (string_field is not None): - CONTAINERS.ran_checkers['d_retx_th'] = [float(x) for x in string_field.split(',')] - string_field=test.findtext('u_retx_th') - if (string_field is not None): - CONTAINERS.ran_checkers['u_retx_th'] = [float(x) for x in string_field.split(',')] - elif action == 'Run_CUDATest' or action == 'Run_NRulsimTest' or action == 'Run_T2Test': ldpc.runargs = test.findtext('physim_run_args') ldpc.runsim = test.findtext('physim_run') @@ -865,7 +857,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re if not success: RAN.prematureExit = True elif action == 'Create_Workspace': - CONTAINERS.Create_Workspace() + CONTAINERS.Create_Workspace(HTML) elif action == 'Deploy_Object': CONTAINERS.DeployObject(HTML, EPC) if CONTAINERS.exitStatus==1: @@ -884,20 +876,10 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re RAN.prematureExit = True elif action == 'Deploy_Run_PhySim': PHYSIM.Deploy_PhySim(HTML, RAN) - elif action == 'DeployGenObject': - CONTAINERS.DeployGenObject(HTML, RAN, CiTestObj) - if CONTAINERS.exitStatus==1: - RAN.prematureExit = True - elif action == 'UndeployGenObject': - CONTAINERS.UndeployGenObject(HTML, RAN, CiTestObj) - if CONTAINERS.exitStatus==1: - RAN.prematureExit = True elif action == 'IperfFromContainer': CONTAINERS.IperfFromContainer(HTML, RAN, CiTestObj) if CONTAINERS.exitStatus==1: RAN.prematureExit = True - elif action == 'StatsFromGenObject': - CONTAINERS.StatsFromGenObject(HTML) elif action == 'Push_Images_To_Test_Servers': logging.debug('To be implemented') else: diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml index e40cc6f80a..adfe8860d6 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml @@ -31,7 +31,6 @@ 040101 800813 030131 -800814 030132 040301 040531 040633 040634 040636 040671 040672 040673 040401 040201 030231 @@ -78,12 +77,6 @@ 0 0 - - Create_Workspace - Creating new Workspace for server 0 - 0 - 0 - Deploy_Object Deploy RCC (FDD/Band7/5MHz) in a container diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml index 8d67c23efd..e7ede0ff49 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml @@ -30,7 +30,6 @@ 111110 800813 030134 -800814 030135 040301 040532 040631 040632 040634 040635 040681 040682 040684 040685 040401 040201 030231 @@ -79,12 +78,6 @@ 0 0 - - Create_Workspace - Creating new Workspace for server 0 - 0 - 0 - Deploy_Object Deploy RCC (TDD/Band40/5MHz) in a container diff --git a/ci-scripts/xml_files/container_sa_aerial_quectel.xml b/ci-scripts/xml_files/container_sa_aerial_quectel.xml index 49f09ed669..7d7e992c12 100644 --- a/ci-scripts/xml_files/container_sa_aerial_quectel.xml +++ b/ci-scripts/xml_files/container_sa_aerial_quectel.xml @@ -31,7 +31,6 @@ 001111 800813 002222 - 800814 002223 000111 100000 @@ -70,12 +69,6 @@ 0 0 - - Create_Workspace - Creating new Workspace for server 0 - 0 - 0 - Deploy_Object Deploy VNF in a container diff --git a/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml b/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml index 96067b5592..a2b7ab425e 100644 --- a/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml @@ -94,12 +94,6 @@ 0 gnb_cucp - - Create_Workspace - Creating new Workspace - 0 - 0 - Deploy_Object Deploy gNB-CU-UP in a container @@ -108,12 +102,6 @@ 0 gnb_cuup - - Create_Workspace - Creating new Workspace - 0 - 0 - Deploy_Object Deploy gNB-DU (TDD/Band78/40MHz/B200) in a container diff --git a/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml b/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml index 2c5ae10dba..821367cd3f 100644 --- a/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml @@ -30,7 +30,6 @@ 110002 800813 130101 - 800814 130102 100001 110000 @@ -95,12 +94,6 @@ 0 gnb_cu - - Create_Workspace - Creating new Workspace - 0 - 0 - Deploy_Object Deploy gNB-DU (FDD/Band1/10MHz/B200) in a container diff --git a/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml b/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml index bac2ec38a0..6839be5e2d 100644 --- a/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml +++ b/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml @@ -28,6 +28,7 @@ 200000 110000 + 800813 120000 102000 102001 @@ -56,7 +57,12 @@ oaicicd-ran oai-gnb-fhi72 - + + Create_Workspace + Creating new Workspace for server 0 + 0 + 0 + Deploy_Object Deploy gNB (TDD/Band78/100MHz/VVDN) in a container