From 9b3602ccf64f1d690a0a3d4adff987a5a12594b1 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Fri, 28 Feb 2014 13:52:29 -0500 Subject: [PATCH] Fix intermittent error in exercises/floating_ips.sh Every once in a while I see this error running floating_ips.sh: /devstack/exercises/floating_ips.sh:184:ping_check /devstack/functions:356:_ping_check_neutron /devstack/lib/neutron:904:die [ERROR] /devstack/lib/neutron:904 [Fail] Could ping server I think the problem is that it immediately tries to ping right after the icmp rule is deleted. Add a timeout and check so we at least wait one second. Change-Id: I753ec257fa12f6d2ddff1a5b1909e32d8995e173 --- exercises/floating_ips.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exercises/floating_ips.sh b/exercises/floating_ips.sh index 8dc44effbc..8b7b96197e 100755 --- a/exercises/floating_ips.sh +++ b/exercises/floating_ips.sh @@ -178,6 +178,10 @@ fi nova secgroup-delete-rule $SECGROUP icmp -1 -1 0.0.0.0/0 || \ die $LINENO "Failure deleting security group rule from $SECGROUP" +if ! timeout $ASSOCIATE_TIMEOUT sh -c "while nova secgroup-list-rules $SECGROUP | grep -q icmp; do sleep 1; done"; then + die $LINENO "Security group rule not deleted from $SECGROUP" +fi + # FIXME (anthony): make xs support security groups if [ "$VIRT_DRIVER" != "xenserver" -a "$VIRT_DRIVER" != "openvz" ]; then # Test we can aren't able to ping our floating ip within ASSOCIATE_TIMEOUT seconds