osstest: FreeBSD bugfixes and improvements
cover osstest: FreeBSD bugfixes and improvements
Hello,
The first 4 patches in this patch series prevent FreeBSD jobs from running on boxes booting from UEFI. This is needed due to osstest lack of support for installing FreeBSD from UEFI at the moment.
Last two patches add support for creating Xen build jobs running on FreeBSD. Such a job is added to the FreeBSD flight and also to the Xen flights.
The patches can also be found at:
git://xenbits.xen.org/people/royger/osstest.git freebsd_improvement
Thanks, Roger.
Ian Jackson (1):
osstest: allow appending to existing runvars
Roger Pau Monne (5):
osstest: remove duplicate set_freebsd_runvars
osstest: abstract code to create a FreeBSD build job
osstest: limit FreeBSD jobs to hardware booting in BIOS mode
osstest: set the make command to use for xen-build
osstest: add FreeBSD Xen build job
cs-job-create | 8 ++++-- make-flight | 3 ++- make-freebsd-flight | 59 +++++++------------------------------------ mfi-common | 59 ++++++++++++++++++++++++++++++++++++++++--- sg-run-job | 5 ++++ ts-build-prep-freebsd | 5 +++- ts-xen-build | 11 ++++---- ts-xen-build-freebsd | 19 ++++++++++++++ 8 files changed, 106 insertions(+), 63 deletions(-) create mode 100755 ts-xen-build-freebsd
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 1/6 osstest: allow appending to existing runvars
From: Ian Jackson <[email protected]>
So that the contents of the runvar can be expanded. There are currently two ways to do this:
- Using += will append to the end of the runvar.
- Using ,= will append to the end of the runvar using ',' as the separator.
Note that if the runvar is empty {,|+}= just sets the runvar.
--- cs-job-create | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
cs-job-create +6 -2
@@ -53,8 +53,12 @@ foreach my $rv (@runvars) { $suppress{$1}= 1; next; } - $rv =~ m/^([a-z][0-9a-z_]*)(\~?)\=(.*)$/ or die "$rv ?"; - my ($name,$synth,$val) = ($1,$2,$3); + $rv =~ m/^([a-z][0-9a-z_]*)(\~?)([+,]?)\=(.*)$/ or die "$rv ?"; + my ($name,$synth,$add,$val) = ($1,$2,$3,$4); + if ($add && $runvars{$name}) { + die "$name synth mismatch" if !!$runvars{$name}[1] ne !!$synth; + $val = $runvars{$name}[0].($add ne '+' && $add).$val; + } $runvars{$name}= [$val,$synth]; }
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 2/6 osstest: remove duplicate set_freebsd_runvars
In reply to Roger Pau MonneThe set_freebsd_runvars helper in mfi-common is a superset of the original function present in make-freebsd-flight, and will attempt to fetch the last anointed FreeBSD build as a last resort option if no FreeBSD build is signaled from the FreeBSD env vars. There's no reason to have this duplication, since the set_freebsd_runvars in mfi-common is perfectly suitable to be used by make-freebsd-flight.
This duplication was wrongly introduced by d36a7d892f by adding a set_freebsd_runvars to mfi-common without removing the original function in make-freebsd-flight.
---
Changes since v1:
- Add commit message.
--- make-freebsd-flight | 31 ------------------------------- 1 file changed, 31 deletions(-)
make-freebsd-flight +0 -31
@@ -36,37 +36,6 @@ job_create_build_filter_callback () { : } -set_freebsd_runvars () { - # Caller should have done if required: - # local freebsd_runvars - # - # Figure out where are the installer binaries. The order is the - # following: - # - # 1. Env variable FREEBSD_<arch>_BUILDJOB: use the output from a - # previous build-<arch>-freebsd. - # - # 2. Env variables FREEBSD_DIST, FREEBSD_VERSION: set before calling - # into make-flight, provide the path to the installer image, the sets - # to install and the version being installed. - # - # 3. Config file FreeBSDDist, FreeBSDVersion: same as 2. except that - # they are set on the config file. - # - envvar="FREEBSD_${arch^^}_BUILDJOB" - if [ -n "${!envvar}" ]; then - freebsd_runvars="freebsdbuildjob=${!envvar}" - elif [ -n "$FREEBSD_DIST" ] && [ -n "$FREEBSD_VERSION" ]; then - freebsd_runvars="freebsd_distpath=$FREEBSD_DIST/$arch \ - freebsd_version=$FREEBSD_VERSION" - else - distpath=`getconfig "FreeBSDDist"` - version=`getconfig "FreeBSDVersion"` - freebsd_runvars="freebsd_distpath=$distpath/$arch \ - freebsd_version=$version" - fi -} - for arch in "$arches"; do set_freebsd_runvars job_create_build build-$arch-freebsd build-freebsd \
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [PATCH 2/6] osstest: remove duplicate set_freebsd_runvars
Roger Pau Monne writes ("[PATCH 2/6] osstest: remove duplicate set_freebsd_runvars"):
Quoted 10 lines
The
set_freebsd_runvarshelper in mfi-common is a superset of the original function present in make-freebsd-flight, and will attempt to fetch the last anointed FreeBSD build as a last resort option if no FreeBSD build is signaled from the FreeBSD env vars. There's no reason to have this duplication, since theset_freebsd_runvarsin mfi-common is perfectly suitable to be used by make-freebsd-flight.This duplication was wrongly introduced by
d36a7d892fby adding aset_freebsd_runvarsto mfi-common without removing the original function in make-freebsd-flight.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 3/6 osstest: abstract code to create a FreeBSD build job
In reply to Roger Pau MonneInto a helper.
--- make-freebsd-flight | 24 +++++------------------- mfi-common | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 19 deletions(-)
make-freebsd-flight +5 -19
@@ -38,28 +38,14 @@ job_create_build_filter_callback () { for arch in "$arches"; do set_freebsd_runvars - job_create_build build-$arch-freebsd build-freebsd \ - arch=$arch \ - $RUNVARS $BUILD_RUNVARS $BUILD_FREEBSD_RUNVARS \ - $arch_runvars \ - tree_freebsd=$TREE_FREEBSD \ - revision_freebsd=$REVISION_FREEBSD \ - host_hostflags=arch-$arch,purpose-build \ - all_host_os=freebsd \ - $freebsd_runvars + + create_freebsd_build_job build-$arch-freebsd # Create an identical job that's going to use the build output from # the previous one. - job_create_build build-$arch-freebsd-again build-freebsd \ - arch=$arch \ - $RUNVARS $BUILD_RUNVARS $BUILD_FREEBSD_RUNVARS \ - $arch_runvars \ - tree_freebsd=$TREE_FREEBSD \ - revision_freebsd=$REVISION_FREEBSD \ - host_hostflags=arch-$arch,purpose-build \ - all_host_os=freebsd \ - freebsdbuildjob=build-$arch-freebsd \ - recipe_testinstall=true + freebsd_runvars="$freebsd_runvars freebsdbuildjob=build-$arch-freebsd \ + recipe_testinstall=true" + create_freebsd_build_job build-$arch-freebsd-again done echo $flight
mfi-common +14 -0
@@ -174,6 +174,20 @@ set_freebsd_runvars () { fi } +create_freebsd_build_job () { + local name=$1 + + job_create_build $name build-freebsd \ + arch=$arch \ + $RUNVARS $BUILD_RUNVARS $BUILD_FREEBSD_RUNVARS \ + $arch_runvars \ + tree_freebsd=$TREE_FREEBSD \ + revision_freebsd=$REVISION_FREEBSD \ + host_hostflags=arch-$arch,purpose-build \ + all_host_os=freebsd \ + $freebsd_runvars +} + create_build_jobs () { local arch
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [PATCH 3/6] osstest: abstract code to create a FreeBSD build job
Roger Pau Monne writes ("[PATCH 3/6] osstest: abstract code to create a FreeBSD build job"):
Quoted 1 line
Into a helper.
I guess this is supposed to be NFC, but you don't say so. Have you run standalone-generate-dump-flight-runvars and diffed the result before and after ?
In general that's a good thing to do when editing the flight construction stuff.
I recommend
OSSTEST_CONFIG=standalone-config-example eatmydata ./standalone-generate-dump-flight-runvars
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 4/6 osstest: limit FreeBSD jobs to hardware booting in BIOS mode
In reply to Roger Pau MonneThere's no support yet in osstest to install FreeBSD from UEFI, so for the time being limit the FreeBSD jobs to boxes booting with legacy BIOS.
The hostflags are not set for examine jobs, in order to avoid them from only running on BIOS boxes.
---
Note that this patch depends on Ian Jackson's resource allocation series.
--- make-flight | 3 ++- mfi-common | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-)
make-flight +2 -1
@@ -704,7 +704,8 @@ do_examine_one () { local freebsd_runvars # set_freebsd_runvars expects $arch to be set to the desired FreeBSD arch. local arch=$dom0arch - set_freebsd_runvars + # Pass true to not append any hostflags when creating the FreeBSD runvars. + set_freebsd_runvars true job_create_test test-$xenarch$kern-$dom0arch-examine \ host-examine-xen xl $xenarch $dom0arch \ all_hostflags=$most_hostflags $freebsd_runvars
mfi-common +12 -4
@@ -149,27 +149,35 @@ set_freebsd_runvars () { # # 4. Look for an anointed build of FreeBSD `master' (Executive only) # + local no_hostflags=$1 local envvar="FREEBSD_${arch^^}_BUILDJOB" + + 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. + freebsd_runvars="all_hostflags,=PropEq:Firmware:bios:bios" + fi + if [ -n "${!envvar}" ]; then - freebsd_runvars="freebsdbuildjob=${!envvar}" + freebsd_runvars="$freebsd_runvars freebsdbuildjob=${!envvar}" return fi if [ -n "$FREEBSD_DIST" ] && [ -n "$FREEBSD_VERSION" ]; then - freebsd_runvars="freebsd_distpath=$FREEBSD_DIST/$arch \ + freebsd_runvars="$freebsd_runvars freebsd_distpath=$FREEBSD_DIST/$arch \ freebsd_version=$FREEBSD_VERSION" return fi local distpath=`getconfig "FreeBSDDist"` if [ -n "$distpath" ]; then local version=`getconfig "FreeBSDVersion"` - freebsd_runvars="freebsd_distpath=$distpath/$arch \ + freebsd_runvars="$freebsd_runvars freebsd_distpath=$distpath/$arch \ freebsd_version=$version" return fi local anointment="freebsd build master $arch" local flightjob=`./mg-anoint retrieve --tolerate-unprepared "$anointment"` if [ -n "$flightjob" ]; then - freebsd_runvars="freebsdbuildjob=${flightjob/ /.}" + freebsd_runvars="$freebsd_runvars freebsdbuildjob=${flightjob/ /.}" return fi }
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [PATCH 4/6] osstest: limit FreeBSD jobs to hardware booting in BIOS mode
Roger Pau Monne writes ("[PATCH 4/6] osstest: limit FreeBSD jobs to hardware booting in BIOS mode"):
Quoted 3 lines
There's no support yet in osstest to install FreeBSD from UEFI, so for the time being limit the FreeBSD jobs to boxes booting with legacy BIOS.
expects $arch to be set to the desired FreeBSD arch.
make-flight do_examine_one () { · line 707
Quoted 3 lines
local arch=$dom0arch
make-flight +1
-1- set_freebsd_runvars + # Pass true to not append any hostflags when creating the FreeBSD runvars.
^ nonbreaking space ?!
Aside from that,
(despite the occasional long line).
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 5/6 osstest: set the make command to use for xen-build
In reply to Roger Pau MonneThe default make on FreeBSD is the BSD make, and Xen requires the GNU make in order to build. Set the make command based on the OS for the Xen build.
---
Changes since v1:
- Use gmake for all BSDs.
--- ts-xen-build | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
ts-xen-build +6 -5
@@ -28,6 +28,7 @@ tsreadconfig(); selectbuildhost(\@ARGV); our $dokconfig = 1; +our $make = $ho->{OS} =~ m/bsd/ ? "gmake" : "make"; while (@ARGV && $ARGV[0] =~ m/^-/) { $_ = shift @ARGV;
@@ -156,24 +157,24 @@ END buildcmd_stamped_logged(600, 'xen', 'kconfig', '',<<END,'') if $dokconfig; if test -f xen/Kconfig; then - $make_prefix make -C xen olddefconfig + $make_prefix $make -C xen olddefconfig fi END if (!@make_args) { buildcmd_stamped_logged(9000, 'xen', 'build', '',<<END,''); - $make_prefix make $makeflags build + $make_prefix $make $makeflags build END } buildcmd_stamped_logged(9000, 'xen', 'all', '',<<END,''); - $make_prefix make $makeflags @make_args + $make_prefix $make $makeflags @make_args END if ($enable_xsm) { my $xen_version = target_cmd_output($ho, <<END, 30); cd $builddir/xen - $make_prefix make xenversion + $make_prefix $make xenversion END store_runvar("flaskpolicy", "xenpolicy-" . $xen_version); }
@@ -181,7 +182,7 @@ END if ($enable_livepatch) { substep_eval('/dist-test', sub { buildcmd_stamped_logged(600, 'xen', 'xenlpt', '',<<END,''); - $make_prefix make $makeflags dist-tests + $make_prefix $make $makeflags dist-tests END }); }
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [PATCH 5/6] osstest: set the make command to use for xen-build
Roger Pau Monne writes ("[PATCH 5/6] osstest: set the make command to use for xen-build"):
Quoted 3 lines
The default make on FreeBSD is the BSD make, and Xen requires the GNU make in order to build. Set the make command based on the OS for the Xen build.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 6/6 osstest: add FreeBSD Xen build job
In reply to Roger Pau MonneTo both the FreeBSD and the xen-unstable flights.
This is the runvar difference of a xen-unstable flight:
+build-amd64-xen-freebsd all_host_os freebsd +build-amd64-xen-xsm-freebsd all_host_os freebsd +build-amd64-xen-freebsd all_hostflags PropEq:Firmware:bios:bios +build-amd64-xen-xsm-freebsd all_hostflags PropEq:Firmware:bios:bios +build-amd64-xen-freebsd arch amd64 +build-amd64-xen-xsm-freebsd arch amd64 +build-amd64-xen-freebsd enable_livepatch true +build-amd64-xen-xsm-freebsd enable_livepatch true +build-amd64-xen-freebsd enable_xsm false +build-amd64-xen-xsm-freebsd enable_xsm true +build-amd64-xen-freebsd freebsdbuildjob 124954.build-amd64-freebsd +build-amd64-xen-xsm-freebsd freebsdbuildjob 124954.build-amd64-freebsd +build-amd64-xen-freebsd host_hostflags arch-amd64,purpose-build +build-amd64-xen-xsm-freebsd host_hostflags arch-amd64,purpose-build
+build-amd64-xen-freebsd revision_qemu
+build-amd64-xen-xsm-freebsd revision_qemu
+build-amd64-xen-freebsd revision_qemuu
+build-amd64-xen-xsm-freebsd revision_qemuu
+build-amd64-xen-freebsd revision_seabios
+build-amd64-xen-xsm-freebsd revision_seabios
+build-amd64-xen-freebsd revision_xen
+build-amd64-xen-xsm-freebsd revision_xen
+build-amd64-xen-freebsd tree_qemuu git://xenbits.xen.org/qemu-xen.git
+build-amd64-xen-xsm-freebsd tree_qemuu git://xenbits.xen.org/qemu-xen.git
+build-amd64-xen-freebsd tree_seabios
+build-amd64-xen-xsm-freebsd tree_seabios
+build-amd64-xen-freebsd tree_xen git://xenbits.xen.org/xen.git
+build-amd64-xen-xsm-freebsd tree_xen git://xenbits.xen.org/xen.git
---
Changes since v1:
- Fix enabling of FreeBSD Xen buildjob based on branch.
- Introduce a helper to add the FreeBSD Xen build jobs.
- Introduce the ts-xen-build-freebsd wrapper around ts-xen-build for FreeBSD.
--- make-freebsd-flight | 4 ++++ mfi-common | 29 +++++++++++++++++++++++++++++ sg-run-job | 5 +++++ ts-build-prep-freebsd | 5 ++++- ts-xen-build-freebsd | 19 +++++++++++++++++++ 5 files changed, 61 insertions(+), 1 deletion(-) create mode 100755 ts-xen-build-freebsd
make-freebsd-flight +4 -0
@@ -46,6 +46,10 @@ for arch in "$arches"; do freebsd_runvars="$freebsd_runvars freebsdbuildjob=build-$arch-freebsd \ recipe_testinstall=true" create_freebsd_build_job build-$arch-freebsd-again + + # Create a Xen build job that's going to use the output from the first + # FreeBSD build job. + create_freebsd_xen_build_job done echo $flight
mfi-common +29 -0
@@ -196,6 +196,22 @@ create_freebsd_build_job () { $freebsd_runvars } +create_freebsd_xen_build_job () { + job_create_build build-$arch-xen$xsm_suffix-freebsd build-xen-freebsd \ + arch=$arch \ + enable_xsm=$enable_xsm $livepatch_runvars \ + tree_qemuu=$TREE_QEMU_UPSTREAM \ + tree_xen=$TREE_XEN \ + tree_seabios=$TREE_SEABIOS \ + $RUNVARS $BUILD_RUNVARS $BUILD_XEN_RUNVARS $arch_runvars \ + host_hostflags=arch-$arch,purpose-build \ + revision_xen=$REVISION_XEN \ + revision_qemu=$REVISION_QEMU \ + revision_qemuu=$REVISION_QEMU_UPSTREAM \ + revision_seabios=$REVISION_SEABIOS \ + all_host_os=freebsd $freebsd_runvars +} + create_build_jobs () { local arch
@@ -205,6 +221,7 @@ create_build_jobs () { local enable_ovmf local build_hostflags local livepatch_runvars + local freebsd_runvars build_on_freebsd if [ "x$BUILD_LVEXTEND_MAX" != x ]; then BUILD_RUNVARS+=" build_lvextend_max=$BUILD_LVEXTEND_MAX "
@@ -215,6 +232,8 @@ create_build_jobs () { if [ "x$arch" = xdisable ]; then continue; fi + set_freebsd_runvars + build_matrix_branch_filter_callback || continue case "$arch" in
@@ -291,6 +310,13 @@ create_build_jobs () { esac enable_prevovmf=${enable_prevovmf:-$enable_ovmf} + case "$xenbranch" in + xen-3.*-testing) build_on_freebsd=false;; + xen-4.?-testing) build_on_freebsd=false;; + xen-4.11-testing) build_on_freebsd=false;; + *) build_on_freebsd=true;; + esac + want_prevxen=n if branch_wants_migrupgrade_tests ; then # Only x86 for now
@@ -332,6 +358,9 @@ create_build_jobs () { revision_seabios=$REVISION_SEABIOS \ revision_ovmf=$REVISION_OVMF \ revision_minios=$REVISION_MINIOS + if [ x$arch = xamd64 ] && [ x$build_on_freebsd = xtrue ] ; then + create_freebsd_xen_build_job + fi done if [ x$want_prevxen = xy ] ; then
sg-run-job +5 -0
@@ -712,6 +712,7 @@ proc need-hosts/build-libvirt {} { return BUILD_LINUX } proc need-hosts/build-rumprun {} { return BUILD_LINUX } proc need-hosts/build-xtf {} { return BUILD_LINUX } proc need-hosts/build-freebsd {} { return BUILD_FREEBSD } +proc need-hosts/build-xen-freebsd {} { return BUILD_FREEBSD } proc run-job/build {} { run-ts . = ts-xen-build
@@ -742,6 +743,10 @@ proc run-job/build-freebsd {} { run-ts . = ts-freebsd-build } +proc run-job/build-xen-freebsd {} { + run-ts . = ts-xen-build-freebsd + host +} + proc allocate-build-host {ostype} { global jobinfo switch -exact $ostype {
ts-build-prep-freebsd +4 -1
@@ -31,7 +31,10 @@ our $ho= selecthost($whhost); exit 0 if $ho->{SharedReady}; sub install_deps () { - target_install_packages($ho, qw(git)); + my @packages = qw(git glib pkgconf yajl gmake pixman markdown gettext + python argp-standalone lzo2 git gcc binutils); + + target_install_packages($ho, @packages); } install_deps();
ts-xen-build-freebsd new file +19 -0
@@ -0,0 +1,19 @@ +#!/bin/sh +# This is part of "osstest", an automated testing framework for Xen. +# Copyright (C) 2009-2018 Citrix Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +set -ex +./ts-xen-build "$@" -- clang=y SEABIOSCC=gcc SEABIOSLD=/usr/local/bin/ld
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [PATCH 6/6] osstest: add FreeBSD Xen build job
Roger Pau Monne writes ("[PATCH 6/6] osstest: add FreeBSD Xen build job"):
...
Quoted 4 lines
mfi-common +4
-0+create_freebsd_xen_build_job () { + job_create_build build-$arch-xen$xsm_suffix-freebsd build-xen-freebsd \ + arch=$arch \ + enable_xsm=$enable_xsm $livepatch_runvars \
mfi-common create_freebsd_build_job () { · line 212
Quoted 10 lines
mfi-common +10
-0+ tree_qemuu=$TREE_QEMU_UPSTREAM \ + tree_xen=$TREE_XEN \ + tree_seabios=$TREE_SEABIOS \ + $RUNVARS $BUILD_RUNVARS $BUILD_XEN_RUNVARS $arch_runvars \ + host_hostflags=arch-$arch,purpose-build \ + revision_xen=$REVISION_XEN \ + revision_qemu=$REVISION_QEMU \ + revision_qemuu=$REVISION_QEMU_UPSTREAM \ + revision_seabios=$REVISION_SEABIOS \ + all_host_os=freebsd $freebsd_runvars
Can we not have xen_build_job_runvars or something ? This is still very similar to what is in mfi-common's create_build_jobs.
The rest of this looks fine to me.
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel