blob: f793b9fe0a1cf3f3053dd31790b2500211ff33cd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# SPDX-License-Identifier: GPL-2.0+
""" Unit test for cat command
"""
import pytest
from tests.fs_helper import FsHelper
@pytest.mark.boardspec('sandbox')
@pytest.mark.buildconfigspec('cmd_cat')
def test_cat(ubman):
""" Unit test for cat
Args:
ubman -- U-Boot console
"""
with FsHelper(ubman.config, 'vfat', 1, 'test_cat') as fsh:
with open(f'{fsh.srcdir}/hello', 'w', encoding = 'ascii') as outf:
outf.write('hello world\n')
fsh.mk_fs()
response = ubman.run_command_list([f'host bind 0 {fsh.fs_img}',
'cat host 0 hello'])
assert 'hello world' in response
|