Skip to contentSkip to conversation

Add libvirt build and test jobs.

PATCH In review Ian Campbell 2 participants 8 messages Apr 23, 2014 – May 12, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 Add libvirt build and test jobs.

I have run this through a "cr-daily-branch --real" and the push gate machinery seem functional. The test cases run through to starting a guest which fails because virsh support has not been implemented yet.

The libvirt.git initscript is horribly redhat specific, and the debian package one is large and complex, so ts-libvirt-build inserts its own simple initscript.

I have observed the autogen.sh phase taking 34 minutes on army (arm build cluster) hence the surprisingly large timeout of an hour. The build took around 20 minutes on the same system, but I used a timeout of an hour anyway to be safe.

The standalone wrapper is updated to handle path_libvirt in set-paths.

libvirt.git's autogen.sh involves initialising/cloning a git submodule, which doesn't use osstest's git cache and introduces unpredicability into what is built. Therefore ap-* are taught about a new libvirt-gnulib tree (prefixed libvirt incase we end up with other users of gnulib in the future). However this doesn't use the usual push gate mechanism, since this was deemed to be overkill and just always uses the tip of gnulib. The results are recorded though so the bisector can still operate over this tree in the event of breakage.

---
v5: Print message in ap-push when not pushing gnulib
Switch from libvirt-gnulib to gnulib-libvirt in all tree names. Implemented with:
sed -i -e 's/\(libvirt\)\([-_]\)\(gnulib\)/\3\2\1/gi' $(git grep -il libvirt.gnulib)
And a manual inspection of the result.
v4: Use "xen-tested-master" as the push gate output.
Install extra libraries needed by the binary onto the target.
Install build dependencies in ts-xen-build-prep instead of ts-libvirt-build. Although apt-get invocations are now locked I still have concerns:
http://lists.xen.org/archives/html/xen-devel/2014-04/msg01951.html
Clone gnulib separately.
Avoid running stuff as root during build, no need
Correct ap-fetch-version-old (actually use the gate, not the main libvirt tree) Increase timeouts for arm build.
Ran through cr-daily-branch
v3: Disable uml, lxc and vbox backends at build time
Create test job on armhf as well as x86
Don't run non-libvirt tests in libvirt flights.
v2: Add a test job, which will clearly fail.
Make ts-xen-install DTRT though

---
 Osstest/TestSupport.pm |   8 ++-
 ap-common              |  10 +++
 ap-fetch-version       |   8 +++
 ap-fetch-version-old   |   9 +++
 ap-print-url           |   6 ++
 ap-push                |   9 +++
 cr-daily-branch        |  12 ++++
 cri-common             |   1 +
 make-flight            |   7 +++
 mfi-common             |  17 +++++-
 sg-run-job             |   5 ++
 standalone             |   2 +-
 ts-libvirt-build       | 162 +++++++++++++++++++++++++++++++++++++++++++++++++
 ts-xen-build-prep      |   3 +
 ts-xen-install         |   7 ++-
 15 files changed, 262 insertions(+), 4 deletions(-)
 create mode 100755 ts-libvirt-build
Osstest/TestSupport.pm +7 -1
index d49ff4f..4ea59a6 100644
@@ -1774,7 +1774,13 @@ our %toolstacks=
         Command => 'xl',
         CfgPathVar => 'cfgpath',
 	RestoreNeedsConfig => 1,
-        }
+        },
+     'libvirt' => {
+        NewDaemons => [qw(libvirtd)],
+        Dom0MemFixed => 1,
+        Command => 'virsh',
+        ExtraPackages => [qw(libnl1 libavahi-client3)],
+        },
      );
 
 sub toolstack () {
ap-common +10 -0
index cb0cfff..173f4be 100644
@@ -33,6 +33,14 @@
 
 : ${TREEVCS_LINUX:=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}
+: ${TREEVCS_LIBVIRT:=git}
+
+: ${TREE_GNULIB_LIBVIRT:=git://git.sv.gnu.org/gnulib.git}
+: ${TREEVCS_GNULIB_LIBVIRT:=git}
+
 : ${TREE_LINUXFIRMWARE:=git://xenbits.xen.org/osstest/linux-firmware.git}
 : ${PUSH_TREE_LINUXFIRMWARE:=$XENBITS:/home/osstest/ext/linux-firmware.git}
 : ${UPSTREAM_TREE_LINUXFIRMWARE:=$GIT_KERNEL_ORG/pub/scm/linux/kernel/git/firmware/linux-firmware.git}
@@ -56,6 +64,8 @@ fi
 
 : ${LOCALREV_XEN:=daily-cron.$branch}
 : ${LOCALREV_LINUX:=daily-cron.$branch}
+: ${LOCALREV_LIBVIRT:=daily-cron.$branch}
+: ${LOCALREV_GNULIB_LIBVIRT:=daily-cron.$branch}
 
 : ${TREEBASE_LINUX_XCP:=http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27}
 
ap-fetch-version +8 -0
index aaf884d..7cc2d98 100755
@@ -69,6 +69,14 @@ linuxfirmware)
 	repo_tree_rev_fetch_git linuxfirmware \
 		$UPSTREAM_TREE_LINUXFIRMWARE master daily-cron.$branch
 	;;
+libvirt)
+	repo_tree_rev_fetch_git libvirt \
+		$TREE_LIBVIRT master $LOCALREV_LIBVIRT
+	;;
+gnulib-libvirt)
+	repo_tree_rev_fetch_git gnulib-libvirt \
+		$TREE_GNULIB_LIBVIRT master $LOCALREV_GNULIB_LIBVIRT
+	;;
 osstest)
 	if [ "x$OSSTEST_USE_HEAD" != "xy" ] ; then
 	    git fetch $HOME/testing.git pretest:ap-fetch >&2
ap-fetch-version-old +9 -0
index 21ff786..3879e09 100755
@@ -27,6 +27,7 @@ select_xenbranch
 
 : ${BASE_TAG_LINUX2639:=tested/2.6.39.x}
 : ${BASE_LOCALREV_LINUX:=daily-cron.$branch.old}
+: ${BASE_LOCALREV_LIBVIRT:=daily-cron.$branch.old}
 
 : ${BASE_TREE_QEMU_UPSTREAM:=${TREE_QEMU_UPSTREAM/\/staging\//\/}}
 
@@ -73,6 +74,14 @@ linuxfirmware)
 	repo_tree_rev_fetch_git linuxfirmware \
 		$TREE_LINUXFIRMWARE master daily-cron-old.$branch
 	;;
+libvirt)
+	repo_tree_rev_fetch_git libvirt \
+		$BASE_TREE_LIBVIRT xen-tested-master $BASE_LOCALREV_LIBVIRT
+	;;
+gnulib-libvirt)
+	# No push gate, same as ap-fetch-version
+	./ap-fetch-version $branch
+	;;
 osstest)
 	if [ "x$OSSTEST_USE_HEAD" != "xy" ] ; then
 	    git fetch -f $HOME/testing.git incoming:ap-fetch
ap-print-url +6 -0
index f2812d0..b1af0b9 100755
@@ -46,6 +46,12 @@ linux-2.6.39)
 linuxfirmware)
 	echo $UPSTREAM_TREE_LINUXFIRMWARE
 	;;
+libvirt)
+	echo $TREE_LIBVIRT
+	;;
+gnulib-libvirt)
+	echo $TREE_GNULIB_LIBVIRT
+	;;
 osstest)
 	echo none:;
 	;;
ap-push +9 -0
index dc0a166..69f88a3 100755
@@ -32,6 +32,7 @@ select_xenbranch
 TREE_LINUX=$PUSH_TREE_LINUX
 TREE_QEMU_UPSTREAM=$XENBITS:/home/xen/git/qemu-upstream-${xenbranch#xen-}.git
 TREE_XEN=$PUSH_TREE_XEN
+TREE_LIBVIRT=$PUSH_TREE_LIBVIRT
 
 if info_linux_tree "$branch"; then
 	cd $repos/linux
@@ -72,6 +73,14 @@ linux-xen-*)
         cd $repos/linux
         git push $TREE_LINUX $revision:refs/heads/$branch
         ;;
+libvirt)
+	cd $repos/libvirt
+	git push $TREE_LIBVIRT $revision:xen-tested-master
+	;;
+gnulib-libvirt)
+	# No gate
+	echo "gnulib-libvirt has not push gate, refusing to push" >&2
+	exit 1
 osstest)
 	git push $HOME/testing.git $revision:incoming
 	git push $XENBITS:/home/xen/git/osstest.git $revision:master
cr-daily-branch +12 -0
index 02fef15..05fdee1 100755
@@ -133,6 +133,14 @@ if [ "x$REVISION_LINUX_ARM" = x ]; then
         export REVISION_LINUX_ARM
     fi
 fi
+if [ "x$REVISION_LIBVIRT" = x ]; then
+	determine_version REVISION_LIBVIRT libvirt
+	export REVISION_LIBVIRT
+fi
+if [ "x$REVISION_GNULIB_LIBVIRT" = x ]; then
+	determine_version REVISION_GNULIB_LIBVIRT gnulib-libvirt
+	export REVISION_GNULIB_LIBVIRT
+fi
 if [ "x$REVISION_LINUXFIRMWARE" = x ]; then
 	determine_version REVISION_LINUXFIRMWARE linuxfirmware
         export REVISION_LINUXFIRMWARE
@@ -165,6 +173,10 @@ linuxfirmware)
 	realtree=linuxfirmware
 	NEW_REVISION=$REVISION_LINUXFIRMWARE
         ;;
+libvirt)
+	realtree=libvirt
+	NEW_REVISION=$REVISION_LIBVIRT
+	;;
 *)
 	NEW_REVISION=''
 	wantpush=false
cri-common +1 -0
index 497d4e3..f472927 100644
@@ -42,6 +42,7 @@ select_xenbranch () {
 	linux)			tree=linux;	xenbranch=xen-unstable ;;
 	linux-*)		tree=linux;	xenbranch=xen-unstable ;;
 	linuxfirmware)	    tree=linuxfirmware;	xenbranch=xen-unstable ;;
+	libvirt)		tree=libvirt;	xenbranch=xen-unstable ;;
 	osstest)		tree=osstest;	xenbranch=xen-unstable ;;
 	esac
 	if [ "x$tree" = xlinux ]; then
make-flight +7 -0
index 92b813a..aadf58b 100755
@@ -64,6 +64,9 @@ job_create_test_filter_callback () {
           return 1;;
       esac
       ;;
+    libvirt)
+      if [ x$toolstack != xlibvirt ] ; then return 1; fi
+      ;;
     *)
       case "$job" in
         *-qemuu-*)
@@ -238,6 +241,10 @@ test_matrix_do_one () {
             $xenarch $dom0arch                                   \
             $debian_runvars all_hostflags=$most_hostflags
 
+  job_create_test test-$xenarch$kern-$dom0arch-libvirt test-debian libvirt \
+            $xenarch $dom0arch                                       \
+            $debian_runvars all_hostflags=$most_hostflags
+
   # No further arm tests at the moment
   if [ $dom0arch = armhf ]; then
       return
mfi-common +16 -1
index 598aa02..235575e 100644
@@ -162,6 +162,18 @@ create_build_jobs () {
                 tree_linuxfirmware=$TREE_LINUXFIRMWARE                       \
                 revision_linuxfirmware=$REVISION_LINUXFIRMWARE
 
+    ./cs-job-create $flight build-$arch-libvirt build-libvirt                \
+                arch=$arch                                                   \
+        tree_xen=$TREE_XEN                                                   \
+                $RUNVARS $BUILD_RUNVARS $BUILD_LIBVIRT_RUNVARS $arch_runvars \
+                $suite_runvars                                               \
+                host_hostflags=$build_hostflags                              \
+                buildjob=${bfi}build-$arch                                   \
+                tree_libvirt=$TREE_LIBVIRT revision_libvirt=$REVISION_LIBVIRT\
+                ${TREEVCS_LIBVIRT:+treevcs_libvirt=}${TREEVCS_LIBVIRT}       \
+                tree_gnulib_libvirt=$TREE_GNULIB_LIBVIRT revision_gnulib_libvirt=$REVISION_GNULIB_LIBVIRT\
+                ${TREEVCS_GNULIB_LIBVIRT:+treevcs_gnulib_libvirt=}${TREEVCS_GNULIB_LIBVIRT}
+
     case "$arch" in
     armhf) continue;; # don't do any other kernel builds
     esac
@@ -193,6 +205,7 @@ job_create_test () {
 
   xenbuildjob="${bfi}build-$xenarch"
   buildjob="${bfi}build-$dom0arch"
+  tsbuildjob=
 
   case "$xenbranch:$toolstack" in
     xen-3.*-testing:*) ;;
@@ -203,11 +216,13 @@ job_create_test () {
     *:xend) xenbuildjob="$xenbuildjob-xend"
             buildjob="${bfi}build-$dom0arch-xend"
             ;;
+    *:libvirt) tsbuildjob="libvirtbuildjob=$buildjob-libvirt"
+            ;;
   esac
 
   ./cs-job-create $flight $job $recipe toolstack=$toolstack       \
     $RUNVARS $TEST_RUNVARS $most_runvars                          \
-    xenbuildjob=$xenbuildjob buildjob=$buildjob "$@"
+    xenbuildjob=$xenbuildjob buildjob=$buildjob $tsbuildjob "$@"
 }
 
 # Iterate over xenarch, dom0arch and kernel calling test_matrix_do_one
sg-run-job +5 -0
index d336fbd..3d44331 100755
@@ -312,6 +312,7 @@ proc test-guest-nomigr {g} {
 
 proc need-hosts/build {} { return BUILD }
 proc need-hosts/build-kern {} { return BUILD }
+proc need-hosts/build-libvirt {} { return BUILD }
 
 proc run-job/build {} {
     run-ts . = ts-xen-build
@@ -321,6 +322,10 @@ proc run-job/build-kern {} {
     run-ts . = ts-kernel-build
 }
 
+proc run-job/build-libvirt {} {
+    run-ts . = ts-libvirt-build
+}
+
 proc prepare-build-host {} {
     global jobinfo
     run-ts broken = ts-hosts-allocate + host
standalone +1 -1
index 8d9d88a..6b08995 100755
@@ -171,7 +171,7 @@ case $op in
 
 	job=$1; shift
 
-	for d in '' xen kern ; do
+	for d in '' xen kern libvirt ; do
 	    runvar="path_${d}dist"
  	    path="build/${d}dist.tar.gz"
 	    if [ -f "logs/$flight/$job/$path" ] ; then
ts-libvirt-build new file +162 -0

162 lines not on this page · raw message

ts-xen-build-prep +3 -0
index 528d0a4..a4e166e 100755
@@ -172,6 +172,9 @@ sub prep () {
                                libx11-dev git-core uuid-dev gettext gawk
                                libsdl-dev libyajl-dev libaio-dev libpixman-1-dev
                                libglib2.0-dev pkg-config
+                               autoconf automake libtool xsltproc
+                               libxml2-utils libxml2-dev libnl-dev
+                               libdevmapper-dev w3c-dtd-xhtml
 			       ccache));
 
     target_cmd_root($ho, "chmod -R a+r /usr/share/git-core/templates");
ts-xen-install +6 -1
index 4a810e4..ad0254c 100755
@@ -60,10 +60,15 @@ sub packages () {
     if ($r{arch} eq 'i386') {
 	target_install_packages($ho, 'libc6-xen');
     }
+    target_install_packages($ho, @{toolstack()->{ExtraPackages}})
+        if toolstack()->{ExtraPackages};
 }
 
 sub extract () {
-    foreach my $part ('', 'kern', 'xen') {
+    my @parts = ('', 'kern', 'xen');
+    push @parts, 'libvirt' if $r{toolstack} eq "libvirt";
+
+    foreach my $part (@parts) {
         target_extract_jobdistpath($ho, $part, "path_${part}dist",
 				   $r{"${part}buildjob"}, \%distpath);
     }
Signature · 1 line
1.9.0
#1 lore raw
Quoted 3 lines · Ian Campbell

I have run this through a "cr-daily-branch --real" and the push gate machinery seem functional. The test cases run through to starting a guest which fails because virsh support has not been implemented yet.

I discussed this with Ian yesterday and have now pushed this to osstest's own gateway, along with the following extra change.

However I won't load this new crontab until after these changes have passed the osstest push gate.

8<-----

Quoted 1 line

From 0b5094e69de4c1a6cfb866d0cfe4d10ba655285c Mon Sep 17 00:00:00 2001

From: Ian Campbell <[email protected]>
Date: Fri, 25 Apr 2014 10:07:56 +0100
Subject: [PATCH] crontab: Add a daily run of the libvirt branch.

---
 crontab | 1 +
 1 file changed, 1 insertion(+)
crontab +1 -0
index 77c7c20..002876a 100644
@@ -7,6 +7,7 @@ [email protected],[email protected]
 18		10	* * *		cd testing.git && BRANCHES=linux-linus		./cr-for-branches branches -w "./cr-daily-branch --real"
 18		11	* * *		cd testing.git && BRANCHES=linux-mingo-tip-master ./cr-for-branches branches -w "./cr-daily-branch --real"
 18		12	* * *		cd testing.git && BRANCHES=linux-3.0		./cr-for-branches branches -w "./cr-daily-branch --real"
+18		13	* * *		cd testing.git && BRANCHES=libvirt		./cr-for-branches branches -w "./cr-daily-branch --real"
 6-59/15   	*	* * *		cd testing.git && EXTRA_BRANCHES='linux-linus linux-3.0' ./cr-for-branches bisects -w "./cr-try-bisect --real"
 #8-59/5		*	* * *		cd bisects/adhoc.git &&	with-lock-ex -q data-tree-lock bash -c "./cr-try-bisect-adhoc; exit $?"
 3		5	* * *		savelog -c28 testing.git/tmp/cr-for-branches.log >/dev/null
Signature · 1 line
1.9.0
Acked-by
#2 lore raw

Ian Campbell writes ("Re: [PATCH osstest v5] Add libvirt build and test jobs."):

Quoted 10 lines · Ian Campbell
Quoted 3 lines

I have run this through a "cr-daily-branch --real" and the push gate machinery seem functional. The test cases run through to starting a guest which fails because virsh support has not been implemented yet.

I discussed this with Ian yesterday and have now pushed this to osstest's own gateway, along with the following extra change.

However I won't load this new crontab until after these changes have passed the osstest push gate.

#3 lore raw
Quoted 6 lines · Ian Jackson

Ian Campbell writes ("Re: [PATCH osstest v5] Add libvirt build and test jobs."):

Quoted 5 lines · Ian Campbell
Quoted 3 lines

I have run this through a "cr-daily-branch --real" and the push gate machinery seem functional. The test cases run through to starting a guest which fails because virsh support has not been implemented yet.

Quoted 7 lines
Quoted 5 lines

I discussed this with Ian yesterday and have now pushed this to osstest's own gateway, along with the following extra change.

However I won't load this new crontab until after these changes have passed the osstest push gate.

Which reminded me to reload the crontab now that this is through the gateway, which I've just done...

Ian.

#4 lore raw
In reply to Ian Campbell

On Wed, 2014-04-23 at 11:07 +0100, Ian Campbell wrote:

Looking at some other stuff, I think I needn't have done any of this treevcs stuff:

[...]

Quoted 1 line

+: ${TREEVCS_LIBVIRT:=git}

[...]

Quoted 1 line

+: ${TREEVCS_GNULIB_LIBVIRT:=git}

[...]

Quoted 1 line

+ ${TREEVCS_LIBVIRT:+treevcs_libvirt=}${TREEVCS_LIBVIRT} \

[...]

Right?

#5 lore raw

Ian Campbell writes ("Re: [PATCH osstest v5] Add libvirt build and test jobs."):

Quoted 10 lines

Looking at some other stuff, I think I needn't have done any of this treevcs stuff:

[...]

Quoted 1 line

+: ${TREEVCS_LIBVIRT:=git}

[...]

Quoted 1 line

+: ${TREEVCS_GNULIB_LIBVIRT:=git}

[...]

Quoted 1 line

+ ${TREEVCS_LIBVIRT:+treevcs_libvirt=}${TREEVCS_LIBVIRT} \

[...]

Yes, I don't think it's really necessary. Easier just to fold this into the urls etc.

Ian.

#6 lore raw
Quoted 6 lines · Ian Jackson

Ian Campbell writes ("Re: [PATCH osstest v5] Add libvirt build and test jobs."):

Quoted 5 lines

Looking at some other stuff, I think I needn't have done any of this treevcs stuff:

[...]

Quoted 1 line

+: ${TREEVCS_LIBVIRT:=git}

Quoted 8 lines
Quoted 5 lines

[...]

Quoted 1 line

+: ${TREEVCS_GNULIB_LIBVIRT:=git}

[...]

Quoted 1 line

+ ${TREEVCS_LIBVIRT:+treevcs_libvirt=}${TREEVCS_LIBVIRT} \

[...]

Yes, I don't think it's really necessary. Easier just to fold this into the urls etc.

Not sure what you mean by "fold into the URLS", it is already present there and things seem to be inferred correctly. So I think the relevant cleanup is to just nuke all of this.

8<----------------------

Quoted 1 line

From fa701736e100572814944c441f3c66c4643365fe Mon Sep 17 00:00:00 2001

From: Ian Campbell <[email protected]>
Date: Tue, 6 May 2014 09:05:23 +0100
Subject: [PATCH] Drop unnecessary TREEVCS settings for libvirt and
gnulib-libvirt

This will be correctly inferred from the URL.

---
 ap-common  | 2 --
 mfi-common | 2 --
 2 files changed, 4 deletions(-)
ap-common +0 -2
index 4cae650..ed37811 100644
@@ -36,10 +36,8 @@
 : ${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}
-: ${TREEVCS_LIBVIRT:=git}
 
 : ${TREE_GNULIB_LIBVIRT:=git://git.sv.gnu.org/gnulib.git}
-: ${TREEVCS_GNULIB_LIBVIRT:=git}
 
 : ${TREE_LINUXFIRMWARE:=git://xenbits.xen.org/osstest/linux-firmware.git}
 : ${PUSH_TREE_LINUXFIRMWARE:=$XENBITS:/home/osstest/ext/linux-firmware.git}
mfi-common +0 -2
index 1663c96..464001a 100644
@@ -170,9 +170,7 @@ create_build_jobs () {
                 host_hostflags=$build_hostflags                              \
                 buildjob=${bfi}build-$arch                                   \
                 tree_libvirt=$TREE_LIBVIRT revision_libvirt=$REVISION_LIBVIRT\
-                ${TREEVCS_LIBVIRT:+treevcs_libvirt=}${TREEVCS_LIBVIRT}       \
                 tree_gnulib_libvirt=$TREE_GNULIB_LIBVIRT revision_gnulib_libvirt=$REVISION_GNULIB_LIBVIRT\
-                ${TREEVCS_GNULIB_LIBVIRT:+treevcs_gnulib_libvirt=}${TREEVCS_GNULIB_LIBVIRT}
 
     case "$arch" in
     armhf) continue;; # don't do any other kernel builds
Signature · 1 line
1.9.0
Acked-by
#7 lore raw

Ian Campbell writes ("Re: [PATCH osstest v5] Add libvirt build and test jobs."):

Quoted 7 lines · Ian Jackson
Quoted 2 lines

Yes, I don't think it's really necessary. Easier just to fold this into the urls etc.

Not sure what you mean by "fold into the URLS", it is already present there and things seem to be inferred correctly. So I think the relevant cleanup is to just nuke all of this.

I think that's what I meant, yes.

Quoted 8 lines

From: Ian Campbell <[email protected]>
Date: Tue, 6 May 2014 09:05:23 +0100
Subject: [PATCH] Drop unnecessary TREEVCS settings for libvirt and
gnulib-libvirt

This will be correctly inferred from the URL.

and queued up.

Ian.