diff options
author | Jake McGinty <me@jake.su> | 2018-05-08 22:02:25 -0700 |
---|---|---|
committer | Jake McGinty <me@jake.su> | 2018-05-08 22:02:25 -0700 |
commit | 0a3e026201aa79fbfdd4423d25589bfa67ed698e (patch) | |
tree | cdb749611e44f9f31eef1f60c9a2380c160389b6 | |
parent | peer_server: fix timer bugs caught by tests! (diff) | |
download | wireguard-rs-0a3e026201aa79fbfdd4423d25589bfa67ed698e.tar.xz wireguard-rs-0a3e026201aa79fbfdd4423d25589bfa67ed698e.zip |
tests: add basic persistent keepalive timer test
-rwxr-xr-x | tests/timers.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/timers.sh b/tests/timers.sh index 28138e5..3922f93 100755 --- a/tests/timers.sh +++ b/tests/timers.sh @@ -190,4 +190,17 @@ 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 "testing immediate send of persistent keepalive when set" +n1 wg set wg1 peer "$pub2" persistent-keepalive 5 +sleep 1 +keepalives=$(tcpdump -r $pcap 2>/dev/null | grep "UDP, length 32" | wc -l) +echo "keepalives $keepalives" +[[ $keepalives -eq 2 ]] + +section "waiting for the following persistent keepalive" +sleep 6 +keepalives=$(tcpdump -r $pcap 2>/dev/null | grep "UDP, length 32" | wc -l) +echo "keepalives $keepalives" +[[ $keepalives -eq 3 ]] + section "ALL TESTS PASSED!" |