brintos

brintos / linux-shallow public Read only

0
0
Text · 507 B · a3ff6e0 Raw
36 lines · bash
1#!/bin/bash2# SPDX-License-Identifier: GPL-2.03#4# Test latency spikes caused by FIN/ACK handling race.5 6set +x7set -e8 9tmpfile=$(mktemp /tmp/fin_ack_latency.XXXX.log)10 11cleanup() {12	kill $(pidof fin_ack_lat)13	rm -f $tmpfile14}15 16trap cleanup EXIT17 18do_test() {19	RUNTIME=$120 21	./fin_ack_lat | tee $tmpfile &22	PID=$!23 24	sleep $RUNTIME25	NR_SPIKES=$(wc -l $tmpfile | awk '{print $1}')26	if [ $NR_SPIKES -gt 0 ]27	then28		echo "FAIL: $NR_SPIKES spikes detected"29		return 130	fi31	return 032}33 34do_test "30"35echo "test done"36