ci/bare-metal: Apply autopep8 to our python scripts.
My editor likes to pep8 as I edit, and I'm tired of carefully not committing those changes. Acked-by: Juan A. Suarez <jasuarez@igalia.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17096>
This commit is contained in:
parent
909e7aaf57
commit
1e15ec1949
|
@ -108,7 +108,8 @@ class CrosServoRun:
|
||||||
# the system sometimes, possibly dependent on ambient temperature
|
# the system sometimes, possibly dependent on ambient temperature
|
||||||
# in the farm.
|
# in the farm.
|
||||||
if re.search("POWER_GOOD not seen in time", line):
|
if re.search("POWER_GOOD not seen in time", line):
|
||||||
self.print_error("Detected intermittent poweron failure, restarting run...")
|
self.print_error(
|
||||||
|
"Detected intermittent poweron failure, restarting run...")
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
tftp_failures = 0
|
tftp_failures = 0
|
||||||
|
@ -123,13 +124,15 @@ class CrosServoRun:
|
||||||
if re.search("R8152: Bulk read error 0xffffffbf", line):
|
if re.search("R8152: Bulk read error 0xffffffbf", line):
|
||||||
tftp_failures += 1
|
tftp_failures += 1
|
||||||
if tftp_failures >= 100:
|
if tftp_failures >= 100:
|
||||||
self.print_error("Detected intermittent tftp failure, restarting run...")
|
self.print_error(
|
||||||
|
"Detected intermittent tftp failure, restarting run...")
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
# There are very infrequent bus errors during power management transitions
|
# There are very infrequent bus errors during power management transitions
|
||||||
# on cheza, which we don't expect to be the case on future boards.
|
# 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):
|
if re.search("Kernel panic - not syncing: Asynchronous SError Interrupt", line):
|
||||||
self.print_error("Detected cheza power management bus error, restarting run...")
|
self.print_error(
|
||||||
|
"Detected cheza power management bus error, restarting run...")
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
# If the network device dies, it's probably not graphics's fault, just try again.
|
# If the network device dies, it's probably not graphics's fault, just try again.
|
||||||
|
@ -148,7 +151,8 @@ class CrosServoRun:
|
||||||
# Given that it seems to trigger randomly near a GPU fault and then
|
# Given that it seems to trigger randomly near a GPU fault and then
|
||||||
# break many tests after that, just restart the whole run.
|
# 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):
|
if re.search("a6xx_hfi_send_msg.*Unexpected message id .* on the response queue", line):
|
||||||
self.print_error("Detected cheza power management bus error, restarting run...")
|
self.print_error(
|
||||||
|
"Detected cheza power management bus error, restarting run...")
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
if re.search("coreboot.*bootblock starting", line):
|
if re.search("coreboot.*bootblock starting", line):
|
||||||
|
@ -167,7 +171,8 @@ class CrosServoRun:
|
||||||
else:
|
else:
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
self.print_error("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
|
return 1
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,13 +28,16 @@ from serial_buffer import SerialBuffer
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
|
|
||||||
class FastbootRun:
|
class FastbootRun:
|
||||||
def __init__(self, args):
|
def __init__(self, args):
|
||||||
self.powerup = args.powerup
|
self.powerup = args.powerup
|
||||||
# We would like something like a 1 minute timeout, but the piglit traces
|
# We would like something like a 1 minute timeout, but the piglit traces
|
||||||
# jobs stall out for long periods of time.
|
# jobs stall out for long periods of time.
|
||||||
self.ser = SerialBuffer(args.dev, "results/serial-output.txt", "R SERIAL> ", timeout=600)
|
self.ser = SerialBuffer(
|
||||||
self.fastboot="fastboot boot -s {ser} artifacts/fastboot.img".format(ser=args.fbserial)
|
args.dev, "results/serial-output.txt", "R SERIAL> ", timeout=600)
|
||||||
|
self.fastboot = "fastboot boot -s {ser} artifacts/fastboot.img".format(
|
||||||
|
ser=args.fbserial)
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
self.ser.close()
|
self.ser.close()
|
||||||
|
@ -55,16 +58,18 @@ class FastbootRun:
|
||||||
fastboot_ready = False
|
fastboot_ready = False
|
||||||
for line in self.ser.lines():
|
for line in self.ser.lines():
|
||||||
if re.search("fastboot: processing commands", line) or \
|
if re.search("fastboot: processing commands", line) or \
|
||||||
re.search("Listening for fastboot command on", line):
|
re.search("Listening for fastboot command on", line):
|
||||||
fastboot_ready = True
|
fastboot_ready = True
|
||||||
break
|
break
|
||||||
|
|
||||||
if re.search("data abort", line):
|
if re.search("data abort", line):
|
||||||
self.print_error("Detected crash during boot, restarting run...")
|
self.print_error(
|
||||||
|
"Detected crash during boot, restarting run...")
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
if not fastboot_ready:
|
if not fastboot_ready:
|
||||||
self.print_error("Failed to get to fastboot prompt, restarting run...")
|
self.print_error(
|
||||||
|
"Failed to get to fastboot prompt, restarting run...")
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
if self.logged_system(self.fastboot) != 0:
|
if self.logged_system(self.fastboot) != 0:
|
||||||
|
@ -83,7 +88,8 @@ class FastbootRun:
|
||||||
# The db820c boards intermittently reboot. Just restart the run
|
# The db820c boards intermittently reboot. Just restart the run
|
||||||
# when if we see a reboot after we got past fastboot.
|
# when if we see a reboot after we got past fastboot.
|
||||||
if re.search("PON REASON", line):
|
if re.search("PON REASON", line):
|
||||||
self.print_error("Detected spontaneous reboot, restarting run...")
|
self.print_error(
|
||||||
|
"Detected spontaneous reboot, restarting run...")
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
# db820c sometimes wedges around iommu fault recovery
|
# db820c sometimes wedges around iommu fault recovery
|
||||||
|
@ -117,15 +123,21 @@ class FastbootRun:
|
||||||
else:
|
else:
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
self.print_error("Reached the end of the CPU serial log without finding a result, restarting run...")
|
self.print_error(
|
||||||
|
"Reached the end of the CPU serial log without finding a result, restarting run...")
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('--dev', type=str, help='Serial device (otherwise reading from serial-output.txt)')
|
parser.add_argument(
|
||||||
parser.add_argument('--powerup', type=str, help='shell command for rebooting', required=True)
|
'--dev', type=str, help='Serial device (otherwise reading from serial-output.txt)')
|
||||||
parser.add_argument('--powerdown', type=str, help='shell command for powering off', required=True)
|
parser.add_argument('--powerup', type=str,
|
||||||
parser.add_argument('--fbserial', type=str, help='fastboot serial number of the board', required=True)
|
help='shell command for rebooting', required=True)
|
||||||
|
parser.add_argument('--powerdown', type=str,
|
||||||
|
help='shell command for powering off', required=True)
|
||||||
|
parser.add_argument('--fbserial', type=str,
|
||||||
|
help='fastboot serial number of the board', required=True)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
fastboot = FastbootRun(args)
|
fastboot = FastbootRun(args)
|
||||||
|
@ -142,5 +154,6 @@ def main():
|
||||||
|
|
||||||
sys.exit(retval)
|
sys.exit(retval)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -8,8 +8,8 @@ relay = sys.argv[2]
|
||||||
|
|
||||||
# our relays are "off" means "board is powered".
|
# our relays are "off" means "board is powered".
|
||||||
mode_swap = {
|
mode_swap = {
|
||||||
"on" : "off",
|
"on": "off",
|
||||||
"off" : "on",
|
"off": "on",
|
||||||
}
|
}
|
||||||
mode = mode_swap[mode]
|
mode = mode_swap[mode]
|
||||||
|
|
||||||
|
|
|
@ -28,11 +28,13 @@ from serial_buffer import SerialBuffer
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
|
|
||||||
class PoERun:
|
class PoERun:
|
||||||
def __init__(self, args):
|
def __init__(self, args):
|
||||||
self.powerup = args.powerup
|
self.powerup = args.powerup
|
||||||
self.powerdown = args.powerdown
|
self.powerdown = args.powerdown
|
||||||
self.ser = SerialBuffer(args.dev, "results/serial-output.txt", "", args.timeout)
|
self.ser = SerialBuffer(
|
||||||
|
args.dev, "results/serial-output.txt", "", args.timeout)
|
||||||
|
|
||||||
def print_error(self, message):
|
def print_error(self, message):
|
||||||
RED = '\033[0;31m'
|
RED = '\033[0;31m'
|
||||||
|
@ -54,7 +56,8 @@ class PoERun:
|
||||||
break
|
break
|
||||||
|
|
||||||
if not boot_detected:
|
if not boot_detected:
|
||||||
self.print_error("Something wrong; couldn't detect the boot start up sequence")
|
self.print_error(
|
||||||
|
"Something wrong; couldn't detect the boot start up sequence")
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
for line in self.ser.lines():
|
for line in self.ser.lines():
|
||||||
|
@ -77,14 +80,19 @@ class PoERun:
|
||||||
else:
|
else:
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
self.print_error("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 2
|
return 2
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('--dev', type=str, help='Serial device to monitor', required=True)
|
parser.add_argument('--dev', type=str,
|
||||||
parser.add_argument('--powerup', type=str, help='shell command for rebooting', required=True)
|
help='Serial device to monitor', required=True)
|
||||||
parser.add_argument('--powerdown', type=str, help='shell command for powering off', required=True)
|
parser.add_argument('--powerup', type=str,
|
||||||
|
help='shell command for rebooting', required=True)
|
||||||
|
parser.add_argument('--powerdown', type=str,
|
||||||
|
help='shell command for powering off', required=True)
|
||||||
parser.add_argument('--timeout', type=int, default=60,
|
parser.add_argument('--timeout', type=int, default=60,
|
||||||
help='time in seconds to wait for activity', required=False)
|
help='time in seconds to wait for activity', required=False)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
@ -96,5 +104,6 @@ def main():
|
||||||
|
|
||||||
sys.exit(retval)
|
sys.exit(retval)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -28,8 +28,9 @@ import serial
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
class SerialBuffer:
|
class SerialBuffer:
|
||||||
def __init__(self, dev, filename, prefix, timeout = None):
|
def __init__(self, dev, filename, prefix, timeout=None):
|
||||||
self.filename = filename
|
self.filename = filename
|
||||||
self.dev = dev
|
self.dev = dev
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
import sys
|
import sys
|
||||||
import telnetlib
|
import telnetlib
|
||||||
|
|
||||||
host=sys.argv[1]
|
host = sys.argv[1]
|
||||||
port=sys.argv[2]
|
port = sys.argv[2]
|
||||||
|
|
||||||
tn = telnetlib.Telnet(host, port, 1000000)
|
tn = telnetlib.Telnet(host, port, 1000000)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue