Browse code

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

Brian Haley authored on 2014/03/01 03:52:29
Showing 1 changed files
... ...
@@ -178,6 +178,10 @@ fi
178 178
 nova secgroup-delete-rule $SECGROUP icmp -1 -1 0.0.0.0/0 || \
179 179
     die $LINENO "Failure deleting security group rule from $SECGROUP"
180 180
 
181
+if ! timeout $ASSOCIATE_TIMEOUT sh -c "while nova secgroup-list-rules $SECGROUP | grep -q icmp; do sleep 1; done"; then
182
+    die $LINENO "Security group rule not deleted from $SECGROUP"
183
+fi
184
+
181 185
 # FIXME (anthony): make xs support security groups
182 186
 if [ "$VIRT_DRIVER" != "xenserver" -a "$VIRT_DRIVER" != "openvz" ]; then
183 187
     # Test we can aren't able to ping our floating ip within ASSOCIATE_TIMEOUT seconds