summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/wireguard/netns.sh
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2020-07-03 14:05:59 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-07-03 14:05:59 +0300
commit9434628fcee63b1f3c6a6881b70e8f69a1f68e88 (patch)
tree255d093aeda6c125f0158e883eb2bf400bb7f737 /tools/testing/selftests/wireguard/netns.sh
parentc42ad5d4358230be166fc36c87bae0dd1680c570 (diff)
parentcdd3bb54332f82295ed90cd0c09c78cd0c0ee822 (diff)
downloadlinux-9434628fcee63b1f3c6a6881b70e8f69a1f68e88.tar.xz
Merge remote-tracking branch 'torvalds/master' into perf/urgent
To synchronize UAPI headers. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/testing/selftests/wireguard/netns.sh')
-rwxr-xr-xtools/testing/selftests/wireguard/netns.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/testing/selftests/wireguard/netns.sh b/tools/testing/selftests/wireguard/netns.sh
index 17a1f53ceba0..d77f4829f1e0 100755
--- a/tools/testing/selftests/wireguard/netns.sh
+++ b/tools/testing/selftests/wireguard/netns.sh
@@ -587,9 +587,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