From b4b464a4f70883e325b5fefbebdca698ef4b116a Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 19 Jan 2018 10:43:05 +0100 Subject: [PATCH] test: py: DDR address for writing data back is also randomized Make sure that test is using diferent offsets for reading data back. Signed-off-by: Michal Simek --- test/py/tests/test_qspi.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/py/tests/test_qspi.py b/test/py/tests/test_qspi.py index 47444616590..ebce1b89a14 100644 --- a/test/py/tests/test_qspi.py +++ b/test/py/tests/test_qspi.py @@ -152,6 +152,7 @@ def qspi_write_twice(u_boot_console): old_size = 0 # TODO maybe add alignment and different start for pages for size in random.randint(4, page_size), random.randint(page_size, total_size), total_size: + offset = random.randint(4, page_size) addr = u_boot_utils.find_ram_base(u_boot_console) size = size - old_size output = u_boot_console.run_command('crc32 %x %x' % (addr + total_size, size)) @@ -163,9 +164,9 @@ def qspi_write_twice(u_boot_console): # print expected_crc32 output = u_boot_console.run_command('sf write %x %x %x' % (addr + total_size, old_size, size)) assert expected_write in output - output = u_boot_console.run_command('sf read %x %x %x' % (addr + total_size + 10, old_size, size)) + output = u_boot_console.run_command('sf read %x %x %x' % (addr + total_size + offset, old_size, size)) assert expected_read in output - output = u_boot_console.run_command('crc32 %x %x' % (addr + total_size + 10, size)) + output = u_boot_console.run_command('crc32 %x %x' % (addr + total_size + offset, size)) assert expected_crc32 in output old_size = size -- 2.47.3