Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
Stephen Warren | 10e5063 | 2016-01-15 11:15:24 -0700 | [diff] [blame] | 2 | # Copyright (c) 2015 Stephen Warren |
| 3 | # Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. |
Stephen Warren | 10e5063 | 2016-01-15 11:15:24 -0700 | [diff] [blame] | 4 | |
Simon Glass | e62205d | 2022-04-30 00:56:56 -0600 | [diff] [blame] | 5 | import pytest |
| 6 | |
Stephen Warren | 10e5063 | 2016-01-15 11:15:24 -0700 | [diff] [blame] | 7 | def test_help(u_boot_console): |
Stephen Warren | 75e731e | 2016-01-26 13:41:30 -0700 | [diff] [blame] | 8 | """Test that the "help" command can be executed.""" |
Stephen Warren | 10e5063 | 2016-01-15 11:15:24 -0700 | [diff] [blame] | 9 | |
| 10 | u_boot_console.run_command('help') |
Simon Glass | e62205d | 2022-04-30 00:56:56 -0600 | [diff] [blame] | 11 | |
Simon Glass | 9a3adfa | 2022-04-27 13:47:57 -0600 | [diff] [blame^] | 12 | @pytest.mark.boardspec('sandbox') |
| 13 | def 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 Glass | e62205d | 2022-04-30 00:56:56 -0600 | [diff] [blame] | 24 | @pytest.mark.boardspec('sandbox_vpl') |
| 25 | def 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() |