diff mbox

[OSSTEST,05/11] ts-xen-build: Build livepatches test-cases

Message ID 1496857742-20191-6-git-send-email-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ian Jackson June 7, 2017, 5:48 p.m. UTC
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Livepatch compiles and works on x86/ARM{32|64} so we can enable it
in the Xen config when requested by the enable_livepatch runvar.

When we are trying to build with enable_livepatch, run `make
dist-tests' as well, to ship the test cases.  This depends on a
corresponding change to xen.git.

Finally, split the livepatch tests into their own stashed deliverable
from this job.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

---
v1: New posting
v2: Put the livepatch test-cases in xentlpdist.tar.gz file
v3: Use enable_livepatch to gate the build and tarring the test-cases.
v4: Call `make dist-tests' rather than calling directly deep
     into the xen.git build system.
    Split the output ourselves in `divide' (since make dist-tests
     puts things into dist/install/.)
    Expect the livepath output in DESTDIR/usr/lib/debug/xen-livepatch
     rather than directly in DESTDIR/usr/lib/debug.
    Minor style fix.
    Rewrote the commit message.
---
 ts-xen-build | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
diff mbox

Patch

diff --git a/ts-xen-build b/ts-xen-build
index 31acb9d..eaf44b1 100755
--- a/ts-xen-build
+++ b/ts-xen-build
@@ -51,6 +51,7 @@  $dashdashdash //= -1;
 builddirsprops();
 
 my $enable_xsm = ($r{enable_xsm}//'false') =~ m/true/ ? 1 : 0;
+my $enable_livepatch = ($r{enable_livepatch}//'false') =~ m/true/ ? 1 : 0;
 
 $buildcmd_global_prefix= <<END;
     export XEN_CONFIG_EXPERT=y
@@ -95,6 +96,12 @@  sub checkout () {
 	echo >>.config LIBLEAFDIR_x86_64=lib
 	echo >>.config KERNELS=''
 END
+               (${enable_livepatch} ? <<END : '').
+	if test -f xen/Kconfig; then
+		echo >>xen/.config CONFIG_LIVEPATCH=y
+		echo >>xen/.config CONFIG_FAST_SYMBOL_LOOKUP=y
+    fi
+END
                (nonempty($r{enable_xsm}) ? <<END : '').
 	if test -f xen/Kconfig; then
 		echo >>xen/.config CONFIG_XSM='${build_xsm}'
@@ -164,6 +171,12 @@  END
 END
 	store_runvar("flaskpolicy", "xenpolicy-" . $xen_version);
     }
+
+    if ($enable_livepatch) {
+        buildcmd_stamped_logged(600, 'xen', 'xenlpt', '',<<END,'')
+            $make_prefix make $makeflags dist-tests
+END
+    }
 }
 
 sub divide () {
@@ -193,6 +206,12 @@  sub divide () {
                 mv \$mvfiles xeninstall/boot/.
             fi
         fi
+        lp=usr/lib/debug/xen-livepatch
+        mkdir -p xenlpt/\$lp
+        if test -d install/\$lp; then
+            mvfiles=`find install/\$lp '(' -name 'xen-syms*' -o -name '*.map' -o -name '*.livepatch' ')' -print`
+            mv \$mvfiles xenlpt/\$lp/.
+        fi
 	if test -d install/usr/lib64/efi/; then
             if test -f install/usr/lib64/efi/xen.efi; then
                 mkdir -p xeninstall/usr/lib64/efi
@@ -209,6 +228,8 @@  sub stash () {
                     "xen/dist/${part}install",
                     "${part}dist");
     }
+    built_stash($ho, $builddir, "xen/dist/xenlpt", "xenlptdist")
+	if $enable_livepatch;
     built_stash_file($ho, $builddir, "xen-syms", "xen/xen/xen-syms", 1);
     built_stash_file($ho, $builddir, "xen-config", "xen/.config", 1);
     built_stash_file($ho, $builddir, "xen-hv-config", "xen/xen/.config", 1);