From patchwork Tue Jul 25 15:00:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 9862197 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B3AB9601A1 for ; Tue, 25 Jul 2017 15:02:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A69CB28671 for ; Tue, 25 Jul 2017 15:02:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BA43286C0; Tue, 25 Jul 2017 15:02:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8853528671 for ; Tue, 25 Jul 2017 15:02:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1da1KF-000357-AY; Tue, 25 Jul 2017 15:00:43 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1da1KE-00032f-3H for xen-devel@lists.xenproject.org; Tue, 25 Jul 2017 15:00:42 +0000 Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id 8B/48-02185-91D57795; Tue, 25 Jul 2017 15:00:41 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMIsWRWlGSWpSXmKPExsXitHSDva5EbHm kwZOTlhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8ahVTdYC5abVvzeLtDAOEuji5GTQ0LAX+LX grOMIDabgI7Exbk72boYOThEBFQkbu81AAkzC4RItB77wg5iCwsESPTcPsUGYrMIqEocbJvEA mLzClhIzGndygIxUk/i7cQXYCM5BSwlzrWeYwKxhYBqdvd8gKoXlDg58wkLxHxNidbtv9khbH mJ5q2zmSHqFSX65z1gm8DINwtJyywkLbOQtCxgZF7FqFGcWlSWWqRraK6XVJSZnlGSm5iZo2t oYKyXm1pcnJiempOYVKyXnJ+7iREYaAxAsIPx5WnPQ4ySHExKorzfdMsjhfiS8lMqMxKLM+KL SnNSiw8xynBwKEnwbo4GygkWpaanVqRl5gBDHiYtwcGjJMLbD5LmLS5IzC3OTIdInWK05FjQs +ELE8ec3zuA5KsJ/78xCbHk5eelSonzRoM0CIA0ZJTmwY2DxeUlRlkpYV5GoAOFeApSi3IzS1 DlXzGKczAqCfPGgkzhycwrgdv6CuggJqCD5swoBTmoJBEhJdXAmHu2d9cT532695dnXPYoLZr J7Hpz+u7ftwubtnN1+Nr7rFtd23vy93kulhq52+2M7mpnDKqtZC7lbyiLkNFaY7X7SL7FUbMI W3mX9+FhtqpPO+f5qFWd2/IneRaXUJr/0+1PRG7K/jfvFrhj7L2gXPZuNPefNHWnhu9vzVnvr Gxi9JOZfbhFiaU4I9FQi7moOBEAm2hWOcYCAAA= X-Env-Sender: prvs=372c1d2af=roger.pau@citrix.com X-Msg-Ref: server-13.tower-31.messagelabs.com!1500994837!106378237!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 50957 invoked from network); 25 Jul 2017 15:00:40 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-13.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 25 Jul 2017 15:00:40 -0000 X-IronPort-AV: E=Sophos;i="5.40,411,1496102400"; d="scan'208";a="441232351" From: Roger Pau Monne To: Date: Tue, 25 Jul 2017 16:00:30 +0100 Message-ID: <20170725150032.9225-4-roger.pau@citrix.com> X-Mailer: git-send-email 2.11.0 (Apple Git-81) In-Reply-To: <20170725150032.9225-1-roger.pau@citrix.com> References: <20170725150032.9225-1-roger.pau@citrix.com> MIME-Version: 1.0 Cc: Ian Jackson , Roger Pau Monne Subject: [Xen-devel] [PATCH v7 18/20] osstest: introduce a script to create a FreeBSD flight X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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--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é Acked-by: Ian Jackson --- 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__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_ 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: + //install.img + //base.txz + //kernel.txz + //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 . + +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__BUILDJOB: use the output from a + # previous build--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