test: Add DEBUG output option to test-fit.py
Sometimes it is useful to see the output from U-Boot, so add an option to make this easier. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
b5493d17bd
commit
cc4477289d
|
|
@ -20,6 +20,9 @@ import struct
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
# Enable printing of all U-Boot output
|
||||||
|
DEBUG = True
|
||||||
|
|
||||||
# The 'command' library in patman is convenient for running commands
|
# The 'command' library in patman is convenient for running commands
|
||||||
base_path = os.path.dirname(sys.argv[0])
|
base_path = os.path.dirname(sys.argv[0])
|
||||||
patman = os.path.join(base_path, '../../tools/patman')
|
patman = os.path.join(base_path, '../../tools/patman')
|
||||||
|
|
@ -103,6 +106,10 @@ sb save hostfs 0 %(ramdisk_addr)x %(ramdisk_out)s %(ramdisk_size)x
|
||||||
reset
|
reset
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
def debug_stdout(stdout):
|
||||||
|
if DEBUG:
|
||||||
|
print stdout
|
||||||
|
|
||||||
def make_fname(leaf):
|
def make_fname(leaf):
|
||||||
"""Make a temporary filename
|
"""Make a temporary filename
|
||||||
|
|
||||||
|
|
@ -328,6 +335,7 @@ def run_fit_test(mkimage, u_boot):
|
||||||
# We could perhaps reduce duplication with some loss of readability
|
# We could perhaps reduce duplication with some loss of readability
|
||||||
set_test('Kernel load')
|
set_test('Kernel load')
|
||||||
stdout = command.Output(u_boot, '-d', control_dtb, '-c', cmd)
|
stdout = command.Output(u_boot, '-d', control_dtb, '-c', cmd)
|
||||||
|
debug_stdout(stdout)
|
||||||
if read_file(kernel) != read_file(kernel_out):
|
if read_file(kernel) != read_file(kernel_out):
|
||||||
fail('Kernel not loaded', stdout)
|
fail('Kernel not loaded', stdout)
|
||||||
if read_file(control_dtb) == read_file(fdt_out):
|
if read_file(control_dtb) == read_file(fdt_out):
|
||||||
|
|
@ -352,6 +360,7 @@ def run_fit_test(mkimage, u_boot):
|
||||||
params['fdt_load'] = 'load = <%#x>;' % params['fdt_addr']
|
params['fdt_load'] = 'load = <%#x>;' % params['fdt_addr']
|
||||||
fit = make_fit(mkimage, params)
|
fit = make_fit(mkimage, params)
|
||||||
stdout = command.Output(u_boot, '-d', control_dtb, '-c', cmd)
|
stdout = command.Output(u_boot, '-d', control_dtb, '-c', cmd)
|
||||||
|
debug_stdout(stdout)
|
||||||
if read_file(kernel) != read_file(kernel_out):
|
if read_file(kernel) != read_file(kernel_out):
|
||||||
fail('Kernel not loaded', stdout)
|
fail('Kernel not loaded', stdout)
|
||||||
if read_file(control_dtb) != read_file(fdt_out):
|
if read_file(control_dtb) != read_file(fdt_out):
|
||||||
|
|
@ -365,6 +374,7 @@ def run_fit_test(mkimage, u_boot):
|
||||||
params['ramdisk_load'] = 'load = <%#x>;' % params['ramdisk_addr']
|
params['ramdisk_load'] = 'load = <%#x>;' % params['ramdisk_addr']
|
||||||
fit = make_fit(mkimage, params)
|
fit = make_fit(mkimage, params)
|
||||||
stdout = command.Output(u_boot, '-d', control_dtb, '-c', cmd)
|
stdout = command.Output(u_boot, '-d', control_dtb, '-c', cmd)
|
||||||
|
debug_stdout(stdout)
|
||||||
if read_file(ramdisk) != read_file(ramdisk_out):
|
if read_file(ramdisk) != read_file(ramdisk_out):
|
||||||
fail('Ramdisk not loaded', stdout)
|
fail('Ramdisk not loaded', stdout)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue