diff mbox series

[OSSTEST,45/82] sg-run-job: Detect improper use of @ iffail with run-ts

Message ID 20201007180024.7932-46-iwj@xenproject.org (mailing list archive)
State New, archived
Headers show
Series Reuse test hosts | expand

Commit Message

Ian Jackson Oct. 7, 2020, 5:59 p.m. UTC
From: Ian Jackson <ian.jackson@eu.citrix.com>

Only per-host-ts understands this.  This is a bit of a bear trap, so
arrange to bail rather than putting strange step status values with
`@' at the front in the database...

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 sg-run-job | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/sg-run-job b/sg-run-job
index a074cd42..067b28db 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -317,6 +317,9 @@  proc iffail-check {iffail okexpr iffail_status_var} {
     if {![regsub {^!} $iffail {} iffail_status]} {
 	if {![uplevel 1 [list expr $okexpr]]} { return 0 }
     }
+    if {[regexp {^@} $iffail]} {
+	error "internal error - @ only valid for iffail with per-host-ts"
+    }
     return 1
 }