Skip to contentSkip to conversation

test/py: Add support for loading image via tftp to specified location

PATCH Superseded Michal Simek 2 participants 3 messages Mar 31, 2016 – Apr 4, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test/py: Add support for loading image via tftp to specified location

For example this setting:

env__net_tftp_readable_file = {
    "fn": "ep108/image.ub",
    "addr": "0x10000000",
    "size": 25846296,
    "crc32": "b726f9de",
}

---

 test/py/tests/test_net.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
test/py/tests/test_net.py +6 -1
index 07393eb1fdf8..4c578273aee3 100644
@@ -135,7 +135,12 @@ def test_net_tftpboot(u_boot_console):
     if not f:
         pytest.skip('No TFTP readable file to read')
 
-    addr = u_boot_utils.find_ram_base(u_boot_console)
+    addr = f.get('addr', None)
+    if addr:
+        addr = int(addr,16)
+    else:
+        addr = u_boot_utils.find_ram_base(u_boot_console)
+
     fn = f['fn']
     output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn))
     expected_text = 'Bytes transferred = '
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 test/py: Add support for loading image via tftp to specified location

Quoted 5 lines · Michal Simek

For example this setting:

env__net_tftp_readable_file = {
     "fn": "ep108/image.ub",
     "addr": "0x10000000",

Why not remove the quotes, so the value is an integer already...

Could you please add the "addr" field into the example at the top of test_net.py too?

test/py/tests/test_net.py def test_net_tftpboot(u_boot_console): · line 140

Quoted 3 lines
test/py/tests/test_net.py +1 -0
 
+        addr = int(addr,16)

There should be a space after the comma.

... but removing the quotes as I mentioned above would allow removing this int() call altogether.

#2 lore raw

PATCH 1/1 test/py: Add support for loading image via tftp to specified location

Quoted 12 lines · Stephen Warren
Quoted 5 lines · Michal Simek

For example this setting:

env__net_tftp_readable_file = {
     "fn": "ep108/image.ub",
     "addr": "0x10000000",

Why not remove the quotes, so the value is an integer already...

Could you please add the "addr" field into the example at the top of test_net.py too?

Quoted 8 lines

test/py/tests/test_net.py def test_net_tftpboot(u_boot_console): · line 140

Quoted 3 lines
test/py/tests/test_net.py +1 -0
 
+        addr = int(addr,16)

There should be a space after the comma.

... but removing the quotes as I mentioned above would allow removing this int() call altogether.

All added to v2 and sent.

Thanks,
Michal