Modifications in cls_containerize to support deployment of oai-nr-ue
- add oai-nr-ue to image list - add oai-nr-ue sync message to check - skip oai-nr-ue log analysis in undeployemnt stage - add UE log analysis
This commit is contained in:
@@ -52,7 +52,7 @@ import cls_cmd
|
|||||||
import sshconnection as SSH
|
import sshconnection as SSH
|
||||||
import helpreadme as HELP
|
import helpreadme as HELP
|
||||||
import constants as CONST
|
import constants as CONST
|
||||||
|
import cls_oaicitest
|
||||||
#-----------------------------------------------------------
|
#-----------------------------------------------------------
|
||||||
# Helper functions used here and in other classes
|
# Helper functions used here and in other classes
|
||||||
# (e.g., cls_cluster.py)
|
# (e.g., cls_cluster.py)
|
||||||
@@ -838,7 +838,7 @@ class Containerize():
|
|||||||
|
|
||||||
mySSH.command('cd ' + lSourcePath + '/' + self.yamlPath[self.eNB_instance], '\$', 5)
|
mySSH.command('cd ' + lSourcePath + '/' + self.yamlPath[self.eNB_instance], '\$', 5)
|
||||||
mySSH.command('cp docker-compose.y*ml ci-docker-compose.yml', '\$', 5)
|
mySSH.command('cp docker-compose.y*ml ci-docker-compose.yml', '\$', 5)
|
||||||
imagesList = ['oai-enb', 'oai-gnb', 'oai-nr-cuup', 'oai-gnb-aw2s']
|
imagesList = ['oai-enb', 'oai-gnb', 'oai-nr-cuup', 'oai-gnb-aw2s', 'oai-nr-ue']
|
||||||
for image in imagesList:
|
for image in imagesList:
|
||||||
imageTag = ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge)
|
imageTag = ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge)
|
||||||
mySSH.command(f'sed -i -e "s#image: {image}:latest#image: oai-ci/{imageTag}#" ci-docker-compose.yml', '\$', 2)
|
mySSH.command(f'sed -i -e "s#image: {image}:latest#image: oai-ci/{imageTag}#" ci-docker-compose.yml', '\$', 2)
|
||||||
@@ -877,6 +877,7 @@ class Containerize():
|
|||||||
else:
|
else:
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
cnt += 1
|
cnt += 1
|
||||||
|
|
||||||
mySSH.command('docker inspect --format="ImageUsed: {{.Config.Image}}" ' + containerName, '\$', 5)
|
mySSH.command('docker inspect --format="ImageUsed: {{.Config.Image}}" ' + containerName, '\$', 5)
|
||||||
for stdoutLine in mySSH.getBefore().split('\n'):
|
for stdoutLine in mySSH.getBefore().split('\n'):
|
||||||
if stdoutLine.count('ImageUsed: oai-ci'):
|
if stdoutLine.count('ImageUsed: oai-ci'):
|
||||||
@@ -903,7 +904,7 @@ class Containerize():
|
|||||||
cnt = 0
|
cnt = 0
|
||||||
while (cnt < 20):
|
while (cnt < 20):
|
||||||
mySSH.command('docker logs ' + containerName + ' | egrep --text --color=never -i "wait|sync|Starting"', '\$', 30)
|
mySSH.command('docker logs ' + containerName + ' | egrep --text --color=never -i "wait|sync|Starting"', '\$', 30)
|
||||||
result = re.search('got sync|Starting F1AP at CU', mySSH.getBefore())
|
result = re.search('got sync|Starting F1AP at CU|Got sync', mySSH.getBefore())
|
||||||
if result is None:
|
if result is None:
|
||||||
time.sleep(6)
|
time.sleep(6)
|
||||||
cnt += 1
|
cnt += 1
|
||||||
@@ -993,7 +994,6 @@ class Containerize():
|
|||||||
mySSH.command('docker volume prune --force', '\$', 20)
|
mySSH.command('docker volume prune --force', '\$', 20)
|
||||||
|
|
||||||
mySSH.close()
|
mySSH.close()
|
||||||
|
|
||||||
# Analyzing log file!
|
# Analyzing log file!
|
||||||
files = ','.join([f'{s}-{HTML.testCase_id}' for s in services])
|
files = ','.join([f'{s}-{HTML.testCase_id}' for s in services])
|
||||||
if len(services) > 1:
|
if len(services) > 1:
|
||||||
@@ -1005,6 +1005,15 @@ class Containerize():
|
|||||||
HTML.htmleNBFailureMsg='Could not copy logfile to analyze it!'
|
HTML.htmleNBFailureMsg='Could not copy logfile to analyze it!'
|
||||||
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ENB_PROCESS_NOLOGFILE_TO_ANALYZE)
|
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ENB_PROCESS_NOLOGFILE_TO_ANALYZE)
|
||||||
self.exitStatus = 1
|
self.exitStatus = 1
|
||||||
|
elif 'oai-nr-ue' in services:
|
||||||
|
self.exitStatus == 0
|
||||||
|
logging.debug('\u001B[1m Analyzing UE logfile ' + filename + ' \u001B[0m')
|
||||||
|
logStatus = cls_oaicitest.OaiCiTest().AnalyzeLogFile_UE(f'{filename}', HTML, RAN)
|
||||||
|
if (logStatus < 0):
|
||||||
|
fullStatus = False
|
||||||
|
HTML.CreateHtmlTestRow('UE log Analysis', 'KO', logStatus)
|
||||||
|
else:
|
||||||
|
HTML.CreateHtmlTestRow('UE log Analysis', 'OK', CONST.ALL_PROCESSES_OK)
|
||||||
else:
|
else:
|
||||||
for svcName in services:
|
for svcName in services:
|
||||||
filename = f'{svcName}-{HTML.testCase_id}.log'
|
filename = f'{svcName}-{HTML.testCase_id}.log'
|
||||||
|
|||||||
Reference in New Issue
Block a user