From patchwork Fri Jun 30 16:25:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 9820097 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E2E63603F2 for ; Fri, 30 Jun 2017 16:28:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 100E6286A4 for ; Fri, 30 Jun 2017 16:28:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04BC5286AE; Fri, 30 Jun 2017 16:28:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A1B15286B4 for ; Fri, 30 Jun 2017 16:28:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQyjg-0005nL-Vt; Fri, 30 Jun 2017 16:25:36 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQyjf-0005k6-6A for xen-devel@lists.xenproject.org; Fri, 30 Jun 2017 16:25:35 +0000 Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id 50/E3-01862-E7B76595; Fri, 30 Jun 2017 16:25:34 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeJIrShJLcpLzFFi42JxWrrBXre2Oiz SYPNWc4vvWyYzOTB6HP5whSWAMYo1My8pvyKBNeP+kmbmgudCFQvnJjcwruLvYuTgkBDwl1i9 Ja+LkZODTUBXomnLXzaQsIiAisTtvQYgYWaBBYwSD7+XgNjCAu4SP07vYgIpYRFQlbjRnA8S5 hXwkpg+6RQ7iC0hICdx/vhPZhCbEyj+cNoisLiQgKfEi3MTWEBahQTUJOauj4doFZQ4OfMJC8 QmCYmDL14wT2DknYUkNQtJagEj0ypGjeLUorLUIl0jE72kosz0jJLcxMwcXUMDY73c1OLixPT UnMSkYr3k/NxNjMCQqWdgYNzB+Oq43yFGSQ4mJVHelddCI4X4kvJTKjMSizPii0pzUosPMcpw cChJ8FpXhUUKCRalpqdWpGXmAIMXJi3BwaMkwisbBJTmLS5IzC3OTIdInWLU5Xg14f83JiGWv Py8VClx3gSQGQIgRRmleXAjYJF0iVFWSpiXkYGBQYinILUoN7MEVf4VozgHo5Iwbz/IFJ7MvB K4Ta+AjmACOkJ4RgjIESWJCCmpBkZjQ1PPDP1v+1i+rZD4v8FD5O+5wlNPf0X5OOeF1a+c4/9 7n/I6o6DARr1g/vRtenMX8/xrfV3vqVbBcOR0auWqGfm/5haWFcpoi+5gerPKzWn5atPNT7Nu pLXZ6wd5ZDC1rtmyRGA7k4yamaWOS+iEaVuuqIqZXiw4zmc/7WhXaUisANf5E0osxRmJhlrMR cWJAIFa4uefAgAA X-Env-Sender: prvs=3471c4a24=Ian.Jackson@citrix.com X-Msg-Ref: server-8.tower-31.messagelabs.com!1498839926!103474145!5 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 60221 invoked from network); 30 Jun 2017 16:25:33 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-8.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 30 Jun 2017 16:25:33 -0000 X-IronPort-AV: E=Sophos;i="5.40,287,1496102400"; d="scan'208";a="438490420" From: Ian Jackson To: Date: Fri, 30 Jun 2017 17:25:16 +0100 Message-ID: <1498839920-17025-14-git-send-email-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1498839920-17025-1-git-send-email-ian.jackson@eu.citrix.com> References: <1498839920-17025-1-git-send-email-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Cc: Andrew Cooper , Wei Liu , Ian Jackson Subject: [Xen-devel] [OSSTEST PATCH 13/17] step logfiles: Honour new logfile column X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP There are the following places in the tree where we construct the logfile name from stepno and step: * tcl/JobDB-Executive main decision about logfile name } OK * JobDB::Executive final fallback for new steps } keep * steps-logfile-constraint.sql default for old data } * sg-report-flight (twice) } both read stepno and step from the db; * determine-failure-reasons } here we teach them to try logfile first Now substep logs will have correct links in the job output, as soon as the logfile column has the right data. This is part of a "Populate-then-rely" schema change, as described in schema/README.updates. Specifically, this is the step: 6. Optionally commit: code which reads new column, but which tolerates it containing NULL/DEFAULT. (`add' is already Needed.) Signed-off-by: Ian Jackson --- determine-failure-reasons | 2 +- sg-report-flight | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/determine-failure-reasons b/determine-failure-reasons index a3b2100..89c67e6 100755 --- a/determine-failure-reasons +++ b/determine-failure-reasons @@ -52,7 +52,7 @@ sub gethosts ($) { } while (my $step= $stepsq->fetchrow_hashref) { - my $logfile = "$step->{stepno}.$step->{step}.log"; + my $logfile = $step->{logfile} // "$step->{stepno}.$step->{step}.log"; $step->{Log}= "$c{Logs}/$step->{flight}/$step->{job}/".$logfile; if (!stat $step->{Log}) { diff --git a/sg-report-flight b/sg-report-flight index ec30ed0..4e3560e 100755 --- a/sg-report-flight +++ b/sg-report-flight @@ -1001,7 +1001,8 @@ END printf H "%s", show_abs_time $step->{started}; my $st= $step->{status}; - my $logfilename= "$step->{stepno}.$step->{step}.log"; + my $logfilename= $step->{logfile} + // "$step->{stepno}.$step->{step}.log"; printf H "%s", (html_status2_colour_priority($st))[0], encode_entities(uri_escape($logfilename)), @@ -1167,7 +1168,7 @@ END : ('#ffff00',250); } my $ch = "bgcolor=\"$bgc\""; - my $logfilename= "$s->{stepno}.$s->{step}.log"; + my $logfilename= $s->{logfile} // "$s->{stepno}.$s->{step}.log"; my $h = "{job}). "/".encode_entities($logfilename)."\">"; #print H "[$s->{stepno}] ";