Commit 70f73562 authored by Xiang Mei's avatar Xiang Mei Committed by Paolo Abeni
Browse files

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: default avatarXiang Mei <xmei5@asu.edu>
Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: default avatarVictor Nogueira <victor@mojatatu.com>
Link: https://patch.msgid.link/20260331050217.504278-3-xmei5@asu.edu


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 1a280dd4
Loading
Loading
Loading
Loading
+44 −0
Original line number Diff line number Diff line
@@ -22,5 +22,49 @@
        "teardown": [
            "$TC qdisc del dev $DUMMY root handle 1: htb default 1"
        ]
    },
    {
        "id": "b7e3",
        "name": "Empty fw filter on shared block - rejected at config time",
        "category": [
            "filter",
            "fw"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "$TC qdisc add dev $DEV1 egress_block 1 clsact"
        ],
        "cmdUnderTest": "$TC filter add block 1 protocol ip prio 1 fw",
        "expExitCode": "2",
        "verifyCmd": "$TC filter show block 1",
        "matchPattern": "fw",
        "matchCount": "0",
        "teardown": [
            "$TC qdisc del dev $DEV1 clsact"
        ]
    },
    {
        "id": "c8f4",
        "name": "Flow filter on shared block without baseclass - rejected at config time",
        "category": [
            "filter",
            "flow"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "$TC qdisc add dev $DEV1 ingress_block 1 clsact"
        ],
        "cmdUnderTest": "$TC filter add block 1 protocol ip prio 1 handle 1 flow map key dst",
        "expExitCode": "2",
        "verifyCmd": "$TC filter show block 1",
        "matchPattern": "flow",
        "matchCount": "0",
        "teardown": [
            "$TC qdisc del dev $DEV1 clsact"
        ]
    }
]