ci/bare-metal: handle non-zero exit codes

The fastboot/poe/cros-servo scripts always exits with code 1,
regardless of the HWCI_TEST_SCRIPT's exit code. This commit
fixes these scripts to exit with the actual code returned by
the test.

Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31189>
This commit is contained in:
Vignesh Raman
2024-09-19 07:02:13 +05:30
committed by Marge Bot
parent 9b762a3caf
commit 1f9f7ae112
3 changed files with 21 additions and 13 deletions

View File

@@ -127,14 +127,18 @@ class CrosServoRun:
self.print_error("Detected cheza MMU fail, abandoning run.")
return 1
result = re.search("hwci: mesa: (\S*)", line)
result = re.search(r"hwci: mesa: (\S*), exit_code: (\d+)", line)
if result:
if result.group(1) == "pass":
status = result.group(1)
exit_code = int(result.group(2))
if status == "pass":
self.logger.update_dut_job("status", "pass")
return 0
else:
self.logger.update_status_fail("test fail")
return 1
self.logger.update_dut_job("exit_code", exit_code)
return exit_code
self.print_error(
"Reached the end of the CPU serial log without finding a result")

View File

@@ -119,12 +119,12 @@ class FastbootRun:
if print_more_lines == -1:
print_more_lines = 30
result = re.search("hwci: mesa: (\S*)", line)
result = re.search(r"hwci: mesa: (\S*), exit_code: (\d+)", line)
if result:
if result.group(1) == "pass":
return 0
else:
return 1
status = result.group(1)
exit_code = int(result.group(2))
return exit_code
self.print_error(
"Reached the end of the CPU serial log without finding a result, abandoning run.")

View File

@@ -87,14 +87,18 @@ class PoERun:
self.print_error("nouveau jetson tk1 network fail, abandoning run.")
return 1
result = re.search("hwci: mesa: (\S*)", line)
result = re.search(r"hwci: mesa: (\S*), exit_code: (\d+)", line)
if result:
if result.group(1) == "pass":
status = result.group(1)
exit_code = int(result.group(2))
if status == "pass":
self.logger.update_dut_job("status", "pass")
return 0
else:
self.logger.update_status_fail("test fail")
return 1
self.logger.update_dut_job("exit_code", exit_code)
return exit_code
self.print_error(
"Reached the end of the CPU serial log without finding a result")