From: Ian Jackson Subject: [OSSTEST PATCH 09/24] await_tcp(): Run check_ip on each loop iteration Date: Fri, 13 Nov 2015 12:03:37 +0000 Message-ID: <1447416232-12699-10-git-send-email-ian.jackson@eu.citrix.com> References: <1447416232-12699-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZxD5I-0001PD-SB for xen-devel@lists.xenproject.org; Fri, 13 Nov 2015 12:04:04 +0000 In-Reply-To: <1447416232-12699-1-git-send-email-ian.jackson@eu.citrix.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.xenproject.org Cc: Robert Ho , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org From: Robert Ho 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 Signed-off-by: Ian Jackson Tested-by: Robert Ho Acked-by: Ian Campbell --- 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 325e2e3..b70f19f 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -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); }); } -- 1.7.10.4