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