sg-run-job: nested: Break out nested-hosts-p
PATCH 1/2 sg-run-job: nested: Break out nested-hosts-p
We are going to want to test this elsewhere, too.
No functional change.
Signed-off-by Ian Jackson <[email protected]>
--- sg-run-job | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
sg-run-job +6 -1
@@ -75,7 +75,7 @@ proc run-job {job} { while 1 { per-host-finish - if {![llength $nested_layers_hosts]} break + if {![nested-hosts-p]} break per-host-ts . final-poweroff {ts-host-powercycle --power=0}
@@ -257,6 +257,11 @@ proc per-host-ts {iffail ident script args} { } } +proc nested-hosts-p {} { + global nested_layers_hosts + expr {!![llength nested_layers_hosts]} +} + proc nested-layer-descend {nested_hosts} { # We save need_xen_hosts on a stack in nested_layers_hosts # It gets popped again during the cleanup part of run-job
Signature · 7 lines
1.7.10.4 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
PATCH 2/2 sg-run-job: nested: Report nested log capture failure as `fail'
Previously this was `broken' (ie, infrastructure failure), which is not really true - the usual reason is that the L0 has crashed, so that efforts to manipulate the L1 do not succeed.
Tested using OSSTEST_SIMULATE and this:
diff --git a/sg-run-job b/sg-run-job
index 8b2d5e1..0f8e278 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -181,6 +181,11 @@ proc spawn-ts {iffail testid args} {
set xprefix {}
if {[var-or-default env(OSSTEST_SIMULATE) 0]} { set xprefix echo } +puts stderr ">$ts $real_args"
+ switch -glob "$ts $real_args" {
+ {ts-logs-capture *} { set xprefix "bomb $xprefix" }
+ }
+
set log [jobdb::step-log-filename $flight $jobinfo(job) $stepno $ts]
set redirects {< /dev/null}
if {[string length $log]} {Signed-off-by Ian Jackson <[email protected]>
--- sg-run-job | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
sg-run-job +3 -2
@@ -33,8 +33,9 @@ proc per-host-prep {} { } proc per-host-finish {} { + if {[nested-hosts-p]} { set broken fail } { set broken broken } per-host-ts . = {ts-leak-check check} - per-host-ts !broken capture-logs/@(*) ts-logs-capture + per-host-ts !$broken capture-logs/@(*) ts-logs-capture } proc run-job {job} {
@@ -259,7 +260,7 @@ proc per-host-ts {iffail ident script args} { proc nested-hosts-p {} { global nested_layers_hosts - expr {!![llength nested_layers_hosts]} + expr {!![llength $nested_layers_hosts]} } proc nested-layer-descend {nested_hosts} {
Signature · 7 lines
1.7.10.4 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel