Patches 1 and 3 are fixes for tdc that were discovered when running it using defconfig + tc-testing config and against the latest iproute2.
Patch 2 improves the taprio tests.
Patch 4 enables all tdc tests.
Patch 5 fixes the return code of tdc for when a test fails setup/teardown.
v1->v2: Suggestions by Davide
Pedro Tammela (5): selftests: tc-testing: add missing netfilter config selftests: tc-testing: check if 'jq' is available in taprio tests selftests: tc-testing: adjust fq test to latest iproute2 selftests: tc-testing: enable all tdc tests selftests: tc-testing: return fail if a test fails in setup/teardown
tools/testing/selftests/tc-testing/config | 1 + tools/testing/selftests/tc-testing/tc-tests/qdiscs/fq.json | 2 +- tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json | 2 ++ tools/testing/selftests/tc-testing/tdc.py | 2 +- tools/testing/selftests/tc-testing/tdc.sh | 3 +-- 5 files changed, 6 insertions(+), 4 deletions(-)
On a default config + tc-testing config build, tdc will miss all the netfilter related tests because it's missing: CONFIG_NETFILTER=y
Signed-off-by: Pedro Tammela pctammela@mojatatu.com --- tools/testing/selftests/tc-testing/config | 1 + 1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/tc-testing/config b/tools/testing/selftests/tc-testing/config index c60acba951c2..db176fe7d0c3 100644 --- a/tools/testing/selftests/tc-testing/config +++ b/tools/testing/selftests/tc-testing/config @@ -8,6 +8,7 @@ CONFIG_VETH=y # # Core Netfilter Configuration # +CONFIG_NETFILTER=y CONFIG_NETFILTER_ADVANCED=y CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_MARK=y
If 'jq' is not available the taprio tests might enter an infinite loop, use the "dependsOn" feature from tdc to check if jq is present. If it's not the test is skipped.
Suggested-by: Davide Caratti dcaratti@redhat.com Signed-off-by: Pedro Tammela pctammela@mojatatu.com --- tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json index 2d603ef2e375..12da0a939e3e 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json +++ b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json @@ -167,6 +167,7 @@ "plugins": { "requires": "nsPlugin" }, + "dependsOn": "echo '' | jq", "setup": [ "echo "1 1 8" > /sys/bus/netdevsim/new_device", "$TC qdisc replace dev $ETH handle 8001: parent root stab overhead 24 taprio num_tc 8 map 0 1 2 3 4 5 6 7 queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 base-time 0 sched-entry S ff 20000000 clockid CLOCK_TAI", @@ -192,6 +193,7 @@ "plugins": { "requires": "nsPlugin" }, + "dependsOn": "echo '' | jq", "setup": [ "echo "1 1 8" > /sys/bus/netdevsim/new_device", "$TC qdisc replace dev $ETH handle 8001: parent root stab overhead 24 taprio num_tc 8 map 0 1 2 3 4 5 6 7 queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 base-time 0 sched-entry S ff 20000000 flags 0x2",
Adjust the fq verify regex to the latest iproute2
Signed-off-by: Pedro Tammela pctammela@mojatatu.com --- tools/testing/selftests/tc-testing/tc-tests/qdiscs/fq.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/fq.json b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/fq.json index be293e7c6d18..3a537b2ec4c9 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/fq.json +++ b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/fq.json @@ -77,7 +77,7 @@ "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root fq quantum 9000", "expExitCode": "0", "verifyCmd": "$TC qdisc show dev $DUMMY", - "matchPattern": "qdisc fq 1: root refcnt [0-9]+ limit 10000p flow_limit 100p buckets.*orphan_mask 1023 quantum 9000b", + "matchPattern": "qdisc fq 1: root refcnt [0-9]+ limit 10000p flow_limit 100p.*quantum 9000b", "matchCount": "1", "teardown": [ "$TC qdisc del dev $DUMMY handle 1: root"
For the longest time tdc ran only actions and qdiscs tests. It's time to enable all the remaining tests so every user visible piece of TC is tested by the downstream CIs.
Signed-off-by: Pedro Tammela pctammela@mojatatu.com --- tools/testing/selftests/tc-testing/tdc.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/testing/selftests/tc-testing/tdc.sh b/tools/testing/selftests/tc-testing/tdc.sh index c53ede8b730d..cddff1772e10 100755 --- a/tools/testing/selftests/tc-testing/tdc.sh +++ b/tools/testing/selftests/tc-testing/tdc.sh @@ -63,5 +63,4 @@ try_modprobe sch_hfsc try_modprobe sch_hhf try_modprobe sch_htb try_modprobe sch_teql -./tdc.py -J`nproc` -c actions -./tdc.py -J`nproc` -c qdisc +./tdc.py -J`nproc`
As of today tests throwing exceptions in setup/teardown phase are treated as skipped but they should really be failures.
Signed-off-by: Pedro Tammela pctammela@mojatatu.com --- tools/testing/selftests/tc-testing/tdc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/tc-testing/tdc.py b/tools/testing/selftests/tc-testing/tdc.py index caeacc691587..ee349187636f 100755 --- a/tools/testing/selftests/tc-testing/tdc.py +++ b/tools/testing/selftests/tc-testing/tdc.py @@ -541,7 +541,7 @@ def test_runner(pm, args, filtered_tests): message = pmtf.message output = pmtf.output res = TestResult(tidx['id'], tidx['name']) - res.set_result(ResultState.skip) + res.set_result(ResultState.fail) res.set_errormsg(pmtf.message) res.set_failmsg(pmtf.output) tsr.add_resultdata(res)
On Wed, Jan 24, 2024 at 1:19 PM Pedro Tammela pctammela@mojatatu.com wrote:
Patches 1 and 3 are fixes for tdc that were discovered when running it using defconfig + tc-testing config and against the latest iproute2.
Patch 2 improves the taprio tests.
Patch 4 enables all tdc tests.
Patch 5 fixes the return code of tdc for when a test fails setup/teardown.
v1->v2: Suggestions by Davide
For the patchset Acked-by: Jamal Hadi Salim jhs@mojatatu.com
cheers, jamal
Pedro Tammela (5): selftests: tc-testing: add missing netfilter config selftests: tc-testing: check if 'jq' is available in taprio tests selftests: tc-testing: adjust fq test to latest iproute2 selftests: tc-testing: enable all tdc tests selftests: tc-testing: return fail if a test fails in setup/teardown
tools/testing/selftests/tc-testing/config | 1 + tools/testing/selftests/tc-testing/tc-tests/qdiscs/fq.json | 2 +- tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json | 2 ++ tools/testing/selftests/tc-testing/tdc.py | 2 +- tools/testing/selftests/tc-testing/tdc.sh | 3 +-- 5 files changed, 6 insertions(+), 4 deletions(-)
-- 2.40.1
On Wed, Jan 24, 2024 at 03:19:28PM -0300, Pedro Tammela wrote:
Patches 1 and 3 are fixes for tdc that were discovered when running it using defconfig + tc-testing config and against the latest iproute2.
Patch 2 improves the taprio tests.
Patch 4 enables all tdc tests.
Patch 5 fixes the return code of tdc for when a test fails setup/teardown.
v1->v2: Suggestions by Davide
for the series,
Reviewed-by: Davide Caratti dcaratti@redhat.com
thanks!
Hello:
This series was applied to netdev/net-next.git (main) by Jakub Kicinski kuba@kernel.org:
On Wed, 24 Jan 2024 15:19:28 -0300 you wrote:
Patches 1 and 3 are fixes for tdc that were discovered when running it using defconfig + tc-testing config and against the latest iproute2.
Patch 2 improves the taprio tests.
Patch 4 enables all tdc tests.
[...]
Here is the summary with links: - [net-next,v2,1/5] selftests: tc-testing: add missing netfilter config https://git.kernel.org/netdev/net-next/c/14a12e6c0b7f - [net-next,v2,2/5] selftests: tc-testing: check if 'jq' is available in taprio tests https://git.kernel.org/netdev/net-next/c/4f4d38412140 - [net-next,v2,3/5] selftests: tc-testing: adjust fq test to latest iproute2 https://git.kernel.org/netdev/net-next/c/3007d8712c9b - [net-next,v2,4/5] selftests: tc-testing: enable all tdc tests https://git.kernel.org/netdev/net-next/c/d17d0e333707 - [net-next,v2,5/5] selftests: tc-testing: return fail if a test fails in setup/teardown https://git.kernel.org/netdev/net-next/c/8981a85e1ba7
You are awesome, thank you!
linux-kselftest-mirror@lists.linaro.org