Skip to content

Commit

Permalink
selftests: fib_rule_tests: Add port range match tests
Browse files Browse the repository at this point in the history
Currently, only matching on specific ports is tested. Add port range
testing to make sure this use case does not regress.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20250217134109.311176-8-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Ido Schimmel authored and Jakub Kicinski committed Feb 20, 2025
1 parent ab35ebf commit 94694aa
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tools/testing/selftests/net/fib_rule_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,14 @@ fib_rule6_test()
fib_rule6_test_match_n_redirect "$match" "$match" \
"$getnomatch" "sport and dport redirect to table" \
"sport and dport no redirect to table"

match="sport 100-200 dport 300-400"
getmatch="sport 100 dport 400"
getnomatch="sport 100 dport 401"
fib_rule6_test_match_n_redirect "$match" "$getmatch" \
"$getnomatch" \
"sport and dport range redirect to table" \
"sport and dport range no redirect to table"
fi

fib_check_iproute_support "ipproto" "ipproto"
Expand Down Expand Up @@ -525,6 +533,14 @@ fib_rule4_test()
fib_rule4_test_match_n_redirect "$match" "$match" \
"$getnomatch" "sport and dport redirect to table" \
"sport and dport no redirect to table"

match="sport 100-200 dport 300-400"
getmatch="sport 100 dport 400"
getnomatch="sport 100 dport 401"
fib_rule4_test_match_n_redirect "$match" "$getmatch" \
"$getnomatch" \
"sport and dport range redirect to table" \
"sport and dport range no redirect to table"
fi

fib_check_iproute_support "ipproto" "ipproto"
Expand Down

0 comments on commit 94694aa

Please sign in to comment.