1# SPDX-License-Identifier: GPL-2.0+
2# Copyright (c) 2016 Google, Inc
3
4import pytest
5
6OF_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'''
35
36@pytest.mark.buildconfigspec('spl_of_platdata')
37def 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
43