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
This commit is contained in:
Brian Haley 2014-02-28 13:52:29 -05:00
parent 2cf03d2469
commit 9b3602ccf6

View File

@ -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