2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 01:51:26 +00:00
Frode Nordahl 34ae81c1f4 tests: Use ping timeout instead of deadline.
Many system tests currently use ping with the combination of a
low packet count (-c 3), short interval between sends (-i 0.3)
and a _deadline_ of 2 seconds (-d 2).

This combination of options may lead to a situation where more
than count packets are sent however ping will stop when count
packets are received. This results in a failed test due to how
the result is checked, for example:

    ping6 -q -c 3 -i 0.3 -w 2 fc00::3 | FORMAT_PING
    @@ -1,2 +1,2 @@
    -3 packets transmitted, 3 received, 0% packet loss, time 0ms
    +4 packets transmitted, 3 received, 25% packet loss, time 0ms

To reiterate, in the above example there is no packet loss, but
ping stops after _receiving_ 3 packets, not bothering with
waiting for the response to the fourth packet it just sent out.

If we look at the iputils ping manual for the -w deadline option
we can read that this is expected behavior:

 > Specify a timeout, in seconds, before ping exits regardless of
 > how many packets have been sent or received. In this case ping
 > does not stop after count packet are sent, it waits either for
 > deadline expire or until count probes are answered or for some
 > error notification from network.

To avoid these kinds of failures in checks where a response is
expected, we replace ping -w with ping -W.

We keep ping -w for checks where it is expected to NOT get a
response.

Acked-by: Simon Horman <horms@ovn.org>
Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2023-10-26 22:28:43 +02:00
..
2023-06-29 22:13:55 +02:00
2020-07-27 14:50:17 -07:00
2023-03-29 22:16:04 +02:00
2022-07-15 20:14:24 +02:00
2019-12-20 12:23:06 -08:00
2021-06-22 21:29:57 +02:00
2022-05-30 23:34:39 +02:00
2021-06-22 21:29:57 +02:00
2019-12-20 12:23:06 -08:00
2023-07-14 22:24:03 +02:00