Miscellaneous improvements
cover Miscellaneous improvements
These patches were accumulated during the Xen 4.16 freeze and as RM I chose to defer them. I am submitting them to osstest pretest now.
Ian Jackson (12):
make-flight: do_examine_one: add firmware argument
ts-memdisk-try-append: Reindent (nfc)
ts-memdisk-try-append: Enable perl warnings
ts-memdisk-try-append: More defensive case test
examination: skip memdisk on non-BIOS hosts, run per-firmware on x86
starvation: Only count "pass" and "fail" as done jobs
sg-run-job: Do not set a step status to pass unless it's running
TestSupport: sub broken: break out "$msg"
TestSupport: sub broken: Add a newline
TestSupport: sub broken: exit with status 0 for skip
TestSupport: sub broken: document that it does not return.
ts-memdisk-try-append: Fix for fact that broken() does not return
Roger Pau Monne (1):
ts-xen-install: enable timestamp on guests logs
Osstest/Executive.pm | 3 ++- Osstest/TestSupport.pm | 13 ++++++++++-- make-flight | 24 +++++++++++++++++++-- mfi-common | 1 + tcl/JobDB-Executive.tcl | 1 + ts-hosts-allocate-Executive | 5 ++++- ts-memdisk-try-append | 42 +++++++++++++++++++++++++------------ ts-xen-install | 2 +- 8 files changed, 71 insertions(+), 20 deletions(-)
Signature · 1 line
2.20.1
PATCH 1/13 make-flight: do_examine_one: add firmware argument
Nothing sets this yet.
No functional change (checked with standalone-generate-dump-flight-runvars)
--- make-flight | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
make-flight +13 -2
@@ -687,20 +687,31 @@ do_pv_debian_tests () { } do_examine_one () { + local firmware="$1" + case "$branch" in xen-unstable) ;; # only likely to regress on -unstable osstest) ;; # very likely to regress linux-*) ;; # often seems to regress *) return ;; # stuff used for guests is irrelevant esac + + local firmware_suffix + local firmware_hostflag + if [ "$firmware" ]; then + firmware_suffix=-$firmware + firmware_hostflag=,PropEq:Firmware:bios:$firmware + fi + local freebsd_runvars # set_freebsd_runvars expects $arch to be set to the desired FreeBSD arch. local arch=$dom0arch # Pass true to not append any hostflags when creating the FreeBSD runvars. set_freebsd_runvars true - job_create_test test-$xenarch$kern-$dom0arch-examine \ + job_create_test test-$xenarch$kern-$dom0arch-examine${firmware_suffix} \ host-examine-xen xl $xenarch $dom0arch \ - all_hostflags=$most_hostflags $freebsd_runvars + all_hostflags=$most_hostflags$firmware_hostflag \ + $freebsd_runvars } test_matrix_do_one () {
Signature · 1 line
2.20.1
PATCH 2/13 ts-memdisk-try-append: Reindent (nfc)
In reply to Ian Jackson--- ts-memdisk-try-append | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
ts-memdisk-try-append +8 -8
@@ -19,17 +19,17 @@ set -xe -o posix arch=`perl -I. -e ' - use Osstest; - use Osstest::TestSupport; + use Osstest; + use Osstest::TestSupport; - tsreadconfig(); + tsreadconfig(); - our $whhost = pop @ARGV; # arg parsing bodge - $whhost ||= "host"; - our $ho = selecthost($whhost); + our $whhost = pop @ARGV; # arg parsing bodge + $whhost ||= "host"; + our $ho = selecthost($whhost); - print $ho->{Arch} or die $!; - ' "$@"` + print $ho->{Arch} or die $!; + ' "$@"` case "$arch" in amd64)
Signature · 1 line
2.20.1
PATCH 3/13 ts-memdisk-try-append: Enable perl warnings
In reply to Ian Jackson--- ts-memdisk-try-append | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ts-memdisk-try-append +1 -1
@@ -18,7 +18,7 @@ set -xe -o posix -arch=`perl -I. -e ' +arch=`perl -I. -we ' use Osstest; use Osstest::TestSupport;
Signature · 1 line
2.20.1
PATCH 4/13 ts-memdisk-try-append: More defensive case test
In reply to Ian Jackson--- ts-memdisk-try-append | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
ts-memdisk-try-append +5 -5
@@ -34,14 +34,14 @@ arch=`perl -I. -we ' case "$arch" in amd64) ;; -'') - echo >&2 'Job arch retrieval failed?' - exit 1 - ;; -*) +[a-z]*) echo "Arch $arch not supported for memdisk tests" exit 0 ;; +*) + echo >&2 'Job arch retrieval failed?' + exit 1 + ;; esac if ./ts-freebsd-host-install --test-boot --record-append $@; then
Signature · 1 line
2.20.1
PATCH 5/13 examination: skip memdisk on non-BIOS hosts, run per-firmware on x86
In reply to Ian JacksonThis is a combination of two changes:
ts-memdisk-try-append: skip memdisk test on non-BIOS hosts
make-flight: examine: Insist on -bios and -uefi tests on x86
This will let us skip ts-memdisk-try-append on non-bios platforms without risking regression. It will also definitely spot regressions which will occur on any uefi host.
standalone-generate-dump-flight-runvars reveals the changes are as follows:
New jobs
test-amd64-i386-examine-bios test-amd64-i386-examine-uefi
test-amd64-amd64-examine-bios test-amd64-amd64-examine-uefi
added everywhere that has the corresponding plain job, namely
osstest
linux-*
xen-unstable These jobs are just like the plain jobs, except that one of
,PropEq:Firmware:bios:bios ,PropEq:Firmware:bios:uefi
has been added to the end of all_hostflags.
--- make-flight | 9 +++++++++ mfi-common | 1 + ts-memdisk-try-append | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+)
make-flight +9 -0
@@ -736,6 +736,15 @@ test_matrix_do_one () { do_credit12_tests do_examine_one + case "$dom0arch" in + i386|amd64) + # Test on BIOS, which makes sure we test one where FreeBSD should + # work. See ts-memdisk-try-append, and set_freebsd_runvars in + # mfi-common. + do_examine_one bios + do_examine_one uefi + ;; + esac # No further arm tests at the moment if [ $dom0arch = armhf -o $dom0arch = arm64 ]; then
mfi-common +1 -0
@@ -163,6 +163,7 @@ set_freebsd_runvars () { if [ x$no_hostflags != xtrue ]; then # osstest doesn't yet know how to install FreeBSD on UEFI hosts, so # limit the usable hardware to boxes that boot from BIOS. + # See also in ts-memdisk-try-append. freebsd_runvars="all_hostflags,=PropEq:Firmware:bios:bios" fi
ts-memdisk-try-append +18 -0
@@ -28,6 +28,20 @@ arch=`perl -I. -we ' $whhost ||= "host"; our $ho = selecthost($whhost); + if (get_target_property($ho,"firmware") ne "bios") { + # osstest does not yet know how to install FreeBSD on UEFI hosts + # See also in set_freebsd_runvars in mfi_common + + # Skipping this test on non-BIOS does not lead to pushes + # where this test is broken, because make-flght test_matrix_do_one + # arranges to run this test on BIOS too. + + broken("skipping memdisk because firmware is not bios", + "skip"); + print "SKIP\n" or die $!; + exit 0; + } + print $ho->{Arch} or die $!; ' "$@"`
@@ -38,6 +52,10 @@ amd64) echo "Arch $arch not supported for memdisk tests" exit 0 ;; +SKIP) + echo "Step skipped." + exit 0 + ;; *) echo >&2 'Job arch retrieval failed?' exit 1
Signature · 1 line
2.20.1
PATCH 6/13 starvation: Only count "pass" and "fail" as done jobs
In reply to Ian JacksonThe main effect is to treat "broken" and "blocked" jobs as not part of the flight for starvation calculations.
This is correct for commissioning flights and OK for other flights.
--- Osstest/Executive.pm | 3 ++- ts-hosts-allocate-Executive | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-)
Osstest/Executive.pm +2 -1
@@ -1148,7 +1148,8 @@ END # to allow for slow jobs, compared to other jobs # W number of jobs waiting - strictly, jobs in states # preparing queued running -# D number of jobs done - strictly, other states +# D number of jobs done - strictly, jobs in states +# pass fail # tuning parameters: # Xt X when D=9 W=1, ie cancel one job out of ten # Xh X when D=1 W=1, ie cancel one job out of two
ts-hosts-allocate-Executive +4 -1
@@ -846,11 +846,14 @@ sub starving ($$$) { # is indistinguishable from a flight which is at the head # of the queue for a small set of resources. return (0, "job $j status $st, don't give up just yet"); - } else { + } elsif ($st eq 'pass' || + $st eq 'fail') { $d++; return (0, "job $j status $st but no step finished time!") unless defined $fin; $maxfin = $fin if $fin > $maxfin; + } else { + # disregard - neither W or D } } # we quit if the total time from the start of the flight
Signature · 1 line
2.20.1
PATCH 7/13 sg-run-job: Do not set a step status to pass unless it's running
In reply to Ian JacksonThis avoids skip etc. being treated as pass.
--- tcl/JobDB-Executive.tcl | 1 + 1 file changed, 1 insertion(+)
tcl/JobDB-Executive.tcl +1 -0
@@ -326,6 +326,7 @@ proc step-set-status {flight job stepno st} { AND status<>'broken' AND status<>'starved' AND status<>'fail' + AND NOT ('$st' = 'pass' AND status <> 'running') " set pause 0 db-execute-array stopinfo "
Signature · 1 line
2.20.1
PATCH 8/13 TestSupport: sub broken: break out "$msg"
In reply to Ian JacksonNo functional change.
--- Osstest/TestSupport.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Osstest/TestSupport.pm +4 -2
@@ -281,8 +281,10 @@ sub broken ($;$) { AND (status='queued' OR status='running' OR status='preparing') END }); - die uc($newst).": $m; ". ($affected>0 ? "marked $flight.$job $newst" - : "($flight.$job not marked $newst)"); + my $msg = uc($newst).": $m; ". + ($affected>0 ? "marked $flight.$job $newst" + : "($flight.$job not marked $newst)"); + die $msg; } sub complete_testid ($) {
Signature · 1 line
2.20.1
PATCH 9/13 TestSupport: sub broken: Add a newline
In reply to Ian JacksonThis suppresses printing of the the line number, which is not useful.
--- Osstest/TestSupport.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Osstest/TestSupport.pm +2 -1
@@ -283,7 +283,8 @@ END }); my $msg = uc($newst).": $m; ". ($affected>0 ? "marked $flight.$job $newst" - : "($flight.$job not marked $newst)"); + : "($flight.$job not marked $newst)"). + "\n"; die $msg; }
Signature · 1 line
2.20.1
PATCH 10/13 TestSupport: sub broken: exit with status 0 for skip
In reply to Ian JacksonOtherwise, whatever calls us will set the step to fail (or something).
--- Osstest/TestSupport.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
Osstest/TestSupport.pm +6 -1
@@ -285,7 +285,12 @@ END ($affected>0 ? "marked $flight.$job $newst" : "($flight.$job not marked $newst)"). "\n"; - die $msg; + if ($newst =~ m{^(?:skip)$}) { + print STDERR $msg; + exit 0; + } else { + die $msg; + } } sub complete_testid ($) {
Signature · 1 line
2.20.1
PATCH 11/13 TestSupport: sub broken: document that it does not return.
In reply to Ian Jackson--- Osstest/TestSupport.pm | 1 + 1 file changed, 1 insertion(+)
Osstest/TestSupport.pm +1 -0
@@ -261,6 +261,7 @@ sub fail ($) { sub broken ($;$) { my ($m, $newst) = @_; # must be run outside transaction + # dies or exits my $affected; $newst= 'broken' unless defined $newst; eval {
Signature · 1 line
2.20.1
PATCH 12/13 ts-memdisk-try-append: Fix for fact that broken() does not return
In reply to Ian Jackson--- ts-memdisk-try-append | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
ts-memdisk-try-append +1 -3
@@ -38,8 +38,6 @@ arch=`perl -I. -we ' broken("skipping memdisk because firmware is not bios", "skip"); - print "SKIP\n" or die $!; - exit 0; } print $ho->{Arch} or die $!;
@@ -52,7 +50,7 @@ amd64) echo "Arch $arch not supported for memdisk tests" exit 0 ;; -SKIP) +'') echo "Step skipped." exit 0 ;;
Signature · 1 line
2.20.1
PATCH 13/13 ts-xen-install: enable timestamp on guests logs
In reply to Ian JacksonFrom: Roger Pau Monne <[email protected]>
Enable the timestamp feature of xenconsoled so guests logs have a time reference. Can be helpful when debugging boot related slowness.
This requires using the XENCONSOLED_ARGS option and setting both the log and the timestamp options. Note that setting XENCONSOLED_TRACE will override any options in XENCONSOLED_ARGS, so they can not be used in conjunction.
--- ts-xen-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ts-xen-install +1 -1
@@ -140,7 +140,7 @@ sub adjustconfig () { my @commons_config = ( - "XENCONSOLED_TRACE" => "guest", + "XENCONSOLED_ARGS" => '"--log=guest --timestamp=all"', ); my $xenstored = target_var($ho, 'xenstored');
Signature · 1 line
2.20.1