aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tests
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-05-14 14:15:16 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-05-17 18:07:42 +0200
commit523f15ccccb99362279c020de9cc054b587c45ef (patch)
treeb3bf5e12c4d9a05f359708a7480abbec74516b5e /src/tests
parentqemu: new location for test kernels (diff)
downloadwireguard-monolithic-historical-523f15ccccb99362279c020de9cc054b587c45ef.tar.xz
wireguard-monolithic-historical-523f15ccccb99362279c020de9cc054b587c45ef.zip
tests: check for stats counter increases
The kernel API for this has changed a lot, so this test is important to ensure our compat layer is doing the right thing.
Diffstat (limited to 'src/tests')
-rwxr-xr-xsrc/tests/netns.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tests/netns.sh b/src/tests/netns.sh
index 9ef83a7..1ad767e 100755
--- a/src/tests/netns.sh
+++ b/src/tests/netns.sh
@@ -140,6 +140,10 @@ big_mtu=$(( 34816 - 1500 + $orig_mtu ))
# Test using IPv4 as outer transport
n1 wg set wg0 peer "$pub2" endpoint 127.0.0.1:2
n2 wg set wg0 peer "$pub1" endpoint 127.0.0.1:1
+# Before calling tests, we first make sure that the stats counters are working
+n2 ping -c 10 -f -W 1 192.168.241.1
+{ read _; read _; read _; read rx_bytes _; read _; read tx_bytes _; } < <(ip2 -stats link show dev wg0)
+[[ $rx_bytes -ge 1052 && $tx_bytes -ge 1516 && $rx_bytes -lt 2500 && $rx_bytes -lt 2500 ]]
tests
ip1 link set wg0 mtu $big_mtu
ip2 link set wg0 mtu $big_mtu