test/py: Shorten u_boot_console
This fixture name is quite long and results in lots of verbose code.
We know this is U-Boot so the 'u_boot_' part is not necessary.
But it is also a bit of a misnomer, since it provides access to all the
information available to tests. It is not just the console.
It would be too confusing to use con as it would be confused with
config and it is probably too short.
So shorten it to 'ubman'.
Signed-off-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/u-boot/CAFLszTgPa4aT_J9h9pqeTtLCVn4x2JvLWRcWRD8NaN3uoSAtyA@mail.gmail.com/
diff --git a/test/py/tests/test_memtest.py b/test/py/tests/test_memtest.py
index 0618d96..0340edb 100644
--- a/test/py/tests/test_memtest.py
+++ b/test/py/tests/test_memtest.py
@@ -24,8 +24,8 @@
}
"""
-def get_memtest_env(u_boot_console):
- f = u_boot_console.config.env.get("env__memtest", None)
+def get_memtest_env(ubman):
+ f = ubman.config.env.get("env__memtest", None)
if not f:
pytest.skip("memtest is not enabled!")
else:
@@ -38,31 +38,31 @@
return start, end, pattern, iteration, timeout
@pytest.mark.buildconfigspec("cmd_memtest")
-def test_memtest_negative(u_boot_console):
+def test_memtest_negative(ubman):
"""Negative testcase where end address is smaller than starting address and
pattern is invalid."""
- start, end, pattern, iteration, timeout = get_memtest_env(u_boot_console)
+ start, end, pattern, iteration, timeout = get_memtest_env(ubman)
expected_response = "Refusing to do empty test"
- response = u_boot_console.run_command(
+ response = ubman.run_command(
f"mtest 2000 1000 {pattern} {hex(iteration)}"
)
assert expected_response in response
- output = u_boot_console.run_command("echo $?")
+ output = ubman.run_command("echo $?")
assert not output.endswith("0")
- u_boot_console.run_command(f"mtest {start} {end} 'xyz' {hex(iteration)}")
- output = u_boot_console.run_command("echo $?")
+ ubman.run_command(f"mtest {start} {end} 'xyz' {hex(iteration)}")
+ output = ubman.run_command("echo $?")
assert not output.endswith("0")
@pytest.mark.buildconfigspec("cmd_memtest")
-def test_memtest_ddr(u_boot_console):
+def test_memtest_ddr(ubman):
"""Test that md reads memory as expected, and that memory can be modified
using the mw command."""
- start, end, pattern, iteration, timeout = get_memtest_env(u_boot_console)
+ start, end, pattern, iteration, timeout = get_memtest_env(ubman)
expected_response = f"Tested {str(iteration)} iteration(s) with 0 errors."
- with u_boot_console.temporary_timeout(timeout):
- response = u_boot_console.run_command(
+ with ubman.temporary_timeout(timeout):
+ response = ubman.run_command(
f"mtest {start} {end} {pattern} {hex(iteration)}"
)
assert expected_response in response
- output = u_boot_console.run_command("echo $?")
+ output = ubman.run_command("echo $?")
assert output.endswith("0")