tests: Don't raise TimeoutError when waiting for ping
Timeout error makes debugging a little bit harder. This exception makes more sense. Change-Id: Idd6556710190019d440b94e725a0f17f89e0f082
This commit is contained in:
parent
499425b85b
commit
a17c52f388
@ -22,6 +22,10 @@ from neutron.common import utils
|
||||
from neutron.tests.common import net_helpers
|
||||
|
||||
|
||||
class FakeMachineException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class FakeMachineBase(fixtures.Fixture):
|
||||
"""Create a fake machine.
|
||||
|
||||
@ -60,7 +64,11 @@ class FakeMachineBase(fixtures.Fixture):
|
||||
|
||||
def block_until_ping(self, dst_ip):
|
||||
predicate = functools.partial(self.ping_predicate, dst_ip)
|
||||
utils.wait_until_true(predicate)
|
||||
utils.wait_until_true(
|
||||
predicate,
|
||||
exception=FakeMachineException(
|
||||
"No ICMP reply obtained from IP address %s" % dst_ip)
|
||||
)
|
||||
|
||||
def assert_ping(self, dst_ip):
|
||||
net_helpers.assert_ping(self.namespace, dst_ip)
|
||||
|
Loading…
x
Reference in New Issue
Block a user