Commit d5b78067 authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

CI: AW2S pipeline - CN deployment on OC - CN path, OC project changed

parent d237e43f
......@@ -240,9 +240,9 @@ class EPCManagement():
HTML.CreateHtmlTestRow(self.Type, 'OK', CONST.ALL_PROCESSES_OK)
def Initialize5GCN(self, HTML):
if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '':
if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.Type == '':
HELP.GenericHelp(CONST.Version)
HELP.EPCSrvHelp(self.IPAddress, self.UserName, self.Password, self.SourceCodePath, self.Type)
HELP.EPCSrvHelp(self.IPAddress, self.UserName, self.Password, self.Type)
sys.exit('Insufficient EPC Parameters')
mySSH = cls_cmd.getConnection(self.IPAddress)
html_cell = ''
......@@ -299,8 +299,9 @@ class EPCManagement():
imageNames = ["oai-nrf", "oai-amf", "oai-smf", "oai-spgwu-tiny", "oai-ausf", "oai-udm", "oai-udr", "mysql","oai-traffic-server"]
logging.debug('Deploying OAI CN5G on Openshift Cluster')
lIpAddr = self.IPAddress
lSourcePath = self.SourceCodePath
succeeded = OC.OC_login(mySSH, self.OCUserName, self.OCPassword, self.OCProjectName)
lOcProject = 'oaicicd-core-for-ci-ran'
lSourcePath = "/opt/oai-cn5g-fed-develop-2023-04-28-20897"
succeeded = OC.OC_login(mySSH, self.OCUserName, self.OCPassword, lOcProject)
if not succeeded:
logging.error('\u001B[1m OC Cluster Login Failed\u001B[0m')
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_LOGIN_FAIL)
......@@ -595,11 +596,12 @@ class EPCManagement():
elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE):
logging.debug('Terminating OAI CN5G on Openshift Cluster')
lIpAddr = self.IPAddress
lOcProject = 'oaicicd-core-for-ci-ran'
lSourcePath = self.SourceCodePath
mySSH.run(f'rm -Rf {lSourcePath}/logs')
mySSH.run(f'mkdir -p {lSourcePath}/logs')
logging.debug('OC OAI CN5G - Collecting Log files to workspace')
succeeded = OC.OC_login(mySSH, self.OCUserName, self.OCPassword, self.OCProjectName)
succeeded = OC.OC_login(mySSH, self.OCUserName, self.OCPassword, lOcProject)
if not succeeded:
logging.error('\u001B[1m OC Cluster Login Failed\u001B[0m')
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_LOGIN_FAIL)
......@@ -618,7 +620,7 @@ class EPCManagement():
mySSH.run(f'cd {lSourcePath}/logs && zip -r -qq test_logs_CN.zip *.log')
mySSH.copyin(f'{lSourcePath}/logs/test_logs_CN.zip','test_logs_CN.zip')
ret = mySSH.run(f'oc get pods', silent=True)
res = re.search('No resources found in oaicicd-ran namespace.', ret.stdout)
res = re.search(f'No resources found in {lOcProject} namespace.', ret.stdout)
if res is not None:
logging.debug('OC OAI CN5G components uninstalled')
message = 'OC OAI CN5G components uninstalled'
......
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