mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-20 22:21:41 +00:00
test: Add a function to restart U-Boot
Add a proper function for this rather than using internal functions. Use it in the single call site. Also, do a restart at the end of the vboot test to reset to the normal device tree. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
parent
851271a71a
commit
27c087d58a
2 changed files with 8 additions and 2 deletions
|
@ -65,8 +65,7 @@ def test_vboot(u_boot_console):
|
||||||
sha_algo: Either 'sha1' or 'sha256', to select the algorithm to
|
sha_algo: Either 'sha1' or 'sha256', to select the algorithm to
|
||||||
use.
|
use.
|
||||||
"""
|
"""
|
||||||
cons.cleanup_spawn()
|
cons.restart_uboot()
|
||||||
cons.ensure_spawned()
|
|
||||||
with cons.log.section('Verified boot %s %s' % (sha_algo, test_type)):
|
with cons.log.section('Verified boot %s %s' % (sha_algo, test_type)):
|
||||||
output = cons.run_command_list(
|
output = cons.run_command_list(
|
||||||
['sb load hostfs - 100 %stest.fit' % tmpdir,
|
['sb load hostfs - 100 %stest.fit' % tmpdir,
|
||||||
|
@ -190,4 +189,6 @@ def test_vboot(u_boot_console):
|
||||||
test_with_algo('sha1')
|
test_with_algo('sha1')
|
||||||
test_with_algo('sha256')
|
test_with_algo('sha256')
|
||||||
finally:
|
finally:
|
||||||
|
# Go back to the original U-Boot with the correct dtb.
|
||||||
cons.config.dtb = old_dtb
|
cons.config.dtb = old_dtb
|
||||||
|
cons.restart_uboot()
|
||||||
|
|
|
@ -393,6 +393,11 @@ class ConsoleBase(object):
|
||||||
pass
|
pass
|
||||||
self.p = None
|
self.p = None
|
||||||
|
|
||||||
|
def restart_uboot(self):
|
||||||
|
"""Shut down and restart U-Boot."""
|
||||||
|
self.cleanup_spawn()
|
||||||
|
self.ensure_spawned()
|
||||||
|
|
||||||
def get_spawn_output(self):
|
def get_spawn_output(self):
|
||||||
"""Return the start-up output from U-Boot
|
"""Return the start-up output from U-Boot
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue