summaryrefslogtreecommitdiff
path: root/test/py/tests/test_shell_basics.py
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2025-02-09 09:07:14 -0700
committerSimon Glass <[email protected]>2025-03-15 10:38:38 +0000
commit752c3769874596d012cd8325099d2ae20123f989 (patch)
treeb50b3025ff2d124a96793b64d83b8a7d1cb2326c /test/py/tests/test_shell_basics.py
parent00dfb7038ea4dfe9d9667143bfecd11c05cab6fa (diff)
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 <[email protected]> Link: https://lore.kernel.org/u-boot/CAFLszTgPa4aT_J9h9pqeTtLCVn4x2JvLWRcWRD8NaN3uoSAtyA@mail.gmail.com/
Diffstat (limited to 'test/py/tests/test_shell_basics.py')
-rw-r--r--test/py/tests/test_shell_basics.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/test/py/tests/test_shell_basics.py b/test/py/tests/test_shell_basics.py
index 68a3f892f6b..97e22af5da5 100644
--- a/test/py/tests/test_shell_basics.py
+++ b/test/py/tests/test_shell_basics.py
@@ -7,39 +7,39 @@ import pytest
pytestmark = pytest.mark.buildconfigspec('cmd_echo')
-def test_shell_execute(u_boot_console):
+def test_shell_execute(ubman):
"""Test any shell command."""
- response = u_boot_console.run_command('echo hello')
+ response = ubman.run_command('echo hello')
assert response.strip() == 'hello'
-def test_shell_semicolon_two(u_boot_console):
+def test_shell_semicolon_two(ubman):
"""Test two shell commands separate by a semi-colon."""
cmd = 'echo hello; echo world'
- response = u_boot_console.run_command(cmd)
+ response = ubman.run_command(cmd)
# This validation method ignores the exact whitespace between the strings
assert response.index('hello') < response.index('world')
-def test_shell_semicolon_three(u_boot_console):
+def test_shell_semicolon_three(ubman):
"""Test three shell commands separate by a semi-colon, with variable
expansion dependencies between them."""
cmd = 'setenv list 1; setenv list ${list}2; setenv list ${list}3; ' + \
'echo ${list}'
- response = u_boot_console.run_command(cmd)
+ response = ubman.run_command(cmd)
assert response.strip() == '123'
- u_boot_console.run_command('setenv list')
+ ubman.run_command('setenv list')
-def test_shell_run(u_boot_console):
+def test_shell_run(ubman):
"""Test the "run" shell command."""
- u_boot_console.run_command('setenv foo \'setenv monty 1; setenv python 2\'')
- u_boot_console.run_command('run foo')
- response = u_boot_console.run_command('echo ${monty}')
+ ubman.run_command('setenv foo \'setenv monty 1; setenv python 2\'')
+ ubman.run_command('run foo')
+ response = ubman.run_command('echo ${monty}')
assert response.strip() == '1'
- response = u_boot_console.run_command('echo ${python}')
+ response = ubman.run_command('echo ${python}')
assert response.strip() == '2'
- u_boot_console.run_command('setenv foo')
- u_boot_console.run_command('setenv monty')
- u_boot_console.run_command('setenv python')
+ ubman.run_command('setenv foo')
+ ubman.run_command('setenv monty')
+ ubman.run_command('setenv python')