blob: 98103ee71a94ef44b633307b28aa1bfccda87276 [file] [log] [blame]
Simon Glassc405fc42016-07-04 11:58:41 -06001# SPDX-License-Identifier: GPL-2.0+
Tom Rini10e47792018-05-06 17:58:06 -04002# Copyright (c) 2016 Google, Inc
Simon Glassc405fc42016-07-04 11:58:41 -06003
4import pytest
5
Simon Glassb5dfea82018-11-15 18:44:01 -07006OF_PLATDATA_OUTPUT = '''
7of-platdata probe:
8bool 1
9byte 05
10bytearray 06 00 00
11int 1
12intarray 2 3 4 0
13longbytearray 09 0a 0b 0c 0d 0e 0f 10 11
14string message
15stringarray "multi-word" "message" ""
16of-platdata probe:
17bool 0
18byte 08
19bytearray 01 23 34
20int 3
21intarray 5 0 0 0
22longbytearray 09 00 00 00 00 00 00 00 00
23string message2
24stringarray "another" "multi-word" "message"
25of-platdata probe:
26bool 0
27byte 00
28bytearray 00 00 00
29int 0
30intarray 0 0 0 0
31longbytearray 00 00 00 00 00 00 00 00 00
32string <NULL>
33stringarray "one" "" ""
34'''
Simon Glassc405fc42016-07-04 11:58:41 -060035
Simon Glasse0b02742016-07-16 18:36:44 -060036@pytest.mark.buildconfigspec('spl_of_platdata')
Simon Glassc405fc42016-07-04 11:58:41 -060037def test_ofplatdata(u_boot_console):
38 """Test that of-platdata can be generated and used in sandbox"""
39 cons = u_boot_console
Simon Glassb5dfea82018-11-15 18:44:01 -070040 cons.restart_uboot_with_flags(['--show_of_platdata'])
Simon Glassc405fc42016-07-04 11:58:41 -060041 output = cons.get_spawn_output().replace('\r', '')
42 assert OF_PLATDATA_OUTPUT in output