Skip to content

Commit 70f7356

Browse files
n132Paolo Abeni
authored andcommitted
selftests/tc-testing: add tests for cls_fw and cls_flow on shared blocks
Regression tests for the shared-block NULL derefs fixed in the previous two patches: - fw: attempt to attach an empty fw filter to a shared block and verify the configuration is rejected with EINVAL. - flow: create a flow filter on a shared block without a baseclass and verify the configuration is rejected with EINVAL. Signed-off-by: Xiang Mei <xmei5@asu.edu> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Reviewed-by: Victor Nogueira <victor@mojatatu.com> Link: https://patch.msgid.link/20260331050217.504278-3-xmei5@asu.edu Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 1a280dd commit 70f7356

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

  • tools/testing/selftests/tc-testing/tc-tests/infra

tools/testing/selftests/tc-testing/tc-tests/infra/filter.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,49 @@
2222
"teardown": [
2323
"$TC qdisc del dev $DUMMY root handle 1: htb default 1"
2424
]
25+
},
26+
{
27+
"id": "b7e3",
28+
"name": "Empty fw filter on shared block - rejected at config time",
29+
"category": [
30+
"filter",
31+
"fw"
32+
],
33+
"plugins": {
34+
"requires": "nsPlugin"
35+
},
36+
"setup": [
37+
"$TC qdisc add dev $DEV1 egress_block 1 clsact"
38+
],
39+
"cmdUnderTest": "$TC filter add block 1 protocol ip prio 1 fw",
40+
"expExitCode": "2",
41+
"verifyCmd": "$TC filter show block 1",
42+
"matchPattern": "fw",
43+
"matchCount": "0",
44+
"teardown": [
45+
"$TC qdisc del dev $DEV1 clsact"
46+
]
47+
},
48+
{
49+
"id": "c8f4",
50+
"name": "Flow filter on shared block without baseclass - rejected at config time",
51+
"category": [
52+
"filter",
53+
"flow"
54+
],
55+
"plugins": {
56+
"requires": "nsPlugin"
57+
},
58+
"setup": [
59+
"$TC qdisc add dev $DEV1 ingress_block 1 clsact"
60+
],
61+
"cmdUnderTest": "$TC filter add block 1 protocol ip prio 1 handle 1 flow map key dst",
62+
"expExitCode": "2",
63+
"verifyCmd": "$TC filter show block 1",
64+
"matchPattern": "flow",
65+
"matchCount": "0",
66+
"teardown": [
67+
"$TC qdisc del dev $DEV1 clsact"
68+
]
2569
}
2670
]

0 commit comments

Comments
 (0)