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