Skip to content

Commit

Permalink
selftests: fib_nexthops: Test large scale nexthop flushing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ido Schimmel authored and David S. Miller committed Apr 19, 2021
1 parent 9e46fb6 commit bf5eb67
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tools/testing/selftests/net/fib_nexthops.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit bf5eb67

Please sign in to comment.