Mesa (main): ci/bare-metal: Apply autopep8 to our python scripts.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jun 21 22:18:46 UTC 2022
Module: Mesa
Branch: main
Commit: 1e15ec1949f6724e75a6eaf6df4c0746279d2560
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1e15ec1949f6724e75a6eaf6df4c0746279d2560
Author: Emma Anholt <emma at anholt.net>
Date: Thu Jun 16 14:55:45 2022 -0700
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 at igalia.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17096>
---
.gitlab-ci/bare-metal/cros_servo_run.py | 15 ++++++++-----
.gitlab-ci/bare-metal/fastboot_run.py | 35 ++++++++++++++++++++---------
.gitlab-ci/bare-metal/google-power-relay.py | 4 ++--
.gitlab-ci/bare-metal/poe_run.py | 21 ++++++++++++-----
.gitlab-ci/bare-metal/serial_buffer.py | 3 ++-
.gitlab-ci/bare-metal/telnet-buffer.py | 4 ++--
6 files changed, 55 insertions(+), 27 deletions(-)
diff --git a/.gitlab-ci/bare-metal/cros_servo_run.py b/.gitlab-ci/bare-metal/cros_servo_run.py
index 042465e9872..c9212a2b74a 100755
--- a/.gitlab-ci/bare-metal/cros_servo_run.py
+++ b/.gitlab-ci/bare-metal/cros_servo_run.py
@@ -108,7 +108,8 @@ class CrosServoRun:
# the system sometimes, possibly dependent on ambient temperature
# in the farm.
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
tftp_failures = 0
@@ -123,13 +124,15 @@ class CrosServoRun:
if re.search("R8152: Bulk read error 0xffffffbf", line):
tftp_failures += 1
if tftp_failures >= 100:
- self.print_error("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):
- self.print_error("Detected cheza power management bus error, restarting run...")
+ self.print_error(
+ "Detected cheza power management bus error, restarting run...")
return 2
# 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
# 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):
- self.print_error("Detected cheza power management bus error, restarting run...")
+ self.print_error(
+ "Detected cheza power management bus error, restarting run...")
return 2
if re.search("coreboot.*bootblock starting", line):
@@ -167,7 +171,8 @@ class CrosServoRun:
else:
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
diff --git a/.gitlab-ci/bare-metal/fastboot_run.py b/.gitlab-ci/bare-metal/fastboot_run.py
index 0521a387da4..41ee29933dc 100755
--- a/.gitlab-ci/bare-metal/fastboot_run.py
+++ b/.gitlab-ci/bare-metal/fastboot_run.py
@@ -28,13 +28,16 @@ from serial_buffer import SerialBuffer
import sys
import threading
+
class FastbootRun:
def __init__(self, args):
self.powerup = args.powerup
# We would like something like a 1 minute timeout, but the piglit traces
# jobs stall out for long periods of time.
- self.ser = SerialBuffer(args.dev, "results/serial-output.txt", "R SERIAL> ", timeout=600)
- self.fastboot="fastboot boot -s {ser} artifacts/fastboot.img".format(ser=args.fbserial)
+ self.ser = SerialBuffer(
+ 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):
self.ser.close()
@@ -55,16 +58,18 @@ class FastbootRun:
fastboot_ready = False
for line in self.ser.lines():
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
break
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
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
if self.logged_system(self.fastboot) != 0:
@@ -83,7 +88,8 @@ class FastbootRun:
# 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):
- self.print_error("Detected spontaneous reboot, restarting run...")
+ self.print_error(
+ "Detected spontaneous reboot, restarting run...")
return 2
# db820c sometimes wedges around iommu fault recovery
@@ -117,15 +123,21 @@ class FastbootRun:
else:
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
+
def main():
parser = argparse.ArgumentParser()
- parser.add_argument('--dev', type=str, help='Serial device (otherwise reading from serial-output.txt)')
- 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('--fbserial', type=str, help='fastboot serial number of the board', required=True)
+ parser.add_argument(
+ '--dev', type=str, help='Serial device (otherwise reading from serial-output.txt)')
+ 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('--fbserial', type=str,
+ help='fastboot serial number of the board', required=True)
args = parser.parse_args()
fastboot = FastbootRun(args)
@@ -142,5 +154,6 @@ def main():
sys.exit(retval)
+
if __name__ == '__main__':
main()
diff --git a/.gitlab-ci/bare-metal/google-power-relay.py b/.gitlab-ci/bare-metal/google-power-relay.py
index 5d0540ddc44..52ed6f5e48f 100755
--- a/.gitlab-ci/bare-metal/google-power-relay.py
+++ b/.gitlab-ci/bare-metal/google-power-relay.py
@@ -8,8 +8,8 @@ relay = sys.argv[2]
# our relays are "off" means "board is powered".
mode_swap = {
- "on" : "off",
- "off" : "on",
+ "on": "off",
+ "off": "on",
}
mode = mode_swap[mode]
diff --git a/.gitlab-ci/bare-metal/poe_run.py b/.gitlab-ci/bare-metal/poe_run.py
index f53c1478ffb..155256efa53 100755
--- a/.gitlab-ci/bare-metal/poe_run.py
+++ b/.gitlab-ci/bare-metal/poe_run.py
@@ -28,11 +28,13 @@ from serial_buffer import SerialBuffer
import sys
import threading
+
class PoERun:
def __init__(self, args):
self.powerup = args.powerup
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):
RED = '\033[0;31m'
@@ -54,7 +56,8 @@ class PoERun:
break
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
for line in self.ser.lines():
@@ -77,14 +80,19 @@ class PoERun:
else:
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
+
def main():
parser = argparse.ArgumentParser()
- parser.add_argument('--dev', type=str, help='Serial device to monitor', 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('--dev', type=str,
+ help='Serial device to monitor', 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,
help='time in seconds to wait for activity', required=False)
args = parser.parse_args()
@@ -96,5 +104,6 @@ def main():
sys.exit(retval)
+
if __name__ == '__main__':
main()
diff --git a/.gitlab-ci/bare-metal/serial_buffer.py b/.gitlab-ci/bare-metal/serial_buffer.py
index 710e7867782..bcf2b87e32a 100755
--- a/.gitlab-ci/bare-metal/serial_buffer.py
+++ b/.gitlab-ci/bare-metal/serial_buffer.py
@@ -28,8 +28,9 @@ import serial
import threading
import time
+
class SerialBuffer:
- def __init__(self, dev, filename, prefix, timeout = None):
+ def __init__(self, dev, filename, prefix, timeout=None):
self.filename = filename
self.dev = dev
diff --git a/.gitlab-ci/bare-metal/telnet-buffer.py b/.gitlab-ci/bare-metal/telnet-buffer.py
index c0fa2f875d5..408243a0109 100755
--- a/.gitlab-ci/bare-metal/telnet-buffer.py
+++ b/.gitlab-ci/bare-metal/telnet-buffer.py
@@ -28,8 +28,8 @@
import sys
import telnetlib
-host=sys.argv[1]
-port=sys.argv[2]
+host = sys.argv[1]
+port = sys.argv[2]
tn = telnetlib.Telnet(host, port, 1000000)
More information about the mesa-commit
mailing list