]> Git Repo - J-u-boot.git/blob - test/py/tests/test_semihosting/test_hostfs.py
Merge tag 'u-boot-imx-master-20250127' of https://gitlab.denx.de/u-boot/custodians...
[J-u-boot.git] / test / py / tests / test_semihosting / test_hostfs.py
1 # SPDX-License-Identifier:      GPL-2.0+
2
3 """ Unit test for semihosting
4 """
5
6 import pytest
7
8 @pytest.mark.buildconfigspec('semihosting')
9 def test_semihosting_hostfs(u_boot_console, semihosting_data):
10     """ Unit test for semihosting
11
12     Args:
13         u_boot_console -- U-Boot console
14         semihosting_data -- Path to the disk image used for testing.
15     """
16     response = u_boot_console.run_command(
17         f'load hostfs - $loadaddr {semihosting_data}')
18     assert '11 bytes read' in response
19
20     response = u_boot_console.run_command(
21         'crc32 $loadaddr $filesize')
22     assert '==> 60cfccfc' in response
23
24     u_boot_console.run_command(
25         f'save hostfs - $loadaddr {semihosting_data} 11 11')
26
27     response = u_boot_console.run_command(
28         f'load hostfs - $loadaddr {semihosting_data} 4 13')
29     assert '4 bytes read' in response
30
31     response = u_boot_console.run_command(
32         'crc32 $loadaddr $filesize')
33     assert '==> e29063ea' in response
This page took 0.028354 seconds and 4 git commands to generate.