summaryrefslogtreecommitdiff
path: root/test/py/tests/test_scsi.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2025-02-09 09:07:14 -0700
committerSimon Glass <sjg@chromium.org>2025-03-15 10:38:38 +0000
commit752c3769874596d012cd8325099d2ae20123f989 (patch)
treeb50b3025ff2d124a96793b64d83b8a7d1cb2326c /test/py/tests/test_scsi.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 <sjg@chromium.org> Link: https://lore.kernel.org/u-boot/CAFLszTgPa4aT_J9h9pqeTtLCVn4x2JvLWRcWRD8NaN3uoSAtyA@mail.gmail.com/
Diffstat (limited to 'test/py/tests/test_scsi.py')
-rw-r--r--test/py/tests/test_scsi.py48
1 files changed, 24 insertions, 24 deletions
diff --git a/test/py/tests/test_scsi.py b/test/py/tests/test_scsi.py
index 445693cafd7..2a35e47e558 100644
--- a/test/py/tests/test_scsi.py
+++ b/test/py/tests/test_scsi.py
@@ -19,8 +19,8 @@ env__scsi_device_test = {
}
"""
-def scsi_setup(u_boot_console):
- f = u_boot_console.config.env.get('env__scsi_device_test', None)
+def scsi_setup(ubman):
+ f = ubman.config.env.get('env__scsi_device_test', None)
if not f:
pytest.skip('No SCSI device to test')
@@ -39,54 +39,54 @@ def scsi_setup(u_boot_console):
return dev_num, dev_type, dev_size
@pytest.mark.buildconfigspec('cmd_scsi')
-def test_scsi_reset(u_boot_console):
- dev_num, dev_type, dev_size = scsi_setup(u_boot_console)
- output = u_boot_console.run_command('scsi reset')
+def test_scsi_reset(ubman):
+ dev_num, dev_type, dev_size = scsi_setup(ubman)
+ output = ubman.run_command('scsi reset')
assert f'Device {dev_num}:' in output
assert f'Type: {dev_type}' in output
assert f'Capacity: {dev_size}' in output
- output = u_boot_console.run_command('echo $?')
+ output = ubman.run_command('echo $?')
assert output.endswith('0')
@pytest.mark.buildconfigspec('cmd_scsi')
-def test_scsi_info(u_boot_console):
- dev_num, dev_type, dev_size = scsi_setup(u_boot_console)
- output = u_boot_console.run_command('scsi info')
+def test_scsi_info(ubman):
+ dev_num, dev_type, dev_size = scsi_setup(ubman)
+ output = ubman.run_command('scsi info')
assert f'Device {dev_num}:' in output
assert f'Type: {dev_type}' in output
assert f'Capacity: {dev_size}' in output
- output = u_boot_console.run_command('echo $?')
+ output = ubman.run_command('echo $?')
assert output.endswith('0')
@pytest.mark.buildconfigspec('cmd_scsi')
-def test_scsi_scan(u_boot_console):
- dev_num, dev_type, dev_size = scsi_setup(u_boot_console)
- output = u_boot_console.run_command('scsi scan')
+def test_scsi_scan(ubman):
+ dev_num, dev_type, dev_size = scsi_setup(ubman)
+ output = ubman.run_command('scsi scan')
assert f'Device {dev_num}:' in output
assert f'Type: {dev_type}' in output
assert f'Capacity: {dev_size}' in output
- output = u_boot_console.run_command('echo $?')
+ output = ubman.run_command('echo $?')
assert output.endswith('0')
@pytest.mark.buildconfigspec('cmd_scsi')
-def test_scsi_dev(u_boot_console):
- dev_num, dev_type, dev_size = scsi_setup(u_boot_console)
- output = u_boot_console.run_command('scsi device')
+def test_scsi_dev(ubman):
+ dev_num, dev_type, dev_size = scsi_setup(ubman)
+ output = ubman.run_command('scsi device')
assert 'no scsi devices available' not in output
assert f'device {dev_num}:' in output
assert f'Type: {dev_type}' in output
assert f'Capacity: {dev_size}' in output
- output = u_boot_console.run_command('echo $?')
+ output = ubman.run_command('echo $?')
assert output.endswith('0')
- output = u_boot_console.run_command('scsi device %d' % dev_num)
+ output = ubman.run_command('scsi device %d' % dev_num)
assert 'is now current device' in output
- output = u_boot_console.run_command('echo $?')
+ output = ubman.run_command('echo $?')
assert output.endswith('0')
@pytest.mark.buildconfigspec('cmd_scsi')
-def test_scsi_part(u_boot_console):
- test_scsi_dev(u_boot_console)
- output = u_boot_console.run_command('scsi part')
+def test_scsi_part(ubman):
+ test_scsi_dev(ubman)
+ output = ubman.run_command('scsi part')
assert 'Partition Map for scsi device' in output
- output = u_boot_console.run_command('echo $?')
+ output = ubman.run_command('echo $?')
assert output.endswith('0')