7 Commits

Author SHA1 Message Date
Simon Glass
791872b9fe test/py: Move member variables from spawn to console_base
Now that all the expect() functionality is in console_base, move the
variables there too.

Ensure they are reset when a new connection is spawned.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-23 19:38:03 -06:00
Simon Glass
31c6d1d063 test/py: Move the timeout to console_base
This timeout relates to the expect() function so move it into the same
file and class.

Reset the timeout when a new spawn is created, to mimic the existing
behabiour. Update a few tests which access the timeout directly.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-23 17:44:15 -06:00
Simon Glass
c5cad939ad test/py: Move expect() function into console_base
This function is only used from console_base and it is always accessed
via a 'self.p.expect()' expression, which is confusing.

Checking for expected output doesn't really relate to spawning in any
case, so move this function to console_base

For now the spawn class is kept as it is, to reduce the change in each
patch.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-23 17:38:59 -06:00
Simon Glass
ffdf4039cb test/py: Move exceptions to console_base
As a first step towards moving the expect() handler to console_base,
move the exceptions there.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-23 17:30:11 -06:00
Simon Glass
4b9e71cccf test/py: Tidy up pylint warnings in spawn
There are quite a few warnings which makes it confusing when editing
this file. Resolve the easy ones, with these remaining:

  55:0: R0913: Too many arguments (7/5) (too-many-arguments)
  91:0: R0902: Too many instance attributes (14/7) (too-many-instance-attributes)
  136:12: W0702: No exception type(s) specified (bare-except)
  246:4: R0912: Too many branches (14/12) (too-many-branches)

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-23 12:17:34 -06:00
Simon Glass
4f1e711579 test/py: Tidy up pylint warnings in console_base
There are quite a few warnings which makes it confusing when editing
this file. Resolve the easy ones, leaving:

  125:0: R0902: Too many instance attributes (14/7) (too-many-instance-attributes)
  212:4: R0912: Too many branches (14/12) (too-many-branches)
  271:4: R0913: Too many arguments (6/5) (too-many-arguments)
  271:4: R0912: Too many branches (13/12) (too-many-branches)
  454:8: W0702: No exception type(s) specified (bare-except)
  531:8: W0702: No exception type(s) specified (bare-except)

Rename wait_for_boot_prompt() so it is clear that it is an internal
function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-23 12:16:43 -06:00
Simon Glass
d428226459 test/py: Drop u_boot_ prefix on test files
We know this is U-Boot so the prefix serves no purpose other than to
make things longer and harder to read. Drop it and rename the files.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # test_android / test_dfu
2025-02-16 17:30:53 -07:00