Skip to content

Commit 5760711

Browse files
idoschPaolo Abeni
authored andcommitted
selftests: fib_rule_tests: Add flow label selector match tests
Add tests for the new FIB rule flow label selector. Test both good and bad flows and with both input and output routes. # ./fib_rule_tests.sh IPv6 FIB rule tests [...] TEST: rule6 check: flowlabel redirect to table [ OK ] TEST: rule6 check: flowlabel no redirect to table [ OK ] TEST: rule6 del by pref: flowlabel redirect to table [ OK ] TEST: rule6 check: iif flowlabel redirect to table [ OK ] TEST: rule6 check: iif flowlabel no redirect to table [ OK ] TEST: rule6 del by pref: iif flowlabel redirect to table [ OK ] TEST: rule6 check: flowlabel masked redirect to table [ OK ] TEST: rule6 check: flowlabel masked no redirect to table [ OK ] TEST: rule6 del by pref: flowlabel masked redirect to table [ OK ] TEST: rule6 check: iif flowlabel masked redirect to table [ OK ] TEST: rule6 check: iif flowlabel masked no redirect to table [ OK ] TEST: rule6 del by pref: iif flowlabel masked redirect to table [ OK ] [...] Tests passed: 268 Tests failed: 0 Reviewed-by: Petr Machata <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Guillaume Nault <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 002bf68 commit 5760711

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tools/testing/selftests/net/fib_rule_tests.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,37 @@ fib_rule6_test()
291291
"$getnomatch" "iif dscp redirect to table" \
292292
"iif dscp no redirect to table"
293293
fi
294+
295+
fib_check_iproute_support "flowlabel" "flowlabel"
296+
if [ $? -eq 0 ]; then
297+
match="flowlabel 0xfffff"
298+
getmatch="flowlabel 0xfffff"
299+
getnomatch="flowlabel 0xf"
300+
fib_rule6_test_match_n_redirect "$match" "$getmatch" \
301+
"$getnomatch" "flowlabel redirect to table" \
302+
"flowlabel no redirect to table"
303+
304+
match="flowlabel 0xfffff"
305+
getmatch="from $SRC_IP6 iif $DEV flowlabel 0xfffff"
306+
getnomatch="from $SRC_IP6 iif $DEV flowlabel 0xf"
307+
fib_rule6_test_match_n_redirect "$match" "$getmatch" \
308+
"$getnomatch" "iif flowlabel redirect to table" \
309+
"iif flowlabel no redirect to table"
310+
311+
match="flowlabel 0x08000/0x08000"
312+
getmatch="flowlabel 0xfffff"
313+
getnomatch="flowlabel 0xf7fff"
314+
fib_rule6_test_match_n_redirect "$match" "$getmatch" \
315+
"$getnomatch" "flowlabel masked redirect to table" \
316+
"flowlabel masked no redirect to table"
317+
318+
match="flowlabel 0x08000/0x08000"
319+
getmatch="from $SRC_IP6 iif $DEV flowlabel 0xfffff"
320+
getnomatch="from $SRC_IP6 iif $DEV flowlabel 0xf7fff"
321+
fib_rule6_test_match_n_redirect "$match" "$getmatch" \
322+
"$getnomatch" "iif flowlabel masked redirect to table" \
323+
"iif flowlabel masked no redirect to table"
324+
fi
294325
}
295326

296327
fib_rule6_vrf_test()

0 commit comments

Comments
 (0)