From patchwork Sun Apr 28 02:17:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 240220 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 A358D2C00A8 for ; Sun, 28 Apr 2013 12:20:41 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 122C94A19E; Sun, 28 Apr 2013 04:19:51 +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 hrpq5xRrubi5; Sun, 28 Apr 2013 04:19:50 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D39FC4A1C1; Sun, 28 Apr 2013 04:18:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3EE074A1B0 for ; Sun, 28 Apr 2013 04:18:35 +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 MXb4gy0u3Ryl for ; Sun, 28 Apr 2013 04:18:34 +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 mail-vb0-f73.google.com (mail-vb0-f73.google.com [209.85.212.73]) by theia.denx.de (Postfix) with ESMTPS id 32DBA4A18C for ; Sun, 28 Apr 2013 04:18:24 +0200 (CEST) Received: by mail-vb0-f73.google.com with SMTP id 11so41049vbe.0 for ; Sat, 27 Apr 2013 19:18:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=6ph+mzLx0C+xjomudNaOMu3CNUIuh8x4TTlyQL/ZF7A=; b=i8cLI93JRyOae4oLByPb8dvbDoHpYwO1pa+smlYeMXH7JC88MsmRzDFmWU1p8vcDW/ XgrAwDyPeXrKsEkznZBWGkJGVbrLG4rNv9Esw16T5zZ+ibAiZUHG8SN0NRf6BJdg4Ohn 0OjTp40JVUEXwQBoMV33XBFeEvtlhYmgy5BOgCfNK5z7RReEmajb5xsHsvK5/HMYzlp1 TkWA5NG/xF9N+6BobxhJm+cniCM9YfaCPVvIF714OsYeZT1WcpX0LS9OnglaoyBHOAXS juPf0LAf9pvXgqScVz345Butk0sSAFc978eZH0Q1AxX2VV0Tt3L+Wa23tfLCnsqce90z kk4g== X-Received: by 10.236.93.116 with SMTP id k80mr1319304yhf.32.1367115502949; Sat, 27 Apr 2013 19:18:22 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id a64si992741yhi.1.2013.04.27.19.18.22 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Sat, 27 Apr 2013 19:18:22 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.83.1]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id C56215A402F; Sat, 27 Apr 2013 19:18:22 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id A472016089C; Sat, 27 Apr 2013 19:18:22 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 27 Apr 2013 19:17:51 -0700 Message-Id: <1367115472-29531-15-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1367115472-29531-1-git-send-email-sjg@chromium.org> References: <1367115472-29531-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQn66JpuRPHpi1poppXnkzbDRmDeFFA+dQ5PDgsXAi1VFLnQx1j/dMeELTdEVlywkfGvY/Sq/gg6pOeVEZH8jdhFEe89EaioZpoGGCGUk9iNDNMMWicdEAyIpim5ftviAlChHLWxe1An4eXYFtswGSbEoawKvr+NAdQYxi+9qOz/RWR6h33xQKPRVFlsYBek7V/z5ok/ Cc: Tom Rini , u-boot-review@google.com Subject: [U-Boot] [RFC PATCH 14/15] Show stdout on error in fit-test 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 this test fails it is useful to see the output from U-Boot. Add printing of this information on failure. Signed-off-by: Simon Glass --- test/image/test-fit.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/test/image/test-fit.py b/test/image/test-fit.py index c4e8211..aad9f59 100755 --- a/test/image/test-fit.py +++ b/test/image/test-fit.py @@ -272,12 +272,13 @@ def set_test(name): test_name = name print name -def fail(msg): +def fail(msg, stdout): """Raise an error with a helpful failure message Args: msg: Message to display """ + print stdout raise ValueError("Test '%s' failed: %s" % (test_name, msg)) def run_fit_test(mkimage, u_boot): @@ -341,11 +342,11 @@ def run_fit_test(mkimage, u_boot): set_test('Kernel load') stdout = command.Output(u_boot, '-d', control_dtb, '-c', cmd) if read_file(kernel) != read_file(kernel_out): - fail('Kernel not loaded') + fail('Kernel not loaded', stdout) if read_file(control_dtb) == read_file(fdt_out): - fail('FDT loaded but should be ignored') + fail('FDT loaded but should be ignored', stdout) if read_file(ramdisk) == read_file(ramdisk_out): - fail('Ramdisk loaded but should not be') + fail('Ramdisk loaded but should not be', stdout) # Find out the offset in the FIT where U-Boot has found the FDT line = find_matching(stdout, 'Booting using the fdt blob at ') @@ -357,7 +358,7 @@ def run_fit_test(mkimage, u_boot): real_fit_offset = data.find(fdt_magic, 4) if fit_offset != real_fit_offset: fail('U-Boot loaded FDT from offset %#x, FDT is actually at %#x' % - (fit_offset, real_fit_offset)) + (fit_offset, real_fit_offset), stdout) # Now a kernel and an FDT set_test('Kernel + FDT load') @@ -365,11 +366,11 @@ def run_fit_test(mkimage, u_boot): fit = make_fit(mkimage, params) stdout = command.Output(u_boot, '-d', control_dtb, '-c', cmd) if read_file(kernel) != read_file(kernel_out): - fail('Kernel not loaded') + fail('Kernel not loaded', stdout) if read_file(control_dtb) != read_file(fdt_out): - fail('FDT not loaded') + fail('FDT not loaded', stdout) if read_file(ramdisk) == read_file(ramdisk_out): - fail('Ramdisk loaded but should not be') + fail('Ramdisk loaded but should not be', stdout) # Try a ramdisk set_test('Kernel + FDT + Ramdisk load') @@ -378,7 +379,7 @@ def run_fit_test(mkimage, u_boot): fit = make_fit(mkimage, params) stdout = command.Output(u_boot, '-d', control_dtb, '-c', cmd) if read_file(ramdisk) != read_file(ramdisk_out): - fail('Ramdisk not loaded') + fail('Ramdisk not loaded', stdout) def run_tests(): """Parse options, run the FIT tests and print the result"""