summaryrefslogtreecommitdiffhomepage
path: root/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests')
-rwxr-xr-xsrc/tests/netns.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/tests/netns.sh b/src/tests/netns.sh
index e4dc485..11fd7f6 100755
--- a/src/tests/netns.sh
+++ b/src/tests/netns.sh
@@ -590,9 +590,20 @@ ip0 link set wg0 up
kill $ncat_pid
ip0 link del wg0
+# Ensure there aren't circular reference loops
+ip1 link add wg1 type wireguard
+ip2 link add wg2 type wireguard
+ip1 link set wg1 netns $netns2
+ip2 link set wg2 netns $netns1
+pp ip netns delete $netns1
+pp ip netns delete $netns2
+pp ip netns add $netns1
+pp ip netns add $netns2
+
+sleep 2 # Wait for cleanup and grace periods
declare -A objects
while read -t 0.1 -r line 2>/dev/null || [[ $? -ne 142 ]]; do
- [[ $line =~ .*(wg[0-9]+:\ [A-Z][a-z]+\ [0-9]+)\ .*(created|destroyed).* ]] || continue
+ [[ $line =~ .*(wg[0-9]+:\ [A-Z][a-z]+\ ?[0-9]*)\ .*(created|destroyed).* ]] || continue
objects["${BASH_REMATCH[1]}"]+="${BASH_REMATCH[2]}"
done < /dev/kmsg
alldeleted=1