aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tests
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-19 04:41:13 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-31 17:22:49 +0100
commit9d930f5d183da66f0859a2c21cdd5e9919b84db4 (patch)
treea145dcb8d279c3fcca66b32e0f9ac3e2ea8854c8 /src/tests
parentselftest: initialize mutex in routingtable selftest (diff)
downloadwireguard-monolithic-historical-9d930f5d183da66f0859a2c21cdd5e9919b84db4.tar.xz
wireguard-monolithic-historical-9d930f5d183da66f0859a2c21cdd5e9919b84db4.zip
stats: more robust accounting
Diffstat (limited to '')
-rwxr-xr-xsrc/tests/netns.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/tests/netns.sh b/src/tests/netns.sh
index 94666f3..9a12a19 100755
--- a/src/tests/netns.sh
+++ b/src/tests/netns.sh
@@ -144,7 +144,14 @@ 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 932 && $tx_bytes -ge 1516 && $rx_bytes -lt 2500 && $rx_bytes -lt 2500 ]]
+(( rx_bytes == 1372 && (tx_bytes == 1428 || tx_bytes == 1460) ))
+{ read _; read _; read _; read rx_bytes _; read _; read tx_bytes _; } < <(ip1 -stats link show dev wg0)
+(( tx_bytes == 1372 && (rx_bytes == 1428 || rx_bytes == 1460) ))
+read _ rx_bytes tx_bytes < <(n2 wg show wg0 transfer)
+(( rx_bytes == 1372 && (tx_bytes == 1428 || tx_bytes == 1460) ))
+read _ rx_bytes tx_bytes < <(n1 wg show wg0 transfer)
+(( tx_bytes == 1372 && (rx_bytes == 1428 || rx_bytes == 1460) ))
+
tests
ip1 link set wg0 mtu $big_mtu
ip2 link set wg0 mtu $big_mtu