From mboxrd@z Thu Jan 1 00:00:00 1970 From: "longtao.pang" Subject: [OSSTEST Nested PATCH 2/6] Add and expose some testsupport APIs Date: Tue, 17 Mar 2015 14:16:50 -0400 Message-ID: <1426616214-11670-3-git-send-email-longtaox.pang@intel.com> References: <1426616214-11670-1-git-send-email-longtaox.pang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1426616214-11670-1-git-send-email-longtaox.pang@intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: wei.liu2@citrix.com, longtaox.pang@intel.com, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com, robert.hu@intel.com List-Id: xen-devel@lists.xenproject.org From: "longtao.pang" 1. Designate vif model to 'e1000', otherwise, with default device model, the L1 eth0 interface disappear, hence xenbridge cannot work. Maybe this limitation can be removed later after some fix it. For now, we have to accomodate to it. 2. Since reboot L1 guest VM will take more time to boot up, we increase multi-times for reboot-confirm-booted if test nested job, and the multi value is stored as a runvar in 'ts-nested-setup' script. Added another function 'guest_editconfig_cd' and expose it, this function bascically changes guest boot device sequence, alter its on_reboot behavior to restart and enabled nestedhvm feature. 3. In L2 installation context, its host (L1) IP address is not queried from DNS, but after running "ts-nested-setup + host + nested", L1 IP is stored in runvar. --- Osstest/TestSupport.pm | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index e1ebcb7..57c7167 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -111,6 +111,7 @@ BEGIN { iso_gen_flags_basic iso_copy_content_from_image guest_editconfig_nocd + guest_editconfig_cd ); %EXPORT_TAGS = ( ); @@ -819,6 +820,10 @@ sub selecthost ($) { logm("Host $name is in HostGroup $ho->{Properties}{HostGroup}"); } + if ( $r{"${name}_ip"} ) { + $setprop->("IpAddr", $r{"${name}_ip"}); + } + # Next, we use the config file's general properites as defaults foreach my $k (keys %c) { next unless $k =~ m/^HostProp_([A-Z].*)$/; @@ -990,8 +995,9 @@ sub common_toolstack ($) { sub host_reboot ($) { my ($ho) = @_; + my $wait_time = $r{multi_reboot_time} ? $r{multi_reboot_time}*40 : 40; target_reboot($ho); - poll_loop(40,2, 'reboot-confirm-booted', sub { + poll_loop($wait_time,2, 'reboot-confirm-booted', sub { my $output; if (!eval { $output= target_cmd_output($ho, <{Ether}' ] +vif = [ 'type=ioemu,model=e1000,mac=$gho->{Ether}' ] # on_poweroff = '$onpoweroff' on_reboot = '$onreboot' @@ -2113,4 +2119,15 @@ sub guest_editconfig_nocd ($$) { }); } +sub guest_editconfig_cd ($) { + my ($gho) = @_; + guest_editconfig($gho->{Host}, $gho, sub { + if (m/^\s*boot\s*= '\s*d\s*c\s*'/) { + s/dc/cd/; + } + s/^on_reboot.*/on_reboot='restart'/; + s/#nestedhvm/nestedhvm/; + }); +} + 1; -- 1.7.10.4