Skip to content

Commit f9c8759

Browse files
idoschkuba-moo
authored andcommitted
selftests: fib_rule_tests: Add VRF match tests
Add tests for FIB rules that match on iif / oif being a VRF device. Test both good and bad flows. With previous patch ("net: fib_rules: Fix iif / oif matching on L3 master device"): # ./fib_rule_tests.sh [...] Tests passed: 328 Tests failed: 0 Without it: # ./fib_rule_tests.sh [...] Tests passed: 324 Tests failed: 4 Signed-off-by: Ido Schimmel <[email protected]> Acked-by: David Ahern <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 2d300ce commit f9c8759

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tools/testing/selftests/net/fib_rule_tests.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,23 @@ fib_rule6_test()
359359
"$getnomatch" "iif flowlabel masked redirect to table" \
360360
"iif flowlabel masked no redirect to table"
361361
fi
362+
363+
$IP link show dev $DEV | grep -q vrf0
364+
if [ $? -eq 0 ]; then
365+
match="oif vrf0"
366+
getmatch="oif $DEV"
367+
getnomatch="oif lo"
368+
fib_rule6_test_match_n_redirect "$match" "$getmatch" \
369+
"$getnomatch" "VRF oif redirect to table" \
370+
"VRF oif no redirect to table"
371+
372+
match="from $SRC_IP6 iif vrf0"
373+
getmatch="from $SRC_IP6 iif $DEV"
374+
getnomatch="from $SRC_IP6 iif lo"
375+
fib_rule6_test_match_n_redirect "$match" "$getmatch" \
376+
"$getnomatch" "VRF iif redirect to table" \
377+
"VRF iif no redirect to table"
378+
fi
362379
}
363380

364381
fib_rule6_vrf_test()
@@ -635,6 +652,23 @@ fib_rule4_test()
635652
"$getnomatch" "iif dscp masked redirect to table" \
636653
"iif dscp masked no redirect to table"
637654
fi
655+
656+
$IP link show dev $DEV | grep -q vrf0
657+
if [ $? -eq 0 ]; then
658+
match="oif vrf0"
659+
getmatch="oif $DEV"
660+
getnomatch="oif lo"
661+
fib_rule4_test_match_n_redirect "$match" "$getmatch" \
662+
"$getnomatch" "VRF oif redirect to table" \
663+
"VRF oif no redirect to table"
664+
665+
match="from $SRC_IP iif vrf0"
666+
getmatch="from $SRC_IP iif $DEV"
667+
getnomatch="from $SRC_IP iif lo"
668+
fib_rule4_test_match_n_redirect "$match" "$getmatch" \
669+
"$getnomatch" "VRF iif redirect to table" \
670+
"VRF iif no redirect to table"
671+
fi
638672
}
639673

640674
fib_rule4_vrf_test()

0 commit comments

Comments
 (0)