test_000_version.py 934 B

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