net_helpers.async_ping() should pass when each of the ICMP echo requests
is matched by a corresponding ICMP echo reply, and it should fail if a
response is not received for some request. The async_ping implementation
relies on the ping exit code: when ping returns nonzero exit code,
RuntimeException would be consequentially thrown and async_ping assertion
would thus fail.
Current implementation of net_helpers.async_ping() is broken due to its
usage of -c parameter of ping command and assumption that if _some_ of
the ICMP replies does not arrive, ping would return nonzero exit code.
However, Linux ping works in the way that if _at least one_ reply is
received from any number of ICMP ping requests, result code is 0
(success) and thus no RuntimeException is thrown. This commit fixes
assert_ping to be a reliable assertion guaranteeing that no ping request
stays without reply. For simple bash reproducer and more thorough
discussion of possible solutions, see the bug description.
Closes-Bug: #1588731
Change-Id: I9257b94a8ebbfaf1c4266c1f8ce3097657bacee5
(cherry picked from commit 2dcacaae88970365350200ca58982a18e21c703d)
Reviewed: https:/ /review. openstack. org/347062 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=0036bc07e7e e1d59e713df604d 73645b8764d025
Committed: https:/
Submitter: Jenkins
Branch: stable/liberty
commit 0036bc07e7ee1d5 9e713df604d7364 5b8764d025
Author: Hynek Mlnarik <email address hidden>
Date: Fri Jun 3 11:30:17 2016 +0200
Fix of ping usage in net_helpers. async_ping( )
net_ helpers. async_ping( ) should pass when each of the ICMP echo requests ption would be consequentially thrown and async_ping assertion
is matched by a corresponding ICMP echo reply, and it should fail if a
response is not received for some request. The async_ping implementation
relies on the ping exit code: when ping returns nonzero exit code,
RuntimeExce
would thus fail.
Current implementation of net_helpers. async_ping( ) is broken due to its
usage of -c parameter of ping command and assumption that if _some_ of
the ICMP replies does not arrive, ping would return nonzero exit code.
However, Linux ping works in the way that if _at least one_ reply is
received from any number of ICMP ping requests, result code is 0
(success) and thus no RuntimeException is thrown. This commit fixes
assert_ping to be a reliable assertion guaranteeing that no ping request
stays without reply. For simple bash reproducer and more thorough
discussion of possible solutions, see the bug description.
Closes-Bug: #1588731 f1c4266c1f8ce30 97657bacee5 5350200ca58982a 18e21c703d)
Change-Id: I9257b94a8ebbfa
(cherry picked from commit 2dcacaae8897036