Simon Glass | c405fc4 | 2016-07-04 11:58:41 -0600 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0+ |
Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 2 | # Copyright (c) 2016 Google, Inc |
Simon Glass | c405fc4 | 2016-07-04 11:58:41 -0600 | [diff] [blame] | 3 | |
| 4 | import pytest |
| 5 | |
Simon Glass | b5dfea8 | 2018-11-15 18:44:01 -0700 | [diff] [blame] | 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 | ''' |
Simon Glass | c405fc4 | 2016-07-04 11:58:41 -0600 | [diff] [blame] | 35 | |
Simon Glass | e0b0274 | 2016-07-16 18:36:44 -0600 | [diff] [blame] | 36 | @pytest.mark.buildconfigspec('spl_of_platdata') |
Simon Glass | c405fc4 | 2016-07-04 11:58:41 -0600 | [diff] [blame] | 37 | def test_ofplatdata(u_boot_console): |
| 38 | """Test that of-platdata can be generated and used in sandbox""" |
| 39 | cons = u_boot_console |
Simon Glass | b5dfea8 | 2018-11-15 18:44:01 -0700 | [diff] [blame] | 40 | cons.restart_uboot_with_flags(['--show_of_platdata']) |
Simon Glass | c405fc4 | 2016-07-04 11:58:41 -0600 | [diff] [blame] | 41 | output = cons.get_spawn_output().replace('\r', '') |
| 42 | assert OF_PLATDATA_OUTPUT in output |