test_ofplatdata.py 895 B

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