test_ofplatdata.py 951 B

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