]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
Set {ident}_suite runvar when install a Debian guest.
authorIan Campbell <ian.campbell@citrix.com>
Mon, 23 Nov 2015 11:54:11 +0000 (11:54 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 25 Nov 2015 11:18:01 +0000 (11:18 +0000)
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@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/Debian.pm
Osstest/TestSupport.pm
ts-debian-di-install
ts-debian-hvm-install
ts-debian-install

index 317f66330114bb309d2d55f4102406820b0654d7..cee0d88768d8eb052c8b11d5c819da03e399a2e6 100644 (file)
@@ -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;
index d1f7d3682de54294c3eb888ea37ceb9cbb0cf12c..61e885ab6bb093cef800456f05f41c7b9f77109b 100644 (file)
@@ -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}++;
index 64b5d44a4b931cbb1c88bebb68a74b3f26278f7e..a9b3b200c598cd558238209ef8031068a73018b6 100755 (executable)
@@ -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);
index 2c7580c14a44b8a903e6b50aa92148e3acdfe615..96190a18fb40065229241506d31aed268d37991f 100755 (executable)
@@ -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');
 
index 0dfe40c2bb66f9592916fd0c090fca1f7daac345..f42edbfb9817ef5b51c4dba4615433c39907090f 100755 (executable)
@@ -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});