From patchwork Fri Jun 30 16:25:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 9820067 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 94631603F3 for ; Fri, 30 Jun 2017 16:27:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62819286B6 for ; Fri, 30 Jun 2017 16:27:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5711D286C3; Fri, 30 Jun 2017 16:27:59 +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 84CB3286B6 for ; Fri, 30 Jun 2017 16:27:58 +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-0005mA-CI; Fri, 30 Jun 2017 16:25:36 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQyje-0005jU-JK for xen-devel@lists.xenproject.org; Fri, 30 Jun 2017 16:25:34 +0000 Received: from [193.109.254.147] by server-11.bemta-6.messagelabs.com id 17/35-03612-E7B76595; Fri, 30 Jun 2017 16:25:34 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeJIrShJLcpLzFFi42JxWrrBXre2Oiz SYNdNM4vvWyYzOTB6HP5whSWAMYo1My8pvyKBNWP/0g72gtVcFVM3TGVrYJzO0cXIySEh4C9x 4M5xFhCbTUBXomnLX7YuRg4OEQEVidt7DUDCzAILGCUefi8BsYUFUiQ2PjvABmKzCKhKzNo1j xHE5hXwkvh4t5cJYqScxPnjP5lBbE6g+MNpi9hBbCEBT4kX5yawgIwXElCTmLs+HqJVUOLkzC csEKskJA6+eME8gZF3FpLULCSpBYxMqxg1ilOLylKLdI3M9ZKKMtMzSnITM3N0DQ3M9HJTi4s T01NzEpOK9ZLzczcxAgOHAQh2MC5eG3iIUZKDSUmUd+W10EghvqT8lMqMxOKM+KLSnNTiQ4wy HBxKErwrq8IihQSLUtNTK9Iyc4AhDJOW4OBREuGVDQJK8xYXJOYWZ6ZDpE4x6nK8mvD/G5MQS 15+XqqUOG8CyAwBkKKM0jy4EbB4usQoKyXMywh0lBBPQWpRbmYJqvwrRnEORiVh3n6QKTyZeS Vwm14BHcEEdITwjBCQI0oSEVJSDYyeBlsmXf1ferVMLEtezXFOAb+F2wb90JQT8WbXjoVdy66 8tPXd7orGg/PVri4PbtPT9FlW6RH0Z4mizOQ/9+Q3iRfGKv86o97wvu7LEqOCUs5Np456zfK5 IWS24eTiF3mrml4UKrIvC5t5SqqSudRtctHZtU46gbfyLmv68QeeECqSYV9Vf1KJpTgj0VCLu ag4EQAkdXJcogIAAA== X-Env-Sender: prvs=3471c4a24=Ian.Jackson@citrix.com X-Msg-Ref: server-12.tower-27.messagelabs.com!1498839931!103566412!2 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.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 58436 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-12.tower-27.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="438490418" From: Ian Jackson To: Date: Fri, 30 Jun 2017 17:25:15 +0100 Message-ID: <1498839920-17025-13-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 12/17] substep logfiles: Set logfile and step columns correctly for substeps 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 If we are running under sg-run-job, OSSTEST_TESTID will be set to the testid of the parent step (ie, the step created by sg-run-job which relates to the execution of the whole script). Unless the caller has specified otherwise, the log and script are the same as for the parent step. Signed-off-by: Ian Jackson --- Osstest/JobDB/Executive.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm index e1e2052..a7a6696 100644 --- a/Osstest/JobDB/Executive.pm +++ b/Osstest/JobDB/Executive.pm @@ -254,6 +254,19 @@ END status,testid,started) VALUES (?,?,?,?, ?, 'running',?,?) END + my $parent_testid = $ENV{OSSTEST_TESTID}; + if ((!defined $logfile || !defined $script) && defined $parent_testid) { + my $parentq = $dbh_tests->prepare(<execute($flight,$job,$parent_testid); + my $row = $parentq->fetchrow_hashref(); + $logfile //= $row->{logfile}; + $script //= $row->{script}; + }); + } if (!defined $script) { $script = $0; $script =~ s{^.*/}{};