diff mbox series

[net-next,2/2] tc-testing/ingress: Add control-plane selftests for clsact egress mini-Qdisc option

Message ID 165f9fb53d04c62e11f87c98ee317fb9a5aaa277.1627936393.git.peilin.ye@bytedance.com
State New
Headers show
Series None | expand

Commit Message

Peilin Ye Aug. 2, 2021, 8:50 p.m. UTC
From: Peilin Ye <peilin.ye@bytedance.com>

Recently we added a new clsact egress mini-Qdisc option for sch_ingress.
Add a few control-plane tdc.py selftests for it.

Depends on kernel patch "net/sched: sch_ingress: Support clsact egress
mini-Qdisc option", as well as iproute2 patch "tc/ingress: Introduce
clsact egress mini-Qdisc option".

Reviewed-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Peilin Ye <peilin.ye@bytedance.com>
---
 .../tc-testing/tc-tests/qdiscs/ingress.json   | 84 +++++++++++++++++++
 1 file changed, 84 insertions(+)
diff mbox series

Patch

diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/ingress.json b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/ingress.json
index d99dba6e2b1a..2cde11b2ea9b 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/ingress.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/ingress.json
@@ -98,5 +98,89 @@ 
         "teardown": [
             "$IP link del dev $DUMMY type dummy"
         ]
+    },
+    {
+        "id": "8e8c",
+        "name": "Enable clsact egress mini-qdisc for ingress",
+        "category": [
+            "qdisc",
+            "ingress"
+        ],
+        "setup": [
+            "$IP link add dev $DUMMY type dummy || /bin/true",
+            "$TC qdisc add dev $DUMMY ingress"
+        ],
+        "cmdUnderTest": "$TC qdisc change dev $DUMMY ingress clsact-on",
+        "expExitCode": "0",
+        "verifyCmd": "$TC qdisc show dev $DUMMY",
+        "matchPattern": "qdisc ingress ffff:.*clsact",
+        "matchCount": "1",
+        "teardown": [
+            "$IP link del dev $DUMMY type dummy"
+        ]
+    },
+    {
+        "id": "3a76",
+        "name": "Disable clsact egress mini-qdisc for ingress",
+        "category": [
+            "qdisc",
+            "ingress"
+        ],
+        "setup": [
+            "$IP link add dev $DUMMY type dummy || /bin/true",
+            "$TC qdisc add dev $DUMMY ingress",
+            "$TC qdisc change dev $DUMMY ingress clsact-on"
+        ],
+        "cmdUnderTest": "$TC qdisc change dev $DUMMY ingress clsact-off",
+        "expExitCode": "0",
+        "verifyCmd": "$TC qdisc show dev $DUMMY",
+        "matchPattern": "qdisc ingress ffff:.*clsact",
+        "matchCount": "0",
+        "teardown": [
+            "$IP link del dev $DUMMY type dummy"
+        ]
+    },
+    {
+        "id": "7b2b",
+        "name": "Enable clsact egress mini-qdisc for ingress twice",
+        "category": [
+            "qdisc",
+            "ingress"
+        ],
+        "setup": [
+            "$IP link add dev $DUMMY type dummy || /bin/true",
+            "$TC qdisc add dev $DUMMY ingress",
+            "$TC qdisc change dev $DUMMY ingress clsact-on"
+        ],
+        "cmdUnderTest": "$TC qdisc change dev $DUMMY ingress clsact-on",
+        "expExitCode": "2",
+        "verifyCmd": "$TC qdisc show dev $DUMMY",
+        "matchPattern": "qdisc ingress ffff:.*clsact",
+        "matchCount": "1",
+        "teardown": [
+            "$IP link del dev $DUMMY type dummy"
+        ]
+    },
+    {
+        "id": "05ab",
+        "name": "Disable clsact egress mini-qdisc for ingress twice",
+        "category": [
+            "qdisc",
+            "ingress"
+        ],
+        "setup": [
+            "$IP link add dev $DUMMY type dummy || /bin/true",
+            "$TC qdisc add dev $DUMMY ingress",
+            "$TC qdisc change dev $DUMMY ingress clsact-on",
+            "$TC qdisc change dev $DUMMY ingress clsact-off"
+        ],
+        "cmdUnderTest": "$TC qdisc change dev $DUMMY ingress clsact-off",
+        "expExitCode": "2",
+        "verifyCmd": "$TC qdisc show dev $DUMMY",
+        "matchPattern": "qdisc ingress ffff:.*clsact",
+        "matchCount": "0",
+        "teardown": [
+            "$IP link del dev $DUMMY type dummy"
+        ]
     }
 ]