]> xenbits.xensource.com Git - osstest.git/commitdiff
Honour OSSTEST_SIMULATE_FAIL in sg-run-job
authorIan Jackson <iwj@xenproject.org>
Thu, 8 Oct 2020 16:15:25 +0000 (17:15 +0100)
committerIan Jackson <iwj@xenproject.org>
Thu, 8 Oct 2020 19:05:18 +0000 (20:05 +0100)
This is a Tcl list of globs for <job>.<step>, and allows for
simulating particular test failures.

Signed-off-by: Ian Jackson <iwj@xenproject.org>
sg-run-job

index dd76d4f23259c7b21373571a0d32633812a1e132..c64ae02619cd9eaed7c774b7222fca9a7cad1cd7 100755 (executable)
@@ -406,7 +406,14 @@ proc spawn-ts {iffail testid args} {
     jobdb::spawn-step-commit $flight $jobinfo(job) $stepno $testid
 
     set xprefix {}
-    if {[var-or-default env(OSSTEST_SIMULATE) 0]} { set xprefix echo }
+    if {[var-or-default env(OSSTEST_SIMULATE) 0]} {
+       set xprefix echo
+       foreach ent [var-or-default env(OSSTEST_SIMULATE_FAIL) {}] {
+           if {[string match $ent $jobinfo(job).$testid]} {
+               set xprefix OSSTEST_SIMULATE_FAIL
+           }
+       }
+    }
 
     set log [jobdb::step-log-filename $flight $jobinfo(job) $stepno $ts]
     set redirects {}