1 #!/bin/bash 2 # SPDX-License-Identifier: GPL-2.0 3 # 4 # Test latency spikes caused by FIN/ACK handling race. 5 6 set +x 7 set -e 8 9 tmpfile=$(mktemp /tmp/fin_ack_latency.XXXX.log) 10 11 cleanup() { 12 kill $(pidof fin_ack_lat) 13 rm -f $tmpfile 14 } 15 16 trap cleanup EXIT 17 18 do_test() { 19 RUNTIME=$1 20 21 ./fin_ack_lat | tee $tmpfile & 22 PID=$! 23 24 sleep $RUNTIME 25 NR_SPIKES=$(wc -l $tmpfile | awk '{print $1}') 26 if [ $NR_SPIKES -gt 0 ] 27 then 28 echo "FAIL: $NR_SPIKES spikes detected" 29 return 1 30 fi 31 return 0 32 } 33 34 do_test "30" 35 echo "test done"
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.