test_cat.py 503 B

1234567891011121314151617181920
  1. # SPDX-License-Identifier: GPL-2.0+
  2. """ Unit test for cat command
  3. """
  4. import pytest
  5. @pytest.mark.boardspec('sandbox')
  6. @pytest.mark.buildconfigspec('cmd_cat')
  7. def test_cat(u_boot_console, cat_data):
  8. """ Unit test for cat
  9. Args:
  10. u_boot_console -- U-Boot console
  11. cat_data -- Path to the disk image used for testing.
  12. """
  13. response = u_boot_console.run_command_list([
  14. f'host bind 0 {cat_data}',
  15. 'cat host 0 hello'])
  16. assert 'hello world' in response