Skip to content

Commit 5fafbef

Browse files
vbnogueiraNipaLocal
authored andcommitted
selftests/tc-testing: Add test case redirecting to self on egress
Add single mirred test case that attempts to redirect to self on egress using clsact Signed-off-by: Victor Nogueira <victor@mojatatu.com> Signed-off-by: NipaLocal <nipa@local>
1 parent 79476f7 commit 5fafbef

File tree

1 file changed

+47
-0
lines changed
  • tools/testing/selftests/tc-testing/tc-tests/actions

1 file changed

+47
-0
lines changed

tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,5 +1098,52 @@
10981098
"teardown": [
10991099
"$TC qdisc del dev $DUMMY root"
11001100
]
1101+
},
1102+
{
1103+
"id": "4ed9",
1104+
"name": "Try to redirect to self on egress with clsact",
1105+
"category": [
1106+
"filter",
1107+
"mirred"
1108+
],
1109+
"plugins": {
1110+
"requires": [
1111+
"nsPlugin"
1112+
]
1113+
},
1114+
"setup": [
1115+
"$IP link set dev $DUMMY up || true",
1116+
"$IP addr add 10.10.10.10/24 dev $DUMMY || true",
1117+
"$TC qdisc add dev $DUMMY clsact",
1118+
"$TC filter add dev $DUMMY egress protocol ip prio 10 matchall action mirred egress redirect dev $DUMMY index 1"
1119+
],
1120+
"cmdUnderTest": "ping -c1 -W0.01 -I $DUMMY 10.10.10.1",
1121+
"expExitCode": "1",
1122+
"verifyCmd": "$TC -j -s actions get action mirred index 1",
1123+
"matchJSON": [
1124+
{
1125+
"total acts": 0
1126+
},
1127+
{
1128+
"actions": [
1129+
{
1130+
"order": 1,
1131+
"kind": "mirred",
1132+
"mirred_action": "redirect",
1133+
"direction": "egress",
1134+
"index": 1,
1135+
"stats": {
1136+
"packets": 1,
1137+
"overlimits": 1
1138+
},
1139+
"not_in_hw": true
1140+
}
1141+
]
1142+
}
1143+
],
1144+
"teardown": [
1145+
"$TC qdisc del dev $DUMMY clsact"
1146+
]
11011147
}
1148+
11021149
]

0 commit comments

Comments
 (0)