All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v7 00/20] osstest: initial FreeBSD support
@ 2017-07-25 15:00 Roger Pau Monne
  2017-07-25 15:00 ` [PATCH v7 11/20] osstest: introduce an OS $ho field Roger Pau Monne
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Roger Pau Monne @ 2017-07-25 15:00 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

Hello,

Note that this thread only contains the patches that need an ack or
have been modified in some way between v6 and v7. This is done in
order to prevent spamming the list with already acked patches for such
long series. The full series can be found at:

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

This includes Ian's mg-anoint series.

The procedure to enable this in production mode (ie: on the mass
osstest instance) is as follows:

1. Make the memdisk binary available from the tftp path. This is
   described in patch 5.

2. Pick the output from a previous FreeBSD build and make it available
   to the osstest controller. I'm currently running a flight that
   should create a suitable installer for the mass osstest instance
   (should contain the right ssh authorized keys). Taking the output
   of flight 71726 as an example, the contents of the build folder [0]
   should be copied to the osstest controller. The following path
   hierarchy should be used:

      <FREEBSD_DIST>/amd64/{install.img,MANIFEST,base.txz,kernel.txz}

   [watch this space for the path to the new images]

3. The path in FREEBSD_DIST described above should be set on the
   environment, together with FREEBSD_VERSION:

      export FREEBSD_DIST=<FREEBSD_DIST>
      export FREEBSD_VERSION=12

4. Run cr-daily-branch to create the first build output:

      ./cr-daily-branch freebsd-master

5. Prepare and anoint the first build (provided the previous step 4.
   is successful):

   ./mg-anoint prepare 'freebsd build master amd64' 'FreeBSD HEAD amd64 builds'
   ./mg-anoint anoint --allow-blessed=play 'freebsd build master amd64' $flight build-amd64-freebsd

6. Unset FREEBSD_DIST and FREEBSD_VERSION.

Thanks, Roger.

[0] http://osstest.xs.citrite.net/~osstest/testlogs/logs/71726/build-amd64-freebsd/build/


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v7 11/20] osstest: introduce an OS $ho field
  2017-07-25 15:00 [PATCH v7 00/20] osstest: initial FreeBSD support Roger Pau Monne
@ 2017-07-25 15:00 ` Roger Pau Monne
  2017-07-25 15:13   ` Ian Jackson
  2017-07-25 15:00 ` [PATCH v7 12/20] osstest: add support for the FreeBSD package manager Roger Pau Monne
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Roger Pau Monne @ 2017-07-25 15:00 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Roger Pau Monne

In order to differentiate between FreeBSD and Debian hosts.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v6:
 - New in this version
---
 Osstest/TestSupport.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index ce475d81..7642a95b 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -983,6 +983,7 @@ sub selecthost ($) {
 	$ho->{Suite} = target_var($ho, "suite") // $c{DebianSuite};
 	$ho->{DiVersion} = target_var($ho, "di_version")
 	    // cfg_tftp_di_version($ho->{Suite});
+        $ho->{Os} = target_var($ho, "os") // "debian";
     }
 
     #----- handle hosts which are themselves guests (nested) -----
-- 
2.11.0 (Apple Git-81)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v7 12/20] osstest: add support for the FreeBSD package manager
  2017-07-25 15:00 [PATCH v7 00/20] osstest: initial FreeBSD support Roger Pau Monne
  2017-07-25 15:00 ` [PATCH v7 11/20] osstest: introduce an OS $ho field Roger Pau Monne
@ 2017-07-25 15:00 ` Roger Pau Monne
  2017-07-25 15:00 ` [PATCH v7 18/20] osstest: introduce a script to create a FreeBSD flight Roger Pau Monne
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Roger Pau Monne @ 2017-07-25 15:00 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Roger Pau Monne

FreeBSD support is added to target_install_packages and
target_install_packages_norec, although there's no equivalent to the
--no-install-recommends in the FreeBSD package manager.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v6:
 - Use $ho->{Os} in order to detect the target OS.

Changes since v5:
 - Add prototype for package_install_cmd.
 - Use $ho->{Ident} instead of hardcoding "host" in get_hostflags.

Changes since v4:
 - Unify more code between FreeBSD and Debian: introduce an
   OS-agnostic package_install_cmd to generate the install cmd.

Changes since v3:
 - New in this version.
---
 Osstest/TestSupport.pm | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 7642a95b..4cb939e7 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -68,7 +68,6 @@ BEGIN {
                       http_proxy_envsettings
                       target_editfile_root target_file_exists
                       target_editfile_kvp_replace
-                      target_run_apt
                       target_install_packages target_install_packages_norec
                       target_jobdir target_extract_jobdistpath_subdir
                       target_extract_jobdistpath target_tftp_prefix
@@ -523,19 +522,33 @@ sub target_putfile ($$$$;$) {
 sub target_putfile_root ($$$$;$) {
     tputfileex('root', @_);
 }
-sub target_run_apt {
-    my ($ho, @aptopts) = @_;
-    target_cmd_root($ho,
-        "DEBIAN_PRIORITY=critical UCF_FORCE_CONFFOLD=y \\
-            with-lock-ex -w /var/lock/osstest-apt apt-get @aptopts", 3000);
+
+sub package_install_cmd ($;$) {
+    my ($ho, $norec) = @_;
+    my @cmd;
+
+    if ($ho->{Os} eq "freebsd") {
+        push @cmd, qw(lockf /var/run/osstest-pkg-lock pkg-static install);
+    } else {
+        push @cmd, qw(DEBIAN_PRIORITY=critical UCF_FORCE_CONFFOLD=y
+                      with-lock-ex -w /var/lock/osstest-apt apt-get);
+        push @cmd, qw(--no-install-recommends) if $norec;
+        push @cmd, qw(-y install);
+    }
+
+    return @cmd;
 }
 sub target_install_packages ($@) {
     my ($ho, @packages) = @_;
-    target_run_apt($ho, qw(-y install), @packages);
+    my @cmd = package_install_cmd($ho);
+
+    target_cmd_root($ho,"@cmd @packages", 3000);
 }
 sub target_install_packages_norec ($@) {
     my ($ho, @packages) = @_;
-    target_run_apt($ho, qw(--no-install-recommends -y install), @packages);
+    my @cmd = package_install_cmd($ho, 1);
+
+    target_cmd_root($ho,"@cmd @packages", 3000);
 }
 
 sub target_somefile_getleaf ($$$) {
-- 
2.11.0 (Apple Git-81)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v7 18/20] osstest: introduce a script to create a FreeBSD flight
  2017-07-25 15:00 [PATCH v7 00/20] osstest: initial FreeBSD support Roger Pau Monne
  2017-07-25 15:00 ` [PATCH v7 11/20] osstest: introduce an OS $ho field Roger Pau Monne
  2017-07-25 15:00 ` [PATCH v7 12/20] osstest: add support for the FreeBSD package manager Roger Pau Monne
@ 2017-07-25 15:00 ` Roger Pau Monne
  2017-07-25 15:13   ` Ian Jackson
  2017-07-25 15:00 ` [PATCH v7 19/20] osstest: hook FreeBSD flight into cr-daily-branch Roger Pau Monne
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Roger Pau Monne @ 2017-07-25 15:00 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Roger Pau Monne

The logic to create a FreeBSD build job is added to
make-freebsd-flight. This includes creating a FreeBSD build job, and
also testing the output of that build job (by creating another build
job that depends on the output of the first).

Note that the FreeBSD build job needs some input in order to setup a
FreeBSD host, and that can be fetched from different places:

1. Env variable FREEBSD_<arch>_BUILDJOB: use the output from a
previous build-<arch>-freebsd job.

2. Env variables FREEBSD_DIST and FREEBSD_VERSION: set before calling
into make-flight, provide the path to the installer image and sets
folder and the version being installed.

3. Config file FreeBSDDist and FreeBSDVersion: same as 2. except that
they are set on the config file.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v6:
 - Re-wrap lines.
 - Remove the freebsd hostflag.
 - Do not set the FreeBSD git trees in this patch.
 - Set all_host_os runvar to freebsd for the FreeBSD build jobs.

Changes since v5:
 - Append the "freebsd" hostflag, the specific version will be set
   dynamically by the ts-freebsd-set-hostflags script.
 - Use FREEBSD_<arch>_BUILDJOB to set the freebsdbuildjob runvar.
 - Loop around arches, although only amd64 is supported ATM. This
   should make it easier to add more arches later on.
 - Expand README comment to describe the expected layout of the
   FreeBSD install media.

Changes since v4:
 - Convert get_freebsdjob_runvars into set_freebsd_runvars, mimic the
   behavior of set_hostos_runvars.

Changes since v3:
 - Split the sg-run-job code into pre-patches.

Changes since v1:
 - Replace freebsd_buildjob with freebsdbuildjob.
 - Replace FREEBSD_SETS/IMAGE with a single FREEBSD_DIST that points
   to a folder that should contain both things.
 - Document the FreeBSDDist and FreeBSDVersion config file options in
   the README file.
---
 README              | 16 +++++++++
 make-freebsd-flight | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 111 insertions(+)
 create mode 100755 make-freebsd-flight

diff --git a/README b/README
index b45058da..2b5173da 100644
--- a/README
+++ b/README
@@ -423,6 +423,22 @@ HostGroupFlags_<group>
 DebianPreseed
    Text to add to the debian-installer preseed file.  Optional.
 
+FreeBSDDist
+   Path to the folder(s) that contain the FreeBSD install image and
+   the FreeBSD compressed install sets, together with the MANIFEST
+   file that holds the checksums. This is required in order to run
+   a FreeBSD host install if no previous FreeBSD buildjob is
+   available (ie: for example when running in standalone mode).
+   The layout expected by osstest is the following:
+      <FreeBSDDist>/<arch>/install.img
+      <FreeBSDDist>/<arch>/base.txz
+      <FreeBSDDist>/<arch>/kernel.txz
+      <FreeBSDDist>/<arch>/MANIFEST
+
+FreeBSDVersion
+   Numeric value holding the major FreeBSD version of the media
+   provided in FreeBSDDist (ie: 12).
+
 ========================================
 
 Config settings relevant only to standalone mode
diff --git a/make-freebsd-flight b/make-freebsd-flight
new file mode 100755
index 00000000..64dfe9a6
--- /dev/null
+++ b/make-freebsd-flight
@@ -0,0 +1,95 @@
+#!/bin/bash
+
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2017 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 -e -o posix
+
+branch=$1
+xenbranch=$2
+blessing=$3
+buildflight=$4
+
+flight=`./cs-flight-create $blessing $branch`
+
+. ./cri-common
+. ./ap-common
+. ./mfi-common
+
+# Only supports amd64 ATM.
+arches="amd64"
+
+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          \
+                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 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
+done
+
+echo $flight
-- 
2.11.0 (Apple Git-81)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v7 19/20] osstest: hook FreeBSD flight into cr-daily-branch
  2017-07-25 15:00 [PATCH v7 00/20] osstest: initial FreeBSD support Roger Pau Monne
                   ` (2 preceding siblings ...)
  2017-07-25 15:00 ` [PATCH v7 18/20] osstest: introduce a script to create a FreeBSD flight Roger Pau Monne
@ 2017-07-25 15:00 ` Roger Pau Monne
  2017-07-25 15:14   ` Ian Jackson
  2017-07-25 15:00 ` [PATCH v7 20/20] osstest: save/retrieve the last successfully tested FreeBSD build Roger Pau Monne
  2017-07-26  7:40 ` [PATCH v7 00/20] osstest: initial FreeBSD support Roger Pau Monne
  5 siblings, 1 reply; 14+ messages in thread
From: Roger Pau Monne @ 2017-07-25 15:00 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Roger Pau Monne

Add the missing pieces so that cr-daily-branch knows how to create a
FreeBSD flight. This has been tested by calling `./cr-daily-branch
freebsd-master`.

Note that there are two missing pieces. The first one is correctly
setting the FREEBSD_<arch>_BUILDJOB environment variable when calling
make-freebsd-flight, without it the installer media will always be
picked from the configuration file. This requires keeping track of
previous FreeBSD successful build jobs, marking them as permanent and
fetching them from the database in order to pass them on the env
variable.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v6:
 - Set the path to the FreeBSD git trees in this patch.
 - Push to tested/master or tested/stable/<version> instead of using
   the same branches as the origin tree.

Changes since v5:
 - Add support for testing multiple FreeBSD branches, default to
   branch master.

Changes since v3:
 - Fix the daily-cron-email-* settings for FreeBSD branch flights.
---
 ap-common                              |  5 +++++
 ap-fetch-version                       |  8 ++++++++
 ap-fetch-version-old                   |  9 +++++++++
 ap-print-url                           |  3 +++
 ap-push                                |  9 +++++++++
 cr-daily-branch                        | 17 +++++++++++++++++
 cr-for-branches                        |  2 +-
 cri-common                             |  1 +
 daily-cron-email-adhoc--freebsd-master |  1 +
 daily-cron-email-play--freebsd-master  |  1 +
 daily-cron-email-real--freebsd-master  |  4 ++++
 11 files changed, 59 insertions(+), 1 deletion(-)
 create mode 100644 daily-cron-email-adhoc--freebsd-master
 create mode 100644 daily-cron-email-play--freebsd-master
 create mode 100644 daily-cron-email-real--freebsd-master

diff --git a/ap-common b/ap-common
index bc7c03cb..28144ca6 100644
--- a/ap-common
+++ b/ap-common
@@ -37,6 +37,10 @@
 : ${PUSH_TREE_XTF:=$XENBITS:/home/xen/git/xtf.git}
 : ${BASE_TREE_XTF:=git://xenbits.xen.org/xtf.git}
 
+: ${TREE_FREEBSD:=git://github.com/freebsd/freebsd.git}
+: ${PUSH_TREE_FREEBSD:=$XENBITS:/home/xen/git/freebsd.git}
+: ${BASE_TREE_FREEBSD:=git://xenbits.xen.org/freebsd.git}
+
 : ${TREE_LIBVIRT:=git://libvirt.org/libvirt.git}
 : ${PUSH_TREE_LIBVIRT:=$XENBITS:/home/xen/git/libvirt.git}
 : ${BASE_TREE_LIBVIRT:=git://xenbits.xen.org/libvirt.git}
@@ -82,6 +86,7 @@ fi
 : ${LOCALREV_SEABIOS:=daily-cron.$branch}
 : ${LOCALREV_OVMF:=daily-cron.$branch}
 : ${LOCALREV_XTF:=daily-cron.$branch}
+: ${LOCALREV_FREEBSD:=daily-cron.$branch}
 
 : ${TREEBASE_LINUX_XCP:=http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27}
 
diff --git a/ap-fetch-version b/ap-fetch-version
index a107c93d..87725bf0 100755
--- a/ap-fetch-version
+++ b/ap-fetch-version
@@ -106,6 +106,14 @@ ovmf)
 	repo_tree_rev_fetch_git ovmf \
 		$TREE_OVMF_UPSTREAM master $LOCALREV_OVMF
 	;;
+freebsd-*)
+	branchcore=${branch#freebsd-}
+	if [ "x$branchcore" != "xmaster" ]; then
+		branchcore="stable/$branchcore"
+	fi
+	repo_tree_rev_fetch_git freebsd \
+		$TREE_FREEBSD $branchcore $LOCALREV_FREEBSD
+	;;
 osstest)
         if [ "x$OSSTEST_USE_HEAD" = "xy" ] ; then
 	    git update-ref -m "Arranging to test HEAD" \
diff --git a/ap-fetch-version-old b/ap-fetch-version-old
index 3cbc1768..f952a249 100755
--- a/ap-fetch-version-old
+++ b/ap-fetch-version-old
@@ -34,6 +34,7 @@ check_ap_fetch_placeholders
 : ${BASE_LOCALREV_SEABIOS:=daily-cron.$branch.old}
 : ${BASE_LOCALREV_XTF:=daily-cron.$branch.old}
 : ${BASE_LOCALREV_OVMF:=daily-cron.$branch.old}
+: ${BASE_LOCALREV_FREEBSD:=daily-cron.$branch.old}
 : ${BASE_TAG_LIBVIRT:=xen-tested-master}
 
 if info_linux_tree "$branch"; then
@@ -114,6 +115,14 @@ ovmf)
 	repo_tree_rev_fetch_git ovmf \
 		$BASE_TREE_OVMF xen-tested-master $BASE_LOCALREV_OVMF
 	;;
+freebsd-*)
+	branchcore=${branch#freebsd-}
+	if [ "x$branchcore" != "xmaster" ]; then
+		branchcore="stable/$branchcore"
+	fi
+	repo_tree_rev_fetch_git freebsd \
+		$BASE_TREE_FREEBSD $branchcore $BASE_LOCALREV_FREEBSD
+	;;
 osstest)
 	if [ "x$OSSTEST_USE_HEAD" != "xy" ] ; then
 	    git fetch -f $HOME/testing.git production:ap-fetch
diff --git a/ap-print-url b/ap-print-url
index 93c14b35..e9934bc0 100755
--- a/ap-print-url
+++ b/ap-print-url
@@ -64,6 +64,9 @@ xtf)
 ovmf)
 	echo $TREE_OVMF_UPSTREAM
 	;;
+freebsd-*)
+	echo $TREE_FREEBSD
+	;;
 osstest)
 	echo none:;
 	;;
diff --git a/ap-push b/ap-push
index a27ccc22..dea5c436 100755
--- a/ap-push
+++ b/ap-push
@@ -41,6 +41,7 @@ TREE_RUMPRUN=$PUSH_TREE_RUMPRUN
 TREE_SEABIOS=$PUSH_TREE_SEABIOS
 TREE_OVMF=$PUSH_TREE_OVMF
 TREE_XTF=$PUSH_TREE_XTF
+TREE_FREEBSD=$PUSH_TREE_FREEBSD
 
 if info_linux_tree "$branch"; then
 	cd $repos/linux
@@ -125,6 +126,14 @@ xtf)
 	cd $repos/xtf
 	git push $TREE_XTF $revision:refs/heads/xen-tested-master
 	;;
+freebsd-*)
+	branchcore=${branch#freebsd-}
+	if [ "x$branchcore" != "xmaster" ]; then
+		branchcore="stable/$branchcore"
+	fi
+	cd $repos/freebsd
+	git push $TREE_FREEBSD $revision:refs/heads/tested/$branchcore
+	;;
 ovmf)
 	cd $repos/ovmf
 	git push $TREE_OVMF $revision:refs/heads/xen-tested-master
diff --git a/cr-daily-branch b/cr-daily-branch
index 39483cda..af17ad20 100755
--- a/cr-daily-branch
+++ b/cr-daily-branch
@@ -207,6 +207,18 @@ if [ "x$REVISION_LINUXFIRMWARE" = x ]; then
 	determine_version REVISION_LINUXFIRMWARE linuxfirmware LINUXFIRMWARE
         export REVISION_LINUXFIRMWARE
 fi
+if [ "x$REVISION_FREEBSD" = x ]; then
+	case "$branch" in
+	freebsd-*)
+		determine_version REVISION_FREEBSD "$branch" FREEBSD
+		;;
+	*)
+		determine_version REVISION_FREEBSD freebsd-master FREEBSD
+		;;
+	esac
+
+	export REVISION_FREEBSD
+fi
 
 case "$tree" in
 xen)
@@ -255,6 +267,10 @@ ovmf)
 	realtree=ovmf
 	NEW_REVISION=$REVISION_OVMF
 	;;
+freebsd)
+	realtree=freebsd
+	NEW_REVISION=$REVISION_FREEBSD
+	;;
 *)
 	NEW_REVISION=''
 	wantpush=false
@@ -274,6 +290,7 @@ examine)	makeflight=make_hosts_flight
 			./make-hosts-flight $1 $2 blessed-$3 $3 $4
 		}
 		;;
+freebsd-*)	makeflight=./make-freebsd-flight ;;
 *)         	makeflight=./make-flight ;;
 esac
 
diff --git a/cr-for-branches b/cr-for-branches
index a6912735..a54a8e91 100755
--- a/cr-for-branches
+++ b/cr-for-branches
@@ -31,7 +31,7 @@ scriptoptions="$1"; shift
 LOGFILE=tmp/cr-for-branches.log
 export LOGFILE
 
-: ${BRANCHES:=osstest xen-4.0-testing xen-4.1-testing xen-4.2-testing xen-4.3-testing xen-4.4-testing xen-4.5-testing xen-4.6-testing xen-4.7-testing xen-4.8-testing xen-4.9-testing xen-unstable qemu-mainline qemu-upstream-unstable qemu-upstream-4.2-testing qemu-upstream-4.3-testing qemu-upstream-4.4-testing qemu-upstream-4.5-testing qemu-upstream-4.6-testing qemu-upstream-4.7-testing qemu-upstream-4.8-testing qemu-upstream-4.9-testing linux-linus linux-4.9 linux-4.1 linux-3.18 linux-3.16 linux-3.14 linux-3.10 linux-3.4 linux-arm-xen seabios ovmf xtf ${EXTRA_BRANCHES}}
+: ${BRANCHES:=osstest xen-4.0-testing xen-4.1-testing xen-4.2-testing xen-4.3-testing xen-4.4-testing xen-4.5-testing xen-4.6-testing xen-4.7-testing xen-4.8-testing xen-4.9-testing xen-unstable qemu-mainline qemu-upstream-unstable qemu-upstream-4.2-testing qemu-upstream-4.3-testing qemu-upstream-4.4-testing qemu-upstream-4.5-testing qemu-upstream-4.6-testing qemu-upstream-4.7-testing qemu-upstream-4.8-testing qemu-upstream-4.9-testing linux-linus linux-4.9 linux-4.1 linux-3.18 linux-3.16 linux-3.14 linux-3.10 linux-3.4 linux-arm-xen seabios ovmf xtf freebsd-master ${EXTRA_BRANCHES}}
 export BRANCHES
 
 fetchwlem=$wlem
diff --git a/cri-common b/cri-common
index 903fb4e2..8d2d26cf 100644
--- a/cri-common
+++ b/cri-common
@@ -80,6 +80,7 @@ select_xenbranch () {
 	seabios)		tree=seabios;	xenbranch=xen-unstable ;;
 	xtf)			tree=xtf;	xenbranch=xen-unstable ;;
 	ovmf)			tree=ovmf;	xenbranch=xen-unstable ;;
+	freebsd-*)		tree=freebsd;	xenbranch=xen-unstable ;;
 	distros-*|examine)	tree=none;	xenbranch=xen-unstable ;;
 	osstest)		tree=osstest;	xenbranch=xen-unstable ;;
 	esac
diff --git a/daily-cron-email-adhoc--freebsd-master b/daily-cron-email-adhoc--freebsd-master
new file mode 100644
index 00000000..b64821af
--- /dev/null
+++ b/daily-cron-email-adhoc--freebsd-master
@@ -0,0 +1 @@
+To: royger@FreeBSD.org
diff --git a/daily-cron-email-play--freebsd-master b/daily-cron-email-play--freebsd-master
new file mode 100644
index 00000000..b64821af
--- /dev/null
+++ b/daily-cron-email-play--freebsd-master
@@ -0,0 +1 @@
+To: royger@FreeBSD.org
diff --git a/daily-cron-email-real--freebsd-master b/daily-cron-email-real--freebsd-master
new file mode 100644
index 00000000..6ee2fa4d
--- /dev/null
+++ b/daily-cron-email-real--freebsd-master
@@ -0,0 +1,4 @@
+To: xen-devel@lists.xenproject.org,
+    osstest-admin@xenproject.org,
+    royger@FreeBSD.org
+Bcc: osstest-output@lists.xenproject.org
-- 
2.11.0 (Apple Git-81)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v7 20/20] osstest: save/retrieve the last successfully tested FreeBSD build
  2017-07-25 15:00 [PATCH v7 00/20] osstest: initial FreeBSD support Roger Pau Monne
                   ` (3 preceding siblings ...)
  2017-07-25 15:00 ` [PATCH v7 19/20] osstest: hook FreeBSD flight into cr-daily-branch Roger Pau Monne
@ 2017-07-25 15:00 ` Roger Pau Monne
  2017-07-25 15:18   ` Ian Jackson
  2017-07-26  7:40 ` [PATCH v7 00/20] osstest: initial FreeBSD support Roger Pau Monne
  5 siblings, 1 reply; 14+ messages in thread
From: Roger Pau Monne @ 2017-07-25 15:00 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Roger Pau Monne

And use it in order to install the hosts for the next FreeBSD flight.

Note that the anoints are done after the push, but there's a recovery
mechanism in case osstest manages to do a successful push, but the
artifacts are not anointed for some reason. Osstest will continue to
create flights until the revision of the anointed artifacts matches
the one pushed to the repository (even if that means running flights
with OLD_REVISION == NEW_REVISION).

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v6:
 - Use just the branch name for anoint (instead of freebsd-$branch).
 - Force the creation of flights if the revision of the current
   anoints don't match OLD_VERSION.
 - Iterate over the list of current anoints instead of open-coding the
   arches.
 - Split the retrieve/anoint code blocks into it's own sections.

Changes since v5:
 - New in this version.
---
 cr-daily-branch | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/cr-daily-branch b/cr-daily-branch
index af17ad20..d74f9c33 100755
--- a/cr-daily-branch
+++ b/cr-daily-branch
@@ -126,6 +126,34 @@ elif [ "x$OSSTEST_NO_BASELINE" != xy ] ; then
 	fi
 fi
 
+# For convenience set a global variable with the FreeBSD branch
+# under test, so that we don't need to repeat this in several
+# places
+case "$branch" in
+freebsd-*) freebsd_branch=${branch#freebsd-} ;;
+*) freebsd_branch=master ;;
+esac
+
+case "$branch" in
+freebsd-*)
+    IFS=$'\n'
+    for anointed in \
+        `./mg-anoint list-prepared "freebsd build $freebsd_branch*"`; do
+        # Check if the anointed version matches OLD_VERSION,
+        # or else force a new flight, even if OLD_REVISION matches
+        # NEW_REVISION.
+        flight_job=`./mg-anoint retrieve "$anointed"`
+        anointed_revision=`check_tested --flight=${flight_job%% *} \
+                                        --print-revision=$tree`
+        if [ "x$anointed_revision" != "x$OLD_REVISION" ]; then
+            skipidentical=false
+            break
+        fi
+    done
+    unset IFS
+    ;;
+esac
+
 if [ "x$REVISION_XEN" = x ]; then
         REVISION_XEN="`fetch_version $xenbranch`"
         export REVISION_XEN
@@ -277,6 +305,19 @@ freebsd)
 	;;
 esac
 
+IFS=$'\n'
+for anointed in \
+    `./mg-anoint list-prepared "freebsd build $freebsd_branch*"`; do
+    # Retrieve previous successful FreeBSD build for each arch.
+    freebsd_arch=${anointed##* }
+    freebsd_envvar="FREEBSD_${freebsd_arch^^}_BUILDJOB"
+    if [ "x${!freebsd_envvar}" = "x" ]; then
+        flight_job=`./mg-anoint retrieve "$anointed"`
+        export ${freebsd_envvar}=${flight_job/ /.}
+    fi
+done
+unset IFS
+
 if [ "x$OLD_REVISION" = xdetermine-late ]; then
 	OLD_REVISION="`\
  $AP_FETCH_PFX ./ap-fetch-version-baseline-late $branch $NEW_REVISION`"
@@ -476,6 +517,33 @@ else
         echo
 fi
 
+# Do the anoints after the push: if for some reason this fails,
+# and osstest ends up with a pushed revision that doesn't match
+# the latest anointed artifact a new flight will be run regardless
+# of whether OLD_REVISION == NEW_REVISION.
+case "$branch" in
+freebsd-*)
+    if grep '^tolerable$' $mrof >/dev/null 2>&1 && $OSSTEST_ANOINT &&
+       [ "x$OSSTEST_BLESSING" == "xreal" ]; then
+        IFS=$'\n'
+        for anointed in `./mg-anoint list-prepared \
+                                     "freebsd build $freebsd_branch*"`; do
+            # Update anointed versions
+            # NB: failure to update an anointed build for a specific arch
+            # should not be fatal, and it's not an issue if one of the
+            # arches gets slightly out of sync with the other ones.
+            freebsd_arch=${anointed##* }
+            if ./mg-anoint anoint \
+                           "freebsd build $freebsd_branch $freebsd_arch" \
+                           $flight build-$freebsd_arch-freebsd; then
+                echo "Anointed artifacts from build-$freebsd_arch-freebsd"
+            fi
+        done
+        unset IFS
+    fi
+    ;;
+esac
+
 if [ -f $revlog ]; then
     revlog_lines=`wc -l <$revlog`
     if [ $revlog_lines -lt 300 ]; then
-- 
2.11.0 (Apple Git-81)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v7 11/20] osstest: introduce an OS $ho field
  2017-07-25 15:00 ` [PATCH v7 11/20] osstest: introduce an OS $ho field Roger Pau Monne
@ 2017-07-25 15:13   ` Ian Jackson
  0 siblings, 0 replies; 14+ messages in thread
From: Ian Jackson @ 2017-07-25 15:13 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

Roger Pau Monne writes ("[PATCH v7 11/20] osstest: introduce an OS $ho field"):
> In order to differentiate between FreeBSD and Debian hosts.
...
> +        $ho->{Os} = target_var($ho, "os") // "debian";

I will change this to "OS" when committing, if you don't first.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v7 18/20] osstest: introduce a script to create a FreeBSD flight
  2017-07-25 15:00 ` [PATCH v7 18/20] osstest: introduce a script to create a FreeBSD flight Roger Pau Monne
@ 2017-07-25 15:13   ` Ian Jackson
  0 siblings, 0 replies; 14+ messages in thread
From: Ian Jackson @ 2017-07-25 15:13 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

Roger Pau Monne writes ("[PATCH v7 18/20] osstest: introduce a script to create a FreeBSD flight"):
> The logic to create a FreeBSD build job is added to
> make-freebsd-flight. This includes creating a FreeBSD build job, and
> also testing the output of that build job (by creating another build
> job that depends on the output of the first).
> 
> Note that the FreeBSD build job needs some input in order to setup a
> FreeBSD host, and that can be fetched from different places:
> 
> 1. Env variable FREEBSD_<arch>_BUILDJOB: use the output from a
> previous build-<arch>-freebsd job.
> 
> 2. Env variables FREEBSD_DIST and FREEBSD_VERSION: set before calling
> into make-flight, provide the path to the installer image and sets
> folder and the version being installed.
> 
> 3. Config file FreeBSDDist and FreeBSDVersion: same as 2. except that
> they are set on the config file.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v7 19/20] osstest: hook FreeBSD flight into cr-daily-branch
  2017-07-25 15:00 ` [PATCH v7 19/20] osstest: hook FreeBSD flight into cr-daily-branch Roger Pau Monne
@ 2017-07-25 15:14   ` Ian Jackson
  0 siblings, 0 replies; 14+ messages in thread
From: Ian Jackson @ 2017-07-25 15:14 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

Roger Pau Monne writes ("[PATCH v7 19/20] osstest: hook FreeBSD flight into cr-daily-branch"):
> Add the missing pieces so that cr-daily-branch knows how to create a
> FreeBSD flight. This has been tested by calling `./cr-daily-branch
> freebsd-master`.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v7 20/20] osstest: save/retrieve the last successfully tested FreeBSD build
  2017-07-25 15:00 ` [PATCH v7 20/20] osstest: save/retrieve the last successfully tested FreeBSD build Roger Pau Monne
@ 2017-07-25 15:18   ` Ian Jackson
  2017-07-25 15:37     ` Roger Pau Monne
  2017-07-26  8:14     ` Roger Pau Monne
  0 siblings, 2 replies; 14+ messages in thread
From: Ian Jackson @ 2017-07-25 15:18 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

Roger Pau Monne writes ("[PATCH v7 20/20] osstest: save/retrieve the last successfully tested FreeBSD build"):
> And use it in order to install the hosts for the next FreeBSD flight.
...
> +case "$branch" in
> +freebsd-*)
> +    IFS=$'\n'

That's quite brave, but I don't object.  I would have piped the output
into `read' or something.

> +    for anointed in \> +        `./mg-anoint list-prepared "freebsd build $freebsd_branch*"`; do
                                                                    ^
I think there is a missing space between $freebsd_branch and * ?

> +IFS=$'\n'
> +for anointed in \
> +    `./mg-anoint list-prepared "freebsd build $freebsd_branch*"`; do
> +    # Retrieve previous successful FreeBSD build for each arch.
> +    freebsd_arch=${anointed##* }
> +    freebsd_envvar="FREEBSD_${freebsd_arch^^}_BUILDJOB"
> +    if [ "x${!freebsd_envvar}" = "x" ]; then
> +        flight_job=`./mg-anoint retrieve "$anointed"`
> +        export ${freebsd_envvar}=${flight_job/ /.}
> +    fi
> +done
> +unset IFS

LGTM apart from the same missing space.

So if you add those spaces:

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v7 20/20] osstest: save/retrieve the last successfully tested FreeBSD build
  2017-07-25 15:18   ` Ian Jackson
@ 2017-07-25 15:37     ` Roger Pau Monne
  2017-07-26  8:14     ` Roger Pau Monne
  1 sibling, 0 replies; 14+ messages in thread
From: Roger Pau Monne @ 2017-07-25 15:37 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Tue, Jul 25, 2017 at 04:18:52PM +0100, Ian Jackson wrote:
> Roger Pau Monne writes ("[PATCH v7 20/20] osstest: save/retrieve the last successfully tested FreeBSD build"):
> > And use it in order to install the hosts for the next FreeBSD flight.
> ...
> > +case "$branch" in
> > +freebsd-*)
> > +    IFS=$'\n'
> 
> That's quite brave, but I don't object.  I would have piped the output
> into `read' or something.

Yes, I think that would be better, let me do that as a patch on top of
this afterwards. I'm currently building the new images and I cannot
play freely with osstest ATM.

> > +    for anointed in \> +        `./mg-anoint list-prepared "freebsd build $freebsd_branch*"`; do
>                                                                     ^
> I think there is a missing space between $freebsd_branch and * ?
> 
> > +IFS=$'\n'
> > +for anointed in \
> > +    `./mg-anoint list-prepared "freebsd build $freebsd_branch*"`; do
> > +    # Retrieve previous successful FreeBSD build for each arch.
> > +    freebsd_arch=${anointed##* }
> > +    freebsd_envvar="FREEBSD_${freebsd_arch^^}_BUILDJOB"
> > +    if [ "x${!freebsd_envvar}" = "x" ]; then
> > +        flight_job=`./mg-anoint retrieve "$anointed"`
> > +        export ${freebsd_envvar}=${flight_job/ /.}
> > +    fi
> > +done
> > +unset IFS
> 
> LGTM apart from the same missing space.
> 
> So if you add those spaces:
> 
> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Thanks, I've now pushed this (also with the other acks) to:

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

Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v7 00/20] osstest: initial FreeBSD support
  2017-07-25 15:00 [PATCH v7 00/20] osstest: initial FreeBSD support Roger Pau Monne
                   ` (4 preceding siblings ...)
  2017-07-25 15:00 ` [PATCH v7 20/20] osstest: save/retrieve the last successfully tested FreeBSD build Roger Pau Monne
@ 2017-07-26  7:40 ` Roger Pau Monne
  5 siblings, 0 replies; 14+ messages in thread
From: Roger Pau Monne @ 2017-07-26  7:40 UTC (permalink / raw)
  To: xen-devel, Ian Jackson

On Tue, Jul 25, 2017 at 04:00:27PM +0100, Roger Pau Monne wrote:
> Hello,
> 
> Note that this thread only contains the patches that need an ack or
> have been modified in some way between v6 and v7. This is done in
> order to prevent spamming the list with already acked patches for such
> long series. The full series can be found at:
> 
> git://xenbits.xen.org/people/royger/osstest.git freebsd_v7
> 
> This includes Ian's mg-anoint series.
> 
> The procedure to enable this in production mode (ie: on the mass
> osstest instance) is as follows:
> 
> 1. Make the memdisk binary available from the tftp path. This is
>    described in patch 5.
> 
> 2. Pick the output from a previous FreeBSD build and make it available
>    to the osstest controller. I'm currently running a flight that
>    should create a suitable installer for the mass osstest instance
>    (should contain the right ssh authorized keys). Taking the output
>    of flight 71726 as an example, the contents of the build folder [0]
>    should be copied to the osstest controller. The following path
>    hierarchy should be used:
> 
>       <FREEBSD_DIST>/amd64/{install.img,MANIFEST,base.txz,kernel.txz}
> 

The flight has finished successfully and the images are at:

http://osstest.xs.citrite.net/~osstest/testlogs/logs/71750/build-amd64-freebsd/build/

FYI, the summary of the flight:

http://osstest.xs.citrite.net/~osstest/testlogs/logs/71750/

I've already anointed those in the cam osstest instance.

> 
> 3. The path in FREEBSD_DIST described above should be set on the
>    environment, together with FREEBSD_VERSION:
> 
>       export FREEBSD_DIST=<FREEBSD_DIST>
>       export FREEBSD_VERSION=12
> 
> 4. Run cr-daily-branch to create the first build output:
> 
>       ./cr-daily-branch freebsd-master
> 
> 5. Prepare and anoint the first build (provided the previous step 4.
>    is successful):
> 
>    ./mg-anoint prepare 'freebsd build master amd64' 'FreeBSD HEAD amd64 builds'
>    ./mg-anoint anoint --allow-blessed=play 'freebsd build master amd64' $flight build-amd64-freebsd
> 
> 6. Unset FREEBSD_DIST and FREEBSD_VERSION.
> 
> Thanks, Roger.
> 
> [0] http://osstest.xs.citrite.net/~osstest/testlogs/logs/71726/build-amd64-freebsd/build/
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v7 20/20] osstest: save/retrieve the last successfully tested FreeBSD build
  2017-07-25 15:18   ` Ian Jackson
  2017-07-25 15:37     ` Roger Pau Monne
@ 2017-07-26  8:14     ` Roger Pau Monne
  2017-07-26  9:19       ` Roger Pau Monne
  1 sibling, 1 reply; 14+ messages in thread
From: Roger Pau Monne @ 2017-07-26  8:14 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Tue, Jul 25, 2017 at 04:18:52PM +0100, Ian Jackson wrote:
> Roger Pau Monne writes ("[PATCH v7 20/20] osstest: save/retrieve the last successfully tested FreeBSD build"):
> > And use it in order to install the hosts for the next FreeBSD flight.
> ...
> > +case "$branch" in
> > +freebsd-*)
> > +    IFS=$'\n'
> 
> That's quite brave, but I don't object.  I would have piped the output
> into `read' or something.

I have the following which can be applied on top and is IMHO better, I
also don't fancy playing with IFS. I can push a new branch with this
folded if that's more convenient.

---8<---
diff --git a/cr-daily-branch b/cr-daily-branch
index 91f73ad8..66e7e88b 100755
--- a/cr-daily-branch
+++ b/cr-daily-branch
@@ -136,9 +136,7 @@ esac
 
 case "$branch" in
 freebsd-*)
-    IFS=$'\n'
-    for anointed in \
-        `./mg-anoint list-prepared "freebsd build $freebsd_branch *"`; do
+    while read anointed; do
         # Check if the anointed version matches OLD_VERSION,
         # or else force a new flight, even if OLD_REVISION matches
         # NEW_REVISION.
@@ -149,8 +147,7 @@ freebsd-*)
             skipidentical=false
             break
         fi
-    done
-    unset IFS
+    done <<< `./mg-anoint list-prepared "freebsd build $freebsd_branch *"`
     ;;
 esac
 
@@ -305,9 +302,7 @@ freebsd)
 	;;
 esac
 
-IFS=$'\n'
-for anointed in \
-    `./mg-anoint list-prepared "freebsd build $freebsd_branch *"`; do
+while read anointed; do
     # Retrieve previous successful FreeBSD build for each arch.
     freebsd_arch=${anointed##* }
     freebsd_envvar="FREEBSD_${freebsd_arch^^}_BUILDJOB"
@@ -315,8 +310,7 @@ for anointed in \
         flight_job=`./mg-anoint retrieve "$anointed"`
         export ${freebsd_envvar}=${flight_job/ /.}
     fi
-done
-unset IFS
+done <<< `./mg-anoint list-prepared "freebsd build $freebsd_branch *"`
 
 if [ "x$OLD_REVISION" = xdetermine-late ]; then
 	OLD_REVISION="`\
@@ -525,9 +519,7 @@ case "$branch" in
 freebsd-*)
     if grep '^tolerable$' $mrof >/dev/null 2>&1 && $OSSTEST_ANOINT &&
        [ "x$OSSTEST_BLESSING" == "xreal" ]; then
-        IFS=$'\n'
-        for anointed in `./mg-anoint list-prepared \
-                                     "freebsd build $freebsd_branch *"`; do
+        while read anointed; do
             # Update anointed versions
             # NB: failure to update an anointed build for a specific arch
             # should not be fatal, and it's not an issue if one of the
@@ -537,8 +529,8 @@ freebsd-*)
                            $flight build-$freebsd_arch-freebsd; then
                 echo "Anointed artifacts from build-$freebsd_arch-freebsd"
             fi
-        done
-        unset IFS
+        done <<< `./mg-anoint list-prepared \
+                              "freebsd build $freebsd_branch *"`
     fi
     ;;
 esac


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v7 20/20] osstest: save/retrieve the last successfully tested FreeBSD build
  2017-07-26  8:14     ` Roger Pau Monne
@ 2017-07-26  9:19       ` Roger Pau Monne
  0 siblings, 0 replies; 14+ messages in thread
From: Roger Pau Monne @ 2017-07-26  9:19 UTC (permalink / raw)
  To: Ian Jackson, xen-devel

On Wed, Jul 26, 2017 at 09:14:33AM +0100, Roger Pau Monne wrote:
> On Tue, Jul 25, 2017 at 04:18:52PM +0100, Ian Jackson wrote:
> > Roger Pau Monne writes ("[PATCH v7 20/20] osstest: save/retrieve the last successfully tested FreeBSD build"):
> > > And use it in order to install the hosts for the next FreeBSD flight.
> > ...
> > > +case "$branch" in
> > > +freebsd-*)
> > > +    IFS=$'\n'
> > 
> > That's quite brave, but I don't object.  I would have piped the output
> > into `read' or something.
> 
> I have the following which can be applied on top and is IMHO better, I
> also don't fancy playing with IFS. I can push a new branch with this
> folded if that's more convenient.

After our IRC conversation about here strings and failure, the
following one using pipes is probably better.

---8<---
diff --git a/cr-daily-branch b/cr-daily-branch
index 91f73ad8..bbb1d765 100755
--- a/cr-daily-branch
+++ b/cr-daily-branch
@@ -136,9 +136,8 @@ esac
 
 case "$branch" in
 freebsd-*)
-    IFS=$'\n'
-    for anointed in \
-        `./mg-anoint list-prepared "freebsd build $freebsd_branch *"`; do
+    ./mg-anoint list-prepared "freebsd build $freebsd_branch *" | \
+    while read anointed; do
         # Check if the anointed version matches OLD_VERSION,
         # or else force a new flight, even if OLD_REVISION matches
         # NEW_REVISION.
@@ -150,7 +149,6 @@ freebsd-*)
             break
         fi
     done
-    unset IFS
     ;;
 esac
 
@@ -305,9 +303,8 @@ freebsd)
 	;;
 esac
 
-IFS=$'\n'
-for anointed in \
-    `./mg-anoint list-prepared "freebsd build $freebsd_branch *"`; do
+./mg-anoint list-prepared "freebsd build $freebsd_branch *" | \
+while read anointed; do
     # Retrieve previous successful FreeBSD build for each arch.
     freebsd_arch=${anointed##* }
     freebsd_envvar="FREEBSD_${freebsd_arch^^}_BUILDJOB"
@@ -316,7 +313,6 @@ for anointed in \
         export ${freebsd_envvar}=${flight_job/ /.}
     fi
 done
-unset IFS
 
 if [ "x$OLD_REVISION" = xdetermine-late ]; then
 	OLD_REVISION="`\
@@ -525,9 +521,8 @@ case "$branch" in
 freebsd-*)
     if grep '^tolerable$' $mrof >/dev/null 2>&1 && $OSSTEST_ANOINT &&
        [ "x$OSSTEST_BLESSING" == "xreal" ]; then
-        IFS=$'\n'
-        for anointed in `./mg-anoint list-prepared \
-                                     "freebsd build $freebsd_branch *"`; do
+        ./mg-anoint list-prepared "freebsd build $freebsd_branch *" | \
+        while read anointed; do
             # Update anointed versions
             # NB: failure to update an anointed build for a specific arch
             # should not be fatal, and it's not an issue if one of the
@@ -538,7 +533,6 @@ freebsd-*)
                 echo "Anointed artifacts from build-$freebsd_arch-freebsd"
             fi
         done
-        unset IFS
     fi
     ;;
 esac


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-07-26  9:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-25 15:00 [PATCH v7 00/20] osstest: initial FreeBSD support Roger Pau Monne
2017-07-25 15:00 ` [PATCH v7 11/20] osstest: introduce an OS $ho field Roger Pau Monne
2017-07-25 15:13   ` Ian Jackson
2017-07-25 15:00 ` [PATCH v7 12/20] osstest: add support for the FreeBSD package manager Roger Pau Monne
2017-07-25 15:00 ` [PATCH v7 18/20] osstest: introduce a script to create a FreeBSD flight Roger Pau Monne
2017-07-25 15:13   ` Ian Jackson
2017-07-25 15:00 ` [PATCH v7 19/20] osstest: hook FreeBSD flight into cr-daily-branch Roger Pau Monne
2017-07-25 15:14   ` Ian Jackson
2017-07-25 15:00 ` [PATCH v7 20/20] osstest: save/retrieve the last successfully tested FreeBSD build Roger Pau Monne
2017-07-25 15:18   ` Ian Jackson
2017-07-25 15:37     ` Roger Pau Monne
2017-07-26  8:14     ` Roger Pau Monne
2017-07-26  9:19       ` Roger Pau Monne
2017-07-26  7:40 ` [PATCH v7 00/20] osstest: initial FreeBSD support Roger Pau Monne

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.