Commit 8857905a authored by Raphael Defosseux's avatar Raphael Defosseux

CI: fix cosmetics on HTML report

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent aff80ba1
...@@ -296,7 +296,7 @@ pipeline { ...@@ -296,7 +296,7 @@ pipeline {
} }
if(fileExists("ci-scripts/test_results.html")) { if(fileExists("ci-scripts/test_results.html")) {
sh "mv ci-scripts/test_results.html test_results-${JOB_NAME}.html" sh "mv ci-scripts/test_results.html test_results-${JOB_NAME}.html"
sh "sed -i -e 's#TEMPLATE_JOB_NAME#${JOB_NAME}#' -e 's@build #TEMPLATE_BUILD_ID@build #${BUILD_ID}@' -e 's#Build-ID: TEMPLATE_BUILD_ID#Build-ID: <a href=\"${BUILD_URL}\">${BUILD_ID}</a>#' -e 's#TEMPLATE_STAGE_NAME#${testStageName}#' test_results-${JOB_NAME}.html" sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' -e 's#TEMPLATE_JOB_NAME#${JOB_NAME}#' -e 's@build #TEMPLATE_BUILD_ID@build #${BUILD_ID}@' -e 's#Build-ID: TEMPLATE_BUILD_ID#Build-ID: <a href=\"${BUILD_URL}\">${BUILD_ID}</a>#' -e 's#TEMPLATE_STAGE_NAME#${testStageName}#' test_results-${JOB_NAME}.html"
archiveArtifacts "test_results-${JOB_NAME}.html" archiveArtifacts "test_results-${JOB_NAME}.html"
} }
} }
......
...@@ -2638,6 +2638,17 @@ class SSHConnection(): ...@@ -2638,6 +2638,17 @@ class SSHConnection():
if result is not None: if result is not None:
self.OsVersion = result.group('os_type') self.OsVersion = result.group('os_type')
logging.debug('OS is: ' + self.OsVersion) logging.debug('OS is: ' + self.OsVersion)
else:
self.command('hostnamectl', '\$', 5)
result = re.search('Operating System: (?P<os_type>[a-zA-Z0-9\-\_\.\ ]+)', str(self.ssh.before))
if result is not None:
self.OsVersion = result.group('os_type')
if self.OsVersion == 'CentOS Linux 7 ':
self.command('cat /etc/redhat-release', '\$', 5)
result = re.search('CentOS Linux release (?P<os_version>[0-9\.]+)', str(self.ssh.before))
if result is not None:
self.OsVersion = self.OsVersion.replace('7 ', result.group('os_version'))
logging.debug('OS is: ' + self.OsVersion)
self.command('uname -r', '\$', 5) self.command('uname -r', '\$', 5)
result = re.search('uname -r\\\\r\\\\n(?P<kernel_version>[a-zA-Z0-9\-\_\.]+)', str(self.ssh.before)) result = re.search('uname -r\\\\r\\\\n(?P<kernel_version>[a-zA-Z0-9\-\_\.]+)', str(self.ssh.before))
if result is not None: if result is not None:
...@@ -2648,11 +2659,23 @@ class SSHConnection(): ...@@ -2648,11 +2659,23 @@ class SSHConnection():
if result is not None: if result is not None:
self.UhdVersion = result.group('uhd_version') self.UhdVersion = result.group('uhd_version')
logging.debug('UHD Version is: ' + self.UhdVersion) logging.debug('UHD Version is: ' + self.UhdVersion)
self.command('echo ' + Password + ' | sudo -S uhd_find_devices', '\$', 12) else:
result = re.search('product: (?P<usrp_board>[0-9A-Za-z]+)\\\\r\\\\n', str(self.ssh.before)) self.command('uhd_config_info --version', '\$', 5)
result = re.search('UHD (?P<uhd_version>[a-zA-Z0-9\.\-]+)', str(self.ssh.before))
if result is not None: if result is not None:
self.UsrpBoard = result.group('usrp_board') self.UhdVersion = result.group('uhd_version')
logging.debug('USRP Board is: ' + self.UsrpBoard) logging.debug('UHD Version is: ' + self.UhdVersion)
self.command('echo ' + Password + ' | sudo -S uhd_find_devices', '\$', 12)
usrp_boards = re.findall('product: ([0-9A-Za-z]+)\\\\r\\\\n', str(self.ssh.before))
count = 0
for board in usrp_boards:
if count == 0:
self.UsrpBoard = board
else:
self.UsrpBoard += ',' + board
count += 1
if count > 0:
logging.debug('USRP Board(s) : ' + self.UsrpBoard)
self.command('lscpu', '\$', 5) self.command('lscpu', '\$', 5)
result = re.search('CPU\(s\): *(?P<nb_cpus>[0-9]+).*Model name: *(?P<model>[a-zA-Z0-9\-\_\.\ \(\)]+).*CPU MHz: *(?P<cpu_mhz>[0-9\.]+)', str(self.ssh.before)) result = re.search('CPU\(s\): *(?P<nb_cpus>[0-9]+).*Model name: *(?P<model>[a-zA-Z0-9\-\_\.\ \(\)]+).*CPU MHz: *(?P<cpu_mhz>[0-9\.]+)', str(self.ssh.before))
if result is not None: if result is not None:
...@@ -2840,7 +2863,7 @@ class SSHConnection(): ...@@ -2840,7 +2863,7 @@ class SSHConnection():
self.htmlFile.write(' <td><span class="label label-default">' + self.KernelVersion + '</span></td>\n') self.htmlFile.write(' <td><span class="label label-default">' + self.KernelVersion + '</span></td>\n')
self.htmlFile.write(' <td>UHD Version</td>\n') self.htmlFile.write(' <td>UHD Version</td>\n')
self.htmlFile.write(' <td><span class="label label-default">' + self.UhdVersion + '</span></td>\n') self.htmlFile.write(' <td><span class="label label-default">' + self.UhdVersion + '</span></td>\n')
self.htmlFile.write(' <td>USRP Board</td>\n') self.htmlFile.write(' <td>USRP Board(s)</td>\n')
self.htmlFile.write(' <td><span class="label label-default">' + self.UsrpBoard + '</span></td>\n') self.htmlFile.write(' <td><span class="label label-default">' + self.UsrpBoard + '</span></td>\n')
self.htmlFile.write(' </tr>\n') self.htmlFile.write(' </tr>\n')
self.htmlFile.write(' <tr>\n') self.htmlFile.write(' <tr>\n')
......
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