]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
await_tcp(): Run check_ip on each loop iteration
authorRobert Ho <robert.hu@intel.com>
Sat, 15 Aug 2015 12:37:50 +0000 (20:37 +0800)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 13 Nov 2015 12:42:16 +0000 (12:42 +0000)
await_tcp is often invoked after a reboot.

In this situation the target's IP address may change.  If this happens
while await_tcp is running, we would continue to poll the old IP address.
Fix this by running target_check_ip on each iteration.

Signed-off-by: Robert Ho <robert.hu@intel.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Tested-by: Robert Ho <robert.hu@intel.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v14: Dropped change to selecthost, which was in code which is no
      longer present in this version of the series.
     Rewritten to use target_check_ip.
     Dropped IMO-unnecessary comment.

Osstest/TestSupport.pm

index 325e2e3729f9b9526a332ead2debd41a1b651b1f..b70f19f6b41fa6bcb845e4da629b183995319310 100644 (file)
@@ -2029,9 +2029,10 @@ sub await_tcp ($$$) {
     my ($maxwait,$interval,$ho) = @_;
     target_adjust_timeout($ho,\$maxwait);
     poll_loop($maxwait,$interval,
-              "await tcp $ho->{Name} $ho->{TcpCheckPort}",
+              "await tcp $ho->{Name} $ho->{Ip} $ho->{TcpCheckPort}",
               sub {
-        return target_tcp_check($ho,$interval);
+       return target_check_ip($ho) //
+               target_tcp_check($ho,$interval);
     });
 }