Skip to contentSkip to conversation

Build and test rump kernel xenstore-ls

PATCH In review Ian Jackson 2 participants 34 messages Jul 15, 2014 – Jul 16, 2014

lore
Share & tools
lore
#0 lore raw

cover Build and test rump kernel xenstore-ls

Preparatory:

 01/13  selectguest: log a message
 02/13  BuildSupport: make selectbuildhost modify @ARGV
 03/13  sg-run-job: Support toggling `adding' by repeating `+'
 04/13  building: Delete when cloning, not when preparing $builddir
 05/13  make-flight: rumpuserxen tests: use same buildjob for all guests

Building:

 06/13  ts-xen-build: Allow specification of make targets
 07/13  ts-xen-build: Honour cmdprefix_configure, cmdprefix_make
 08/13  rump kernel tests: Do a xen.git tools build

Testing:

 09/13  rump kernel tests: Use guest-specific fs images location
 10/13  rump kernel tests: Specify kernel via runvar
 11/13  rump kernel tests: Specify cmdline via runvar
 12/13  ts-guest-destroy-hard: New script
 13/13  rump kernel tests: Run xenstore-ls demo                             

I have not yet run a full flight with this - I have only bench-tested it. I'm about to set a flight off to see how it does.

#1 lore raw

PATCH 1/13 selectguest: log a message

Print the guest's name and the host it's on; this can help with interpreting the logs.

---
 Osstest/TestSupport.pm |    1 +
 1 file changed, 1 insertion(+)
Osstest/TestSupport.pm +1 -0
index 23ad106..22dcbff 100644
@@ -1227,6 +1227,7 @@ sub selectguest ($$) {
     foreach my $opt (guest_var_commalist($gho,'options')) {
         $gho->{Options}{$opt}++;
     }
+    logm("guest: using $gn on $gho->{Host}{Name}");
     guest_find_lv($gho);
     guest_find_ether($gho);
     guest_find_tcpcheckport($gho);
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/13 BuildSupport: make selectbuildhost modify @ARGV

In reply to Ian Jackson

We pass it \@ARGV everywhere now, and it eats the argument (if it finds one). This allows build scripts to take extra arguments.

---
 Osstest/BuildSupport.pm |    5 +++--
 ts-kernel-build         |    2 +-
 ts-libvirt-build        |    2 +-
 ts-rumpuserxen-build    |    2 +-
 ts-xen-build            |    2 +-
 5 files changed, 7 insertions(+), 6 deletions(-)
Osstest/BuildSupport.pm +3 -2
index 6d43cbc..0938810 100644
@@ -56,8 +56,9 @@ our ($builddir,$makeflags);
 our ($xendist);
 
 sub selectbuildhost {
-    # pass @ARGV
-    ($whhost) = @_;
+    # pass \@ARGV
+    my ($av) = @_;
+    $whhost = shift @$av;
     $whhost ||= 'host';
     $ho= selecthost($whhost);
 }
ts-kernel-build +1 -1
index 984a935..3b48920 100755
@@ -22,7 +22,7 @@ use Osstest::TestSupport;
 use Osstest::BuildSupport;
 
 tsreadconfig();
-selectbuildhost(@ARGV);
+selectbuildhost(\@ARGV);
 builddirsprops();
 
 my $archparms = {
ts-libvirt-build +1 -1
index 5f493e4..940c034 100755
@@ -22,7 +22,7 @@ use Osstest::TestSupport;
 use Osstest::BuildSupport;
 
 tsreadconfig();
-selectbuildhost(@ARGV);
+selectbuildhost(\@ARGV);
 builddirsprops();
 
 sub libvirtd_init ();
ts-rumpuserxen-build +1 -1
index ee2db97..a1f31cd 100755
@@ -22,7 +22,7 @@ use Osstest::TestSupport;
 use Osstest::BuildSupport;
 
 tsreadconfig();
-selectbuildhost(@ARGV);
+selectbuildhost(\@ARGV);
 builddirsprops();
 
 our %submodmap = qw(nblibs nblibs
ts-xen-build +1 -1
index 828c2b4..3913273 100755
@@ -24,7 +24,7 @@ use Osstest::TestSupport;
 use Osstest::BuildSupport;
 
 tsreadconfig();
-selectbuildhost(@ARGV);
+selectbuildhost(\@ARGV);
 builddirsprops();
     
 sub checkout () {
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 3/13 sg-run-job: Support toggling `adding' by repeating `+'

In reply to Ian Jackson

Specifying +' as an argument to spawn-ts suppresses the automatic addition of subsequent arguments to the testid. Make it possible to toggle this by repeating +'.

---
 sg-run-job |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sg-run-job +1 -1
index e903869..b02a755 100755
@@ -122,7 +122,7 @@ proc spawn-ts {iffail testid ts args} {
     set host_testid_suffix {}
     foreach arg $args {
         if {![string compare + $arg]} {
-            set adding 0
+            set adding [expr {!$adding}]
             continue
         }
         lappend real_args $arg
Signature · 1 line
1.7.10.4
#4 lore raw

Re: [OSSTEST PATCH 03/13] sg-run-job: Support toggling `adding' by repeating `+'

Quoted 3 lines · Ian Jackson

Specifying +' as an argument to spawn-ts suppresses the automatic addition of subsequent arguments to the testid. Make it possible to toggle this by repeating +'.

So that's what that syntax was doing. I had been boggling over that!

Quoted 19 lines
---
 sg-run-job |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sg-run-job +1 -1
index e903869..b02a755 100755
@@ -122,7 +122,7 @@ proc spawn-ts {iffail testid ts args} {
     set host_testid_suffix {}
     foreach arg $args {
         if {![string compare + $arg]} {
-            set adding 0
+            set adding [expr {!$adding}]
             continue
         }
         lappend real_args $arg
#5 lore raw

PATCH 4/13 building: Delete when cloning, not when preparing $builddir

In reply to Ian Jackson

Make prepbuilddirs no longer delete $builddir; instead:
- have prepbuilddirs delete *-stamp files and dist/;
- have build_clone delete the specific source directories;
- any individual ts-*-build scripts that use other things would have to delete them (but searching for $builddir reveals none).

---
 Osstest/BuildSupport.pm |    2 +-
 Osstest/TestSupport.pm  |    4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
Osstest/BuildSupport.pm +1 -1
index 0938810..874e27e 100644
@@ -74,7 +74,7 @@ sub builddirsprops {
 
 sub prepbuilddirs {
     my (@xbuilddirs) = @_;
-    my $cmd = "rm -rf $builddir && mkdir $builddir";
+    my $cmd = "mkdir -p $builddir && rm -rf $builddir/*-stamp $builddir/dist";
     $cmd .= " && mkdir $builddir/$_" foreach @xbuilddirs;
     target_cmd($ho,$cmd,600);
 }
Osstest/TestSupport.pm +4 -0
index 22dcbff..3930595 100644
@@ -1061,9 +1061,12 @@ sub build_clone ($$$$) {
 	}
     }
 
+    my $rm = "rm -rf $subdir";
+
     if ($vcs eq 'hg') {
         
         target_cmd_build($ho, $timeout, $builddir, <<END.
+	    $rm
 	    hg clone '$tree' $subdir
 	    cd $subdir
 END
@@ -1075,6 +1078,7 @@ END
 	my $eff_tree = git_massage_url($tree);
 
         target_cmd_build($ho, $timeout, $builddir, <<END.
+            $rm
             git clone '$eff_tree' $subdir
             cd $subdir
 END
Signature · 1 line
1.7.10.4
#6 lore raw

Re: [OSSTEST PATCH 04/13] building: Delete when cloning, not when preparing $builddir

Quoted 6 lines · Ian Jackson

Make prepbuilddirs no longer delete $builddir; instead:
- have prepbuilddirs delete *-stamp files and dist/;
- have build_clone delete the specific source directories;
- any individual ts-*-build scripts that use other things would have to delete them (but searching for $builddir reveals none).

Is it also implied that ts-*-build ought to do some sort of "make clean" like thing? Deleting dist is only really relevant for ts-xen-build I think, e.g. I don't think ts-kernel-build uses it.

#7 lore raw

Re: [OSSTEST PATCH 04/13] building: Delete when cloning, not when preparing $builddir

Ian Campbell writes ("Re: [OSSTEST PATCH 04/13] building: Delete when cloning, not when preparing $builddir"):

Quoted 11 lines · Ian Jackson
Quoted 6 lines

Make prepbuilddirs no longer delete $builddir; instead:
- have prepbuilddirs delete *-stamp files and dist/;
- have build_clone delete the specific source directories;
- any individual ts-*-build scripts that use other things would have to delete them (but searching for $builddir reveals none).

Is it also implied that ts-*-build ought to do some sort of "make clean" like thing? Deleting dist is only really relevant for ts-xen-build I think, e.g. I don't think ts-kernel-build uses it.

No, because the builds all happen in trees which have been recloned.

Ian.

#8 lore raw

Re: [OSSTEST PATCH 04/13] building: Delete when cloning, not when preparing $builddir

Quoted 9 lines · Ian Jackson

Ian Campbell writes ("Re: [OSSTEST PATCH 04/13] building: Delete when cloning, not when preparing $builddir"):

Quoted 8 lines · Ian Jackson
Quoted 6 lines

Make prepbuilddirs no longer delete $builddir; instead:
- have prepbuilddirs delete *-stamp files and dist/;
- have build_clone delete the specific source directories;
- any individual ts-*-build scripts that use other things would have to delete them (but searching for $builddir reveals none).

Quoted 5 lines
Quoted 3 lines

Is it also implied that ts-*-build ought to do some sort of "make clean" like thing? Deleting dist is only really relevant for ts-xen-build I think, e.g. I don't think ts-kernel-build uses it.

No, because the builds all happen in trees which have been recloned.

You mean that currently happens to be the case for ts-foo-build for foo != xen, for Xen you are in the process or making this not hold, I think?

Perhaps prepbuilddirs should take a list of paths to clean?

Ian.

#9 lore raw

Re: [OSSTEST PATCH 04/13] building: Delete when cloning, not when preparing $builddir

Ian Campbell writes ("Re: [OSSTEST PATCH 04/13] building: Delete when cloning, not when preparing $builddir"):

Quoted 11 lines · Ian Jackson
Quoted 6 lines

Ian Campbell writes ("Re: [OSSTEST PATCH 04/13] building: Delete when cloning, not when preparing $builddir"):

Quoted 3 lines

Is it also implied that ts-*-build ought to do some sort of "make clean" like thing? Deleting dist is only really relevant for ts-xen-build I think, e.g. I don't think ts-kernel-build uses it.

No, because the builds all happen in trees which have been recloned.

You mean that currently happens to be the case for ts-foo-build for foo != xen, for Xen you are in the process or making this not hold, I think?

No. build_clone always gives you a fresh tree. ts-xen-build always builds in a directory from build_clone.

The rumpuserxen xen.git build is done (also, must be done) in a tree which has not had any ordinary build done in it.

Quoted 1 line

Perhaps prepbuilddirs should take a list of paths to clean?

That would be fine if it was in fact necessary to use that feature :-).

Ian.

#10 lore raw

Re: [OSSTEST PATCH 04/13] building: Delete when cloning, not when preparing $builddir

Quoted 13 lines · Ian Jackson

Ian Campbell writes ("Re: [OSSTEST PATCH 04/13] building: Delete when cloning, not when preparing $builddir"):

Quoted 11 lines · Ian Jackson
Quoted 6 lines

Ian Campbell writes ("Re: [OSSTEST PATCH 04/13] building: Delete when cloning, not when preparing $builddir"):

Quoted 3 lines

Is it also implied that ts-*-build ought to do some sort of "make clean" like thing? Deleting dist is only really relevant for ts-xen-build I think, e.g. I don't think ts-kernel-build uses it.

No, because the builds all happen in trees which have been recloned.

You mean that currently happens to be the case for ts-foo-build for foo != xen, for Xen you are in the process or making this not hold, I think?

Quoted 5 lines

No. build_clone always gives you a fresh tree. ts-xen-build always builds in a directory from build_clone.

The rumpuserxen xen.git build is done (also, must be done) in a tree which has not had any ordinary build done in it.

OK, then I'm just confused about the purpose of this change ;-)

I thought you were reusing the build tree.

Ian.

#11 lore raw

Re: [OSSTEST PATCH 04/13] building: Delete when cloning, not when preparing $builddir

Ian Campbell writes ("Re: [OSSTEST PATCH 04/13] building: Delete when cloning, not when preparing $builddir"):

Quoted 7 lines · Ian Jackson
Quoted 2 lines

The rumpuserxen xen.git build is done (also, must be done) in a tree which has not had any ordinary build done in it.

OK, then I'm just confused about the purpose of this change ;-)

I thought you were reusing the build tree.

This change is needed because previously prepbuilddirs would delete the whole per-job directory.

I will add some text to the commit messages to clarify this:

building: Delete when cloning, not when preparing $builddir
...

This makes it possible for later steps within a build job to look at the build trees from previous steps. This is helpful if for any reason it isn't easy or desirable to package up a formal set of build outputs for reuse.

And

rump kernel tests: Do a xen.git tools build
...

ts-rumpuserxen-build does not generate a formal set of build outputs. Instead, the ts-xen-build step references the files generated by ts-rumpuserxen-build directly (and is told where to find them via the new command prefix runvars).

Ian.

#12 lore raw

Re: [OSSTEST PATCH 04/13] building: Delete when cloning, not when preparing $builddir

Quoted 11 lines · Ian Jackson

Ian Campbell writes ("Re: [OSSTEST PATCH 04/13] building: Delete when cloning, not when preparing $builddir"):

Quoted 7 lines · Ian Jackson
Quoted 2 lines

The rumpuserxen xen.git build is done (also, must be done) in a tree which has not had any ordinary build done in it.

OK, then I'm just confused about the purpose of this change ;-)

I thought you were reusing the build tree.

This change is needed because previously prepbuilddirs would delete the whole per-job directory.

Ah, I see.

Quoted 9 lines

I will add some text to the commit messages to clarify this:

building: Delete when cloning, not when preparing $builddir
...

This makes it possible for later steps within a build job to look at the build trees from previous steps. This is helpful if for any reason it isn't easy or desirable to package up a formal set of build outputs for reuse.

Thanks, makes sense.

Quoted 12 lines

And

rump kernel tests: Do a xen.git tools build
...

ts-rumpuserxen-build does not generate a formal set of build outputs. Instead, the ts-xen-build step references the files generated by ts-rumpuserxen-build directly (and is told where to find them via the new command prefix runvars).

Ian.

#13 lore raw

PATCH 5/13 make-flight: rumpuserxen tests: use same buildjob for all guests

In reply to Ian Jackson

Change the name of the runvar for the build job to be guests_rumpuserxenbuildjob, which is the default (fallback) for guest_var.

(We are going to introduce another step which uses another guest but wants the same build job.)

No resulting change in the system's overall behaviour.

BUILDJOB GUESTS_

---
 make-flight |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
make-flight +1 -1
index fbda440..8aa5396 100755
@@ -122,7 +122,7 @@ do_rumpkernel_tests () {
   job_create_test test-$xenarch$kern-$dom0arch-rumpuserxen-$rumparch \
                       test-rumpuserxen xl \
             $xenarch $dom0arch                                       \
-            rump_rumpuserxenbuildjob=build-$rumparch-rumpuserxen     \
+            guests_rumpuserxenbuildjob=build-$rumparch-rumpuserxen   \
             all_hostflags=$most_hostflags
 }
 
Signature · 1 line
1.7.10.4
#14 lore raw

Re: [OSSTEST PATCH 05/13] make-flight: rumpuserxen tests: use same buildjob for all guests

Quoted 4 lines · Ian Jackson

Change the name of the runvar for the build job to be guests_rumpuserxenbuildjob, which is the default (fallback) for guest_var.

Quoted 8 lines

(We are going to introduce another step which uses another guest but wants the same build job.)

No resulting change in the system's overall behaviour.

BUILDJOB GUESTS_

Stray?

#15 lore raw

Re: [OSSTEST PATCH 05/13] make-flight: rumpuserxen tests: use same buildjob for all guests

Ian Campbell writes ("Re: [OSSTEST PATCH 05/13] make-flight: rumpuserxen tests: use same buildjob for all guests"):

Quoted 4 lines · Ian Jackson
Quoted 1 line

BUILDJOB GUESTS_

Stray?

Oops, yes.

Ian.

#16 lore raw

PATCH 6/13 ts-xen-build: Allow specification of make targets

In reply to Ian Jackson

This allows sg-run-job (or a manual caller of ts-xen-build) to specify which target(s) to pass to `make'.

---
 ts-xen-build |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
ts-xen-build +2 -1
index 3913273..7c9e804 100755
@@ -25,6 +25,7 @@ use Osstest::BuildSupport;
 
 tsreadconfig();
 selectbuildhost(\@ARGV);
+# remaining arguments are passed as targets to "make"
 builddirsprops();
     
 sub checkout () {
@@ -108,7 +109,7 @@ END
 END
 #/;
     buildcmd_stamped_logged(9000, 'build', '',<<END,'');
-            make $makeflags
+            make $makeflags @ARGV
 END
 }
 
Signature · 1 line
1.7.10.4
#17 lore raw

PATCH 7/13 ts-xen-build: Honour cmdprefix_configure, cmdprefix_make

In reply to Ian Jackson

These runvars can be set to specify a string (containing shell code) to be prefixed to the executions of ./configure and make.

If not set, the behaviour is as as before.

---
 ts-xen-build |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
ts-xen-build +5 -2
index 7c9e804..661f186 100755
@@ -94,6 +94,9 @@ sub build () {
     my $xend_opt= $r{enable_xend} =~ m/true/ ? "--enable-xend" : "--disable-xend";
     my $ovmf_opt= $r{enable_ovmf} =~ m/true/ ? "--enable-ovmf" : "--disable-ovmf";
 
+    my $configure_prefix = $r{cmdprefix_configure} // '';
+    my $make_prefix =      $r{cmdprefix_make}      // '';
+
     buildcmd_stamped_logged(600, 'configure', <<END,<<END,<<END);
             if test -f configure; then
                 if grep -q -- $xend_opt tools/configure ; then
@@ -103,13 +106,13 @@ sub build () {
                     ovmf=$ovmf_opt
                 fi
 END
-                ./configure --sysconfdir=/etc \$xend \$ovmf
+               $configure_prefix ./configure --sysconfdir=/etc \$xend \$ovmf
 END
             fi
 END
 #/;
     buildcmd_stamped_logged(9000, 'build', '',<<END,'');
-            make $makeflags @ARGV
+            $make_prefix make $makeflags @ARGV
 END
 }
 
Signature · 1 line
1.7.10.4
#18 lore raw

PATCH 8/13 rump kernel tests: Do a xen.git tools build

In reply to Ian Jackson

Having laid the groundwork, we can now:

* In make-flight, for the rumpuserxen builds, set the runvars that specify which xen.git bits etc. to build. (We pass qemuu now, because we intend that eventually we will want to build that too.)

* In ts-rumpuserxen-build, record the locations of the app-tools configure and make wrappers in the runvars which will be honoured by ts-xen-build. Thus ts-xen-build in rumpuserxen build jobs will use these app-tools and do a rump cross build.

* Add a ts-xen-build step to the build-rumpuserxen recipe, passing `tools' as the target to build.

---
 mfi-common           |    4 ++++
 sg-run-job           |    1 +
 ts-rumpuserxen-build |    7 +++++++
 3 files changed, 12 insertions(+)
mfi-common +4 -0
index 2055bab..aba0b15 100644
@@ -204,6 +204,10 @@ create_build_jobs () {
                 tree_rumpuserxen=$TREE_RUMPUSERXEN			\
           ${TREEVCS_RUMPUSERXEN:+treevcs_rumpuserxen=}${TREEVCS_RUMPUSERXEN} \
                 revision_rumpuserxen=$REVISION_RUMPUSERXEN		\
+                tree_xen=$TREE_XEN                                           \
+                tree_qemuu=$TREE_QEMU_UPSTREAM                               \
+                revision_xen=$REVISION_XEN                                   \
+                revision_qemuu=$REVISION_QEMU_UPSTREAM                       \
                 tree_rumpuserxen_rumpsrc=$TREE_RUMPUSERXEN_RUMPSRC	\
                 ${TREEVCS_RUMPUSERXEN_RUMPSRC:+treevcs_rumpuserxen_rumpsrc=}${TREEVCS_RUMPUSERXEN_RUMPSRC}
                 # rumpsrc-related runvars needed only for old rumpuser-xen
sg-run-job +1 -0
index b02a755..ab9f333 100755
@@ -338,6 +338,7 @@ proc run-job/build-libvirt {} {
 
 proc run-job/build-rumpuserxen {} {
     run-ts . = ts-rumpuserxen-build
+    run-ts . = ts-xen-build + host tools
 }
 
 proc prepare-build-host {} {
ts-rumpuserxen-build +7 -0
index a1f31cd..e0b18a7 100755
@@ -97,6 +97,12 @@ sub build() {
 END
 }
 
+sub recordtools() {
+    my $apptool = "$rux/app-tools/rumpxen-app";
+    store_runvar('cmdprefix_configure', "$apptool-configure");
+    store_runvar('cmdprefix_make',      "$apptool-make");
+}
+
 sub install() {
     my $destdir="dist/usr/local/lib/xen/rump-kernel";
     target_cmd_build($ho, 300, $builddir, <<END);
@@ -110,5 +116,6 @@ END
 checkout();
 massage();
 build();
+recordtools();
 install();
 built_stash($ho, $builddir, 'dist', 'rumpuserxendist');
Signature · 1 line
1.7.10.4
#19 lore raw

PATCH 9/13 rump kernel tests: Use guest-specific fs images location

In reply to Ian Jackson

We are going to want to have multiple different guests in the same job. Don't use the same locations for all of their fs images.

---
 ts-rumpuserxen-demo-setup |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
ts-rumpuserxen-demo-setup +7 -4
index 4ad77f8..68ec7d4 100755
@@ -42,7 +42,7 @@ sub prep () {
 
     my @images;
 
-    my $jobdir = target_jobdir($ho);
+    my $fsimagesdir = target_jobdir($ho)."/$gn-images";
 
     my $cfgfile = "$gn.cfg";
     my $cfgpath = "/etc/xen/$cfgfile";
@@ -62,7 +62,7 @@ sub prep () {
 	    if ($in eq 'disk') {
 		s{\b img/(\w+.ffs) \b}{
                     push @images, $1;
-                    "$jobdir/$1";
+                    "$fsimagesdir/$1";
                 }xeg;
 	    }
 
@@ -72,8 +72,11 @@ sub prep () {
 
     store_runvar("$gho->{Guest}_cfgpath", $cfgpath);
 
-    target_cmd($ho, "cp $rkdist/img/$_ $jobdir/$_", 200)
-	foreach @images;
+    target_cmd($ho, <<END.(join "\n", map { <<END; } @images), 200);
+                   mkdir -p $fsimagesdir
+END
+                   cp $cfg_rkdist/img/$_ $fsimagesdir/$_
+END
 }
 
 prep();
Signature · 1 line
1.7.10.4
#20 lore raw

PATCH 10/13 rump kernel tests: Specify kernel via runvar

In reply to Ian Jackson

The runvar <gn>_builtimage is set to <distpart>:<distpath>. Previously we hardcoded /usr/local/lib/xen/rump-kernel' in rumpuserxen'.

The ffs filesystem images, and the demo config template, still come from a single particular build, which we find from the guests_rumpuserxenbuildjob' runvar. This runvar is then doing double duty as the build job for the ffs filesystem images and example configs, and the default' build job for guest kernels.

The subpath /usr/local/lib/xen/rump-kernel is duplicated, because it appears once (in make-flight, for setting a runvar) to find the demo guest's kernel, and once (hardcoded in ts-rumpuserxen-demo-setup) for the filesystem images and config file.

---
 make-flight               |    1 +
 ts-rumpuserxen-demo-setup |   17 +++++++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)
make-flight +1 -0
index 8aa5396..cede756 100755
@@ -123,6 +123,7 @@ do_rumpkernel_tests () {
                       test-rumpuserxen xl \
             $xenarch $dom0arch                                       \
             guests_rumpuserxenbuildjob=build-$rumparch-rumpuserxen   \
+            rump_builtimage=rumpuserxen:/usr/local/lib/xen/rump-kernel \
             all_hostflags=$most_hostflags
 }
 
ts-rumpuserxen-demo-setup +13 -4
index 68ec7d4..34da7cb 100755
@@ -35,10 +35,19 @@ our $rkdist;
 sub prep () {
     $gho = prepareguest($ho, $gn, $gn, 4096, undef, 30);
 
+    my $cfg_rkdist = target_extract_jobdistpath_subdir
+	($ho, 'rumpuserxen--base', 'rumpuserxen',
+	 $r{guests_rumpuserxenbuildjob});
+    $cfg_rkdist .= '/usr/local/lib/xen/rump-kernel';
+
     my $buildjob = guest_var($gho, 'rumpuserxenbuildjob', undef);
+    my $builtimage = guest_var($gho, 'builtimage', undef);
+    $builtimage =~ m/\:/ or die "$builtimage ?";
+    my $builtimage_part = $`;
+    my $builtimage_subpath = $'; #';
     $rkdist = target_extract_jobdistpath_subdir
-	($ho, 'rumpuserxen', 'rumpuserxen', $buildjob);
-    $rkdist .= '/usr/local/lib/xen/rump-kernel';
+	($ho, "rumpuserxen-$gn", $builtimage_part, $buildjob);
+    my $imagefile = $rkdist.$builtimage_subpath;
 
     my @images;
 
@@ -46,7 +55,7 @@ sub prep () {
 
     my $cfgfile = "$gn.cfg";
     my $cfgpath = "/etc/xen/$cfgfile";
-    target_editfile_root($ho, "$rkdist/domain_config", $cfgfile, $cfgpath,
+    target_editfile_root($ho, "$cfg_rkdist/domain_config", $cfgfile, $cfgpath,
 			 sub {
 	while (<EI>) {
 	    next if m/^\s*\#/;
@@ -55,7 +64,7 @@ sub prep () {
 	    my $in = $& if m/^\w\S*/;
 
 	    s# = .*              # " = '$gn'"          #xe  if $in eq 'name';
-	    s# =\s* ['"](.*)['"] # " = '$rkdist/$1'"   #xe  if $in eq 'kernel';
+	    s# = .*              # " = '$imagefile'"   #xe  if $in eq 'kernel';
 	    s#\b mac=[0-9a-f:]+  # "mac=$gho->{Ether}" #xe  if $in eq 'vif';
 	    s#\b 4             \b# 3                   #xe  if $in eq 'extra';
 
Signature · 1 line
1.7.10.4
#21 lore raw

PATCH 11/13 rump kernel tests: Specify cmdline via runvar

In reply to Ian Jackson

The runvar <gn>_cmdline is used for the rumpuserxen guest command line. Previously "3" (a binary flags word meaningful to the test/demo program included in rumpuser-xen.git) was hardcoded.

---
 make-flight               |    1 +
 ts-rumpuserxen-demo-setup |    3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
make-flight +1 -0
index cede756..ccfa3e3 100755
@@ -124,6 +124,7 @@ do_rumpkernel_tests () {
             $xenarch $dom0arch                                       \
             guests_rumpuserxenbuildjob=build-$rumparch-rumpuserxen   \
             rump_builtimage=rumpuserxen:/usr/local/lib/xen/rump-kernel \
+            rump_cmdline=3                                           \
             all_hostflags=$most_hostflags
 }
 
ts-rumpuserxen-demo-setup +2 -1
index 34da7cb..04ed0b9 100755
@@ -48,6 +48,7 @@ sub prep () {
     $rkdist = target_extract_jobdistpath_subdir
 	($ho, "rumpuserxen-$gn", $builtimage_part, $buildjob);
     my $imagefile = $rkdist.$builtimage_subpath;
+    my $cmdline = guest_var($gho, 'cmdline', undef);
 
     my @images;
 
@@ -66,7 +67,7 @@ sub prep () {
 	    s# = .*              # " = '$gn'"          #xe  if $in eq 'name';
 	    s# = .*              # " = '$imagefile'"   #xe  if $in eq 'kernel';
 	    s#\b mac=[0-9a-f:]+  # "mac=$gho->{Ether}" #xe  if $in eq 'vif';
-	    s#\b 4             \b# 3                   #xe  if $in eq 'extra';
+	    s# = .*              # " = '$cmdline'"     #xe  if $in eq 'extra';
 
 	    if ($in eq 'disk') {
 		s{\b img/(\w+.ffs) \b}{
Signature · 1 line
1.7.10.4
#22 lore raw

PATCH 12/13 ts-guest-destroy-hard: New script

In reply to Ian Jackson

This just calls xl destroy; it doesn't check that the guest is running, or on the network, or anything. (It also doesn't check that the guest is down afterwards.)

We are going to want this to be able to destroy the rumpuserxen xenstorels domain, which is short-lived (and will normally have terminated by the time we want to destroy it).

---
 ts-guest-destroy-hard |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100755 ts-guest-destroy-hard
ts-guest-destroy-hard new file +27 -0
new file mode 100755
index 0000000..5c2430c
@@ -0,0 +1,27 @@
+#!/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 Osstest::TestSupport;
+
+tsreadconfig();
+
+our ($ho,$gho) = ts_get_host_guest(@ARGV);
+
+guest_destroy($ho, $gho);
Signature · 1 line
1.7.10.4
#23 lore raw

Re: [OSSTEST PATCH 12/13] ts-guest-destroy-hard: New script

Quoted 7 lines · Ian Jackson

This just calls xl destroy; it doesn't check that the guest is running, or on the network, or anything. (It also doesn't check that the guest is down afterwards.)

We are going to want this to be able to destroy the rumpuserxen xenstorels domain, which is short-lived (and will normally have terminated by the time we want to destroy it).

You could use on_poweroff=preserve to avoid racing with that?

Quoted 13 lines
---
 ts-guest-destroy-hard |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100755 ts-guest-destroy-hard
ts-guest-destroy-hard new file +0 -0
new file mode 100755
index 0000000..5c2430c

ts-guest-destroy-hard line 3

Quoted 3 lines
ts-guest-destroy-hard new file +3 -0
@@ -0,0 +1,27 @@
+#!/usr/bin/perl -w
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2013 Citrix Inc.

Out of date

#24 lore raw

Re: [OSSTEST PATCH 12/13] ts-guest-destroy-hard: New script

Ian Campbell writes ("Re: [OSSTEST PATCH 12/13] ts-guest-destroy-hard: New script"):

Quoted 6 lines · Ian Jackson
Quoted 3 lines

We are going to want this to be able to destroy the rumpuserxen xenstorels domain, which is short-lived (and will normally have terminated by the time we want to destroy it).

You could use on_poweroff=preserve to avoid racing with that?

No, because it still insists that the guest is up and responding to pings etc.

Quoted 11 lines

ts-guest-destroy-hard line 3

Quoted 9 lines
ts-guest-destroy-hard new file +3 -0
new file mode 100755
index 0000000..5c2430c
@@ -0,0 +1,27 @@
+#!/usr/bin/perl -w
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2013 Citrix Inc.

Out of date

Will fix.

Thanks,
Ian.

#25 lore raw

Re: [OSSTEST PATCH 12/13] ts-guest-destroy-hard: New script

Quoted 10 lines · Ian Jackson

Ian Campbell writes ("Re: [OSSTEST PATCH 12/13] ts-guest-destroy-hard: New script"):

Quoted 6 lines · Ian Jackson
Quoted 3 lines

We are going to want this to be able to destroy the rumpuserxen xenstorels domain, which is short-lived (and will normally have terminated by the time we want to destroy it).

You could use on_poweroff=preserve to avoid racing with that?

No, because it still insists that the guest is up and responding to pings etc.

Ah, I was thinking of the other thing which jut parses xl list to see if it exists and in what state.

Quoted 17 lines
Quoted 12 lines

ts-guest-destroy-hard line 3

Quoted 10 lines
ts-guest-destroy-hard new file +3 -0
new file mode 100755
index 0000000..5c2430c
@@ -0,0 +1,27 @@
+#!/usr/bin/perl -w
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2013 Citrix Inc.

Out of date

Will fix.

Thanks,
Ian.

#26 lore raw

Re: [OSSTEST PATCH 12/13] ts-guest-destroy-hard: New script

Ian Campbell writes ("Re: [OSSTEST PATCH 12/13] ts-guest-destroy-hard: New script"):

Quoted 6 lines · Ian Jackson
Quoted 2 lines

No, because it still insists that the guest is up and responding to pings etc.

Ah, I was thinking of the other thing which jut parses xl list to see if it exists and in what state.

That wouldn't work either because the state would be `crashed'.

The rump environment currently uses minios's exit arrangements, and the authors of minios apparently felt that if you return from main you wanted a stack trace...

Ian.

#27 lore raw

Re: [OSSTEST PATCH 12/13] ts-guest-destroy-hard: New script

Quoted 5 lines · Ian Jackson

Ian Campbell writes ("Re: [OSSTEST PATCH 12/13] ts-guest-destroy-hard: New script"):

Quoted 4 lines · Ian Jackson
Quoted 2 lines

No, because it still insists that the guest is up and responding to pings etc.

Quoted 8 lines
Quoted 2 lines

Ah, I was thinking of the other thing which jut parses xl list to see if it exists and in what state.

That wouldn't work either because the state would be `crashed'.

The rump environment currently uses minios's exit arrangements, and the authors of minios apparently felt that if you return from main you wanted a stack trace...

As in SCHEDOP_crash? How exciting... I stupidly assumed it would do the sane thing and SCHEDOP_shutdown...

Ian.

#28 lore raw

Re: [OSSTEST PATCH 12/13] ts-guest-destroy-hard: New script

Ian Campbell writes ("Re: [OSSTEST PATCH 12/13] ts-guest-destroy-hard: New script"):

Quoted 7 lines · Ian Jackson
Quoted 3 lines

The rump environment currently uses minios's exit arrangements, and the authors of minios apparently felt that if you return from main you wanted a stack trace...

As in SCHEDOP_crash? How exciting... I stupidly assumed it would do the sane thing and SCHEDOP_shutdown...

Yes, indeed. Quite.

Ian.

#29 lore raw

PATCH 13/13 rump kernel tests: Run xenstore-ls demo

In reply to Ian Jackson

We can use the newly-generalised ts-rumpuserxen-demo-setup to set up the config file etc. to run xenstore-ls from the xen.git build.

We have a bespoke script to actually execute it: we extract the actual program output from the guest console log, and compare the results to those we expect (based on running xenstore-ls in dom0).

---
 make-flight                    |    2 +
 sg-run-job                     |    4 ++
 ts-rumpuserxen-demo-xenstorels |  111 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 117 insertions(+)
 create mode 100755 ts-rumpuserxen-demo-xenstorels
make-flight +2 -0
index ccfa3e3..b02720f 100755
@@ -125,6 +125,8 @@ do_rumpkernel_tests () {
             guests_rumpuserxenbuildjob=build-$rumparch-rumpuserxen   \
             rump_builtimage=rumpuserxen:/usr/local/lib/xen/rump-kernel \
             rump_cmdline=3                                           \
+            xenstorels_builtimage=:/usr/local/bin/xenstore           \
+            xenstorels_cmdline='ls -fp device'                       \
             all_hostflags=$most_hostflags
 }
 
sg-run-job +4 -0
index ab9f333..2cf810a 100755
@@ -315,6 +315,10 @@ proc run-job/test-rumpuserxen {} {
     run-ts . =   ts-rumpuserxen-demo-setup + host $g
     run-ts . =   ts-guest-start            + host $g
     run-ts . =   ts-guest-destroy          + host $g
+    set g xenstorels
+    run-ts . =   ts-rumpuserxen-demo-setup      + host + $g
+    run-ts . =   ts-rumpuserxen-demo-xenstorels + host + $g
+    run-ts . =   ts-guest-destroy-hard          + host + $g
 }
 
 #---------- builds ----------
ts-rumpuserxen-demo-xenstorels new file +111 -0

111 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#30 lore raw

Re: [OSSTEST PATCH 13/13] rump kernel tests: Run xenstore-ls demo

Quoted 20 lines · Ian Jackson

We can use the newly-generalised ts-rumpuserxen-demo-setup to set up the config file etc. to run xenstore-ls from the xen.git build.

We have a bespoke script to actually execute it: we extract the actual program output from the guest console log, and compare the results to those we expect (based on running xenstore-ls in dom0).

---
 make-flight                    |    2 +
 sg-run-job                     |    4 ++
 ts-rumpuserxen-demo-xenstorels |  111 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 117 insertions(+)
 create mode 100755 ts-rumpuserxen-demo-xenstorels
make-flight +0 -0
index ccfa3e3..b02720f 100755

make-flight do_rumpkernel_tests () { · line 128

Quoted 4 lines
make-flight +1 -0
@@ -125,6 +125,8 @@ do_rumpkernel_tests () {
             guests_rumpuserxenbuildjob=build-$rumparch-rumpuserxen   \
             rump_builtimage=rumpuserxen:/usr/local/lib/xen/rump-kernel \
             rump_cmdline=3                                           \
+            xenstorels_builtimage=:/usr/local/bin/xenstore           \

Really no distpart here? Doesn't that look in the main build job which built the regular Xen not the rump one?

Assuming this is a path within the rump build target -- might it be wise to override --prefix when building that to avoid surprising clashes?

Ian.

#31 lore raw

Re: [OSSTEST PATCH 13/13] rump kernel tests: Run xenstore-ls demo

Ian Campbell writes ("Re: [OSSTEST PATCH 13/13] rump kernel tests: Run xenstore-ls demo"):

Quoted 3 lines · Ian Jackson
Quoted 2 lines

We can use the newly-generalised ts-rumpuserxen-demo-setup to set up the config file etc. to run xenstore-ls from the xen.git build.

...

Quoted 6 lines
Quoted 3 lines
             guests_rumpuserxenbuildjob=build-$rumparch-rumpuserxen   \
             rump_builtimage=rumpuserxen:/usr/local/lib/xen/rump-kernel \
             rump_cmdline=3                                           \> > +            xenstorels_builtimage=:/usr/local/bin/xenstore           \

Really no distpart here? Doesn't that look in the main build job which built the regular Xen not the rump one?

No, the job is that specified in guests_rumpuserxenbuildjob.

The distpart is <foo> in the runvar path_<foo>dist. In this case we want the main output rather than the hypervisor (path_xendist, not built because we say make tools') or kernel (path_kerndist, not built nowadays). So the distpart is '.

Quoted 2 lines

Assuming this is a path within the rump build target -- might it be wise to override --prefix when building that to avoid surprising clashes?

I think it is easier to deal with this on the output end. If you install the rump xen.git build's dist/install/ in your system's / you have only yourself to blame.

Ian.

#32 lore raw

Re: [OSSTEST PATCH 13/13] rump kernel tests: Run xenstore-ls demo

Quoted 12 lines · Ian Jackson

Ian Campbell writes ("Re: [OSSTEST PATCH 13/13] rump kernel tests: Run xenstore-ls demo"):

Quoted 3 lines · Ian Jackson
Quoted 2 lines

We can use the newly-generalised ts-rumpuserxen-demo-setup to set up the config file etc. to run xenstore-ls from the xen.git build.

...

Quoted 6 lines
Quoted 3 lines
             guests_rumpuserxenbuildjob=build-$rumparch-rumpuserxen   \
             rump_builtimage=rumpuserxen:/usr/local/lib/xen/rump-kernel \
             rump_cmdline=3                                           \> > +            xenstorels_builtimage=:/usr/local/bin/xenstore           \

Really no distpart here? Doesn't that look in the main build job which built the regular Xen not the rump one?

Quoted 6 lines

No, the job is that specified in guests_rumpuserxenbuildjob.

The distpart is <foo> in the runvar path_<foo>dist. In this case we want the main output rather than the hypervisor (path_xendist, not built because we say make tools') or kernel (path_kerndist, not built nowadays). So the distpart is '.

Ah yes, I was confusing this with ${thing}buildjob.

Quoted 6 lines
Quoted 2 lines

Assuming this is a path within the rump build target -- might it be wise to override --prefix when building that to avoid surprising clashes?

I think it is easier to deal with this on the output end. If you install the rump xen.git build's dist/install/ in your system's / you have only yourself to blame.

OK.

#33 lore raw
In reply to Ian Jackson

I've commented on a bunch of these. Most of them look good.

You can add my acked-by to the following (some of them I commented on, but only in passing):

Quoted 6 lines · Ian Jackson
 01/13  selectguest: log a message
 02/13  BuildSupport: make selectbuildhost modify @ARGV
 03/13  sg-run-job: Support toggling `adding' by repeating `+'

05/13 make-flight: rumpuserxen tests: use same buildjob for all guests

Quoted 8 lines
 06/13  ts-xen-build: Allow specification of make targets
 07/13  ts-xen-build: Honour cmdprefix_configure, cmdprefix_make
 08/13  rump kernel tests: Do a xen.git tools build
 09/13  rump kernel tests: Use guest-specific fs images location
 10/13  rump kernel tests: Specify kernel via runvar
 11/13  rump kernel tests: Specify cmdline via runvar
 12/13  ts-guest-destroy-hard: New script

Ian.