Skip to contentSkip to conversation

Add libvirt build and test jobs.

PATCH Superseded Ian Campbell 2 participants 6 messages Apr 18, 2014 – Apr 22, 2014

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 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.

---
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                |   8 +++
 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, 261 insertions(+), 4 deletions(-)
 create mode 100755 ts-libvirt-build
Osstest/TestSupport.pm +7 -1
index 65afc5b..99b313e 100644
@@ -1776,7 +1776,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..998df34 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_LIBVIRT_GNULIB:=git://git.sv.gnu.org/gnulib.git}
+: ${TREEVCS_LIBVIRT_GNULIB:=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_LIBVIRT_GNULIB:=daily-cron.$branch}
 
 : ${TREEBASE_LINUX_XCP:=http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27}
 
ap-fetch-version +8 -0
index aaf884d..4cbe84d 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
+	;;
+libvirt-gnulib)
+	repo_tree_rev_fetch_git libvirt-gnulib \
+		$TREE_LIBVIRT_GNULIB master $LOCALREV_LIBVIRT_GNULIB
+	;;
 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..661d1c0 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
+	;;
+libvirt-gnulib)
+	# 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..f05e0d1 100755
@@ -46,6 +46,12 @@ linux-2.6.39)
 linuxfirmware)
 	echo $UPSTREAM_TREE_LINUXFIRMWARE
 	;;
+libvirt)
+	echo $TREE_LIBVIRT
+	;;
+libvirt-gnulib)
+	echo $TREE_LIBVIRT_GNULIB
+	;;
 osstest)
 	echo none:;
 	;;
ap-push +8 -0
index dc0a166..c3359fc 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,13 @@ 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
+	;;
+libvirt-gnulib)
+	# No gate
+	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..2f8a394 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_LIBVIRT_GNULIB" = x ]; then
+	determine_version REVISION_LIBVIRT_GNULIB libvirt-gnulib
+	export REVISION_LIBVIRT_GNULIB
+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..503a1fc 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_libvirt_gnulib=$TREE_LIBVIRT_GNULIB revision_libvirt_gnulib=$REVISION_LIBVIRT_GNULIB\
+                ${TREEVCS_LIBVIRT_GNULIB:+treevcs_libvirt_gnulib=}${TREEVCS_LIBVIRT_GNULIB}
+
     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 2 lines · Ian Campbell

I have run this through a "cr-daily-branch --real" and the push gate machinery seem functional.

This patch is missing the crontab and/or cr-for-branches update, I figured that should be done separately after this had passed osstest's own push gate?

Ian.

#2 lore raw

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

Quoted 7 lines · Ian Campbell
Quoted 2 lines

I have run this through a "cr-daily-branch --real" and the push gate machinery seem functional.

This patch is missing the crontab and/or cr-for-branches update, I figured that should be done separately after this had passed osstest's own push gate?

Yes.

Ian.

#3 lore raw
In reply to Ian Campbell

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

Quoted 1 line

[stuff]

Thanks.

Quoted 2 lines
ap-push +0 -0
index dc0a166..c3359fc 100755

...

ap-push linux-xen-*) · line 82

Quoted 3 lines
ap-push +3 -0
+libvirt-gnulib)
+	# No gate
+	exit 1

This would result in a mysterious failure. You probably need to add a suitable echo >&2.

Quoted 4 lines
mfi-common +0 -0
index 598aa02..503a1fc 100644

...

Quoted 1 line

+ tree_libvirt_gnulib=$TREE_LIBVIRT_GNULIB revision_libv\

irt_gnulib=$REVISION_LIBVIRT_GNULIB\

Quoted 1 line

+ ${TREEVCS_LIBVIRT_GNULIB:+treevcs_libvirt_gnulib=}${TR\

EEVCS_LIBVIRT_GNULIB}

I was concerted about the "_" in "*_libvirt_gnulib" for the runvar names. I haven't been able to find anything which will actually break due to the intervening "_" and a search of the db does produce some old flights which mention a tree_linux_pq.

I think we should go with this because the alternatives are too ugly but we should watch for breakage.

Also, I wonder if "tree_gnulib_libvirt" would be more in keeping with our naming scheme. (cf "BLAH_LINUX_ARM".)

The rest of it looks plausible apart from this:

Quoted 7 lines
Osstest/TestSupport.pm +0 -0
index 65afc5b..99b313e 100644
@@ -1776,7 +1776,13 @@ our %toolstacks=
         Command => 'xl',
         CfgPathVar => 'cfgpath',

Osstest/TestSupport.pm our %toolstacks= · line 1786

Quoted 10 lines
Osstest/TestSupport.pm +7 -1
 	RestoreNeedsConfig => 1,
-        }
+        },
+     'libvirt' => {
+        NewDaemons => [qw(libvirtd)],
+        Dom0MemFixed => 1,
+        Command => 'virsh',
+        ExtraPackages => [qw(libnl1 libavahi-client3)],
+        },
      );

This is obviously not going to work. Do you intend for this to just fail in ridiculous ways, and provide a general abstraction later ?

Thanks,
Ian.

#4 lore raw
Quoted 8 lines · Ian Jackson

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

Quoted 1 line

[stuff]

Thanks.

Quoted 2 lines
ap-push +0 -0
index dc0a166..c3359fc 100755

...

Quoted 6 lines

ap-push linux-xen-*) · line 82

Quoted 3 lines
ap-push +3 -0
+libvirt-gnulib)
+	# No gate
+	exit 1

This would result in a mysterious failure. You probably need to add a suitable echo >&2.

OK.

Quoted 10 lines
Quoted 4 lines
mfi-common +0 -0
index 598aa02..503a1fc 100644

...

Quoted 1 line

+ tree_libvirt_gnulib=$TREE_LIBVIRT_GNULIB revision_libv\

irt_gnulib=$REVISION_LIBVIRT_GNULIB\

Quoted 1 line

+ ${TREEVCS_LIBVIRT_GNULIB:+treevcs_libvirt_gnulib=}${TR\

EEVCS_LIBVIRT_GNULIB}

Quoted 7 lines

I was concerted about the "_" in "*_libvirt_gnulib" for the runvar names. I haven't been able to find anything which will actually break due to the intervening "_" and a search of the db does produce some old flights which mention a tree_linux_pq.

I think we should go with this because the alternatives are too ugly but we should watch for breakage.

OK.

Quoted 2 lines

Also, I wonder if "tree_gnulib_libvirt" would be more in keeping with our naming scheme. (cf "BLAH_LINUX_ARM".)

I'm ok with either.

Quoted 14 lines

The rest of it looks plausible apart from this:

Quoted 11 lines
Osstest/TestSupport.pm +2 -1
index 65afc5b..99b313e 100644
@@ -1776,7 +1776,13 @@ our %toolstacks=
         Command => 'xl',
         CfgPathVar => 'cfgpath',
 	RestoreNeedsConfig => 1,
-        }
+        },
+     'libvirt' => {
Quoted 8 lines

Osstest/TestSupport.pm our %toolstacks= · line 1786

Quoted 6 lines
Osstest/TestSupport.pm +5 -0
+        NewDaemons => [qw(libvirtd)],
+        Dom0MemFixed => 1,
+        Command => 'virsh',
+        ExtraPackages => [qw(libnl1 libavahi-client3)],
+        },
      );

This is obviously not going to work.

Correct.

Quoted 2 lines

Do you intend for this to just
fail in ridiculous ways, and provide a general abstraction later ?

Yes. The test job runs up into ts-guest-start which fails as expected. I figured that fixing that could come later, probably via an abstraction layer as you suggest.

Ian.

#5 lore raw

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

Quoted 5 lines · Ian Jackson
Quoted 2 lines

Also, I wonder if "tree_gnulib_libvirt" would be more in keeping with our naming scheme. (cf "BLAH_LINUX_ARM".)

I'm ok with either.

Let's go with tree_gnulib_libvirt then.

Quoted 10 lines
Quoted 1 line

This is obviously not going to work.

Correct.

Quoted 2 lines

Do you intend for this to just
fail in ridiculous ways, and provide a general abstraction later ?

Yes. The test job runs up into ts-guest-start which fails as expected. I figured that fixing that could come later, probably via an abstraction layer as you suggest.

Right, OK then.

Thanks,
Ian.