summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-08-07 23:13:35 -0400
committerTom Rini <trini@konsulko.com>2019-08-07 23:13:35 -0400
commitdb857dcbbfe993c21781524e44404f9800db87c7 (patch)
tree6f94410d22fa9bffc0c44feb11241ef8e012edfd /test
parent7127151d538d878bd073ca6d6cca630a4b35b76f (diff)
parent0b6febfdb3cf9b4a51fa65fbd94f9ab2d7738f32 (diff)
downloadu-boot-db857dcbbfe993c21781524e44404f9800db87c7.tar.gz
Merge branch '2019-08-07-master-imports'
- Misc Android / AVB bugfixes (including updating the header from Android). - MediaTek updates - Other assorted bugfixes.
Diffstat (limited to 'test')
-rwxr-xr-xtest/py/tests/test_fit.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/py/tests/test_fit.py b/test/py/tests/test_fit.py
index 8009d2907b..e3210ed43f 100755
--- a/test/py/tests/test_fit.py
+++ b/test/py/tests/test_fit.py
@@ -269,6 +269,11 @@ def test_fit(u_boot_console):
def check_equal(expected_fname, actual_fname, failure_msg):
"""Check that a file matches its expected contents
+ This is always used on out-buffers whose size is decided by the test
+ script anyway, which in some cases may be larger than what we're
+ actually looking for. So it's safe to truncate it to the size of the
+ expected data.
+
Args:
expected_fname: Filename containing expected contents
actual_fname: Filename containing actual contents
@@ -276,6 +281,8 @@ def test_fit(u_boot_console):
"""
expected_data = read_file(expected_fname)
actual_data = read_file(actual_fname)
+ if len(expected_data) < len(actual_data):
+ actual_data = actual_data[:len(expected_data)]
assert expected_data == actual_data, failure_msg
def check_not_equal(expected_fname, actual_fname, failure_msg):
@@ -435,7 +442,8 @@ def test_fit(u_boot_console):
output = cons.run_command_list(cmd.splitlines())
check_equal(kernel, kernel_out, 'Kernel not loaded')
check_equal(control_dtb, fdt_out, 'FDT not loaded')
- check_equal(ramdisk, ramdisk_out, 'Ramdisk not loaded')
+ check_not_equal(ramdisk, ramdisk_out, 'Ramdisk got decompressed?')
+ check_equal(ramdisk + '.gz', ramdisk_out, 'Ramdist not loaded')
cons = u_boot_console