selftests/net: make so_txtime more robust to timer variance
[linux-2.6-microblaze.git] / tools / testing / selftests / net / so_txtime.sh
index 5aa5193..3f7800e 100755 (executable)
@@ -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