]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
test: py: tests: Add py-test case for zynq aes loadp command
authorT Karthik Reddy <t.karthik.reddy@xilinx.com>
Tue, 12 Mar 2019 14:50:26 +0000 (20:20 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 13 Mar 2019 14:19:22 +0000 (15:19 +0100)
This patch adds py-test case for zynq aes loadp command. It tests
loading partial bitstream to DDR and tests loading partial bitstream
to PL using "zynq aes loadp" command. This test needs to be executed
only in bootmode, if not it wil be skipped.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
test/py/tests/test_zynq_aes.py

index 574d2a9ffda39e0cffeb114f9f56d163f96273d0..48ffa23d22a457ba51e60b044962a2201f30cbbc 100644 (file)
@@ -32,6 +32,7 @@ env__net_static_env_vars = [
 env__zynq_aes_readable_file = {
     "fn": "zynq_aes_image.bin",
     "fnbit": "zynq_aes_bit.bin",
+    "fnpbit": "zynq_aes_par_bit.bin",
     "srcaddr": 0x1000000,
     "dstaddr": 0x2000000,
     "dstlen": "0x1000000",
@@ -117,3 +118,33 @@ def test_zynq_aes_bitstream(u_boot_console):
     expected_zynqaes = 'zynq aes [operation type] <srcaddr>'
     output = u_boot_console.run_command('zynq aes load %x $filesize' % (srcaddr))
     assert expected_zynqaes not in output
+
+
+@pytest.mark.buildconfigspec('cmd_zynq_aes')
+@pytest.mark.buildconfigspec('cmd_net')
+@pytest.mark.buildconfigspec('cmd_dhcp')
+@pytest.mark.buildconfigspec('net')
+# Can be tested on board xhd-zc702-2 - efuse must be blown
+@pytest.mark.xfail
+def test_zynq_aes_partial_bitstream(u_boot_console):
+
+    zynq_aes_pre_commands(u_boot_console)
+    test_net.test_net_dhcp(u_boot_console)
+    test_net.test_net_setup_static(u_boot_console)
+
+    f = u_boot_console.config.env.get('env__zynq_aes_readable_file', None)
+    if not f:
+        pytest.skip('No TFTP readable file to read')
+
+    srcaddr = f.get('srcaddr', None)
+    if not srcaddr:
+      addr = u_boot_utils.find_ram_base(u_boot_console)
+
+    expected_tftp = 'Bytes transferred = '
+    fn = f['fnpbit']
+    output = u_boot_console.run_command('tftpboot %x %s' % (srcaddr, fn))
+    assert expected_tftp in output
+
+    expected_zynqaes = 'zynq aes [operation type] <srcaddr>'
+    output = u_boot_console.run_command('zynq aes loadp %x $filesize' % (srcaddr))
+    assert expected_zynqaes not in output