From patchwork Thu Jan 28 20:14:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 574864 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 0FAFC140BCE for ; Fri, 29 Jan 2016 07:14:45 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 28ECCA754A; Thu, 28 Jan 2016 21:14:41 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Wk_uOOZYhV9g; Thu, 28 Jan 2016 21:14:41 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AB5CAA7526; Thu, 28 Jan 2016 21:14:40 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6258CA7526 for ; Thu, 28 Jan 2016 21:14:37 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uYWVWo3V3tud for ; Thu, 28 Jan 2016 21:14:37 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from avon.wwwdotorg.org (avon.wwwdotorg.org [70.85.31.133]) by theia.denx.de (Postfix) with ESMTPS id 13937A74FF for ; Thu, 28 Jan 2016 21:14:33 +0100 (CET) Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id A50B46348; Thu, 28 Jan 2016 13:14:18 -0700 (MST) Received: from swarren-lx1.nvidia.com (localhost [127.0.0.1]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id 73407E4626; Thu, 28 Jan 2016 13:14:51 -0700 (MST) From: Stephen Warren To: Simon Glass Date: Thu, 28 Jan 2016 13:14:16 -0700 Message-Id: <1454012056-12960-1-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 2.7.0 X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.98.6 at avon.wwwdotorg.org X-Virus-Status: Clean Cc: u-boot@lists.denx.de, Stephen Warren Subject: [U-Boot] [PATCH] test/py: dfu: allow boardenv to specify test sizes X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Stephen Warren 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 Acked-by: Simon Glass --- test/py/tests/test_dfu.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 = []