blob: 153133cf28f881120e7d24f3d724ee49d16a1ec9 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001# SPDX-License-Identifier: GPL-2.0
Stephen Warrend2015062016-01-15 11:15:24 -07002# Copyright (c) 2015 Stephen Warren
3# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
Stephen Warrend2015062016-01-15 11:15:24 -07004
Simon Glass5f195142022-04-30 00:56:56 -06005import pytest
6
Stephen Warrend2015062016-01-15 11:15:24 -07007def test_help(u_boot_console):
Stephen Warrene8debf32016-01-26 13:41:30 -07008 """Test that the "help" command can be executed."""
Stephen Warrend2015062016-01-15 11:15:24 -07009
10 u_boot_console.run_command('help')
Simon Glass5f195142022-04-30 00:56:56 -060011
Simon Glassccf24a92022-04-27 13:47:57 -060012@pytest.mark.boardspec('sandbox')
13def test_help_no_devicetree(u_boot_console):
14 try:
15 cons = u_boot_console
16 cons.restart_uboot_with_flags([], use_dtb=False)
17 cons.run_command('help')
18 output = cons.get_spawn_output().replace('\r', '')
19 assert 'print command description/usage' in output
20 finally:
21 # Restart afterward to get the normal device tree back
22 u_boot_console.restart_uboot()
23
Simon Glass5f195142022-04-30 00:56:56 -060024@pytest.mark.boardspec('sandbox_vpl')
25def test_vpl_help(u_boot_console):
26 try:
27 cons = u_boot_console
28 cons.restart_uboot()
29 cons.run_command('help')
30 output = cons.get_spawn_output().replace('\r', '')
31 assert 'print command description/usage' in output
32 finally:
33 # Restart afterward to get the normal device tree back
34 u_boot_console.restart_uboot()