Skip to contentSkip to conversation

Add libvirt build and test jobs.

PATCH Superseded Ian Campbell 2 participants 6 messages Apr 14, 2014 – Apr 15, 2014

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

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

The ts-libvirt-build, sg-run-job and mfi-common changes have been tested in standalone mode.

The ts-xen-install change has been tested in standalone mode, it is expected that the rest of test-*-*-libvirt will fail horribly at this time.

The remaining changes are intended to introduce a libvirt push gate and have been tested as far as my limited ability to invoke cr-daily-branch by hand is able, but I am sure they are incomplete in some way or other.

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.

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

libvirt.git's autogen.sh involves initialising/cloning a git submodule. AIUI the way git submodules work they are effectively versioned by the repo which references them and so there are no push gate implications here.

---
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 |   7 ++-
 ap-common              |   5 ++
 ap-fetch-version       |   4 ++
 ap-fetch-version-old   |   5 ++
 ap-print-url           |   3 +
 ap-push                |   5 ++
 cr-daily-branch        |   8 +++
 cri-common             |   1 +
 make-flight            |   7 +++
 mfi-common             |  15 ++++-
 sg-run-job             |   5 ++
 standalone             |   2 +-
 ts-libvirt-build       | 159 +++++++++++++++++++++++++++++++++++++++++++++++++
 ts-xen-install         |   5 +-
 14 files changed, 227 insertions(+), 4 deletions(-)
 create mode 100755 ts-libvirt-build
Osstest/TestSupport.pm +6 -1
index b11eb17..87b8b2e 100644
@@ -1764,7 +1764,12 @@ our %toolstacks=
         Command => 'xl',
         CfgPathVar => 'cfgpath',
 	RestoreNeedsConfig => 1,
-        }
+        },
+     'libvirt' => {
+        NewDaemons => [qw(libvirtd)],
+        Dom0MemFixed => 1,
+        Command => 'virsh',
+        },
      );
 
 sub toolstack () {
ap-common +5 -0
index cb0cfff..73bb90c 100644
@@ -33,6 +33,10 @@
 
 : ${TREEVCS_LINUX:=git}
 
+: ${TREE_LIBVIRT:=git://libvirt.org/libvirt.git}
+: ${PUSH_TREE_LIBVIRT:=$XENBITS:/home/xen/git/libvirt.git}
+: ${TREEVCS_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 +60,7 @@ fi
 
 : ${LOCALREV_XEN:=daily-cron.$branch}
 : ${LOCALREV_LINUX:=daily-cron.$branch}
+: ${LOCALREV_LIBVIRT:=daily-cron.$branch}
 
 : ${TREEBASE_LINUX_XCP:=http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27}
 
ap-fetch-version +4 -0
index aaf884d..2990462 100755
@@ -69,6 +69,10 @@ 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
+	;;
 osstest)
 	if [ "x$OSSTEST_USE_HEAD" != "xy" ] ; then
 	    git fetch $HOME/testing.git pretest:ap-fetch >&2
ap-fetch-version-old +5 -0
index 21ff786..a32de0e 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,10 @@ linuxfirmware)
 	repo_tree_rev_fetch_git linuxfirmware \
 		$TREE_LINUXFIRMWARE master daily-cron-old.$branch
 	;;
+libvirt)
+	repo_tree_rev_fetch_git libvirt \
+		$TREE_LIBVIRT master $BASE_LOCALREV_LIBVIRT
+	;;
 osstest)
 	if [ "x$OSSTEST_USE_HEAD" != "xy" ] ; then
 	    git fetch -f $HOME/testing.git incoming:ap-fetch
ap-print-url +3 -0
index f2812d0..2b55fce 100755
@@ -46,6 +46,9 @@ linux-2.6.39)
 linuxfirmware)
 	echo $UPSTREAM_TREE_LINUXFIRMWARE
 	;;
+libvirt)
+	echo $TREE_LIBVIRT
+	;;
 osstest)
 	echo none:;
 	;;
ap-push +5 -0
index dc0a166..af76ecc 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,10 @@ linux-xen-*)
         cd $repos/linux
         git push $TREE_LINUX $revision:refs/heads/$branch
         ;;
+libvirt)
+	cd $repos/libvirt
+	git push $TREE_LIBVIRT $revision:master
+	;;
 osstest)
 	git push $HOME/testing.git $revision:incoming
 	git push $XENBITS:/home/xen/git/osstest.git $revision:master
cr-daily-branch +8 -0
index 02fef15..a13d75a 100755
@@ -133,6 +133,10 @@ 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_LINUXFIRMWARE" = x ]; then
 	determine_version REVISION_LINUXFIRMWARE linuxfirmware
         export REVISION_LINUXFIRMWARE
@@ -165,6 +169,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 +14 -1
index 598aa02..a8e528a 100644
@@ -162,6 +162,16 @@ 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}
+
     case "$arch" in
     armhf) continue;; # don't do any other kernel builds
     esac
@@ -193,6 +203,7 @@ job_create_test () {
 
   xenbuildjob="${bfi}build-$xenarch"
   buildjob="${bfi}build-$dom0arch"
+  tsbuildjob=
 
   case "$xenbranch:$toolstack" in
     xen-3.*-testing:*) ;;
@@ -203,11 +214,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 37c0294..d10a223 100755
@@ -166,7 +166,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 +159 -0

159 lines not on this page · raw message

ts-xen-install +4 -1
index 4a810e4..435fc3e 100755
@@ -63,7 +63,10 @@ sub packages () {
 }
 
 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 14 lines · Ian Campbell

The ts-libvirt-build, sg-run-job and mfi-common changes have been tested in standalone mode.

The ts-xen-install change has been tested in standalone mode, it is expected that the rest of test-*-*-libvirt will fail horribly at this time.

The remaining changes are intended to introduce a libvirt push gate and have been tested as far as my limited ability to invoke cr-daily-branch by hand is able, but I am sure they are incomplete in some way or other.

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.

Quoted 8 lines

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

libvirt.git's autogen.sh involves initialising/cloning a git submodule. AIUI the way git submodules work they are effectively versioned by the repo which references them and so there are no push gate implications here.

Ian, if you you've got a moment at some point this week to set up a new push gate (and/or teach me how) that'd be great.

I just want to check you are ok with the final set of comments on in
http://article.gmane.org/gmane.comp.emulators.xen.devel/193345 though...

Ian.

#2 lore raw
In reply to Ian Campbell

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

Quoted 2 lines

The ts-libvirt-build, sg-run-job and mfi-common changes have been tested in standalone mode.

...

The ap-* and cr-daily-branch changes look good.

Quoted 3 lines
ts-libvirt-build new file +0 -0
new file mode 100755
index 0000000..56b78f1

...

ts-libvirt-build line 53

Quoted 5 lines
ts-libvirt-build new file +5 -0
+sub prep() {
+    target_install_packages($ho, qw(autoconf automake libtool xsltproc
+                                    libxml2-utils libxml2-dev libnl-dev
+                                    libdevmapper-dev w3c-dtd-xhtml));
+}

Sadly, you mustn't invoke apt here because this script might run in parallel on the same host with other scripts.

I had to make a similar comment in response to another patch recently. Perhaps it is time to fix this by wrapping the apt-get rune in with-lock-ex.

ts-libvirt-build line 105

Quoted 9 lines
ts-libvirt-build new file +9 -0
+sub libvirtd_init () {
+    return <<'END';
+#! /bin/sh
+#
+# Init script for libvirtd
+#
+# Loosely based on Debian libvirt-bin initscript:
+# (c) 2007 Guido Guenther <[email protected]>
+# based on the skeletons that comes with dh_make

Does libvirt really not come with one ?

ts-xen-install sub packages () { · line 69

Quoted 13 lines
ts-xen-install +4 -1
index 4a810e4..435fc3e 100755
@@ -63,7 +63,10 @@ sub packages () {
 }
 
 sub extract () {
-    foreach my $part ('', 'kern', 'xen') {
+    my @parts = ('', 'kern', 'xen');
+    push @parts, 'libvirt' if $r{toolstack} eq "libvirt";
+
+    foreach my $part (@parts) {

Fine.

Thanks,
Ian.

#3 lore raw
Quoted 6 lines · Ian Jackson

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

Quoted 2 lines

The ts-libvirt-build, sg-run-job and mfi-common changes have been tested in standalone mode.

...

The ap-* and cr-daily-branch changes look good.

This continues to surprise me ;-)

Quoted 13 lines
Quoted 3 lines
ts-libvirt-build new file +0 -0
new file mode 100755
index 0000000..56b78f1

...

ts-libvirt-build line 53

Quoted 5 lines
ts-libvirt-build new file +5 -0
+sub prep() {
+    target_install_packages($ho, qw(autoconf automake libtool xsltproc
+                                    libxml2-utils libxml2-dev libnl-dev
+                                    libdevmapper-dev w3c-dtd-xhtml));
+}

Sadly, you mustn't invoke apt here because this script might run in parallel on the same host with other scripts.

Quoted 2 lines

I had to make a similar comment in response to another patch recently.

Ah, I remember that now you mention it.

Quoted 2 lines

Perhaps it is time to fix this by wrapping the apt-get rune
in with-lock-ex.

Can do. I'd also be happy to move these packages to the build-prep job.

Quoted 11 lines

ts-libvirt-build line 105

Quoted 9 lines
ts-libvirt-build new file +9 -0
+sub libvirtd_init () {
+    return <<'END';
+#! /bin/sh
+#
+# Init script for libvirtd
+#
+# Loosely based on Debian libvirt-bin initscript:
+# (c) 2007 Guido Guenther <[email protected]>
+# based on the skeletons that comes with dh_make

Does libvirt really not come with one ?

It's very RH specific and unusable in this context.

Ian.

#4 lore raw

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

Quoted 7 lines · Ian Jackson
Quoted 5 lines

Sadly, you mustn't invoke apt here because this script might run in parallel on the same host with other scripts.

I had to make a similar comment in response to another patch recently.

Quoted 6 lines

Ah, I remember that now you mention it.

Quoted 2 lines

Perhaps it is time to fix this by wrapping the apt-get rune
in with-lock-ex.

Can do. I'd also be happy to move these packages to the build-prep job.

I think adding the extra flexibility is probably better. It might avoid quite a bit of needless installing of things. It would also remove one more barrier sharing of test dom0s.

NB you'll probably want to replace the timeout with a fixed value. The current timeout is a guess based on the number of packages which wouldn't be right if "this" run could be queued up behind a much larger run holding the lock.

Quoted 7 lines
Quoted 5 lines

ts-libvirt-build line 105

Quoted 3 lines
ts-libvirt-build new file +3 -0
+# Loosely based on Debian libvirt-bin initscript:
+# (c) 2007 Guido Guenther <[email protected]>
+# based on the skeletons that comes with dh_make

Does libvirt really not come with one ?

It's very RH specific and unusable in this context.

How unhelpful. Fair enough.

Thanks,
Ian.

#5 lore raw
Quoted 10 lines · Ian Jackson

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

Quoted 9 lines · Ian Jackson
Quoted 5 lines

Sadly, you mustn't invoke apt here because this script might run in parallel on the same host with other scripts.

I had to make a similar comment in response to another patch recently.

Ah, I remember that now you mention it.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Perhaps it is time to fix this by wrapping the apt-get rune
in with-lock-ex.

Can do. I'd also be happy to move these packages to the build-prep job.

I think adding the extra flexibility is probably better. It might avoid quite a bit of needless installing of things. It would also remove one more barrier sharing of test dom0s.

One concern I just had was that it could make some stuff be slightly less deterministic, since it might depend more on what jobs previously ran on the host. At least by having all packages installed to ts-xen-build-prep we guarantee that everything sees the same set of installed packages.

Now, we should be passing all the right options to configure etc to make this issue moot -- but I bet we aren't.

Ian.