]> xenbits.xensource.com Git - osstest.git/commitdiff
Timeouts: Honour guest-related timeout-adjustment runvars
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 18 Sep 2015 16:26:44 +0000 (17:26 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 22 Sep 2015 15:34:27 +0000 (16:34 +0100)
We look up a guest runvar GUEST_CONTEXT_timeoutfactor (according to
the usual rules for guest runvars).

Here CONTEXT can currently be `general' or `install'.  (`install'
applies when the guest is being installed.)  If the runvar exists, all
timeouts relating to that guest in that context are increased by the
specified factor.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Osstest/TestSupport.pm

index 110339dd5ce16e83809ca90481547b4377782bdd..7ba51ec3a6af8ae9d5c75e336e4d10873091ab9f 100644 (file)
@@ -312,6 +312,10 @@ END
 
 sub target_adjust_timeout ($$) {
     my ($ho,$timeoutref) = @_; # $ho might be a $gho
+    if ($ho->{Guest}) {
+       my $context = $ho->{TimeoutContext} // 'general';
+       $$timeoutref *= guest_var($ho,"${context}_timeoutfactor",1);
+    }
 }
 
 #---------- running commands eg on targets ----------
@@ -1618,6 +1622,8 @@ sub prepareguest ($$$$$$) {
        }
     }
 
+    $gho->{TimeoutContext} = 'install';
+
     guest_find_lv($gho);
     guest_find_diskimg($gho);
     guest_find_ether($gho);