]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
Cope with Jessie's d-i vg name
authorWei Liu <wei.liu2@citrix.com>
Mon, 15 Jun 2015 11:07:38 +0000 (12:07 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Tue, 23 Jun 2015 15:43:55 +0000 (16:43 +0100)
In Jessie the default vg name is changed to "$hostname-vg". Make that
default case and check for wheezy, squeeze and lenny for backward
compatibility.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes in v4:
1. Add missing "use Osstest::Debian;".

Changes in v3:
1. Introduce a function to return vg name and use it.

Changes in v2:
1. Make Jessie case default.

Osstest/Debian.pm
ts-host-install
ts-xen-build-prep

index 8ad673e147b6bdba55e74a6f5a4c8e1d9b114049..b1a5396f99d569cf245fba02af37671a9f261391 100644 (file)
@@ -43,6 +43,7 @@ BEGIN {
                       preseed_hook_overlay
                       preseed_hook_cmds
                       di_installcmdline_core
+                      di_vg_name
                       );
     %EXPORT_TAGS = ( );
 
@@ -566,6 +567,18 @@ sub di_installcmdline_core ($$;@) {
     return @cl;
 }
 
+sub di_vg_name($) {
+    my ($ho) = @_;
+
+    if ($ho->{Suite} =~ m/wheezy|squeeze/) {
+       return $ho->{Name};
+    }
+    if ($ho->{Suite} =~ m/lenny/){
+       return "$ho->{Name}.$c{TestHostDomain}";
+    }
+    return "$ho->{Name}-vg";
+}
+
 sub preseed_ssh ($$) {
     my ($ho,$sfx) = @_;
 
index 242bfb0ad4e85b92a145f6ad832f329efda45539..04d548756f30ad0ff01634330bd3af305b2b76e2 100755 (executable)
@@ -87,10 +87,9 @@ END
 
     await_tcp(get_timeout($ho,'reboot',$timeout{Sshd}), 14,$ho);
 
-    our $vgname= $ho->{Name};
+    our $vgname = di_vg_name($ho);
 
     if ($ho->{Suite} =~ m/lenny/) {
-        $vgname .= ".$c{TestHostDomain}";
         target_editfile_root($ho, '/boot/grub/menu.lst', sub {
             while (<EI>) {
                 s/^terminal.*/terminal --timeout=10 serial console/;
index 4dece65909d256e04740f628fbc5d00f0600282e..b5d7ed006bc825ceb3f80b0d5ddf2aba43d11ded 100755 (executable)
@@ -20,6 +20,7 @@ use DBI;
 use Osstest;
 use POSIX;
 use Osstest::TestSupport;
+use Osstest::Debian;
 
 tsreadconfig();
 
@@ -52,10 +53,7 @@ sub overall_limit_pe ($) {
 }
 
 sub determine_vg_lv () {
-    $vg=
-        $ho->{Suite} =~ m/lenny/
-        ? "$ho->{Name}.$c{TestHostDomain}"
-        : $ho->{Name};
+    $vg = di_vg_name($ho);
     $lv = "/dev/$vg/$lvleaf";
 }