From patchwork Fri Sep 12 06:27:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 388491 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 02348140141 for ; Fri, 12 Sep 2014 16:28:01 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9D6D9A7704; Fri, 12 Sep 2014 08:27:59 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 m4kGfIZdGP7Q; Fri, 12 Sep 2014 08:27:59 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CEB68A7700; Fri, 12 Sep 2014 08:27:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 86A59A76FD for ; Fri, 12 Sep 2014 08:27:49 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 Z6XjFQittzVR for ; Fri, 12 Sep 2014 08:27:38 +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 pollux.denx.de (host-82-135-33-74.customer.m-online.net [82.135.33.74]) by theia.denx.de (Postfix) with ESMTP id 84BE7A76F6 for ; Fri, 12 Sep 2014 08:27:32 +0200 (CEST) Received: by pollux.denx.de (Postfix, from userid 515) id F37826A87; Fri, 12 Sep 2014 08:27:31 +0200 (CEST) From: Heiko Schocher To: u-boot@lists.denx.de Date: Fri, 12 Sep 2014 08:27:30 +0200 Message-Id: <1410503250-13761-1-git-send-email-hs@denx.de> X-Mailer: git-send-email 1.8.3.1 Cc: Stephen Warren , Roger Meier Subject: [U-Boot] [PATCH] test: dfu: script: wrong md5sum on nand partitions X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de when uplaoding a file, at least from a nand partition, the complete mtd nand partition size is transferred. This leads in a wrong md5sum as the filesize is different between the downloaded file and the uploaded file. Limit the uploaded filesize to the downloaded fixes this. Signed-off-by: Heiko Schocher Cc: Lukasz Majewski Cc: Stephen Warren Cc: Roger Meier --- Tested this on the siemens boards, with current ml I get: Init script for generating data necessary for DFU test script OK ========================================================================================= DFU EP0 transmission test program Trouble shoot -> disable DBG (even the KERN_DEBUG) in the UDC driver @ -> TRATS2 # dfu 0 mmc 0 ========================================================================================= File: dat_960.img TX: md5sum:2947e8f573bc34ba3791f991bd2da869 RX: md5sum:cde0b2024d8ddb55eee9d4b51264ad67 -------> FAILED with this patch: Init script for generating data necessary for DFU test script OK ========================================================================================= DFU EP0 transmission test program Trouble shoot -> disable DBG (even the KERN_DEBUG) in the UDC driver @ -> TRATS2 # dfu 0 mmc 0 ========================================================================================= File: dat_960.img TX: md5sum:2947e8f573bc34ba3791f991bd2da869 RX: md5sum:2947e8f573bc34ba3791f991bd2da869 -------> OK --- test/dfu/dfu_gadget_test.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/dfu/dfu_gadget_test.sh b/test/dfu/dfu_gadget_test.sh index 2f5b7db..5084a29 100755 --- a/test/dfu/dfu_gadget_test.sh +++ b/test/dfu/dfu_gadget_test.sh @@ -45,6 +45,7 @@ dfu_test_file () { printf "$COLOUR_GREEN ========================================================================================= $COLOUR_DEFAULT\n" printf "File:$COLOUR_GREEN %s $COLOUR_DEFAULT\n" $1 + filesize=$(stat -c '%s' $1) dfu-util -D $1 -a $TARGET_ALT_SETTING >> $LOG_FILE 2>&1 || die $? echo -n "TX: " @@ -54,9 +55,11 @@ dfu_test_file () { dfu-util -D ${DIR}/dfudummy.bin -a $TARGET_ALT_SETTING_B >> $LOG_FILE 2>&1 || die $? + N_FILE_FULL=$DIR$RCV_DIR${1:2}"_rcv_full" N_FILE=$DIR$RCV_DIR${1:2}"_rcv" - dfu-util -U $N_FILE -a $TARGET_ALT_SETTING >> $LOG_FILE 2>&1 || die $? + dfu-util -U $N_FILE_FULL -a $TARGET_ALT_SETTING >> $LOG_FILE 2>&1 || die $? + dd if=$N_FILE_FULL of=$N_FILE bs=$filesize count=1 >> $LOG_FILE 2>&1 || die $? echo -n "RX: " calculate_md5sum $N_FILE