test_help.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. # SPDX-License-Identifier: GPL-2.0
  2. # Copyright (c) 2015 Stephen Warren
  3. # Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
  4. import pytest
  5. def test_help(u_boot_console):
  6. """Test that the "help" command can be executed."""
  7. u_boot_console.run_command('help')
  8. @pytest.mark.boardspec('sandbox')
  9. def test_help_no_devicetree(u_boot_console):
  10. try:
  11. cons = u_boot_console
  12. cons.restart_uboot_with_flags([], use_dtb=False)
  13. cons.run_command('help')
  14. output = cons.get_spawn_output().replace('\r', '')
  15. assert 'print command description/usage' in output
  16. finally:
  17. # Restart afterward to get the normal device tree back
  18. u_boot_console.restart_uboot()
  19. @pytest.mark.boardspec('sandbox_vpl')
  20. def test_vpl_help(u_boot_console):
  21. try:
  22. cons = u_boot_console
  23. cons.restart_uboot()
  24. cons.run_command('help')
  25. output = cons.get_spawn_output().replace('\r', '')
  26. assert 'print command description/usage' in output
  27. finally:
  28. # Restart afterward to get the normal device tree back
  29. u_boot_console.restart_uboot()