1 # SPDX-License-Identifier: GPL-2.0
2 # Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
7 @pytest.mark.buildconfigspec('ut_dm')
8 def test_ut_dm_init(u_boot_console):
9 """Initialize data for ut dm tests."""
11 fn = u_boot_console.config.source_dir + '/testflash.bin'
12 if not os.path.exists(fn):
13 data = b'this is a test'
14 data += b'\x00' * ((4 * 1024 * 1024) - len(data))
15 with open(fn, 'wb') as fh:
18 fn = u_boot_console.config.source_dir + '/spi.bin'
19 if not os.path.exists(fn):
20 data = b'\x00' * (2 * 1024 * 1024)
21 with open(fn, 'wb') as fh:
24 def test_ut(u_boot_console, ut_subtest):
25 """Execute a "ut" subtest."""
27 output = u_boot_console.run_command('ut ' + ut_subtest)
28 assert output.endswith('Failures: 0')