From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Ian.Jackson@eu.citrix.com, Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH v4 15/16] osstest: introduce a script to create a FreeBSD flight
Date: Thu, 6 Jul 2017 15:42:26 +0100 [thread overview]
Message-ID: <20170706144227.36580-16-roger.pau@citrix.com> (raw)
In-Reply-To: <20170706144227.36580-1-roger.pau@citrix.com>
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_BUILDJOB: use the output from a previous
build-<arch>-freebsd.
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 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 | 11 +++++++
ap-common | 4 +++
make-freebsd-flight | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 98 insertions(+)
create mode 100755 make-freebsd-flight
diff --git a/README b/README
index b45058da..51243974 100644
--- a/README
+++ b/README
@@ -423,6 +423,17 @@ HostGroupFlags_<group>
DebianPreseed
Text to add to the debian-installer preseed file. Optional.
+FreeBSDDist
+ Path to the folder that contains 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).
+
+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/ap-common b/ap-common
index cbb815ce..d4fa7aef 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}
diff --git a/make-freebsd-flight b/make-freebsd-flight
new file mode 100755
index 00000000..cd2ddbdd
--- /dev/null
+++ b/make-freebsd-flight
@@ -0,0 +1,83 @@
+#!/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
+
+arch=amd64
+
+job_create_build_filter_callback () {
+ :
+}
+
+get_freebsdjob_runvars () {
+ # Figure out where are the installer binaries. The order is the following:
+ #
+ # 1. Env variable FREEBSD_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.
+ #
+ if [ -n "$FREEBSD_BUILDJOB" ]; then
+ runvars="freebsdbuildjob=$FREEBSD_BUILDJOB"
+ elif [ -n "$FREEBSD_DIST" ] && [ -n "$FREEBSD_VERSION" ]; then
+ runvars="freebsd_distpath=$FREEBSD_DIST freebsd_version=$FREEBSD_VERSION"
+ else
+ distpath=`getconfig "FreeBSDDist"`
+ version=`getconfig "FreeBSDVersion"`
+ runvars="freebsd_distpath=$distpath freebsd_version=$version"
+ fi
+
+ echo $runvars
+}
+
+runvars=`get_freebsdjob_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 \
+ $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 \
+ host_hostflags=arch-$arch,purpose-build \
+ tree_freebsd=$TREE_FREEBSD \
+ revision_freebsd=$REVISION_FREEBSD \
+ freebsdbuildjob=build-$arch-freebsd
+
+echo $flight
--
2.11.0 (Apple Git-81)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-07-06 14:42 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-06 14:42 [PATCH v4 00/16] osstest: initial FreeBSD support Roger Pau Monne
2017-07-06 14:42 ` [PATCH v4 01/16] osstest: make built_stash_file store a path_ runvar for each file Roger Pau Monne
2017-07-06 14:42 ` [PATCH v4 02/16] osstest: move known_hosts generation to TestSupport Roger Pau Monne
2017-07-06 14:42 ` [PATCH v4 03/16] osstest: introduce helper to get per-host tftp prefix Roger Pau Monne
2017-07-06 14:42 ` [PATCH v4 04/16] osstest: introduce a helper to calculate the sha256 of a given file Roger Pau Monne
2017-07-06 14:43 ` Ian Jackson
2017-07-06 14:42 ` [PATCH v4 05/16] osstest: introduce a helper to setup a host to boot using memdisk Roger Pau Monne
2017-07-06 16:07 ` Ian Jackson
2017-07-06 14:42 ` [PATCH v4 06/16] osstest: add a FreeBSD host install recipe Roger Pau Monne
2017-07-06 14:53 ` Ian Jackson
2017-07-06 15:13 ` Ian Jackson
2017-07-06 14:42 ` [PATCH v4 07/16] osstest: introduce build helpers for FreeBSD Roger Pau Monne
2017-07-06 14:56 ` Ian Jackson
2017-07-06 14:42 ` [PATCH v4 08/16] osstest: add support for the FreeBSD package manager Roger Pau Monne
2017-07-06 15:12 ` Ian Jackson
2017-07-07 9:55 ` Roger Pau Monne
2017-07-06 14:42 ` [PATCH v4 09/16] osstest: introduce a FreeBSD build script Roger Pau Monne
2017-07-06 15:25 ` Ian Jackson
2017-07-06 17:11 ` Roger Pau Monne
2017-07-06 17:31 ` Ian Jackson
2017-07-06 17:39 ` Roger Pau Monne
2017-07-06 17:42 ` Ian Jackson
2017-07-06 14:42 ` [PATCH v4 10/16] osstest: add support for runtime_IDENT_hostflags Roger Pau Monne
2017-07-06 15:28 ` Ian Jackson
2017-07-06 17:34 ` Roger Pau Monne
2017-07-06 17:42 ` Ian Jackson
2017-07-07 13:07 ` Roger Pau Monne
2017-07-07 13:08 ` Ian Jackson
2017-07-06 14:42 ` [PATCH v4 11/16] osstest: introduce a script to set the runtime hostflags runvar for FreeBSD jobs Roger Pau Monne
2017-07-06 15:30 ` Ian Jackson
2017-07-06 16:03 ` Ian Jackson
2017-07-06 14:42 ` [PATCH v4 12/16] osstest: allow catching-otherwise to pass arguments to the called script Roger Pau Monne
2017-07-06 15:33 ` Ian Jackson
2017-07-06 14:42 ` [PATCH v4 13/16] osstest: change the meaning of need_build_host Roger Pau Monne
2017-07-06 15:37 ` Ian Jackson
2017-07-07 11:36 ` Roger Pau Monne
2017-07-07 13:00 ` Ian Jackson
2017-07-06 14:42 ` [PATCH v4 14/16] osstest: add support for FreeBSD buildjobs to sg-run-job Roger Pau Monne
2017-07-06 15:38 ` Ian Jackson
2017-07-06 14:42 ` Roger Pau Monne [this message]
2017-07-06 16:04 ` [PATCH v4 15/16] osstest: introduce a script to create a FreeBSD flight Ian Jackson
2017-07-07 14:39 ` Roger Pau Monne
2017-07-06 14:42 ` [PATCH v4 16/16] osstest: hook FreeBSD flight into cr-daily-branch Roger Pau Monne
2017-07-06 16:10 ` Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170706144227.36580-16-roger.pau@citrix.com \
--to=roger.pau@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).