]> 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>
Tue, 2 Feb 2021 12:49:32 +0000 (13:49 +0100)
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>
State: pending

test/py/tests/test_net.py

index 9ca6743afd9c8fb46b113416f90423d6696f3c88..e51af90f00867d33e33b6d6f80f2c1c9fe3c785f 100644 (file)
@@ -45,6 +45,7 @@ env__net_tftp_readable_file = {
     'addr': 0x10000000,
     'size': 5058624,
     'crc32': 'c2244b26',
+    'timeout": 50000,
 }
 
 # Details regarding a file that may be read from a NFS server. This variable
@@ -146,15 +147,20 @@ def test_net_tftpboot(u_boot_console):
 
     addr = f.get('addr', None)
 
+    timeout = f.get('timeout', u_boot_console.p.timeout)
+
     fn = f['fn']
-    if not addr:
-        output = u_boot_console.run_command('tftpboot %s' % (fn))
-    else:
-        output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn))
+    with u_boot_console.temporary_timeout(timeout):
+        if not addr:
+            output = u_boot_console.run_command('tftpboot %s' % (fn))
+        else:
+            output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn))
+
     expected_text = 'Bytes transferred = '
     sz = f.get('size', None)
     if sz:
         expected_text += '%d' % sz
+    assert 'TIMEOUT' not in output
     assert expected_text in output
 
     expected_crc = f.get('crc32', None)