diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 3ad8fafd21d27dc66ce9ba62e46e0f0eda11f569..0ee4b3f00fa50faae07a5b36dbbe4cc5098efdfc 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -548,75 +548,6 @@ class Containerize(): HTML.CreateHtmlTestRow('commit ' + tag, 'OK', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlNextTabHeaderTestRow(collectInfo, allImagesSize) - def Copy_Image_to_Test_Server(self, HTML): - imageTag = 'develop' - if (self.ranAllowMerge): - imageTag = 'ci-temp' - - lSsh = SSH.SSHConnection() - # Going to the Docker Registry server - if self.registrySvrId == '0': - lIpAddr = self.eNBIPAddress - lUserName = self.eNBUserName - lPassWord = self.eNBPassword - elif self.registrySvrId == '1': - lIpAddr = self.eNB1IPAddress - lUserName = self.eNB1UserName - lPassWord = self.eNB1Password - elif self.registrySvrId == '2': - lIpAddr = self.eNB2IPAddress - lUserName = self.eNB2UserName - lPassWord = self.eNB2Password - lSsh.open(lIpAddr, lUserName, lPassWord) - lSsh.command('docker save ' + self.imageToCopy + ':' + imageTag + ' | gzip --fast > ' + self.imageToCopy + '-' + imageTag + '.tar.gz', '\$', 60) - ret = lSsh.copyin(lIpAddr, lUserName, lPassWord, '~/' + self.imageToCopy + '-' + imageTag + '.tar.gz', '.') - if ret != 0: - HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ALL_PROCESSES_OK) - self.exitStatus = 1 - return False - lSsh.command('rm ' + self.imageToCopy + '-' + imageTag + '.tar.gz', '\$', 60) - if lSsh.getBefore().count('cannot remove'): - HTML.CreateHtmlTestRow('file not created by docker save', 'KO', CONST.ALL_PROCESSES_OK) - self.exitStatus = 1 - return False - lSsh.close() - - # Going to the Test Server - if self.testSvrId == '0': - lIpAddr = self.eNBIPAddress - lUserName = self.eNBUserName - lPassWord = self.eNBPassword - elif self.testSvrId == '1': - lIpAddr = self.eNB1IPAddress - lUserName = self.eNB1UserName - lPassWord = self.eNB1Password - elif self.testSvrId == '2': - lIpAddr = self.eNB2IPAddress - lUserName = self.eNB2UserName - lPassWord = self.eNB2Password - lSsh.open(lIpAddr, lUserName, lPassWord) - lSsh.copyout(lIpAddr, lUserName, lPassWord, './' + self.imageToCopy + '-' + imageTag + '.tar.gz', '~') - # copyout has no return code and will quit if something fails - lSsh.command('docker rmi ' + self.imageToCopy + ':' + imageTag, '\$', 10) - lSsh.command('docker load < ' + self.imageToCopy + '-' + imageTag + '.tar.gz', '\$', 60) - if lSsh.getBefore().count('o such file') or lSsh.getBefore().count('invalid tar header'): - logging.debug(lSsh.getBefore()) - HTML.CreateHtmlTestRow('problem during docker load', 'KO', CONST.ALL_PROCESSES_OK) - self.exitStatus = 1 - return False - lSsh.command('rm ' + self.imageToCopy + '-' + imageTag + '.tar.gz', '\$', 60) - if lSsh.getBefore().count('cannot remove'): - HTML.CreateHtmlTestRow('file not copied during scp?', 'KO', CONST.ALL_PROCESSES_OK) - self.exitStatus = 1 - return False - lSsh.close() - - if os.path.isfile('./' + self.imageToCopy + '-' + imageTag + '.tar.gz'): - os.remove('./' + self.imageToCopy + '-' + imageTag + '.tar.gz') - - HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) - return True - def ImageTagToUse(self, imageName): shortCommit = self.ranCommitID[0:8] if self.ranAllowMerge: @@ -838,11 +769,10 @@ class Containerize(): mySSH.command('cd ' + lSourcePath + '/' + self.yamlPath[self.eNB_instance], '\$', 5) mySSH.command('cp docker-compose.yml ci-docker-compose.yml', '\$', 5) - imageTag = 'develop' - if (self.ranAllowMerge): - imageTag = 'ci-temp' - mySSH.command('sed -i -e "s/image: oai-enb:latest/image: oai-enb:' + imageTag + '/" ci-docker-compose.yml', '\$', 2) - mySSH.command('sed -i -e "s/image: oai-gnb:latest/image: oai-gnb:' + imageTag + '/" ci-docker-compose.yml', '\$', 2) + imagesList = ['oai-enb', 'oai-gnb'] + for image in imagesList: + imageToUse = self.ImageTagToUse(image) + mySSH.command(f'sed -i -e "s#image: {image}:latest#image: {imageToUse}#" ci-docker-compose.yml', '\$', 2) localMmeIpAddr = EPC.MmeIPAddress mySSH.command('sed -i -e "s/CI_MME_IP_ADDR/' + localMmeIpAddr + '/" ci-docker-compose.yml', '\$', 2) # if self.flexranCtrlDeployed: diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 67957b7fba7cb404b5670e6cdef5b3ea364754cc..1a8f7d97feaa745568272e3f650461245c60a697 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -444,17 +444,6 @@ def GetParametersFromXML(action): if (string_field is not None): CONTAINERS.cliOptions = string_field - elif action == 'Copy_Image_to_Test': - string_field = test.findtext('image_name') - if (string_field is not None): - CONTAINERS.imageToCopy = string_field - string_field = test.findtext('registry_svr_id') - if (string_field is not None): - CONTAINERS.registrySvrId = string_field - string_field = test.findtext('test_svr_id') - if (string_field is not None): - CONTAINERS.testSvrId = string_field - elif action == 'Run_LDPCTest' or action == 'Run_NRulsimTest': ldpc.runargs = test.findtext('physim_run_args') @@ -473,6 +462,7 @@ def GetParametersFromXML(action): string_field = test.findtext('test_svr_id') if (string_field is not None): CONTAINERS.testSvrId = string_field + CONTAINERS.imageToPull.clear() for image in test.findall('image_to_pull'): string_field = image.findtext('image_name') if (string_field is not None): @@ -956,10 +946,6 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re CONTAINERS.BuildImage(HTML) elif action == 'Build_Proxy': CONTAINERS.BuildProxy(HTML) - elif action == 'Copy_Image_to_Test': - success = CONTAINERS.Copy_Image_to_Test_Server(HTML) - if not success: - RAN.prematureExit = True elif action == 'Push_Local_Registry': success = CONTAINERS.Push_Image_to_Local_Registry(HTML) if not success: diff --git a/ci-scripts/xml_class_list.yml b/ci-scripts/xml_class_list.yml index d77683f9c9d86777f410531a9e561b551ae737d3..a191bd3332618bdf2ec4da5be8a22b6c6894bb91 100755 --- a/ci-scripts/xml_class_list.yml +++ b/ci-scripts/xml_class_list.yml @@ -40,7 +40,6 @@ - IdleSleep - Perform_X2_Handover - Build_Image - - Copy_Image_to_Test - Deploy_Object - Undeploy_Object - Cppcheck_Analysis diff --git a/ci-scripts/xml_files/container_nsa_b200_quectel.xml b/ci-scripts/xml_files/container_nsa_b200_quectel.xml index 51e6668cf00380e90550fd6c13c56c793f1fda19..0bed99fdb277107cd233ea61e5930bceecb6cf3a 100644 --- a/ci-scripts/xml_files/container_nsa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_nsa_b200_quectel.xml @@ -26,9 +26,10 @@ <htmlTabIcon>tasks</htmlTabIcon> <repeatCount>1</repeatCount> <TestCaseRequestedList> + 111110 + 111111 000001 010002 - 030000 030101 000001 030102 @@ -49,6 +50,24 @@ </TestCaseRequestedList> <TestCaseExclusionList></TestCaseExclusionList> + <testCase id="111110"> + <class>Pull_Local_Registry</class> + <desc>Pull Images from Local Registry</desc> + <test_svr_id>0</test_svr_id> + <image_to_pull> + <image_name>oai-enb</image_name> + </image_to_pull> + </testCase> + + <testCase id="111111"> + <class>Pull_Local_Registry</class> + <desc>Pull Images from Local Registry</desc> + <test_svr_id>1</test_svr_id> + <image_to_pull> + <image_name>oai-gnb</image_name> + </image_to_pull> + </testCase> + <testCase id="010000"> <class>Initialize_UE</class> <desc>Initialize Quectel</desc> @@ -62,14 +81,6 @@ <id>idefix</id> </testCase> - <testCase id="030000"> - <class>Copy_Image_to_Test</class> - <desc>Copy gNB image to test server</desc> - <image_name>oai-gnb</image_name> - <registry_svr_id>0</registry_svr_id> - <test_svr_id>1</test_svr_id> - </testCase> - <testCase id="030101"> <class>Deploy_Object</class> <desc>Deploy eNB (FDD/Band7/5MHz/B200) in a container</desc> diff --git a/ci-scripts/xml_files/container_nsa_b200_terminate.xml b/ci-scripts/xml_files/container_nsa_b200_terminate.xml index 4b446988cdde3b0a30f0e990ff8a649bea6c3eb9..a766fb7bcbd9baae7972b03f29f3370b7d82433c 100644 --- a/ci-scripts/xml_files/container_nsa_b200_terminate.xml +++ b/ci-scripts/xml_files/container_nsa_b200_terminate.xml @@ -28,6 +28,8 @@ <TestCaseRequestedList> 030202 030201 + 222220 + 222221 </TestCaseRequestedList> <TestCaseExclusionList></TestCaseExclusionList> @@ -47,5 +49,17 @@ <eNB_serverId>1</eNB_serverId> </testCase> + <testCase id="222220"> + <class>Clean_Test_Server_Images</class> + <desc>Clean Test Images on Test Server</desc> + <test_svr_id>0</test_svr_id> + </testCase> + + <testCase id="222221"> + <class>Clean_Test_Server_Images</class> + <desc>Clean Test Images on Test Server</desc> + <test_svr_id>1</test_svr_id> + </testCase> + </testCaseList> diff --git a/ci-scripts/xml_files/container_sa_b200_quectel.xml b/ci-scripts/xml_files/container_sa_b200_quectel.xml index 7f0475629ded37ee311645c830ed0d85d913c082..127900343acdd744f7912573ff71a93261f79760 100644 --- a/ci-scripts/xml_files/container_sa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_b200_quectel.xml @@ -26,8 +26,8 @@ <htmlTabIcon>tasks</htmlTabIcon> <repeatCount>1</repeatCount> <TestCaseRequestedList> + 111111 010002 - 030000 030101 000001 010000 @@ -47,6 +47,15 @@ --> <TestCaseExclusionList></TestCaseExclusionList> + <testCase id="111111"> + <class>Pull_Local_Registry</class> + <desc>Pull Images from Local Registry</desc> + <test_svr_id>0</test_svr_id> + <image_to_pull> + <image_name>oai-gnb</image_name> + </image_to_pull> + </testCase> + <testCase id="010000"> <class>Initialize_UE</class> <desc>Initialize Quectel</desc> @@ -60,14 +69,6 @@ <id>idefix</id> </testCase> - <testCase id="030000"> - <class>Copy_Image_to_Test</class> - <desc>Copy gNB image to test server</desc> - <image_name>oai-gnb</image_name> - <registry_svr_id>1</registry_svr_id> - <test_svr_id>0</test_svr_id> - </testCase> - <testCase id="030101"> <class>Deploy_Object</class> <desc>Deploy gNB (TDD/Band78/40MHz/B200) in a container</desc> diff --git a/ci-scripts/xml_files/container_sa_b200_terminate.xml b/ci-scripts/xml_files/container_sa_b200_terminate.xml index 5a2b6bd4543d3183add1b67167f07fc37d2dd58e..8e7e0eff4487d786a8aa81ba7ad6b7774c1e242a 100644 --- a/ci-scripts/xml_files/container_sa_b200_terminate.xml +++ b/ci-scripts/xml_files/container_sa_b200_terminate.xml @@ -27,6 +27,7 @@ <repeatCount>1</repeatCount> <TestCaseRequestedList> 030201 + 222222 </TestCaseRequestedList> <TestCaseExclusionList></TestCaseExclusionList> @@ -39,4 +40,10 @@ <image_tag>sa-test</image_tag> </testCase> + <testCase id="222222"> + <class>Clean_Test_Server_Images</class> + <desc>Clean Test Images on Test Server</desc> + <test_svr_id>0</test_svr_id> + </testCase> + </testCaseList>