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