]> xenbits.xensource.com Git - people/royger/osstest.git/commitdiff
sg-run-job: Allow suppression of consequences of per-host-ts fail
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 2 May 2018 15:20:39 +0000 (16:20 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 11 Jun 2018 14:38:57 +0000 (15:38 +0100)
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
sg-run-job

index aa97ee61fa37a9843431b8bb1c355eafdc3118f6..e1dc2d2c28ddfb84fc6d03c95330a37a01a0723e 100755 (executable)
@@ -216,7 +216,8 @@ proc testid_matches_globs {testid globs} {
 #       where STATUS is the job/step status to be used if the step
 #       status is not as expected, and the special meanings are:
 #
-#           -      Only for run-ts; suprresses exception on failure.
+#           -      for run-ts; suprresses exception on failure.
+#                  for per-host-ts; suppresses consequences of failure.
 #           !      Run this even if the job is being truncated.
 #                  (for per-host-ts, even if the job is no longer $ok)
 #           .      Shorthand for "fail"
@@ -286,6 +287,10 @@ proc iffail-check {iffail okexpr iffail_status_var} {
     global ok
     upvar 1 $iffail_status_var iffail_status
 
+    if {[regexp {^-} $iffail]} {
+       # move - to the end, since docs say it should have come first
+       regsub {^-} "$iffail-" {} iffail
+    }
     if {[regexp {^!?\.$} $iffail]} {
         regsub {\.$} $iffail fail iffail
     }
@@ -444,8 +449,10 @@ proc per-host-ts {iffail ident script args} {
     foreach host $need_xen_hosts await $awaitl {
         if {![reap-ts $await]} {
             jobdb::logputs stderr "$flight.$jobinfo(job) @$host $args failed"
-            set failed 1
-            set ok 0
+           if {[string compare - $iffail_status]} {
+               set failed 1
+               set ok 0
+           }
         }
     }