summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-11-29 21:02:05 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-11-29 21:59:19 +0100
commit92a8e5054807e1c314fbc4b56cbdfed4d2108c75 (patch)
tree7b5967632fc531685e56304d3faddec98e8084a2
parent4fc48ada0f2d5bf6f9c155e72fafcf4d1da95e96 (diff)
tests: be sure we get all messages
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rwxr-xr-xsrc/tests/netns.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tests/netns.sh b/src/tests/netns.sh
index 38d52da..4e8465c 100755
--- a/src/tests/netns.sh
+++ b/src/tests/netns.sh
@@ -43,6 +43,8 @@ waitiface() { pretty "${1//*-}" "wait for $2 to come up"; ip netns exec "$1" bas
cleanup() {
set +e
exec 2>/dev/null
+ echo "$orig_message_cost" > /proc/sys/net/core/message_cost
+ echo "$orig_strict_writes" > /proc/sys/kernel/sysctl_writes_strict
ip0 link del dev wg0
ip1 link del dev wg0
ip2 link del dev wg0
@@ -53,7 +55,11 @@ cleanup() {
exit
}
+orig_strict_writes="$(< /proc/sys/kernel/sysctl_writes_strict)"
+orig_message_cost="$(< /proc/sys/net/core/message_cost)"
trap cleanup EXIT
+echo 1 > /proc/sys/kernel/sysctl_writes_strict
+echo 0 > /proc/sys/net/core/message_cost
ip netns del $netns0 2>/dev/null || true
ip netns del $netns1 2>/dev/null || true
@@ -225,7 +231,6 @@ waitiface $netns0 vethrs
waitiface $netns1 vethc
waitiface $netns2 veths
-n0 bash -c 'echo 1 > /proc/sys/kernel/sysctl_writes_strict'
n0 bash -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'
n0 bash -c 'echo 2 > /proc/sys/net/netfilter/nf_conntrack_udp_timeout'
n0 bash -c 'echo 2 > /proc/sys/net/netfilter/nf_conntrack_udp_timeout_stream'