+
#!/usr/bin/env python3
#
# Copyright © 2020 Google LLC
print("W SERIAL-CPU> %s" % s)
self.cpu_ser.serial.write(s.encode())
+ def print_error(self, message):
+ RED = '\033[0;31m'
+ NO_COLOR = '\033[0m'
+ print(RED + message + NO_COLOR)
+
def run(self):
# Flush any partial commands in the EC's prompt, then ask for a reboot.
self.ec_write("\n")
# the system sometimes, possibly dependent on ambient temperature
# in the farm.
if re.search("POWER_GOOD not seen in time", line):
- print("Detected intermittent poweron failure, restarting run...")
+ self.print_error("Detected intermittent poweron failure, restarting run...")
return 2
tftp_failures = 0
if re.search("R8152: Bulk read error 0xffffffbf", line):
tftp_failures += 1
if tftp_failures >= 100:
- print("Detected intermittent tftp failure, restarting run...")
+ self.print_error("Detected intermittent tftp failure, restarting run...")
return 2
# There are very infrequent bus errors during power management transitions
# on cheza, which we don't expect to be the case on future boards.
if re.search("Kernel panic - not syncing: Asynchronous SError Interrupt", line):
- print("Detected cheza power management bus error, restarting run...")
+ self.print_error("Detected cheza power management bus error, restarting run...")
return 2
# These HFI response errors started appearing with the introduction
# Given that it seems to trigger randomly near a GPU fault and then
# break many tests after that, just restart the whole run.
if re.search("a6xx_hfi_send_msg.*Unexpected message id .* on the response queue", line):
- print("Detected cheza power management bus error, restarting run...")
+ self.print_error("Detected cheza power management bus error, restarting run...")
return 2
result = re.search("bare-metal result: (\S*)", line)
else:
return 1
- print("Reached the end of the CPU serial log without finding a result")
+ self.print_error("Reached the end of the CPU serial log without finding a result")
return 1
self.ser = SerialBuffer(args.dev, "results/serial-output.txt", "R SERIAL> ")
self.fastboot="fastboot boot -s {ser} artifacts/fastboot.img".format(ser=args.fbserial)
+ def print_error(self, message):
+ RED = '\033[0;31m'
+ NO_COLOR = '\033[0m'
+ print(RED + message + NO_COLOR)
+
def logged_system(self, cmd):
print("Running '{}'".format(cmd))
return os.system(cmd)
return 1
if not fastboot_ready:
- print("Failed to get to fastboot prompt")
+ self.print_error("Failed to get to fastboot prompt")
return 1
if self.logged_system(self.fastboot) != 0:
# The db820c boards intermittently reboot. Just restart the run
# when if we see a reboot after we got past fastboot.
if re.search("PON REASON", line):
- print("Detected spontaneous reboot, restarting run...")
+ self.print_error("Detected spontaneous reboot, restarting run...")
return 2
result = re.search("bare-metal result: (\S*)", line)
else:
return 1
- print("Reached the end of the CPU serial log without finding a result")
+ self.print_error("Reached the end of the CPU serial log without finding a result")
return 1
def main():
self.powerdown = args.powerdown
self.ser = SerialBuffer(args.dev, "results/serial-output.txt", "", args.timeout)
+ def print_error(self, message):
+ RED = '\033[0;31m'
+ NO_COLOR = '\033[0m'
+ print(RED + message + NO_COLOR)
+
def logged_system(self, cmd):
print("Running '{}'".format(cmd))
return os.system(cmd)
break
if not boot_detected:
- print("Something wrong; couldn't detect the boot start up sequence")
+ self.print_error("Something wrong; couldn't detect the boot start up sequence")
self.logged_system(self.powerdown)
return 2
# Binning memory problems
if re.search("binner overflow mem", line):
- print("Memory overflow in the binner; GPU hang")
+ self.print_error("Memory overflow in the binner; GPU hang")
return 1
result = re.search("bare-metal result: (\S*)", line)
else:
return 1
- print("Reached the end of the CPU serial log without finding a result")
+ self.print_error("Reached the end of the CPU serial log without finding a result")
return 1
def main():