Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/5] selftests: tc-testing: misc changes for tdc
@ 2024-01-24 18:19 Pedro Tammela
  2024-01-24 18:19 ` [PATCH net-next v2 1/5] selftests: tc-testing: add missing netfilter config Pedro Tammela
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Pedro Tammela @ 2024-01-24 18:19 UTC (permalink / raw)
  To: netdev
  Cc: jhs, xiyou.wangcong, jiri, shuah, kuba, vladimir.oltean, dcaratti,
	edumazet, pabeni, linux-kselftest, Pedro Tammela

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(-)

-- 
2.40.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH net-next v2 1/5] selftests: tc-testing: add missing netfilter config
  2024-01-24 18:19 [PATCH net-next v2 0/5] selftests: tc-testing: misc changes for tdc Pedro Tammela
@ 2024-01-24 18:19 ` Pedro Tammela
  2024-01-24 18:19 ` [PATCH net-next v2 2/5] selftests: tc-testing: check if 'jq' is available in taprio tests Pedro Tammela
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Pedro Tammela @ 2024-01-24 18:19 UTC (permalink / raw)
  To: netdev
  Cc: jhs, xiyou.wangcong, jiri, shuah, kuba, vladimir.oltean, dcaratti,
	edumazet, pabeni, linux-kselftest, Pedro Tammela

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
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH net-next v2 2/5] selftests: tc-testing: check if 'jq' is available in taprio tests
  2024-01-24 18:19 [PATCH net-next v2 0/5] selftests: tc-testing: misc changes for tdc Pedro Tammela
  2024-01-24 18:19 ` [PATCH net-next v2 1/5] selftests: tc-testing: add missing netfilter config Pedro Tammela
@ 2024-01-24 18:19 ` Pedro Tammela
  2024-01-24 18:19 ` [PATCH net-next v2 3/5] selftests: tc-testing: adjust fq test to latest iproute2 Pedro Tammela
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Pedro Tammela @ 2024-01-24 18:19 UTC (permalink / raw)
  To: netdev
  Cc: jhs, xiyou.wangcong, jiri, shuah, kuba, vladimir.oltean, dcaratti,
	edumazet, pabeni, linux-kselftest, Pedro Tammela

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",
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH net-next v2 3/5] selftests: tc-testing: adjust fq test to latest iproute2
  2024-01-24 18:19 [PATCH net-next v2 0/5] selftests: tc-testing: misc changes for tdc Pedro Tammela
  2024-01-24 18:19 ` [PATCH net-next v2 1/5] selftests: tc-testing: add missing netfilter config Pedro Tammela
  2024-01-24 18:19 ` [PATCH net-next v2 2/5] selftests: tc-testing: check if 'jq' is available in taprio tests Pedro Tammela
@ 2024-01-24 18:19 ` Pedro Tammela
  2024-01-24 18:19 ` [PATCH net-next v2 4/5] selftests: tc-testing: enable all tdc tests Pedro Tammela
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Pedro Tammela @ 2024-01-24 18:19 UTC (permalink / raw)
  To: netdev
  Cc: jhs, xiyou.wangcong, jiri, shuah, kuba, vladimir.oltean, dcaratti,
	edumazet, pabeni, linux-kselftest, Pedro Tammela

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"
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH net-next v2 4/5] selftests: tc-testing: enable all tdc tests
  2024-01-24 18:19 [PATCH net-next v2 0/5] selftests: tc-testing: misc changes for tdc Pedro Tammela
                   ` (2 preceding siblings ...)
  2024-01-24 18:19 ` [PATCH net-next v2 3/5] selftests: tc-testing: adjust fq test to latest iproute2 Pedro Tammela
@ 2024-01-24 18:19 ` Pedro Tammela
  2024-01-24 18:19 ` [PATCH net-next v2 5/5] selftests: tc-testing: return fail if a test fails in setup/teardown Pedro Tammela
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Pedro Tammela @ 2024-01-24 18:19 UTC (permalink / raw)
  To: netdev
  Cc: jhs, xiyou.wangcong, jiri, shuah, kuba, vladimir.oltean, dcaratti,
	edumazet, pabeni, linux-kselftest, Pedro Tammela

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`
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH net-next v2 5/5] selftests: tc-testing: return fail if a test fails in setup/teardown
  2024-01-24 18:19 [PATCH net-next v2 0/5] selftests: tc-testing: misc changes for tdc Pedro Tammela
                   ` (3 preceding siblings ...)
  2024-01-24 18:19 ` [PATCH net-next v2 4/5] selftests: tc-testing: enable all tdc tests Pedro Tammela
@ 2024-01-24 18:19 ` Pedro Tammela
  2024-01-24 23:14 ` [PATCH net-next v2 0/5] selftests: tc-testing: misc changes for tdc Jamal Hadi Salim
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Pedro Tammela @ 2024-01-24 18:19 UTC (permalink / raw)
  To: netdev
  Cc: jhs, xiyou.wangcong, jiri, shuah, kuba, vladimir.oltean, dcaratti,
	edumazet, pabeni, linux-kselftest, Pedro Tammela

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)
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next v2 0/5] selftests: tc-testing: misc changes for tdc
  2024-01-24 18:19 [PATCH net-next v2 0/5] selftests: tc-testing: misc changes for tdc Pedro Tammela
                   ` (4 preceding siblings ...)
  2024-01-24 18:19 ` [PATCH net-next v2 5/5] selftests: tc-testing: return fail if a test fails in setup/teardown Pedro Tammela
@ 2024-01-24 23:14 ` Jamal Hadi Salim
  2024-01-25  8:52 ` Davide Caratti
  2024-01-26  0:40 ` patchwork-bot+netdevbpf
  7 siblings, 0 replies; 9+ messages in thread
From: Jamal Hadi Salim @ 2024-01-24 23:14 UTC (permalink / raw)
  To: Pedro Tammela
  Cc: netdev, xiyou.wangcong, jiri, shuah, kuba, vladimir.oltean,
	dcaratti, edumazet, pabeni, linux-kselftest

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
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next v2 0/5] selftests: tc-testing: misc changes for tdc
  2024-01-24 18:19 [PATCH net-next v2 0/5] selftests: tc-testing: misc changes for tdc Pedro Tammela
                   ` (5 preceding siblings ...)
  2024-01-24 23:14 ` [PATCH net-next v2 0/5] selftests: tc-testing: misc changes for tdc Jamal Hadi Salim
@ 2024-01-25  8:52 ` Davide Caratti
  2024-01-26  0:40 ` patchwork-bot+netdevbpf
  7 siblings, 0 replies; 9+ messages in thread
From: Davide Caratti @ 2024-01-25  8:52 UTC (permalink / raw)
  To: Pedro Tammela
  Cc: netdev, jhs, xiyou.wangcong, jiri, shuah, kuba, vladimir.oltean,
	edumazet, pabeni, linux-kselftest

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!
-- 
davide


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next v2 0/5] selftests: tc-testing: misc changes for tdc
  2024-01-24 18:19 [PATCH net-next v2 0/5] selftests: tc-testing: misc changes for tdc Pedro Tammela
                   ` (6 preceding siblings ...)
  2024-01-25  8:52 ` Davide Caratti
@ 2024-01-26  0:40 ` patchwork-bot+netdevbpf
  7 siblings, 0 replies; 9+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-01-26  0:40 UTC (permalink / raw)
  To: Pedro Tammela
  Cc: netdev, jhs, xiyou.wangcong, jiri, shuah, kuba, vladimir.oltean,
	dcaratti, edumazet, pabeni, linux-kselftest

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-01-26  0:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-24 18:19 [PATCH net-next v2 0/5] selftests: tc-testing: misc changes for tdc Pedro Tammela
2024-01-24 18:19 ` [PATCH net-next v2 1/5] selftests: tc-testing: add missing netfilter config Pedro Tammela
2024-01-24 18:19 ` [PATCH net-next v2 2/5] selftests: tc-testing: check if 'jq' is available in taprio tests Pedro Tammela
2024-01-24 18:19 ` [PATCH net-next v2 3/5] selftests: tc-testing: adjust fq test to latest iproute2 Pedro Tammela
2024-01-24 18:19 ` [PATCH net-next v2 4/5] selftests: tc-testing: enable all tdc tests Pedro Tammela
2024-01-24 18:19 ` [PATCH net-next v2 5/5] selftests: tc-testing: return fail if a test fails in setup/teardown Pedro Tammela
2024-01-24 23:14 ` [PATCH net-next v2 0/5] selftests: tc-testing: misc changes for tdc Jamal Hadi Salim
2024-01-25  8:52 ` Davide Caratti
2024-01-26  0:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox