test_000_version.py 936 B

1234567891011121314151617181920
  1. # Copyright (c) 2015 Stephen Warren
  2. # Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
  3. #
  4. # SPDX-License-Identifier: GPL-2.0
  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. def test_version(u_boot_console):
  10. '''Test that the "version" command prints the U-Boot version.'''
  11. # "version" prints the U-Boot sign-on message. This is usually considered
  12. # an error, so that any unexpected reboot causes an error. Here, this
  13. # error detection is disabled since the sign-on message is expected.
  14. with u_boot_console.disable_check('main_signon'):
  15. response = u_boot_console.run_command('version')
  16. # Ensure "version" printed what we expected.
  17. u_boot_console.validate_version_string_in_text(response)