Skip to contentSkip to conversation

osstest: FreeBSD bugfixes and improvements

PATCH Superseded Roger Pau Monne 2 participants 10 messages Jul 12, 2018 – Jul 17, 2018

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 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_v2

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   | 61 ++++++-----------------------
 mfi-common            | 90 ++++++++++++++++++++++++++++++++-----------
 sg-run-job            |  5 +++
 ts-build-prep-freebsd |  5 ++-
 ts-xen-build          | 11 +++---
 ts-xen-build-freebsd  | 19 +++++++++
 8 files changed, 121 insertions(+), 81 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
#1 lore raw

PATCH v2 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
index 064a9294..1980a625 100755
@@ -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
#2 lore raw

PATCH v2 2/6 osstest: remove duplicate set_freebsd_runvars

In reply to Roger Pau Monne

The 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
index 66d4b816..1a2b359c 100755
@@ -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
#3 lore raw

PATCH v2 3/6 osstest: abstract code to create a FreeBSD build job

In reply to Roger Pau Monne

Into a helper. A diff of the runvars of flights generated with and without the patch show no differences.

No functional change.

---
 make-freebsd-flight | 24 +++++-------------------
 mfi-common          | 14 ++++++++++++++
 2 files changed, 19 insertions(+), 19 deletions(-)
make-freebsd-flight +5 -19
index 1a2b359c..6c530ebe 100755
@@ -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
index 9b6c9470..0e6cf01e 100644
@@ -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
#4 lore raw

PATCH v2 4/6 osstest: limit FreeBSD jobs to hardware booting in BIOS mode

In reply to Roger Pau Monne

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.

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.
---
Changes since v1:
- Fix nonbreaking space.
- Fix long line.

---
 make-flight |  3 ++-
 mfi-common  | 16 ++++++++++++----
 2 files changed, 14 insertions(+), 5 deletions(-)
make-flight +2 -1
index 4e2d464f..deb2276d 100755
@@ -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
index 0e6cf01e..74645259 100644
@@ -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
#5 lore raw

Re: [PATCH v2 4/6] osstest: limit FreeBSD jobs to hardware booting in BIOS mode

Roger Pau Monne writes ("[PATCH v2 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.

I did a diff of the output of
OSSTEST_CONFIG=standalone-config-example eatmydata ./standalone-generate-dump-flight-runvars
between current production, and after applying this patch, and I saw
these changes:

+freebsd-master             build-amd64-freebsd       all_hostflags       PropEq:Firmware:bios:bios           
+freebsd-master             build-amd64-freebsd-again all_hostflags       PropEq:Firmware:bios:bios           

These are expected, I think.

-freebsd-master             build-amd64-freebsd       freebsd_distpath    /amd64                              
-freebsd-master             build-amd64-freebsd       freebsd_version                                         

I don't think I understand these changes.

+examine examine-SOMEHOST all_hostflags PropEq:Firmware:bios:bios

This is wrong. The examine job needs to run on all hosts and shouldn't have that hostflag applied.

I also notice that you did a runvar difference only of a xen-unstable flight. Looking at the differences between production and the tip of your series, I think you are perhaps adding the freebsd xen build job to rather too many of these flights.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#6 lore raw

PATCH v2 5/6 osstest: set the make command to use for xen-build

In reply to Roger Pau Monne

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.

---
Changes since v1:
- Use gmake for all BSDs.

---
 ts-xen-build | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
ts-xen-build +6 -5
index 57913d4f..48bf062f 100755
@@ -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
#7 lore raw

PATCH v2 6/6 osstest: add FreeBSD Xen build job

In reply to Roger Pau Monne

To 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_ovmf      false
+build-amd64-xen-xsm-freebsd enable_ovmf      false
+build-amd64-xen-freebsd     enable_xend      false
+build-amd64-xen-xsm-freebsd enable_xend      false
+build-amd64-xen-freebsd     enable_xsm       false
+build-amd64-xen-xsm-freebsd enable_xsm       true
+build-amd64-xen-freebsd     freebsdbuildjob  125104.build-amd64-freebsd
+build-amd64-xen-xsm-freebsd freebsdbuildjob  125104.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_minios
+build-amd64-xen-xsm-freebsd revision_minios
+build-amd64-xen-freebsd revision_ovmf
+build-amd64-xen-xsm-freebsd revision_ovmf
+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_minios
+build-amd64-xen-xsm-freebsd tree_minios
+build-amd64-xen-freebsd tree_ovmf
+build-amd64-xen-xsm-freebsd tree_ovmf

+build-amd64-xen-freebsd     tree_qemu        git://xenbits.xen.org/qemu-xen-traditional.git
+build-amd64-xen-xsm-freebsd tree_qemu        git://xenbits.xen.org/qemu-xen-traditional.git
+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.
- Introduce a create_xen_build_job helper.

---
 make-freebsd-flight   |  6 +++++
 mfi-common            | 60 ++++++++++++++++++++++++++++++-------------
 sg-run-job            |  5 ++++
 ts-build-prep-freebsd |  5 +++-
 ts-xen-build-freebsd  | 19 ++++++++++++++
 5 files changed, 76 insertions(+), 19 deletions(-)
 create mode 100755 ts-xen-build-freebsd
make-freebsd-flight +6 -0
index 6c530ebe..d3c413b5 100755
@@ -46,6 +46,12 @@ 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_xen_build_job build-$arch-xen-freebsd build-xen-freebsd      \
+        host_hostflags=arch-$arch,purpose-build all_host_os=freebsd     \
+        $freebsd_runvars
 done
 
 echo $flight
mfi-common +42 -18

90 lines not on this page · raw message

sg-run-job +5 -0
index d152051f..bbfe3f5b 100755
@@ -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
index 3999ed79..e3220fa8 100755
@@ -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
new file mode 100755
index 00000000..55f513e5
@@ -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
#8 lore raw

Re: [PATCH v2 6/6] osstest: add FreeBSD Xen build job

Roger Pau Monne writes ("[PATCH v2 6/6] osstest: add FreeBSD Xen build job"):

Quoted 3 lines

To both the FreeBSD and the xen-unstable flights.

This is the runvar difference of a xen-unstable flight:

Can you split out the refactoring, please ?

That way I can do my own runvar difference on the just-refactoring part of the series.

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#9 lore raw

Re: [PATCH v2 6/6] osstest: add FreeBSD Xen build job

Quoted 6 lines · Ian Jackson

Roger Pau Monne writes ("[PATCH v2 6/6] osstest: add FreeBSD Xen build job"):

Quoted 3 lines

To both the FreeBSD and the xen-unstable flights.

This is the runvar difference of a xen-unstable flight:

Can you split out the refactoring, please ?

Sure, I've pushed it to:

git://xenbits.xen.org/people/royger/osstest.git freebsd_improvement_v3

If you prefer I can also send the updated series to the mailing list.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel