]> xenbits.xensource.com Git - people/royger/osstest.git/commitdiff
step logfiles: Make substep_* take $logfile, not $script
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 29 Jun 2017 12:10:38 +0000 (13:10 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 30 Jun 2017 16:18:27 +0000 (17:18 +0100)
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@eu.citrix.com>
Osstest/TestSupport.pm
ts-examine-serial-post
ts-xtf-run

index a05dd97ab24ba90906d541bc0845c3f25f28561b..6e19b28a24196fb0b031b7e969d86161dca2d9e6 100644 (file)
@@ -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: $@");
index 2d5c103724a702047fda8e3e13dd7d65c9db02ee..77d8e5df7663f352c1af538ae0b86a243f22c08c 100755 (executable)
@@ -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;
     }
 }
index cef45c83f2aa1f3d5a08d0492bce8f9bc26aa2fd..5b136a6fd0c4e3abb33c62aa76339fcb921b15ce 100755 (executable)
@@ -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);