]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
test/py: Add support for extending timeout for large files
authorMichal Simek <michal.simek@xilinx.com>
Fri, 29 Apr 2016 13:52:48 +0000 (15:52 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 15 Jul 2016 07:04:58 +0000 (09:04 +0200)
Slow network or big image filesize is not able to be finished
in 30s. Add option to user to extend timeout(in miliseconds).

env__net_tftp_readable_file = {
    "fn": "192.168.0.105:zc706/image.ub",
    "addr": 0x20000000,
    "size": 20484981,
    "crc32": "873a30ae",
    "timeout": 50000,
}

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
test/py/tests/test_net.py

index 4ab58b44248a80c6144b3bd5b45374bbb765de4d..100ff73454781aaa4c91815a4e9f557297dfd45e 100644 (file)
@@ -46,6 +46,7 @@ env__net_tftp_readable_file = {
     "addr": 0x10000000,
     "size": 5058624,
     "crc32": "c2244b26",
+    "timeout": 50000,
 }
 """
 
@@ -140,8 +141,12 @@ def test_net_tftpboot(u_boot_console):
     if not addr:
         addr = u_boot_utils.find_ram_base(u_boot_console)
 
+    timeout = f.get('timeout', u_boot_console.p.timeout)
+
     fn = f['fn']
-    output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn))
+    with u_boot_console.temporary_timeout(timeout):
+        output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn))
+
     expected_text = 'Bytes transferred = '
     sz = f.get('size', None)
     if sz: