@@ -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(<<END);
+ SELECT logfile, step FROM steps
+ WHERE flight=? AND job=? AND testid=?
+END
+ db_retry($flight,[qw(running)], $dbh_tests,[],sub {
+ $parentq->execute($flight,$job,$parent_testid);
+ my $row = $parentq->fetchrow_hashref();
+ $logfile //= $row->{logfile};
+ $script //= $row->{script};
+ });
+ }
if (!defined $script) {
$script = $0;
$script =~ s{^.*/}{};
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 <Ian.Jackson@eu.citrix.com> --- Osstest/JobDB/Executive.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+)