[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v6] OSSTEST: introduce a raisin build test



Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

---

Changes in v6:
- move divide to Osstest/BuildSupport.pm and rename it to
divide_xen_build; use divide_xen_build in ts-raisin-build and
ts-xen-build.

Changes in v5:
- remove setting DEFAULT_REVISION_RAISIN to master
- disable raisin when branch is not xen*
- do not overwrite raisin default variables unless both revision_* and
tree_* are set of a given component

Changes in v4:
- introduce enable_raisin in mfi-common: only build raisin when building
xen-unstable
- start off from the default raisin config, then append osstest config
options to it
- do not write variable to the raisin config if the conrresponding
runvar is not set
- remove TREE_OVMF and TREE_SEABIOS

Changes in v3:
- use $raisindir throughout ts-raisin-build
- do not specify ENABLED_COMPONENTS so that empty REVISION variables can
be used to disable building a raisin component

Changes in v2:
- set revision_* variables in mfi-common;
- in ts-raisin-build set the *_REVISION config options based on the
  revision_* variables;
- in ts-raisin-build, call store_revision appropriately;
- divide the output in an hypervisor and a tools tarball.
---
 Osstest/BuildSupport.pm |   48 +++++++++++++++++
 ap-common               |    2 +
 mfi-common              |   41 +++++++++++++++
 sg-run-job              |    5 ++
 ts-raisin-build         |  133 +++++++++++++++++++++++++++++++++++++++++++++++
 ts-xen-build            |   44 +---------------
 6 files changed, 231 insertions(+), 42 deletions(-)
 create mode 100755 ts-raisin-build

diff --git a/Osstest/BuildSupport.pm b/Osstest/BuildSupport.pm
index 933f6e1..76a3feb 100644
--- a/Osstest/BuildSupport.pm
+++ b/Osstest/BuildSupport.pm
@@ -43,6 +43,10 @@ BEGIN {
                       xendist
                       $xendist
 
+                      divide_xen_build
+                      trapping
+                      die_if_fail
+
                       submodulefixup submodule_have submodule_find
 
                       );
@@ -84,6 +88,50 @@ sub xendist () {
        ($ho, 'xendist', '', $r{"buildjob"});
 }
 
+sub divide_xen_build ($$) {
+    my ($subdir, $postfix) = @_;
+    # Only move hv to xeninstall, so that we can have
+    # xenpolicy in tools tarball.
+    #
+    # The files inside boot/ after `make dist' are
+    # xen-$XEN_VERSION: Xen binary
+    # xen.gz/xen: symlink to xen-$XEN_VERSION
+    # xen-$MAJOR: symlink to xen-$XEN_VERSION
+    # xen-$MAJOR.$MINOR: symlink to xen-$XEN_VERSION
+    # xen-sym-$XEN_VERSION: Xen symbol
+    # xenpolicy-$XEN_VERSION: flask policy binary if xsm is enabled
+    #
+    # So the following snippet will leave xenpolicy* in
+    # install/boot and get packaged to tools tarball.
+    target_cmd_build($ho, 100, $builddir, <<END);
+        cd $subdir
+        mkdir xen$postfix
+        for f in *$postfix; do
+            mkdir -p \$f/lib
+        done
+        if test -d $postfix/boot; then
+            if test -f $postfix/boot/xen.gz || test -f $postfix/boot/xen; then
+                mkdir xen$postfix/boot
+                mvfiles=`find $postfix/boot -name 'xen[a-z]*' -prune -o -name 
'xen*' -print`
+                mv \$mvfiles xen$postfix/boot/.
+            fi
+        fi
+END
+}
+
+our @probs;
+
+sub trapping ($) {
+    my ($sub) = @_;
+    my $tok= eval { $sub->(); 1; };
+    if (!$tok) { push @probs, $@; print STDERR "failure (trapped): $@\n"; }
+}
+
+sub die_if_fail () {
+    die "*** something failed:\n\n".(join "\n\n",@probs)."\n** something 
failed"
+        if @probs;
+}
+
 #----- submodules -----
 
 sub submodulefixup ($$$$) {
diff --git a/ap-common b/ap-common
index 64749e3..60eaf66 100644
--- a/ap-common
+++ b/ap-common
@@ -47,6 +47,8 @@
 # rumpsrc-related runvars needed only for old rumpuser-xen
 # (ie ones which need $bodges=1 in ts-rumpuserxen-build)
 
+: ${TREE_RAISIN:=git://xenbits.xen.org/people/sstabellini/raisin.git}
+
 : ${TREE_SEABIOS_UPSTREAM:=git://git.seabios.org/seabios.git}
 : ${PUSH_TREE_SEABIOS:=$XENBITS:/home/xen/git/osstest/seabios.git}
 : ${BASE_TREE_SEABIOS:=git://xenbits.xen.org/osstest/seabios.git}
diff --git a/mfi-common b/mfi-common
index 16fc8c5..d75823d 100644
--- a/mfi-common
+++ b/mfi-common
@@ -148,6 +148,22 @@ create_build_jobs () {
     *) enable_ovmf=true;
     esac
 
+    case "$xenbranch" in
+    xen-3.*-testing) enable_raisin=false;;
+    xen-4.0-testing) enable_raisin=false;;
+    xen-4.1-testing) enable_raisin=false;;
+    xen-4.2-testing) enable_raisin=false;;
+    xen-4.3-testing) enable_raisin=false;;
+    xen-4.4-testing) enable_raisin=false;;
+    xen-4.5-testing) enable_raisin=false;;
+    *)               enable_raisin=true;
+    esac
+    case "$branch" in
+    xen*) ;;
+    *) enable_raisin=false;;
+    esac
+
+
     eval "
         arch_runvars=\"\$ARCH_RUNVARS_$arch\"
     "
@@ -215,6 +231,31 @@ create_build_jobs () {
 
     fi
 
+    if [ "x$REVISION_RAISIN" != xdisable ] && [ "$enable_raisin" = "true" ]; 
then
+
+    ./cs-job-create $flight build-$arch-raisin build-raisin                  \
+                arch=$arch                                                   \
+        tree_xen=$TREE_XEN                                                   \
+                $RUNVARS $BUILD_RUNVARS $BUILD_RAISIN_RUNVARS $arch_runvars \
+                $suite_runvars                                               \
+                host_hostflags=$build_hostflags                              \
+                buildjob=${bfi}build-$arch                                   \
+                tree_raisin=$TREE_RAISIN                                     \
+                tree_qemuu=$TREE_QEMU_UPSTREAM                               \
+                tree_qemu=$TREE_QEMU                                         \
+                tree_seabios=$TREE_SEABIOS                                   \
+                tree_libvirt=$TREE_LIBVIRT                                   \
+                tree_ovmf=$TREE_OVMF                                         \
+                revision_xen=$REVISION_XEN                                   \
+                revision_qemu=$REVISION_QEMU                                 \
+                revision_qemuu=$REVISION_QEMU_UPSTREAM                       \
+                revision_seabios=$REVISION_SEABIOS                           \
+                revision_ovmf=$REVISION_OVMF                                 \
+                revision_libvirt=$REVISION_LIBVIRT                           \
+                revision_raisin=${REVISION_RAISIN:-${DEFAULT_REVISION_RAISIN}}\
+
+    fi
+
     if branch_wants_rumpkernel_tests; then
 
     case $arch in
diff --git a/sg-run-job b/sg-run-job
index eae159d..449118d 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -346,6 +346,7 @@ proc need-hosts/build {} { return BUILD }
 proc need-hosts/build-kern {} { return BUILD }
 proc need-hosts/build-libvirt {} { return BUILD }
 proc need-hosts/build-rumpuserxen {} { return BUILD }
+proc need-hosts/build-raisin {} { return BUILD }
 
 proc run-job/build {} {
     run-ts . = ts-xen-build
@@ -364,6 +365,10 @@ proc run-job/build-rumpuserxen {} {
     run-ts . = ts-xen-build + host tools
 }
 
+proc run-job/build-raisin {} {
+    run-ts . = ts-raisin-build
+}
+
 proc prepare-build-host {} {
     global jobinfo
     run-ts broken = ts-hosts-allocate + host
diff --git a/ts-raisin-build b/ts-raisin-build
new file mode 100755
index 0000000..2a81f97
--- /dev/null
+++ b/ts-raisin-build
@@ -0,0 +1,133 @@
+#!/usr/bin/perl -w
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2013 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/>.
+
+use strict qw(vars);
+use DBI;
+use Osstest;
+use File::Path;
+use POSIX;
+use Osstest::TestSupport;
+use Osstest::BuildSupport;
+
+tsreadconfig();
+selectbuildhost(\@ARGV);
+# remaining arguments are passed as targets to "make"
+builddirsprops();
+
+my $raisindir="$builddir/raisin";
+
+sub checkout () {
+    prepbuilddirs();
+    build_clone($ho, 'raisin', $builddir, 'raisin');
+
+    target_cmd_build($ho, 100, $builddir, <<END.
+        cd $raisindir
+        cp defconfig config
+    >>config
+
+    echo >>config MAKE=\\"make $makeflags\\"
+    echo >>config PREFIX=\\"/usr\\"
+    echo >>config DESTDIR=dist
+    echo >>config ENABLED_COMPONENTS=\\"seabios ovmf xen qemu qemu_traditional 
libvirt\\"
+END
+               (nonempty($r{tree_xen}) && nonempty($r{revision_xen}) ? <<END : 
'').
+    echo >>config XEN_URL=\\"$r{tree_xen}\\"
+    echo >>config XEN_REVISION=\\"$r{revision_xen}\\"
+END
+               (nonempty($r{tree_qemuu}) && nonempty($r{revision_qemuu}) ? 
<<END : '').
+    echo >>config QEMU_URL=\\"$r{tree_qemuu}\\"
+    echo >>config QEMU_REVISION=\\"$r{revision_qemuu}\\"
+END
+               (nonempty($r{tree_qemu}) && nonempty($r{revision_qemu}) ? <<END 
: '').
+    echo >>config QEMU_TRADITIONAL_URL=\\"$r{tree_qemu}\\"
+    echo >>config QEMU_TRADITIONAL_REVISION=\\"$r{revision_qemu}\\"
+END
+               (nonempty($r{tree_seabios}) && nonempty($r{revision_seabios}) ? 
<<END : '').
+    echo >>config SEABIOS_URL=\\"$r{tree_seabios}\\"
+    echo >>config SEABIOS_REVISION=\\"$r{revision_seabios}\\"
+END
+               (nonempty($r{tree_libvirt}) && nonempty($r{revision_libvirt}) ? 
<<END : '').
+    echo >>config LIBVIRT_URL=\\"$r{tree_libvirt}\\"
+    echo >>config LIBVIRT_REVISION=\\"$r{revision_libvirt}\\"
+END
+               (nonempty($r{tree_ovmf}) && nonempty($r{revision_ovmf}) ? <<END 
: '')
+    echo >>config OVMF_URL=\\"$r{tree_ovmf}\\"
+    echo >>config OVMF_REVISION=\\"$r{revision_ovmf}\\"
+END
+               );
+}
+
+sub build () {
+    target_cmd_root($ho, <<END);
+        cd $raisindir
+        ./raise -y install-builddep
+END
+#/;
+    target_cmd_build($ho, 9000, $builddir, <<END);
+        cd $raisindir
+        ./raise -n build
+END
+#/;
+}
+
+sub checkoutput () {
+    target_cmd_build($ho, 100, $builddir, <<END);
+            cd $raisindir/dist
+            ls boot/xen.gz
+            ls usr/sbin/xenstored
+            ls usr/sbin/xenconsoled
+            ls usr/lib/libxenlight.so
+            ls usr/sbin/xl
+            ls usr/lib/xen/boot/hvmloader
+            ls usr/lib/xen/bin/qemu-dm
+            ls usr/lib/xen/bin/qemu-system-i386
+            ls usr/sbin/libvirtd
+END
+#/;
+}
+
+sub collectversions () {
+    store_revision($ho, 'xen', "$raisindir/xen-dir", 1);
+    store_revision($ho, 'qemu', "$raisindir/qemu-traditional-dir", 1);
+    store_revision($ho, 'qemuu', "$raisindir/qemu-dir", 1);
+    store_revision($ho, 'seabios', "$raisindir/seabios-dir", 1);
+    store_revision($ho, 'ovmf', "$raisindir/ovmf-dir", 1);
+    store_revision($ho, 'libvirt', "$raisindir/libvirt-dir", 1);
+}
+
+sub stash () {
+    foreach my $part ('', 'xen') {
+        built_stash($ho, $builddir,
+                    "raisin/${part}dist",
+                    "${part}dist");
+    }
+    built_stash_file($ho, $builddir, "xen-syms", 
"raisin/xen-dir/xen/xen-syms", 1);
+    built_stash_file($ho, $builddir, "raisin-config", "raisin/config", 1);
+    built_stash_file($ho, $builddir, "seabios-config",
+             "raisin/seabios-dir/.config", 1);
+    built_compress_stashed("xen-syms");
+}
+
+
+checkout();
+trapping(\&build);
+trapping(\&checkoutput);
+trapping(\&collectversions);
+divide_xen_build('raisin', 'dist');
+stash();
+die_if_fail();
+
diff --git a/ts-xen-build b/ts-xen-build
index e757f68..10fc95b 100755
--- a/ts-xen-build
+++ b/ts-xen-build
@@ -145,36 +145,6 @@ sub collectversions () {
     store_revision($ho, 'ovmf', "$tools/firmware/ovmf-dir", 1);
 }
 
-sub divide () {
-    # Only move hv to xeninstall, so that we can have
-    # xenpolicy in tools tarball.
-    #
-    # The files inside boot/ after `make dist' are
-    # xen-$XEN_VERSION: Xen binary
-    # xen.gz/xen: symlink to xen-$XEN_VERSION
-    # xen-$MAJOR: symlink to xen-$XEN_VERSION
-    # xen-$MAJOR.$MINOR: symlink to xen-$XEN_VERSION
-    # xen-sym-$XEN_VERSION: Xen symbol
-    # xenpolicy-$XEN_VERSION: flask policy binary if xsm is enabled
-    #
-    # So the following snippet will leave xenpolicy* in
-    # install/boot and get packaged to tools tarball.
-    target_cmd_build($ho, 100, $builddir, <<END);
-        cd xen/dist
-        mkdir xeninstall
-       for f in *install; do
-           mkdir -p \$f/lib
-       done
-        if test -d install/boot; then
-            if test -f install/boot/xen.gz || test -f install/boot/xen; then
-                mkdir xeninstall/boot
-                mvfiles=`find install/boot -name 'xen[a-z]*' -prune -o -name 
'xen*' -print`
-                mv \$mvfiles xeninstall/boot/.
-            fi
-        fi
-END
-}
-
 sub stash () {
     foreach my $part ('', 'xen') {
         built_stash($ho, $builddir,
@@ -212,22 +182,12 @@ END
     $chk->finish();
 }
 
-our @probs;
-
-sub trapping ($) {
-    my ($sub) = @_;
-    my $tok= eval { $sub->(); 1; };
-    if (!$tok) { push @probs, $@; print STDERR "failure (trapped): $@\n"; }
-}
-
 checkout();
 
 trapping(\&build);
 trapping(\&collectversions);
+die_if_fail();
 
-die "*** something failed:\n\n".(join "\n\n",@probs)."\n** something failed"
-    if @probs;
-
-divide();
+divide_xen_build('xen/dist', 'install');
 stash();
 checkversions();
-- 
1.7.10.4


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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.