* [U-Boot] [PATCH] test: add NFS download test
@ 2016-09-14 8:29 Guillaume GARDET
2016-09-14 17:28 ` Stephen Warren
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Guillaume GARDET @ 2016-09-14 8:29 UTC (permalink / raw)
To: u-boot
Add a NFS download test, based on TFTP test.
Tested on i.MX6 SabreLite board.
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Tom Rini <trini@konsulko.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Simon Glass <sjg@chromium.org>
---
test/py/tests/test_net.py | 49 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/test/py/tests/test_net.py b/test/py/tests/test_net.py
index 4ab58b4..0884051 100644
--- a/test/py/tests/test_net.py
+++ b/test/py/tests/test_net.py
@@ -47,6 +47,15 @@ env__net_tftp_readable_file = {
"size": 5058624,
"crc32": "c2244b26",
}
+
+# Details regarding a file that may be read from a NFS server. This variable
+# may be omitted or set to None if NFS testing is not possible or desired.
+env__net_nfs_readable_file = {
+ "fn": "ubtest-readable.bin",
+ "addr": 0x10000000,
+ "size": 5058624,
+ "crc32": "c2244b26",
+}
"""
net_set_up = False
@@ -157,3 +166,43 @@ def test_net_tftpboot(u_boot_console):
output = u_boot_console.run_command('crc32 %x $filesize' % addr)
assert expected_crc in output
+
+ at pytest.mark.buildconfigspec('cmd_nfs')
+def test_net_nfs(u_boot_console):
+ """Test the nfs command.
+
+ A file is downloaded from the NFS server, its size and optionally its
+ CRC32 are validated.
+
+ The details of the file to download are provided by the boardenv_* file;
+ see the comment at the beginning of this file.
+ """
+
+ if not net_set_up:
+ pytest.skip('Network not initialized')
+
+ f = u_boot_console.config.env.get('env__net_nfs_readable_file', None)
+ if not f:
+ pytest.skip('No NFS readable file to read')
+
+ addr = f.get('addr', None)
+ if not addr:
+ addr = u_boot_utils.find_ram_base(u_boot_console)
+
+ fn = f['fn']
+ output = u_boot_console.run_command('nfs %x %s' % (addr, fn))
+ expected_text = 'Bytes transferred = '
+ sz = f.get('size', None)
+ if sz:
+ expected_text += '%d' % sz
+ assert expected_text in output
+
+ expected_crc = f.get('crc32', None)
+ if not expected_crc:
+ return
+
+ if u_boot_console.config.buildconfig.get('config_cmd_crc32', 'n') != 'y':
+ return
+
+ output = u_boot_console.run_command('crc32 %x $filesize' % addr)
+ assert expected_crc in output
--
1.8.4.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] test: add NFS download test
2016-09-14 8:29 [U-Boot] [PATCH] test: add NFS download test Guillaume GARDET
@ 2016-09-14 17:28 ` Stephen Warren
2016-09-23 20:52 ` Joe Hershberger
2016-10-13 17:39 ` [U-Boot] " Joe Hershberger
2 siblings, 0 replies; 5+ messages in thread
From: Stephen Warren @ 2016-09-14 17:28 UTC (permalink / raw)
To: u-boot
On 09/14/2016 02:29 AM, Guillaume GARDET wrote:
> Add a NFS download test, based on TFTP test.
> Tested on i.MX6 SabreLite board.
>
> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
>
> Cc: Tom Rini <trini@konsulko.com>
Nit: There shouldn't be a blank line between your s-o-b and any other tags.
Reviewed-by: Stephen Warren <swarren@nvidia.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] test: add NFS download test
2016-09-14 8:29 [U-Boot] [PATCH] test: add NFS download test Guillaume GARDET
2016-09-14 17:28 ` Stephen Warren
@ 2016-09-23 20:52 ` Joe Hershberger
2016-10-07 9:39 ` Guillaume Gardet
2016-10-13 17:39 ` [U-Boot] " Joe Hershberger
2 siblings, 1 reply; 5+ messages in thread
From: Joe Hershberger @ 2016-09-23 20:52 UTC (permalink / raw)
To: u-boot
On Wed, Sep 14, 2016 at 3:29 AM, Guillaume GARDET
<guillaume.gardet@free.fr> wrote:
> Add a NFS download test, based on TFTP test.
> Tested on i.MX6 SabreLite board.
>
> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> Cc: Stephen Warren <swarren@wwwdotorg.org>
> Cc: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
I'll take the blank line out when I apply it.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] test: add NFS download test
2016-09-23 20:52 ` Joe Hershberger
@ 2016-10-07 9:39 ` Guillaume Gardet
0 siblings, 0 replies; 5+ messages in thread
From: Guillaume Gardet @ 2016-10-07 9:39 UTC (permalink / raw)
To: u-boot
Le 23/09/2016 ? 22:52, Joe Hershberger a ?crit :
> On Wed, Sep 14, 2016 at 3:29 AM, Guillaume GARDET
> <guillaume.gardet@free.fr> wrote:
>> Add a NFS download test, based on TFTP test.
>> Tested on i.MX6 SabreLite board.
>>
>> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
>>
>> Cc: Tom Rini <trini@konsulko.com>
>> Cc: Joe Hershberger <joe.hershberger@ni.com>
>> Cc: Stephen Warren <swarren@wwwdotorg.org>
>> Cc: Simon Glass <sjg@chromium.org>
> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
>
> I'll take the blank line out when I apply it.
>
Ping.
Guillaume
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] test: add NFS download test
2016-09-14 8:29 [U-Boot] [PATCH] test: add NFS download test Guillaume GARDET
2016-09-14 17:28 ` Stephen Warren
2016-09-23 20:52 ` Joe Hershberger
@ 2016-10-13 17:39 ` Joe Hershberger
2 siblings, 0 replies; 5+ messages in thread
From: Joe Hershberger @ 2016-10-13 17:39 UTC (permalink / raw)
To: u-boot
Hi Guillaume,
https://patchwork.ozlabs.org/patch/669800/ was applied to u-boot-net.git.
Thanks!
-Joe
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-10-13 17:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-14 8:29 [U-Boot] [PATCH] test: add NFS download test Guillaume GARDET
2016-09-14 17:28 ` Stephen Warren
2016-09-23 20:52 ` Joe Hershberger
2016-10-07 9:39 ` Guillaume Gardet
2016-10-13 17:39 ` [U-Boot] " Joe Hershberger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.