summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@nvidia.com>2021-04-16 18:55:35 +0300
committerDavid S. Miller <davem@davemloft.net>2021-04-19 15:20:34 -0700
commitbf5eb67dc80a75e0756269084b087c06f0360b78 (patch)
tree88e81aa6a5ae89f4deb0f71177ca939fbcc3b052 /tools
parent9e46fb656fdb40baec33a8942743d81a40f30fd3 (diff)
downloadlinux-bf5eb67dc80a75e0756269084b087c06f0360b78.tar.bz2
selftests: fib_nexthops: Test large scale nexthop flushing
Test that all the nexthops are flushed when a multi-part nexthop dump is required for the flushing. Without previous patch: # ./fib_nexthops.sh TEST: Large scale nexthop flushing [FAIL] With previous patch: # ./fib_nexthops.sh TEST: Large scale nexthop flushing [ OK ] Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Petr Machata <petrm@nvidia.com> Reviewed-by: David Ahern <dsahern@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/net/fib_nexthops.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/fib_nexthops.sh b/tools/testing/selftests/net/fib_nexthops.sh
index 56dd0c6f2e96..49774a8a7736 100755
--- a/tools/testing/selftests/net/fib_nexthops.sh
+++ b/tools/testing/selftests/net/fib_nexthops.sh
@@ -1933,6 +1933,21 @@ basic()
log_test $? 2 "Nexthop group and blackhole"
$IP nexthop flush >/dev/null 2>&1
+
+ # Test to ensure that flushing with a multi-part nexthop dump works as
+ # expected.
+ local batch_file=$(mktemp)
+
+ for i in $(seq 1 $((64 * 1024))); do
+ echo "nexthop add id $i blackhole" >> $batch_file
+ done
+
+ $IP -b $batch_file
+ $IP nexthop flush >/dev/null 2>&1
+ [[ $($IP nexthop | wc -l) -eq 0 ]]
+ log_test $? 0 "Large scale nexthop flushing"
+
+ rm $batch_file
}
check_nexthop_buckets_balance()