Commit 6b6215e6 authored by Raphael Defosseux's avatar Raphael Defosseux

fix(ci): adding detection of timed-out run on the physims on cluster

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent a9ffbc6b
...@@ -245,7 +245,7 @@ class PhySim: ...@@ -245,7 +245,7 @@ class PhySim:
isFinished = False isFinished = False
# doing a deep copy! # doing a deep copy!
tmpPodNames = podNames.copy() tmpPodNames = podNames.copy()
while(count < 28 and isFinished == False): while(count < 32 and isFinished == False):
time.sleep(60) time.sleep(60)
for podName in tmpPodNames: for podName in tmpPodNames:
mySSH.command2(f'oc logs --tail=1 {podName} 2>&1', 6, silent=True) mySSH.command2(f'oc logs --tail=1 {podName} 2>&1', 6, silent=True)
...@@ -257,6 +257,8 @@ class PhySim: ...@@ -257,6 +257,8 @@ class PhySim:
count += 1 count += 1
if isFinished: if isFinished:
logging.debug('\u001B[1m PhySim test is Complete\u001B[0m') logging.debug('\u001B[1m PhySim test is Complete\u001B[0m')
else:
logging.error('\u001B[1m PhySim test Timed-out!\u001B[0m')
# Getting the logs of each executables running in individual pods # Getting the logs of each executables running in individual pods
for podName in podNames: for podName in podNames:
...@@ -279,15 +281,18 @@ class PhySim: ...@@ -279,15 +281,18 @@ class PhySim:
mySSH.command('oc logout', '\$', 6) mySSH.command('oc logout', '\$', 6)
mySSH.close() mySSH.close()
self.AnalyzeLogFile_phySim(HTML) self.AnalyzeLogFile_phySim(HTML)
if self.testStatus: if self.testStatus and isFinished:
HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
HTML.CreateHtmlTestRowPhySimTestResult(self.testSummary,self.testResult) HTML.CreateHtmlTestRowPhySimTestResult(self.testSummary,self.testResult)
logging.info('\u001B[1m Physical Simulator Pass\u001B[0m') logging.info('\u001B[1m Physical Simulator Pass\u001B[0m')
else: else:
RAN.prematureExit = True RAN.prematureExit = True
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ALL_PROCESSES_OK) if isFinished:
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ALL_PROCESSES_OK)
else:
HTML.CreateHtmlTestRow('Some test(s) timed-out!', 'KO', CONST.ALL_PROCESSES_OK)
HTML.CreateHtmlTestRowPhySimTestResult(self.testSummary,self.testResult) HTML.CreateHtmlTestRowPhySimTestResult(self.testSummary,self.testResult)
logging.info('\u001B[1m Physical Simulator Fail\u001B[0m') logging.error('\u001B[1m Physical Simulator Fail\u001B[0m')
def AnalyzeLogFile_phySim(self, HTML): def AnalyzeLogFile_phySim(self, HTML):
lIpAddr = self.eNBIPAddress lIpAddr = self.eNBIPAddress
......
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