public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] test/py: Add support for loading image via tftp to specified location
@ 2016-03-31  8:32 Michal Simek
  2016-03-31 16:31 ` Stephen Warren
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Simek @ 2016-03-31  8:32 UTC (permalink / raw)
  To: u-boot

For example this setting:

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

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 test/py/tests/test_net.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/test/py/tests/test_net.py b/test/py/tests/test_net.py
index 07393eb1fdf8..4c578273aee3 100644
--- a/test/py/tests/test_net.py
+++ b/test/py/tests/test_net.py
@@ -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 = '
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] test/py: Add support for loading image via tftp to specified location
  2016-03-31  8:32 [U-Boot] [PATCH] test/py: Add support for loading image via tftp to specified location Michal Simek
@ 2016-03-31 16:31 ` Stephen Warren
  2016-04-04 18:06   ` Michal Simek
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Warren @ 2016-03-31 16:31 UTC (permalink / raw)
  To: u-boot

On 03/31/2016 02:32 AM, Michal Simek wrote:
> 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?

> diff --git a/test/py/tests/test_net.py b/test/py/tests/test_net.py

> +        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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] test/py: Add support for loading image via tftp to specified location
  2016-03-31 16:31 ` Stephen Warren
@ 2016-04-04 18:06   ` Michal Simek
  0 siblings, 0 replies; 3+ messages in thread
From: Michal Simek @ 2016-04-04 18:06 UTC (permalink / raw)
  To: u-boot

On 31.3.2016 18:31, Stephen Warren wrote:
> On 03/31/2016 02:32 AM, Michal Simek wrote:
>> 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?
> 
>> diff --git a/test/py/tests/test_net.py b/test/py/tests/test_net.py
> 
>> +        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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-04 18:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-31  8:32 [U-Boot] [PATCH] test/py: Add support for loading image via tftp to specified location Michal Simek
2016-03-31 16:31 ` Stephen Warren
2016-04-04 18:06   ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox