diff mbox

[U-Boot] test/py: dfu: allow boardenv to specify test sizes

Message ID 1454012056-12960-1-git-send-email-swarren@wwwdotorg.org
State Accepted
Commit 26db3a617b38cc1bed1ce100381d2c4ccbb55e42
Delegated to: Simon Glass
Headers show

Commit Message

Stephen Warren Jan. 28, 2016, 8:14 p.m. UTC
From: Stephen Warren <swarren@nvidia.com>

Allow the env__dfu_configs boardenv data to specify the set of DFU
transfer sizes to test. Manually specifying test sizes is useful if you
wish to test multiple DFU configurations (e.g. SD card ext4 filesystem, SD
card whole raw partition, RAM, etc.), but don't want to test every
single transfer size on each, to avoid bloating the overall time taken by
testing. If the boardenv doesn't specify a set of sizes, the built-in list
is used as a default, preserving backwards-compatibility.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 test/py/tests/test_dfu.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Simon Glass Jan. 29, 2016, 3:52 a.m. UTC | #1
On 28 January 2016 at 13:14, Stephen Warren <swarren@wwwdotorg.org> wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> Allow the env__dfu_configs boardenv data to specify the set of DFU
> transfer sizes to test. Manually specifying test sizes is useful if you
> wish to test multiple DFU configurations (e.g. SD card ext4 filesystem, SD
> card whole raw partition, RAM, etc.), but don't want to test every
> single transfer size on each, to avoid bloating the overall time taken by
> testing. If the boardenv doesn't specify a set of sizes, the built-in list
> is used as a default, preserving backwards-compatibility.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
>  test/py/tests/test_dfu.py | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)

Acked-by: Simon Glass <sjg@chromium.org>
Simon Glass Jan. 29, 2016, 4:02 a.m. UTC | #2
On 28 January 2016 at 20:52, Simon Glass <sjg@chromium.org> wrote:
> On 28 January 2016 at 13:14, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> From: Stephen Warren <swarren@nvidia.com>
>>
>> Allow the env__dfu_configs boardenv data to specify the set of DFU
>> transfer sizes to test. Manually specifying test sizes is useful if you
>> wish to test multiple DFU configurations (e.g. SD card ext4 filesystem, SD
>> card whole raw partition, RAM, etc.), but don't want to test every
>> single transfer size on each, to avoid bloating the overall time taken by
>> testing. If the boardenv doesn't specify a set of sizes, the built-in list
>> is used as a default, preserving backwards-compatibility.
>>
>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>> ---
>>  test/py/tests/test_dfu.py | 12 ++++++++++--
>>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-dm, thanks!
diff mbox

Patch

diff --git a/test/py/tests/test_dfu.py b/test/py/tests/test_dfu.py
index bb70008af300..093e8d067871 100644
--- a/test/py/tests/test_dfu.py
+++ b/test/py/tests/test_dfu.py
@@ -36,6 +36,14 @@  env__dfu_configs = (
         "fixture_id": "emmc",
         "alt_info": "/dfu_test.bin ext4 0 1;/dfu_dummy.bin ext4 0 1",
         "cmd_params": "mmc 0",
+        # This value is optional.
+        # If present, it specified the set of transfer sizes tested.
+        # If missing, a default list of sizes will be used, which covers
+        #   various useful corner cases.
+        # Manually specifying test sizes is useful if you wish to test 4 DFU
+        # configurations, but don't want to test every single transfer size
+        # on each, to avoid bloating the overall time taken by testing.
+        "test_sizes": (63, 64, 65),
     },
 )
 
@@ -52,7 +60,7 @@  device.)
 # The set of file sizes to test. These values trigger various edge-cases such
 # as one less than, equal to, and one greater than typical USB max packet
 # sizes, and similar boundary conditions.
-test_sizes = (
+test_sizes_default = (
     64 - 1,
     64,
     64 + 1,
@@ -245,7 +253,7 @@  def test_dfu(u_boot_console, env__usb_dev_port, env__dfu_config):
     if not first_usb_dev_port:
         first_usb_dev_port = env__usb_dev_port
     if env__usb_dev_port == first_usb_dev_port:
-        sizes = test_sizes
+        sizes = env__dfu_config.get('test_sizes', test_sizes_default)
     else:
         sizes = []