Merge tag 'u-boot-amlogic-20181126' of git://git.denx.de/u-boot-amlogic
[oweals/u-boot.git] / test / py / tests / test_ofplatdata.py
1 # SPDX-License-Identifier: GPL-2.0+
2 # Copyright (c) 2016 Google, Inc
3
4 import pytest
5
6 OF_PLATDATA_OUTPUT = '''
7 of-platdata probe:
8 bool 1
9 byte 05
10 bytearray 06 00 00
11 int 1
12 intarray 2 3 4 0
13 longbytearray 09 0a 0b 0c 0d 0e 0f 10 11
14 string message
15 stringarray "multi-word" "message" ""
16 of-platdata probe:
17 bool 0
18 byte 08
19 bytearray 01 23 34
20 int 3
21 intarray 5 0 0 0
22 longbytearray 09 00 00 00 00 00 00 00 00
23 string message2
24 stringarray "another" "multi-word" "message"
25 of-platdata probe:
26 bool 0
27 byte 00
28 bytearray 00 00 00
29 int 0
30 intarray 0 0 0 0
31 longbytearray 00 00 00 00 00 00 00 00 00
32 string <NULL>
33 stringarray "one" "" ""
34 '''
35
36 @pytest.mark.buildconfigspec('spl_of_platdata')
37 def test_ofplatdata(u_boot_console):
38     """Test that of-platdata can be generated and used in sandbox"""
39     cons = u_boot_console
40     cons.restart_uboot_with_flags(['--show_of_platdata'])
41     output = cons.get_spawn_output().replace('\r', '')
42     assert OF_PLATDATA_OUTPUT in output