1 # SPDX-License-Identifier: GPL-2.0
2 # Copyright (c) 2015 Stephen Warren
3 # Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
7 def test_help(u_boot_console):
8 """Test that the "help" command can be executed."""
10 lines = u_boot_console.run_command('help')
11 if u_boot_console.config.buildconfig.get('config_cmd_2048', 'n') == 'y':
12 assert lines.splitlines()[0] == "2048 - The 2048 game"
14 assert lines.splitlines()[0] == "? - alias for 'help'"
16 @pytest.mark.boardspec('sandbox')
17 def test_help_no_devicetree(u_boot_console):
20 cons.restart_uboot_with_flags([], use_dtb=False)
21 cons.run_command('help')
22 output = cons.get_spawn_output().replace('\r', '')
23 assert 'print command description/usage' in output
25 # Restart afterward to get the normal device tree back
26 u_boot_console.restart_uboot()
28 @pytest.mark.boardspec('sandbox_vpl')
29 def test_vpl_help(u_boot_console):
33 cons.run_command('help')
34 output = cons.get_spawn_output().replace('\r', '')
35 assert 'print command description/usage' in output
37 # Restart afterward to get the normal device tree back
38 u_boot_console.restart_uboot()