diff options
author | Jake McGinty <me@jake.su> | 2018-05-08 21:40:13 -0700 |
---|---|---|
committer | Jake McGinty <me@jake.su> | 2018-05-08 21:40:13 -0700 |
commit | 421db88866ff049e1c78958ea00ee5f96f7606a3 (patch) | |
tree | 23476638a8a3e07372206ac7d6b341d3178051e8 /tests/timers.sh | |
parent | tests: more strict verification of packets in sanity-check test (diff) | |
download | wireguard-rs-421db88866ff049e1c78958ea00ee5f96f7606a3.tar.xz wireguard-rs-421db88866ff049e1c78958ea00ee5f96f7606a3.zip |
tests: make sure line is not too chatty in passive keepalive case
Diffstat (limited to 'tests/timers.sh')
-rwxr-xr-x | tests/timers.sh | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/timers.sh b/tests/timers.sh index eab4f4e..28138e5 100755 --- a/tests/timers.sh +++ b/tests/timers.sh @@ -170,13 +170,24 @@ pings2to1=$(tcpdump -r $pcap 2>/dev/null | grep "localhost.20000 > localhost.100 pings1to2=$(tcpdump -r $pcap 2>/dev/null | grep "localhost.10000 > localhost.20000: UDP, length 128" | wc -l) [[ $pings2to1 -eq 20 && $pings1to2 -eq 20 ]] -section "sleeping 10 seconds for passive keepalive..." -sleep 10 +section "sleeping 11 seconds for passive keepalive..." +sleep 11 packets2to1=$(tcpdump -r $pcap 2>/dev/null | grep "localhost.20000 > " | wc -l) packets1to2=$(tcpdump -r $pcap 2>/dev/null | grep "localhost.10000 > " | wc -l) keepalives=$(tcpdump -r $pcap 2>/dev/null | grep "UDP, length 32" | wc -l) keepalives1to2=$(tcpdump -r $pcap 2>/dev/null | grep "localhost.10000 > localhost.20000: UDP, length 32" | wc -l) -[[ $packets2to1 -eq 21 && $packets1to2 -eq 22 && $keepalives -eq 1 && $keepalives1to2 -eq 1]] +echo "2to1 $packets2to1" +echo "1to2 $packets1to2" +echo "keepalives $keepalives" +echo "keepalives1to2 $keepalives1to2" +[[ $packets2to1 -eq 21 && $packets1to2 -eq 22 && $keepalives -eq 1 && $keepalives1to2 -eq 1 ]] + +section "sleeping 16 seconds to make sure the line stays quiet." +sleep 16 + +packets2to1=$(tcpdump -r $pcap 2>/dev/null | grep "localhost.20000 > " | wc -l) +packets1to2=$(tcpdump -r $pcap 2>/dev/null | grep "localhost.10000 > " | wc -l) +[[ $packets2to1 -eq 21 && $packets1to2 -eq 22 ]] section "ALL TESTS PASSED!" |