From patchwork Tue Aug 9 03:20:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 657072 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3s7fgW5RD8z9t0H for ; Tue, 9 Aug 2016 13:20:55 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3s7fgW4fKwzDqpQ for ; Tue, 9 Aug 2016 13:20:55 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3s7fgK3hvyzDqf3 for ; Tue, 9 Aug 2016 13:20:45 +1000 (AEST) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u793JuQp106111 for ; Mon, 8 Aug 2016 23:20:43 -0400 Received: from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159]) by mx0b-001b2d01.pphosted.com with ESMTP id 24n9h0nmxm-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 08 Aug 2016 23:20:41 -0400 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 8 Aug 2016 21:20:41 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 8 Aug 2016 21:20:36 -0600 X-IBM-Helo: d03dlp02.boulder.ibm.com X-IBM-MailFrom: stewart@linux.vnet.ibm.com Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id F2BA43E4003E for ; Mon, 8 Aug 2016 21:20:35 -0600 (MDT) Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u793KZ2314680516 for ; Mon, 8 Aug 2016 20:20:35 -0700 Received: from localhost (unknown [127.0.0.1]) by IMSVA (Postfix) with SMTP id D3DBC90001 for ; Mon, 8 Aug 2016 21:20:35 -0600 (MDT) X-IMSS-HAND-OFF-DIRECTIVE: 127.0.0.1:10026 Received: from birb.localdomain (unknown [9.81.198.92]) by b03ledav004.gho.boulder.ibm.com (Postfix) with SMTP id D7E3C90001; Mon, 8 Aug 2016 21:20:26 -0600 (MDT) Received: by birb.localdomain (Postfix, from userid 1000) id 2BBF6229EA8D; Tue, 9 Aug 2016 13:20:22 +1000 (AEST) From: Stewart Smith To: skiboot@lists.ozlabs.org Date: Tue, 9 Aug 2016 13:20:20 +1000 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16080903-0028-0000-0000-00000555296E X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005568; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000178; SDB=6.00742023; UDB=6.00349227; IPR=6.00514581; BA=6.00004651; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012258; XFM=3.00000011; UTC=2016-08-09 03:20:40 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16080903-0029-0000-0000-00002E36263E Message-Id: <1470712821-24994-1-git-send-email-stewart@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-09_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608090036 Subject: [Skiboot] [PATCH 1/2] boot-test: Add -k and -K options to keep logs on fail or always X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Signed-off-by: Stewart Smith --- external/boot-tests/boot_test.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/external/boot-tests/boot_test.sh b/external/boot-tests/boot_test.sh index 40fc954..ed42007 100755 --- a/external/boot-tests/boot_test.sh +++ b/external/boot-tests/boot_test.sh @@ -70,10 +70,14 @@ EOF msg "Waiting for linux has timed out" msg "Boot log follows:" cat $LINUXBOOT_LOG - rm -f $LINUXBOOT_LOG + if [ $keep_log_failure -eq 0 ]; then + rm -f $LINUXBOOT_LOG + fi return 1 else - rm -f $LINUXBOOT_LOG + if [ $keep_log_success -eq 0 ]; then + rm -f $LINUXBOOT_LOG + fi return 0 fi } @@ -156,6 +160,10 @@ Common Options: successful booting into Petitboot will not be detected with this option. -b BMC type (bmc or fsp). + + -k keep logs on failure. + + -K keep logs on success or failure. EOF exit 1; } @@ -180,7 +188,9 @@ PNOR="" LID[0]="" LID[1]="" LID[2]="" -while getopts "hvdpB1:2:3:P:t:b:" OPT; do +keep_log_success=0 +keep_log_failure=0 +while getopts "kKhvdpB1:2:3:P:t:b:" OPT; do case "$OPT" in v) V=1; @@ -191,6 +201,13 @@ while getopts "hvdpB1:2:3:P:t:b:" OPT; do d) set -vx; ;; + k) + keep_log_failure=1; + ;; + K) + keep_log_failure=1; + keep_log_success=1; + ;; B) bootonly=1; if [ $firmware_supplied -eq 1 ]; then