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