]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
test: py: Extend fpga test with fit image with external data
authorMichal Simek <michal.simek@xilinx.com>
Mon, 18 Feb 2019 12:22:56 +0000 (13:22 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 16 Apr 2019 09:51:34 +0000 (11:51 +0200)
Images are created
mkimage -f fit.its -E  download-fit-external.ub

and test expects these entries.

env__fpga_under_test = {
    ...
    "mkimage_fit_external": download-fit-external.ub",
    "mkimage_fit_external_size": xxxxx,
    ...
}

Test download file and loads it to fpga.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
test/py/tests/test_fpga.py

index 798f6eed3dc941b7451f0bdcdcf2414d5d0c8d7f..e3bb7b41c749f7522b9d91e37c23fd78a561d16e 100644 (file)
@@ -353,6 +353,19 @@ def test_fpga_loadmk_legacy_gz(u_boot_console):
     output = u_boot_console.run_command('fpga loadmk %x %x && echo %s' % (dev, addr, expected_text))
     assert expected_text in output
 
+@pytest.mark.buildconfigspec('cmd_fpga')
+@pytest.mark.buildconfigspec('cmd_fpga_loadmk')
+@pytest.mark.buildconfigspec('fit')
+@pytest.mark.buildconfigspec('cmd_echo')
+def test_fpga_loadmk_fit_external(u_boot_console):
+    f, dev, addr, bit, bit_size = load_file_from_var(u_boot_console, 'mkimage_fit_external')
+
+    u_boot_console.run_command('imi %x' % (addr))
+
+    expected_text = 'FPGA loaded successfully'
+    output = u_boot_console.run_command('fpga loadmk %x %x:fpga && echo %s' % (dev, addr, expected_text))
+    assert expected_text in output
+
 @pytest.mark.buildconfigspec('cmd_fpga')
 @pytest.mark.buildconfigspec('cmd_fpga_loadmk')
 @pytest.mark.buildconfigspec('fit')