summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/net/so_txtime.sh
diff options
context:
space:
mode:
authorWillem de Bruijn <willemb@google.com>2019-12-12 19:36:46 +0300
committerJakub Kicinski <jakub.kicinski@netronome.com>2019-12-15 05:03:01 +0300
commitea6a547669b37453f2b1a5d85188d75b3613dfaa (patch)
tree5d037aacd4e54cbe01f59e364671dab16d7e14f6 /tools/testing/selftests/net/so_txtime.sh
parent3a5f494d84187db5a86de6aeceec4ae6b58380cd (diff)
downloadlinux-ea6a547669b37453f2b1a5d85188d75b3613dfaa.tar.xz
selftests/net: make so_txtime more robust to timer variance
The SO_TXTIME test depends on accurate timers. In some virtualized environments the test has been reported to be flaky. This is easily reproduced by disabling kvm acceleration in Qemu. Allow greater variance in a run and retry to further reduce flakiness. Observed errors are one of two kinds: either the packet arrives too early or late at recv(), or it was dropped in the qdisc itself and the recv() call times out. In the latter case, the qdisc queues a notification to the error queue of the send socket. Also explicitly report this cause. Link: https://lore.kernel.org/netdev/CA+FuTSdYOnJCsGuj43xwV1jxvYsaoa_LzHQF9qMyhrkLrivxKw@mail.gmail.com Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org> Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Diffstat (limited to 'tools/testing/selftests/net/so_txtime.sh')
-rwxr-xr-xtools/testing/selftests/net/so_txtime.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/testing/selftests/net/so_txtime.sh b/tools/testing/selftests/net/so_txtime.sh
index 5aa519328a5b..3f7800eaecb1 100755
--- a/tools/testing/selftests/net/so_txtime.sh
+++ b/tools/testing/selftests/net/so_txtime.sh
@@ -5,7 +5,12 @@
# Run in network namespace
if [[ $# -eq 0 ]]; then
- ./in_netns.sh $0 __subprocess
+ if ! ./in_netns.sh $0 __subprocess; then
+ # test is time sensitive, can be flaky
+ echo "test failed: retry once"
+ ./in_netns.sh $0 __subprocess
+ fi
+
exit $?
fi
@@ -18,7 +23,7 @@ tc qdisc add dev lo root fq
./so_txtime -4 -6 -c mono a,10,b,20 a,10,b,20
./so_txtime -4 -6 -c mono a,20,b,10 b,20,a,20
-if tc qdisc replace dev lo root etf clockid CLOCK_TAI delta 200000; then
+if tc qdisc replace dev lo root etf clockid CLOCK_TAI delta 400000; then
! ./so_txtime -4 -6 -c tai a,-1 a,-1
! ./so_txtime -4 -6 -c tai a,0 a,0
./so_txtime -4 -6 -c tai a,10 a,10