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