Add a matchall and a cgroup filter with "tc -echo" and check that the
echoed notification carries the filter handle. Both tests fail without
the previous two patches.
Signed-off-by: Dave Seddon <dave…@gmail.com>
---
.../tc-testing/tc-tests/filters/cgroup.json | 22 +++++++++++++++++++
.../tc-testing/tc-tests/filters/matchall.json | 22 +++++++++++++++++++
2 files changed, 44 insertions(+)
diff --git a/tools/testing/selftests/tc-testing/tc-tests/filters/cgroup.json b/tools/testing/selftests/tc-testing/tc-tests/filters/cgroup.json
index 35c9a7dbe1c4..9bbbb6b08e2d 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/filters/cgroup.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/filters/cgroup.json
@@ -1232,5 +1232,27 @@
"teardown": [
"$TC qdisc del dev $DEV1 ingress"
]
+ },
+ {
+ "id": "b9d4",
+ "name": "Add cgroup filter and check the echoed notification",
+ "category": [
+ "filter",
+ "cgroup"
+ ],
+ "plugins": {
+ "requires": "nsPlugin"
+ },
+ "setup": [
+ "$TC qdisc add dev $DUMMY ingress"
+ ],
+ "cmdUnderTest": "bash -c '$TC -echo filter add dev $DUMMY parent ffff: handle 0x7 prio 1 protocol ip cgroup action ok | grep \"cgroup.*handle 0x7\"'",
+ "expExitCode": "0",
+ "verifyCmd": "$TC filter show dev $DUMMY ingress",
+ "matchPattern": "cgroup.*handle 0x7",
+ "matchCount": "1",
+ "teardown": [
+ "$TC qdisc del dev $DUMMY ingress"
+ ]
}
]
diff --git a/tools/testing/selftests/tc-testing/tc-tests/filters/matchall.json b/tools/testing/selftests/tc-testing/tc-tests/filters/matchall.json
index 6b3eea401fc8..c4689cb62f3e 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/filters/matchall.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/filters/matchall.json
@@ -574,5 +574,27 @@
"teardown": [
"$TC qdisc del dev $DEV1 clsact"
]
+ },
+ {
+ "id": "e3c7",
+ "name": "Add ingress matchall filter and check the echoed notification",
+ "category": [
+ "filter",
+ "matchall"
+ ],
+ "plugins": {
+ "requires": "nsPlugin"
+ },
+ "setup": [
+ "$TC qdisc add dev $DUMMY ingress"
+ ],
+ "cmdUnderTest": "bash -c '$TC -echo filter add dev $DUMMY parent ffff: handle 0x7 prio 1 protocol ip matchall action ok | grep \"matchall.*handle 0x7\"'",
+ "expExitCode": "0",
+ "verifyCmd": "$TC filter show dev $DUMMY ingress",
+ "matchPattern": "matchall.*handle 0x7",
+ "matchCount": "1",
+ "teardown": [
+ "$TC qdisc del dev $DUMMY ingress"
+ ]
}
]
--
2.56.0