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

Re: [Xen-devel] OSSTEST -- nested test case development, RFC: ts-guest-destroy doesn't call guest_await_dhcp_tcp() if guest has fixed IP



> -----Original Message-----
> From: Hu, Robert
> Sent: Thursday, August 13, 2015 11:46 AM
> To: Ian Jackson
> Cc: Ian Campbell; wei.liu2@xxxxxxxxxx; xen-devel@xxxxxxxxxxxxx
> Subject: RE: OSSTEST -- nested test case development, RFC: ts-guest-destroy
> doesn't call guest_await_dhcp_tcp() if guest has fixed IP
> 
> > -----Original Message-----
> > From: Ian Jackson [mailto:Ian.Jackson@xxxxxxxxxxxxx]
> > Sent: Wednesday, August 12, 2015 11:27 PM
> > To: Hu, Robert
> > Cc: Ian Campbell; wei.liu2@xxxxxxxxxx; xen-devel@xxxxxxxxxxxxx
> > Subject: RE: OSSTEST -- nested test case development, RFC:
> ts-guest-destroy
> > doesn't call guest_await_dhcp_tcp() if guest has fixed IP
> >
> > Hu, Robert writes ("RE: OSSTEST -- nested test case development, RFC:
> > ts-guest-destroy doesn't call guest_await_dhcp_tcp() if guest has fixed
> IP"):
> >
> > > So shall I conclude as following?:
> >
> > > 1. Xen install shall create xenbr0 bridge with dhcp mode; Apply to
> > > both L0 and L1.
> >
> > I think ts-xen-install should respect the existing configuration for
> > the primary network device, rather than insisting it be static, or
> > insisting it be dhcp.
> Yes, in fact it is the only network interface (eth0 before Xen intall; xenbr0
> after
> Xen install, eth0 becomes its slave right now).
> So you won't object turn xenbr0 config to 'dhcp' as following, right?
> diff --git a/ts-xen-install b/ts-xen-install
> index 0f53382..74104cb 100755
> --- a/ts-xen-install
> +++ b/ts-xen-install
> @@ -301,10 +301,7 @@ END
>              if (m/^\s* iface \s+ (?: $physif | xenbr0 ) \s+ inet \s /x) {
>                  $suppress= 1;
>                  print EO <<END;
> -iface $iface inet static
> -    address $ho->{Ip}
> -    netmask $netmask
> -    gateway $gateway
> +iface $iface inet dhcp
>  $bridgex
>  END
>              }
> >
> > > 2. in each selecthost invoke, query DHCP lease for host's IP. (This
> > > assumes no more fixed IP used in any cases).
> >
> > We should continue to use fixed IP addresses where we have them.
> Then I'm not confident to change selecthost(). Would you help give me
> the patch addressing this?
I changed like this. It works (I tested with both nested case and 
test-amd64-amd64-xl-qemuu-debianhvm-amd64). How would you like it?

index e9be7f8..b367cfb 100755
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -875,7 +875,7 @@ sub selecthost ($) {
     $ho->{Fqdn} = get_host_property($ho,'fqdn',$defaultfqdn);
 
 
-    $ho->{Ether}= get_host_property($ho,'ether');
+    $ho->{Ether}= get_host_property($ho,'ether') || $r{"$ho->{Ident}_ether"};
     $ho->{DiskDevice}= get_host_property($ho,'disk-device');
     $ho->{Power}= get_host_property($ho,'power-method');
 
@@ -886,17 +886,23 @@ sub selecthost ($) {
     serial_host_setup($ho);
 
     $ho->{IpStatic} = get_host_property($ho,'ip-addr');
-    if (defined $r{"${ident}_ip"}) {
-        $ho->{Ip} = $r{"${ident}_ip"};
-    } else {
-        if (!defined $ho->{IpStatic}) {
-           my $ip_packed= gethostbyname($ho->{Fqdn});
-           die "$ho->{Fqdn} ?" unless $ip_packed;
+    if (!defined $ho->{IpStatic}) {
+       my $ip_packed= gethostbyname($ho->{Fqdn});
+       if (!$ip_packed) {
+           logm("Going to look for $ho->{Name}'s ether: $ho->{Ether}");
+           $ho->{DhcpWatch}->check_ip($ho);
+           $ho->{IpStatic}=$ho->{Ip};
+       }
+#      die "$ho->{Fqdn} ?" unless $ip_packed;
+       else {
            $ho->{IpStatic}= inet_ntoa($ip_packed);
            die "$ho->{Fqdn} ?" unless defined $ho->{IpStatic};
-        }
-        $ho->{Ip}= $ho->{IpStatic};
+           $ho->{Ip}= $ho->{IpStatic};
+       }
     }
> >
> > Ian.

_______________________________________________
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®.