CI: html tab extention to add more details on built shared and target images
fix ssh connection when remote server has public key Signed-off-by: Mohammed Ismail <mohammed.ismail@eurecom.fr>
This commit is contained in:
@@ -139,9 +139,9 @@ class Containerize():
|
||||
else:
|
||||
result = re.search('all', self.imageKind)
|
||||
if result is not None:
|
||||
imageNames.append(('oai-enb', 'eNB'))
|
||||
imageNames.append(('oai-enb', 'eNB'))
|
||||
imageNames.append(('oai-gnb', 'gNB'))
|
||||
imageNames.append(('oai-lte-ue', 'lteUE'))
|
||||
imageNames.append(('oai-lte-ue', 'lteUE'))
|
||||
imageNames.append(('oai-nr-ue', 'nrUE'))
|
||||
if len(imageNames) == 0:
|
||||
imageNames.append(('oai-enb', 'eNB'))
|
||||
@@ -228,16 +228,16 @@ class Containerize():
|
||||
imageSize = imageSize / 1000
|
||||
if imageSize < 1000:
|
||||
logging.debug('\u001B[1m ran-build size is ' + ('%.0f' % imageSize) + ' kbytes\u001B[0m')
|
||||
self.allImagesSize['ran-build'] = str(imageSize) + ' kbytes'
|
||||
self.allImagesSize['ran-build'] = str(round(imageSize,1)) + ' kbytes'
|
||||
else:
|
||||
imageSize = imageSize / 1000
|
||||
if imageSize < 1000:
|
||||
logging.debug('\u001B[1m ran-build size is ' + ('%.0f' % imageSize) + ' Mbytes\u001B[0m')
|
||||
self.allImagesSize['ran-build'] = str(imageSize) + ' Mbytes'
|
||||
self.allImagesSize['ran-build'] = str(round(imageSize,1)) + ' Mbytes'
|
||||
else:
|
||||
imageSize = imageSize / 1000
|
||||
logging.debug('\u001B[1m ran-build size is ' + ('%.3f' % imageSize) + ' Gbytes\u001B[0m')
|
||||
self.allImagesSize['ran-build'] = str(imageSize) + ' Gbytes'
|
||||
self.allImagesSize['ran-build'] = str(round(imageSize,1)) + ' Gbytes'
|
||||
else:
|
||||
logging.debug('ran-build size is unknown')
|
||||
for image,pattern in imageNames:
|
||||
@@ -252,16 +252,16 @@ class Containerize():
|
||||
imageSize = imageSize / 1000
|
||||
if imageSize < 1000:
|
||||
logging.debug('\u001B[1m ' + image + ' size is ' + ('%.0f' % imageSize) + ' kbytes\u001B[0m')
|
||||
self.allImagesSize[image] = str(imageSize) + ' kbytes'
|
||||
self.allImagesSize[image] = str(round(imageSize,1)) + ' kbytes'
|
||||
else:
|
||||
imageSize = imageSize / 1000
|
||||
if imageSize < 1000:
|
||||
logging.debug('\u001B[1m ' + image + ' size is ' + ('%.0f' % imageSize) + ' Mbytes\u001B[0m')
|
||||
self.allImagesSize[image] = str(imageSize) + ' Mbytes'
|
||||
self.allImagesSize[image] = str(round(imageSize,1)) + ' Mbytes'
|
||||
else:
|
||||
imageSize = imageSize / 1000
|
||||
logging.debug('\u001B[1m ' + image + ' size is ' + ('%.3f' % imageSize) + ' Gbytes\u001B[0m')
|
||||
self.allImagesSize[image] = str(imageSize) + ' Gbytes'
|
||||
self.allImagesSize[image] = str(round(imageSize,1)) + ' Gbytes'
|
||||
else:
|
||||
logging.debug('ran-build size is unknown')
|
||||
if not status:
|
||||
|
||||
+48
-1
@@ -218,7 +218,7 @@ class HTMLManagement():
|
||||
self.htmlFile.write(' <div id="build-tab" class="tab-pane fade">\n')
|
||||
self.htmlFile.write(' <table class="table" border = "1">\n')
|
||||
self.htmlFile.write(' <tr bgcolor = "#33CCFF" >\n')
|
||||
self.htmlFile.write(' <th>Relative Time (ms)</th>\n')
|
||||
self.htmlFile.write(' <th>Relative Time (s)</th>\n')
|
||||
self.htmlFile.write(' <th>Test Id</th>\n')
|
||||
self.htmlFile.write(' <th>Test Desc</th>\n')
|
||||
self.htmlFile.write(' <th>Test Options</th>\n')
|
||||
@@ -399,6 +399,53 @@ class HTMLManagement():
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.close()
|
||||
|
||||
|
||||
def CreateHtmlNextTabHeaderTestRow(self, collectInfo, allImagesSize, machine='eNB'):
|
||||
if (self.htmlFooterCreated or (not self.htmlHeaderCreated)):
|
||||
return
|
||||
self.htmlFile = open('test_results.html', 'a')
|
||||
if bool(collectInfo) == False:
|
||||
self.htmlFile.write(' <tr bgcolor = "red" >\n')
|
||||
self.htmlFile.write(' <td colspan=' + str(5+self.htmlUEConnected) + '><b> ----IMAGES BUILDING FAILED - Unable to recover the image logs ---- </b></td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
else:
|
||||
for image in collectInfo:
|
||||
files = collectInfo[image]
|
||||
# TabHeader for image logs on built shared and target images
|
||||
self.htmlFile.write(' <tr bgcolor = "#F0F0F0" >\n')
|
||||
self.htmlFile.write(' <td colspan=' + str(5+self.htmlUEConnected) + '><b> ---- ' + image + ' IMAGE STATUS ----> Size ' + allImagesSize[image] + ' </b></td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr bgcolor = "#33CCFF" >\n')
|
||||
self.htmlFile.write(' <th colspan="2">Element</th>\n')
|
||||
self.htmlFile.write(' <th>Nb Errors</th>\n')
|
||||
self.htmlFile.write(' <th>Nb Warnings</th>\n')
|
||||
self.htmlFile.write(' <th colspan=' + str(1+self.htmlUEConnected) + '>Status</th>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
|
||||
for fil in files:
|
||||
parameters = files[fil]
|
||||
# TestRow for image logs on built shared and target images
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td colspan="2" bgcolor = "lightcyan" >' + fil + ' </td>\n')
|
||||
if (parameters['errors'] == 0):
|
||||
self.htmlFile.write(' <td bgcolor = "green" >' + str(parameters['errors']) + '</td>\n')
|
||||
else:
|
||||
self.htmlFile.write(' <td bgcolor = "red" >' + str(parameters['errors']) + '</td>\n')
|
||||
if (parameters['warnings'] == 0):
|
||||
self.htmlFile.write(' <td bgcolor = "green" >' + str(parameters['warnings']) + '</td>\n')
|
||||
elif ((parameters['warnings'] > 0) and (parameters['warnings'] <= 20)):
|
||||
self.htmlFile.write(' <td bgcolor = "orange" >' + str(parameters['warnings']) + '</td>\n')
|
||||
else:
|
||||
self.htmlFile.write(' <td bgcolor = "red" >' + str(parameters['warnings']) + '</td>\n')
|
||||
if (parameters['errors'] == 0) and (parameters['warnings'] == 0):
|
||||
self.htmlFile.write(' <th colspan=' + str(1+self.htmlUEConnected) + ' bgcolor = "green" ><font color="white">OK </font></th>\n')
|
||||
elif (parameters['errors'] == 0) and ((parameters['warnings'] > 0) and (parameters['warnings'] <= 20)):
|
||||
self.htmlFile.write(' <th colspan=' + str(1+self.htmlUEConnected) + ' bgcolor = "orange" ><font color="white">OK </font></th>\n')
|
||||
else:
|
||||
self.htmlFile.write(' <th colspan=' + str(1+self.htmlUEConnected) + ' bgcolor = "red" > NOT OK </th>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.close()
|
||||
|
||||
def CreateHtmlTestRowQueue(self, options, status, ue_status, ue_queue):
|
||||
if ((not self.htmlFooterCreated) and (self.htmlHeaderCreated)):
|
||||
self.htmlFile = open('test_results.html', 'a')
|
||||
|
||||
@@ -52,13 +52,11 @@ class SSHConnection():
|
||||
self.picocom_closure = True
|
||||
|
||||
def open(self, ipaddress, username, password):
|
||||
extraSshOptions = ''
|
||||
count = 0
|
||||
connect_status = False
|
||||
if ipaddress == '192.168.18.197':
|
||||
extraSshOptions = ' -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
|
||||
while count < 4:
|
||||
self.ssh = pexpect.spawn('ssh', [username + '@' + ipaddress + extraSshOptions], timeout = 5)
|
||||
self.ssh = pexpect.spawn('ssh -o PubkeyAuthentication=no {}@{}'.format(username,ipaddress))
|
||||
self.ssh.timeout = 5
|
||||
self.sshresponse = self.ssh.expect(['Are you sure you want to continue connecting (yes/no)?', 'password:', 'Last login', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if self.sshresponse == 0:
|
||||
self.ssh.sendline('yes')
|
||||
|
||||
Reference in New Issue
Block a user