[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH OSSTEST v4] Set {ident}_suite runvar when install a Debian guest.



Currently those places which want this open code a lookup of the
{ident}_suite runvar with a fallback to the configuration file.

However selecthost was missing such a lookup in the case where it is
constructing a nested L1 host (which begins from the selectguest
template), which lead to ts-xen-install on Jessie missing the
installation of libnl-route-3-200.

Fix this by providing debian_guest_suite($gho) which as well as
initialising $gho->{Suite} stores an {ident}_suite runvar (taking care
to handle the case where one is already set by e.g. make-flight). For
convenience debian_guest_suite() also returns the suite name.

ts-debian-install, ts-debian-di-install and ts-debian-hvm-install now
use debian_guest_suite instead of open coding the lookup.

The final piece of the puzzle is to have selectguest() pickup the
{ident}_suite runvar (if it is set) and initialise $gho->{Suite} from
it.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
I've run an adhoc test with:
OSSTEST_JOBS_ONLY=
OSSTEST_JOBS_ONLY=$OSSTEST_JOBS_ONLY:build-amd64
OSSTEST_JOBS_ONLY=$OSSTEST_JOBS_ONLY:build-amd64-pvops
OSSTEST_JOBS_ONLY=$OSSTEST_JOBS_ONLY:test-amd64-amd64-qemuu-nested # nested
OSSTEST_JOBS_ONLY=$OSSTEST_JOBS_ONLY:test-amd64-amd64-xl-qemuu-debianhvm-amd64 
# regular HVM
OSSTEST_JOBS_ONLY=$OSSTEST_JOBS_ONLY:test-amd64-amd64-xl-qcow2 # DI install
OSSTEST_JOBS_ONLY=$OSSTEST_JOBS_ONLY:test-amd64-amd64-xl # Normal PV
export OSSTEST_JOBS_ONLY
( ;-) )

The three HVM ones have passed and the PV one is well past the point where any
of this would make a difference (it's at 17.ts-guest-localmigrate)

v2: Totally different approach, replacing "selecthost: Correctly set
    ->{Suite} for a nested host in selecthost()". Previous version
    had ts-debian-hvm-install using DebianGuestSuite and
    ts-xen-install using DebianSuite.
v3: Another different approach, replacing "Add $gho->{Suite} field to
    guest objects from {prepare,select}guest()".
v4: Use //= guest_var, and remove spaces inside if expr.
    "use Osstest::Debian" in ts-debian-install (how it avoided that
    requirement until now I'm not sure!)
---
 Osstest/Debian.pm      | 14 ++++++++++++++
 Osstest/TestSupport.pm |  1 +
 ts-debian-di-install   |  2 +-
 ts-debian-hvm-install  |  2 +-
 ts-debian-install      |  3 ++-
 5 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 317f663..cee0d88 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -35,6 +35,7 @@ BEGIN {
     @ISA         = qw(Exporter);
     @EXPORT      = qw(debian_boot_setup
                       debian_overlays
+                      debian_guest_suite
                       %preseed_cmds
                       preseed_base
                       preseed_create
@@ -1335,4 +1336,17 @@ sub preseed_hook_cmds () {
     return $preseed;
 }
 
+sub debian_guest_suite ($) {
+    my ($gho) = @_;
+
+    $gho->{Suite} //= guest_var($gho,'suite',undef);
+
+    if (!$gho->{Suite}) {
+       $gho->{Suite} = $c{GuestDebianSuite};
+       store_runvar("$gho->{Guest}_suite", $gho->{Suite});
+    }
+
+    return $gho->{Suite};
+}
+
 1;
diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index d1f7d36..61e885a 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -1453,6 +1453,7 @@ sub selectguest ($$) {
         CfgPath => $r{"${gn}_cfgpath"},
         Tftp => $ho->{Tftp},
        Host => $ho,
+       Suite => $r{"${gn}_suite"},
     };
     foreach my $opt (guest_var_commalist($gho,'options')) {
         $gho->{Options}{$opt}++;
diff --git a/ts-debian-di-install b/ts-debian-di-install
index 64b5d44..a9b3b20 100755
--- a/ts-debian-di-install
+++ b/ts-debian-di-install
@@ -190,7 +190,7 @@ END
 
     if ( $method eq "netboot" )
     {
-       my $suite= $r{"$gho->{Guest}_suite"};
+       my $suite= debian_guest_suite($gho);
        logm("$method $suite/$arch");
 
        $method_cfg = setup_netboot($tmpdir, $arch, $suite);
diff --git a/ts-debian-hvm-install b/ts-debian-hvm-install
index 2c7580c..96190a1 100755
--- a/ts-debian-hvm-install
+++ b/ts-debian-hvm-install
@@ -199,7 +199,7 @@ sub prep () {
                        $disk_mb + 1,
                        200);
 
-    $gsuite = guest_var($gho,'suite',$c{GuestDebianSuite});
+    $gsuite = debian_guest_suite($gho);
     $kernel = iso_path('kernel', 'vmlinuz');
     $ramdisk = iso_path('ramdisk', 'initrd.gz');
 
diff --git a/ts-debian-install b/ts-debian-install
index 0dfe40c..f42edbf 100755
--- a/ts-debian-install
+++ b/ts-debian-install
@@ -19,6 +19,7 @@ use strict qw(vars);
 use DBI;
 use Osstest;
 use Osstest::TestSupport;
+use Osstest::Debian;
 
 tsreadconfig();
 
@@ -47,7 +48,7 @@ sub prep () {
 sub ginstall () {
     my $arch= $r{"$gho->{Guest}_arch"};
     my $archarg= defined($arch) ? "--arch $arch" : '';
-    my $gsuite= guest_var($gho,'suite',$c{GuestDebianSuite});
+    my $gsuite= debian_guest_suite($gho);
 
     my $kernpath = guest_var($gho,'kernel_path',$r{xen_kernel_path});
     my $initrd = guest_var($gho,'initrd_path',$r{xen_initrd_path});
-- 
2.6.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.