[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 14/17] step logfiles: Make substep_* take $logfile, not $script



The $script parameter was used by Standalone to print a message, but
this is no longer done.

It is used by Executive as the value for the "step" column in the
steps table, which shows up as "script" in the output from
sg-report-flight.  But, when running under sg-run-job,
JobDB::Executive already has a better source of the script name: the
parent step (as reported in OSSTEST_TESTID).  When not running under
sg-run-job the use of $0 is good enough.

Finally, it is used by Executive as a logfile name.  But when running
under sg-run-job, JobDB::Executive gets the right logfile name anyway
(as above); and when not running under sg-run-job there is no default
logfile.

Conversely, substeps might organise their own logfile.

So abolish $script from the TestSupport substep API.  Replace it in
substep_start and substep_eval with a $logfile parameter.

Update all call sites to no longer pass $script.  None make their own
logfiles, so none pass the new parameter $logfile.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 Osstest/TestSupport.pm | 10 +++++-----
 ts-examine-serial-post |  2 +-
 ts-xtf-run             |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index a05dd97..6e19b28 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -246,9 +246,9 @@ sub complete_testid ($) {
 }
 
 sub substep_start ($;$) {
-    my ($testid,$script) = @_;
+    my ($testid,$logfile) = @_;
     complete_testid(\$testid);
-    $mjobdb->step_start($testid,undef,$script);
+    $mjobdb->step_start($testid,$logfile);
 }
 
 sub substep_finish ($$) {
@@ -258,10 +258,10 @@ sub substep_finish ($$) {
 }
 
 sub substep_eval ($$;$) {
-    # substep_eval(TESTID, [SCRIPTNAME], sub { ... });
+    # substep_eval(TESTID, [LOGFILE], sub { ... });
     my $fn = pop @_;
-    my ($testid,$script) = @_;
-    substep_start($testid,$script);
+    my ($testid,$logfile) = @_;
+    substep_start($testid,$logfile);
     eval { $fn->(); };
     if (length $@) {
        logm("substep ($testid) failed: $@");
diff --git a/ts-examine-serial-post b/ts-examine-serial-post
index 2d5c103..77d8e5d 100755
--- a/ts-examine-serial-post
+++ b/ts-examine-serial-post
@@ -44,7 +44,7 @@ sub cookies () {
        my $key = $1;
        my $substep = "examine-serial/$key";
        my $ci = { K => $key, C => $r{$rv}, Substep => $substep };
-       substep_start($ci->{Substep}, 'ts-examine-serial-post');
+       substep_start($ci->{Substep});
        push @cookies, $ci;
     }
 }
diff --git a/ts-xtf-run b/ts-xtf-run
index cef45c8..5b136a6 100755
--- a/ts-xtf-run
+++ b/ts-xtf-run
@@ -62,7 +62,7 @@ sub do_one_test ($) {
     my $ret;
     my $osstest_result;
 
-    substep_start($tid, $cmd);
+    substep_start($tid);
 
     if (!eval {
             $output = target_cmd_output_root($ho, <<END, 600);
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.