xref: /rk3399_rockchip-uboot/test/py/tests/test_unknown_cmd.py (revision 8a36287a019f5d7532a8a1a7da6aa96e490dbb8a)
1d201506cSStephen Warren# Copyright (c) 2015 Stephen Warren
2d201506cSStephen Warren# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
3d201506cSStephen Warren#
4d201506cSStephen Warren# SPDX-License-Identifier: GPL-2.0
5d201506cSStephen Warren
6d201506cSStephen Warrendef test_unknown_command(u_boot_console):
7*e8debf39SStephen Warren    """Test that executing an unknown command causes U-Boot to print an
8*e8debf39SStephen Warren    error."""
9d201506cSStephen Warren
10d201506cSStephen Warren    # The "unknown command" error is actively expected here,
11d201506cSStephen Warren    # so error detection for it is disabled.
12d201506cSStephen Warren    with u_boot_console.disable_check('unknown_command'):
13d201506cSStephen Warren        response = u_boot_console.run_command('non_existent_cmd')
14d201506cSStephen Warren    assert('Unknown command \'non_existent_cmd\' - try \'help\'' in response)
15