]> git.sur5r.net Git - u-boot/blob - test/py/tests/test_000_version.py
bd089ab5439d5b1f6915dbdd38b850cd462eefaa
[u-boot] / test / py / tests / test_000_version.py
1 # SPDX-License-Identifier: GPL-2.0
2 # Copyright (c) 2015 Stephen Warren
3 # Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
4
5 # pytest runs tests the order of their module path, which is related to the
6 # filename containing the test. This file is named such that it is sorted
7 # first, simply as a very basic sanity check of the functionality of the U-Boot
8 # command prompt.
9
10 def test_version(u_boot_console):
11     """Test that the "version" command prints the U-Boot version."""
12
13     # "version" prints the U-Boot sign-on message. This is usually considered
14     # an error, so that any unexpected reboot causes an error. Here, this
15     # error detection is disabled since the sign-on message is expected.
16     with u_boot_console.disable_check('main_signon'):
17         response = u_boot_console.run_command('version')
18     # Ensure "version" printed what we expected.
19     u_boot_console.validate_version_string_in_text(response)