Skip to content

Commit 94694aa

Browse files
idoschkuba-moo
authored andcommitted
selftests: fib_rule_tests: Add port range match tests
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 <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Guillaume Nault <[email protected]> Reviewed-by: David Ahern <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ab35ebf commit 94694aa

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tools/testing/selftests/net/fib_rule_tests.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,14 @@ fib_rule6_test()
256256
fib_rule6_test_match_n_redirect "$match" "$match" \
257257
"$getnomatch" "sport and dport redirect to table" \
258258
"sport and dport no redirect to table"
259+
260+
match="sport 100-200 dport 300-400"
261+
getmatch="sport 100 dport 400"
262+
getnomatch="sport 100 dport 401"
263+
fib_rule6_test_match_n_redirect "$match" "$getmatch" \
264+
"$getnomatch" \
265+
"sport and dport range redirect to table" \
266+
"sport and dport range no redirect to table"
259267
fi
260268

261269
fib_check_iproute_support "ipproto" "ipproto"
@@ -525,6 +533,14 @@ fib_rule4_test()
525533
fib_rule4_test_match_n_redirect "$match" "$match" \
526534
"$getnomatch" "sport and dport redirect to table" \
527535
"sport and dport no redirect to table"
536+
537+
match="sport 100-200 dport 300-400"
538+
getmatch="sport 100 dport 400"
539+
getnomatch="sport 100 dport 401"
540+
fib_rule4_test_match_n_redirect "$match" "$getmatch" \
541+
"$getnomatch" \
542+
"sport and dport range redirect to table" \
543+
"sport and dport range no redirect to table"
528544
fi
529545

530546
fib_check_iproute_support "ipproto" "ipproto"

0 commit comments

Comments
 (0)