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

[Xen-devel] [OSSTest Nested v12 21/21] await_tcp(): check_ip for each loop iteration

await_tcp usually invoked after a reboot, $ho IP may change,
especially when $ho 'client name' of DHCP request changes.
Therefore, await_tcp() check will fail if we don't update $ho->{IP}
But, if $ho has static IP, this won't apply.
Also, this patch add $ho->{Ip} in its $what message, so that we can
observe clearly if $ho->{Ip} changes.

To use $ho->{IpStatic} to indicate what its name means, we have to
correct its assignment: we assign value to it only from configuration
or DNS query. We already have $ho->{Ip}, which shall indicate $ho
IP address in dhcp cases.

Signed-off-by: Robert Ho <robert.hu@xxxxxxxxx>
 Osstest/TestSupport.pm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 1d1d6b1..298fca9 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -894,7 +894,6 @@ sub selecthost ($) {
        if (!$ip_packed) {
            logm("Going to look for $ho->{Name}'s ether: $ho->{Ether}");
-           $ho->{IpStatic}=$ho->{Ip};
 #      die "$ho->{Fqdn} ?" unless $ip_packed;
        else {
@@ -1945,8 +1944,12 @@ sub target_tcp_check ($$) {
 sub await_tcp ($$$) {
     my ($maxwait,$interval,$ho) = @_;
-              "await tcp $ho->{Name} $ho->{TcpCheckPort}",
+              "await tcp $ho->{Name} $ho->{Ip} $ho->{TcpCheckPort}",
               sub {
+       #await_tcp() usually called after a reboot, where $ho IP may change.
+       #unless it has static IP
+       $ho->{DhcpWatch}->check_ip($ho) 
+               unless $ho->{IpStatic};
         return target_tcp_check($ho,$interval);

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.