From: Ian Jackson Date: Fri, 6 Jul 2018 11:08:33 +0000 (+0100) Subject: ts-depriv-audit-qemu: Leaked substeps are `blocked', and then script is fail X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c7cc5c34201713c5dcd30eb5a0b849b8f35c9ab4;p=people%2Froyger%2Fosstest.git ts-depriv-audit-qemu: Leaked substeps are `blocked', and then script is fail If thus script crash in some non-substep-specific operation, the substeps may have been created (and thus be in the db as `running'). Leaving them like this is not allowed: it is treated by sg-run-job, and by the archaeologists as an internal error. If this happens, what we want is for the script as a whole to be `fail', and for the failing tests to be `blocked'. The former will spot if this crash is a regression. The latter will avoid treating the substeps themselves as regressions. Reported-by: Anthony PERARD Signed-off-by: Ian Jackson --- diff --git a/ts-depriv-audit-qemu b/ts-depriv-audit-qemu index 81bd5c0..5d09350 100755 --- a/ts-depriv-audit-qemu +++ b/ts-depriv-audit-qemu @@ -118,10 +118,21 @@ sub audit_fish () { foreach my $cl (sort keys %classes) { substep_finish("/$cl", $classes{$cl} || 'pass'); # (if there are no fds of this class, maybe they were all closed) + $classes{$cl} = 'reported'; } logm("audit complete..."); } +END { + foreach my $cl (sort keys %classes) { + my $st = $classes{$cl}; + next if $st eq 'reported'; + logm("substep not reported, at exit: $cl, $st"); + substep_finish("/$cl", 'blocked'); + $? = -1; # in case we were trying to succeed + } +} + #----- administrivia, main program, etc. ----- sub mode_create () {