From patchwork Tue Apr 19 15:51:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Majewski?= X-Patchwork-Id: 612212 X-Patchwork-Delegate: l.majewski@samsung.com 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 3qq8dP0xwwz9t8g for ; Wed, 20 Apr 2016 01:51:37 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8F189A765E; Tue, 19 Apr 2016 17:51:30 +0200 (CEST) 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 7aerqMmLYrkf; Tue, 19 Apr 2016 17:51:30 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A0364A7660; Tue, 19 Apr 2016 17:51:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4E350A7616 for ; Tue, 19 Apr 2016 17:51:21 +0200 (CEST) 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 mwjmmZg4BwYG for ; Tue, 19 Apr 2016 17:51:21 +0200 (CEST) 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 mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by theia.denx.de (Postfix) with ESMTPS id D85B4A7498 for ; Tue, 19 Apr 2016 17:51:20 +0200 (CEST) Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O5W02IL91D97190@mailout3.samsung.com> for u-boot@lists.denx.de; Wed, 20 Apr 2016 00:51:16 +0900 (KST) X-AuditID: cbfee61b-f792f6d000001a2b-e7-571653f4527f Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id F3.57.06699.4F356175; Wed, 20 Apr 2016 00:51:16 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O5W004RI1D1KL50@mmp1.samsung.com>; Wed, 20 Apr 2016 00:51:16 +0900 (KST) From: Lukasz Majewski To: u-boot@lists.denx.de, Stephen Warren , Stephen Warren Date: Tue, 19 Apr 2016 17:51:23 +0200 Message-id: <1461081084-16649-2-git-send-email-l.majewski@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1461081084-16649-1-git-send-email-l.majewski@samsung.com> References: <1460130291-24223-1-git-send-email-l.majewski@samsung.com> <1461081084-16649-1-git-send-email-l.majewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCLMWRmVeSWpSXmKPExsVy+t9jAd0vwWLhBtcPCVhsnLGe1eLhVX+L HXfuM1u8ecRt8ebhZkaLN22NjBY7Lt9gsTgw9z2Lxbct2xgtbkxvYbV4dbCNxeLt3k52Bx6P 2Q0XWTzmzTrB4rFz1l12j7N3djB6rJv2ltmjt/kdm0ffllWMHttPTmLy2Dg3NIAzissmJTUn syy1SN8ugSvjxrwpLAXvRSq6/q1ibGB8xd/FyMkhIWAiMenmZSYIW0ziwr31bF2MXBxCAksZ JXbOmc8C4fxhlGiZvBWsik1AT+Lz3adgtohAusTNc5uYQIqYBY4zSeydOoMdJCEskCYx8c8/ ZhCbRUBVom/zarA4r4CbRPuXLawQ6xQlup9NYAOxOQXcJX5OPsUOsa2ZUWLZh/dMExh5FzAy rGKUSC1ILihOSs81ykst1ytOzC0uzUvXS87P3cQIDttn0jsYD+9yP8QowMGoxMO7okg0XIg1 say4MvcQowQHs5IIb7m/WLgQb0piZVVqUX58UWlOavEhRmkOFiVx3sf/14UJCaQnlqRmp6YW pBbBZJk4OKUaGNdohBxb3XncaEbGP619PPrWxtFW13cXCkyO/HJb/7Rq5otjHs3prtHnF4Uq Sz9u2pAssCHm8aOrfC0ST1W9VWtWfp34LzisQjzw2VvdlafaZV83pBsz/wroaOZZtS/7nUr9 6h1LdRn65LPfRJYlXX84/f1i31UVvTcebj1pa3JQOm5pu9IpIyWW4oxEQy3mouJEAAZC2qFX AgAA Cc: Marek Vasut , b.zolnierkie@samsung.com, Samuel Egli , Przemyslaw Marczak Subject: [U-Boot] [PATCH v2 2/3] tests: py: dfu: Add functionality to set different u-boot's dfu env variable 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" By default (on almost all systems) the dfu env variable, which defines available alt settings, is named as "dfu_alt_info". However on some platforms (i.e. Odroid XU3), the 'dfu_alt_info' is concatenated from other variables - namely 'dfu_alt_boot' and 'dfu_alt_system' at run time (when one types 'dfu 0 mmc 0' for first time). 'dfu_alt_boot' describes alt settings which depend on boot medium - for example boot loader's LBA sectors which are different on eMMC and SD card because of e.g. MBR/GPT. 'dfu_alt_system' describes board agnostic alt settings - like rootfs, kernel. On such system we can only append/modify this env variable. Because of the above, we must have way to modify other than "dfu_ale_info" variable to perform tests. Signed-off-by: Lukasz Majewski --- Changes for v2: - Rewrite of "alt_info_env_name" variable description - Use of get() method on python's dictionary to easily obtain default value --- test/py/tests/test_dfu.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/py/tests/test_dfu.py b/test/py/tests/test_dfu.py index df3b561..2ed38ad0 100644 --- a/test/py/tests/test_dfu.py +++ b/test/py/tests/test_dfu.py @@ -44,6 +44,14 @@ env__dfu_configs = ( # 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), + # This value is optional. + # The name of the environment variable that the the dfu command reads + # alt info from. If unspecified, this defaults to dfu_alt_info, which is + # valid for most systems. Some systems use a different variable name. + # One example is the Odroid XU3, which automatically generates + # $dfu_alt_info, each time the dfu command is run, by concatenating + # $dfu_alt_boot and $dfu_alt_system. + "alt_info_env_name": "dfu_alt_system", }, ) @@ -124,7 +132,11 @@ def test_dfu(u_boot_console, env__usb_dev_port, env__dfu_config): u_boot_console.log.action( 'Starting long-running U-Boot dfu shell command') - cmd = 'setenv dfu_alt_info "%s"' % env__dfu_config['alt_info'] + dfu_alt_info_env = env__dfu_config.get('alt_info_env_name', \ + 'dfu_alt_info') + + cmd = 'setenv "%s" "%s"' % (dfu_alt_info_env, + env__dfu_config['alt_info']) u_boot_console.run_command(cmd) cmd = 'dfu 0 ' + env__dfu_config['cmd_params']