Fix small bugs and annoyances in tc-testing
Subsystems (4)
cover Fix small bugs and annoyances in tc-testing
Vlad Buslov (4):
selftests/tc-testing: Fix Error: Specified qdisc kind is unknown. selftests/tc-testing: Fix Error: failed to find target LOG selftests/tc-testing: Fix SFB db test selftests/tc-testing: Remove configs that no longer exist
tools/testing/selftests/tc-testing/config | 6 +----- tools/testing/selftests/tc-testing/tc-tests/qdiscs/sfb.json | 4 ++-- tools/testing/selftests/tc-testing/tdc.sh | 1 + 3 files changed, 4 insertions(+), 7 deletions(-)
Signature · 1 line
2.39.2
PATCH 1/4 selftests/tc-testing: Fix Error: Specified qdisc kind is unknown.
All TEQL tests assume that sch_teql module is loaded. Load module in tdc.sh before running qdisc tests.
Fixes following example error when running tests via tdc.sh for all TEQL tests:
# $ sudo ./tdc.py -d eth2 -e 84a0
# -- ns/SubPlugin.__init__
# Test 84a0: Create TEQL with default setting
# exit: 2
# exit: 0
# Error: Specified qdisc kind is unknown.
#
# -----> teardown stage *** Could not execute: "$TC qdisc del dev $DUMMY handle 1: root" #
# -----> teardown stage *** Error message: "Error: Invalid handle.
# "
# returncode 2; expected [0]
#
# -----> teardown stage *** Aborting test run.
#
# <_io.BufferedReader name=3> *** stdout ***
#
# <_io.BufferedReader name=5> *** stderr ***
# "-----> teardown stage" did not complete successfully
# Exception <class '__main__.PluginMgrTestFail'> ('teardown', 'Error: Specified qdisc kind is unknown.\n', '"-----> teardown stage" did not complete successfully') (caught in test_runner, running test 2 84a0 Create TEQL with default setting stage teardown)
# ---------------
# traceback
# File "/images/src/linux/tools/testing/selftests/tc-testing/./tdc.py", line 495, in test_runner
# res = run_one_test(pm, args, index, tidx)
# File "/images/src/linux/tools/testing/selftests/tc-testing/./tdc.py", line 434, in run_one_test
# prepare_env(args, pm, 'teardown', '-----> teardown stage', tidx['teardown'], procout)
# File "/images/src/linux/tools/testing/selftests/tc-testing/./tdc.py", line 245, in prepare_env
# raise PluginMgrTestFail(
# ---------------
# accumulated output for this test:
# Error: Specified qdisc kind is unknown.
#
# ---------------
#
# All test results:
#
# 1..1
# ok 1 84a0 - Create TEQL with default setting # skipped - "-----> teardown stage" did not complete successfully--- tools/testing/selftests/tc-testing/tdc.sh | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/tc-testing/tdc.sh +1 -0
@@ -2,5 +2,6 @@ # SPDX-License-Identifier: GPL-2.0 modprobe netdevsim +modprobe sch_teql ./tdc.py -c actions --nobuildebpf ./tdc.py -c qdisc
Signature · 1 line
2.39.2
Re: [PATCH net 1/4] selftests/tc-testing: Fix Error: Specified qdisc kind is unknown.
Quoted 56 lines · Vlad Buslov
All TEQL tests assume that
sch_teqlmodule is loaded. Load module intdc.shbefore running qdisc tests.Fixes following example error when running tests via
tdc.shfor all TEQL tests:# $ sudo ./tdc.py -d eth2 -e 84a0
# -- ns/SubPlugin.__init__
# Test 84a0: Create TEQL with default setting
# exit: 2
# exit: 0
# Error: Specified qdisc kind is unknown.
#
# -----> teardown stage *** Could not execute: "$TC qdisc del dev $DUMMY handle 1: root" #
# -----> teardown stage *** Error message: "Error: Invalid handle.
# "# returncode 2; expected [0] # # -----> teardown stage *** Aborting test run. # # <_io.BufferedReader name=3> *** stdout *** # # <_io.BufferedReader name=5> *** stderr *** # "-----> teardown stage" did not complete successfully # Exception <class '__main__.PluginMgrTestFail'> ('teardown', 'Error: Specified qdisc kind is unknown.\n', '"-----> teardown stage" did not complete successfully') (caught in test_runner, running test 2 84a0 Create TEQL with default setting stage teardown) # --------------- # traceback # File "/images/src/linux/tools/testing/selftests/tc-testing/./tdc.py", line 495, in test_runner # res = run_one_test(pm, args, index, tidx) # File "/images/src/linux/tools/testing/selftests/tc-testing/./tdc.py", line 434, in run_one_test # prepare_env(args, pm, 'teardown', '-----> teardown stage', tidx['teardown'], procout) # File "/images/src/linux/tools/testing/selftests/tc-testing/./tdc.py", line 245, in prepare_env # raise PluginMgrTestFail( # --------------- # accumulated output for this test: # Error: Specified qdisc kind is unknown. # # --------------- # # All test results: # # 1..1 # ok 1 84a0 - Create TEQL with default setting # skipped - "-----> teardown stage" did not complete successfullyFixes cc62fbe114c9 ("selftests/tc-testing: add selftests for teql qdisc")Signed-off-by Vlad Buslov <[email protected]>--- tools/testing/selftests/tc-testing/tdc.sh | 1 + 1 file changed, 1 insertion(+)tools/testing/selftests/tc-testing/tdc.sh +0
-0
tools/testing/selftests/tc-testing/tdc.sh line 5
Quoted 4 lines
tools/testing/selftests/tc-testing/tdc.sh +1
-0@@ -2,5 +2,6 @@ # SPDX-License-Identifier: GPL-2.0 modprobe netdevsim +modprobe sch_teql
I think not only the sch_teql module needs to be imported, but all test modules need to be imported before testing. Modifying the config file looks more appropriate.
Quoted 2 lines
tools/testing/selftests/tc-testing/tdc.sh +0
-0./tdc.py -c actions --nobuildebpf ./tdc.py -c qdisc
Re: [PATCH net 1/4] selftests/tc-testing: Fix Error: Specified qdisc kind is unknown.
Quoted 52 lines · shaozhengchao
Quoted 51 lines · Vlad Buslov
All TEQL tests assume that
sch_teqlmodule is loaded. Load module intdc.shbefore running qdisc tests.
Fixes following example error when running tests viatdc.shfor all TEQL tests:
# $ sudo ./tdc.py -d eth2 -e 84a0
# -- ns/SubPlugin.__init__
# Test 84a0: Create TEQL with default setting
# exit: 2
# exit: 0
# Error: Specified qdisc kind is unknown.
#
# -----> teardown stage *** Could not execute: "$TC qdisc del dev $DUMMY handle 1: root" #
# -----> teardown stage *** Error message: "Error: Invalid handle.
# "# returncode 2; expected [0] # # -----> teardown stage *** Aborting test run. # # <_io.BufferedReader name=3> *** stdout *** # # <_io.BufferedReader name=5> *** stderr *** # "-----> teardown stage" did not complete successfully # Exception <class '__main__.PluginMgrTestFail'> ('teardown', 'Error: Specified qdisc kind is unknown.\n', '"-----> teardown stage" did not complete successfully') (caught in test_runner, running test 2 84a0 Create TEQL with default setting stage teardown) # --------------- # traceback # File "/images/src/linux/tools/testing/selftests/tc-testing/./tdc.py", line 495, in test_runner # res = run_one_test(pm, args, index, tidx) # File "/images/src/linux/tools/testing/selftests/tc-testing/./tdc.py", line 434, in run_one_test # prepare_env(args, pm, 'teardown', '-----> teardown stage', tidx['teardown'], procout) # File "/images/src/linux/tools/testing/selftests/tc-testing/./tdc.py", line 245, in prepare_env # raise PluginMgrTestFail( # --------------- # accumulated output for this test: # Error: Specified qdisc kind is unknown. # # --------------- # # All test results: # # 1..1 # ok 1 84a0 - Create TEQL with default setting # skipped - "-----> teardown stage" did not complete successfully Fixes: cc62fbe114c9 ("selftests/tc-testing: add selftests for teql qdisc") Signed-off-by: Vlad Buslov <[email protected]> --- tools/testing/selftests/tc-testing/tdc.sh | 1 + 1 file changed, 1 insertion(+)tools/testing/selftests/tc-testing/tdc.sh +0
-1--- a/tools/testing/selftests/tc-testing/tdc.sh
Quoted 8 lines
tools/testing/selftests/tc-testing/tdc.sh line 4
Quoted 5 lines
+++
b/tools/testing/selftests/tc-testing/tdc.shtools/testing/selftests/tc-testing/tdc.sh +1
-0@@ -2,5 +2,6 @@ # SPDX-License-Identifier: GPL-2.0 modprobe netdevsim +modprobe sch_teqlI think not only the
sch_teqlmodule needs to be imported, but all test modules need to be imported before testing. Modifying the config file looks more appropriate.
All other modules are automatically loaded when first qdisc/action/classifier is instantiated via their respective APIs. The problem with two modules that are manually inserted here is that netdevsim-related tests expect /sys/bus/netdevsim/new_device to exist (which only exists if netdevsim module has been manually loaded) and specific command format "$TC qdisc add dev $DUMMY handle 1: root teql0" failing since 'telq0', again, only exists when sch_telq is loaded.
Overall, I added modprobe here not for theoretical correctness sake but because running tdc.sh on cold system causes error included in the commit message for me. I don't get any other errors related to necessary kernel modules not being loaded for any other kinds of tc tests.
Quoted 2 lines
Quoted 2 lines
tools/testing/selftests/tc-testing/tdc.sh +0
-0./tdc.py -c actions --nobuildebpf ./tdc.py -c qdisc
Re: [PATCH net 1/4] selftests/tc-testing: Fix Error: Specified qdisc kind is unknown.
Quoted 70 lines · Vlad Buslov
Quoted 52 lines · shaozhengchao
Quoted 51 lines · Vlad Buslov
All TEQL tests assume that
sch_teqlmodule is loaded. Load module intdc.shbefore running qdisc tests.
Fixes following example error when running tests viatdc.shfor all TEQL tests:# $ sudo ./tdc.py -d eth2 -e 84a0 # -- ns/SubPlugin.__init__ # Test 84a0: Create TEQL with default setting # exit: 2 # exit: 0 # Error: Specified qdisc kind is unknown. # # -----> teardown stage *** Could not execute: "$TC qdisc del dev $DUMMY handle 1: root" # # -----> teardown stage *** Error message: "Error: Invalid handle. # " # returncode 2; expected [0] # # -----> teardown stage *** Aborting test run. # # <_io.BufferedReader name=3> *** stdout *** # # <_io.BufferedReader name=5> *** stderr *** # "-----> teardown stage" did not complete successfully # Exception <class '__main__.PluginMgrTestFail'> ('teardown', 'Error: Specified qdisc kind is unknown.\n', '"-----> teardown stage" did not complete successfully') (caught in test_runner, running test 2 84a0 Create TEQL with default setting stage teardown) # --------------- # traceback # File "/images/src/linux/tools/testing/selftests/tc-testing/./tdc.py", line 495, in test_runner # res = run_one_test(pm, args, index, tidx) # File "/images/src/linux/tools/testing/selftests/tc-testing/./tdc.py", line 434, in run_one_test # prepare_env(args, pm, 'teardown', '-----> teardown stage', tidx['teardown'], procout) # File "/images/src/linux/tools/testing/selftests/tc-testing/./tdc.py", line 245, in prepare_env # raise PluginMgrTestFail( # --------------- # accumulated output for this test: # Error: Specified qdisc kind is unknown. # # --------------- # # All test results: # # 1..1 # ok 1 84a0 - Create TEQL with default setting # skipped - "-----> teardown stage" did not complete successfullyFixes cc62fbe114c9 ("selftests/tc-testing: add selftests for teql qdisc")Signed-off-by Vlad Buslov <[email protected]>--- tools/testing/selftests/tc-testing/tdc.sh | 1 + 1 file changed, 1 insertion(+)tools/testing/selftests/tc-testing/tdc.sh +0
-1--- a/tools/testing/selftests/tc-testing/tdc.shQuoted 8 lines
tools/testing/selftests/tc-testing/tdc.sh line 4
Quoted 5 lines
+++
b/tools/testing/selftests/tc-testing/tdc.shtools/testing/selftests/tc-testing/tdc.sh +1
-0@@ -2,5 +2,6 @@ # SPDX-License-Identifier: GPL-2.0 modprobe netdevsim +modprobe sch_teqlI think not only the
sch_teqlmodule needs to be imported, but all test modules need to be imported before testing. Modifying the config file looks more appropriate.All other modules are automatically loaded when first qdisc/action/classifier is instantiated via their respective APIs. The problem with two modules that are manually inserted here is that netdevsim-related tests expect
/sys/bus/netdevsim/new_deviceto exist (which only exists if netdevsim module has been manually loaded) and specific command format "$TC qdisc add dev $DUMMY handle 1: root teql0" failing since 'telq0', again, only exists whensch_telqis loaded.
Quoted 5 lines
Overall, I added modprobe here not for theoretical correctness sake but because running
tdc.shon cold system causes error included in the commit message for me. I don't get any other errors related to necessary kernel modules not being loaded for any other kinds of tc tests.
Fine, it looks good to me. Thank you.
Zhengchao Shao
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
tools/testing/selftests/tc-testing/tdc.sh +0
-0./tdc.py -c actions --nobuildebpf ./tdc.py -c qdisc
Re: [PATCH net 1/4] selftests/tc-testing: Fix Error: Specified qdisc kind is unknown.
In reply to Vlad BuslovQuoted 47 lines · Vlad Buslov
All TEQL tests assume that
sch_teqlmodule is loaded. Load module intdc.shbefore running qdisc tests.Fixes following example error when running tests via
tdc.shfor all TEQL tests:# $ sudo ./tdc.py -d eth2 -e 84a0
# -- ns/SubPlugin.__init__
# Test 84a0: Create TEQL with default setting
# exit: 2
# exit: 0
# Error: Specified qdisc kind is unknown.
#
# -----> teardown stage *** Could not execute: "$TC qdisc del dev $DUMMY handle 1: root" #
# -----> teardown stage *** Error message: "Error: Invalid handle.
# "# returncode 2; expected [0] # # -----> teardown stage *** Aborting test run. # # <_io.BufferedReader name=3> *** stdout *** # # <_io.BufferedReader name=5> *** stderr *** # "-----> teardown stage" did not complete successfully # Exception <class '__main__.PluginMgrTestFail'> ('teardown', 'Error: Specified qdisc kind is unknown.\n', '"-----> teardown stage" did not complete successfully') (caught in test_runner, running test 2 84a0 Create TEQL with default setting stage teardown) # --------------- # traceback # File "/images/src/linux/tools/testing/selftests/tc-testing/./tdc.py", line 495, in test_runner # res = run_one_test(pm, args, index, tidx) # File "/images/src/linux/tools/testing/selftests/tc-testing/./tdc.py", line 434, in run_one_test # prepare_env(args, pm, 'teardown', '-----> teardown stage', tidx['teardown'], procout) # File "/images/src/linux/tools/testing/selftests/tc-testing/./tdc.py", line 245, in prepare_env # raise PluginMgrTestFail( # --------------- # accumulated output for this test: # Error: Specified qdisc kind is unknown. # # --------------- # # All test results: # # 1..1 # ok 1 84a0 - Create TEQL with default setting # skipped - "-----> teardown stage" did not complete successfully
Quoted 2 lines
Fixes cc62fbe114c9 ("selftests/tc-testing: add selftests for teql qdisc")Signed-off-by Vlad Buslov <[email protected]>
PATCH 2/4 selftests/tc-testing: Fix Error: failed to find target LOG
In reply to Vlad BuslovAdd missing netfilter config dependency.
Fixes following example error when running tests via tdc.sh for all XT tests:
# $ sudo ./tdc.py -d eth2 -e 2029
# Test 2029: Add xt action with log-prefix
# exit: 255
# exit: 0
# failed to find target LOG
#
# bad action parsing
# parse_action: bad value (7:xt)!
# Illegal "action"
#
# -----> teardown stage *** Could not execute: "$TC actions flush action xt"
#
# -----> teardown stage *** Error message: "Error: Cannot flush unknown TC action.
# We have an error flushing
# "
# returncode 1; expected [0]
#
# -----> teardown stage *** Aborting test run.
#
# <_io.BufferedReader name=3> *** stdout ***
#
# <_io.BufferedReader name=5> *** stderr ***
# "-----> teardown stage" did not complete successfully
# Exception <class '__main__.PluginMgrTestFail'> ('teardown', ' failed to find target LOG\n\nbad action parsing\nparse_action: bad value (7:xt)!\nIllegal "action"\n', '"-----> teardown stage" did not complete successfully') (caught in test_runner, running test 2 2029 Add xt action with log-prefix stage teardown)
# ---------------
# traceback
# File "/images/src/linux/tools/testing/selftests/tc-testing/./tdc.py", line 495, in test_runner
# res = run_one_test(pm, args, index, tidx)
# File "/images/src/linux/tools/testing/selftests/tc-testing/./tdc.py", line 434, in run_one_test
# prepare_env(args, pm, 'teardown', '-----> teardown stage', tidx['teardown'], procout)
# File "/images/src/linux/tools/testing/selftests/tc-testing/./tdc.py", line 245, in prepare_env
# raise PluginMgrTestFail(
# ---------------
# accumulated output for this test:
# failed to find target LOG
#
# bad action parsing
# parse_action: bad value (7:xt)!
# Illegal "action"
#
# ---------------
#
# All test results:
#
# 1..1
# ok 1 2029 - Add xt action with log-prefix # skipped - "-----> teardown stage" did not complete successfully--- tools/testing/selftests/tc-testing/config | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/tc-testing/config +1 -0
@@ -6,6 +6,7 @@ CONFIG_NF_CONNTRACK_MARK=y CONFIG_NF_CONNTRACK_ZONES=y CONFIG_NF_CONNTRACK_LABELS=y CONFIG_NF_NAT=m +CONFIG_NETFILTER_XT_TARGET_LOG=m CONFIG_NET_SCHED=y
Signature · 1 line
2.39.2
PATCH 3/4 selftests/tc-testing: Fix SFB db test
In reply to Vlad BuslovSetting very small value of db like 10ms introduces rounding errors when converting to/from jiffies on some kernel configs. For example, on 250hz the actual value will be set to 12ms which causes the test to fail:
# $ sudo ./tdc.py -d eth2 -e 3410
# -- ns/SubPlugin.__init__
# Test 3410: Create SFB with db setting
#
# All test results:
#
# 1..1
# not ok 1 3410 - Create SFB with db setting # Could not match regex pattern. Verify command output: # qdisc sfb 1: root refcnt 2 rehash 600s db 12ms limit 1000p max 25p target 20p increment 0.000503548 decrement 4.57771e-05 penalty_rate 10pps penalty_burst 20p
Set the value to 100ms instead which currently seem to work on 100hz, 250hz, 300hz and 1000hz kernel configs.
--- tools/testing/selftests/tc-testing/tc-tests/qdiscs/sfb.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/tc-testing/tc-tests/qdiscs/sfb.json +2 -2
@@ -58,10 +58,10 @@ "setup": [ "$IP link add dev $DUMMY type dummy || /bin/true" ], - "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfb db 10", + "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfb db 100", "expExitCode": "0", "verifyCmd": "$TC qdisc show dev $DUMMY", - "matchPattern": "qdisc sfb 1: root refcnt [0-9]+ rehash 600s db 10ms", + "matchPattern": "qdisc sfb 1: root refcnt [0-9]+ rehash 600s db 100ms", "matchCount": "1", "teardown": [ "$TC qdisc del dev $DUMMY handle 1: root",
Signature · 1 line
2.39.2
PATCH 4/4 selftests/tc-testing: Remove configs that no longer exist
In reply to Vlad BuslovSome qdiscs and classifiers have recently been retired from kernel. However, tc-testing config is still cluttered with them which causes noise when using merge_config.sh script to update existing config for tc-testing compatibility. Remove the config settings for affected qdiscs and classifiers.
--- tools/testing/selftests/tc-testing/config | 5 ----- 1 file changed, 5 deletions(-)
tools/testing/selftests/tc-testing/config +0 -5
@@ -13,14 +13,11 @@ CONFIG_NET_SCHED=y # # Queueing/Scheduling # -CONFIG_NET_SCH_ATM=m CONFIG_NET_SCH_CAKE=m -CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_CBS=m CONFIG_NET_SCH_CHOKE=m CONFIG_NET_SCH_CODEL=m CONFIG_NET_SCH_DRR=m -CONFIG_NET_SCH_DSMARK=m CONFIG_NET_SCH_ETF=m CONFIG_NET_SCH_FQ=m CONFIG_NET_SCH_FQ_CODEL=m
@@ -58,8 +55,6 @@ CONFIG_NET_CLS_FLOW=m CONFIG_NET_CLS_FLOWER=m CONFIG_NET_CLS_MATCHALL=m CONFIG_NET_CLS_ROUTE4=m -CONFIG_NET_CLS_RSVP=m -CONFIG_NET_CLS_TCINDEX=m CONFIG_NET_EMATCH=y CONFIG_NET_EMATCH_STACK=32 CONFIG_NET_EMATCH_CMP=m
Signature · 1 line
2.39.2
Quoted 11 lines · Vlad Buslov
Vlad Buslov (4):
selftests/tc-testing: Fix Error: Specified qdisc kind is unknown. selftests/tc-testing: Fix Error: failed to find target LOG selftests/tc-testing: Fix SFB db test selftests/tc-testing: Remove configs that no longer existtools/testing/selftests/tc-testing/config | 6 +----- tools/testing/selftests/tc-testing/tc-tests/qdiscs/sfb.json | 4 ++-- tools/testing/selftests/tc-testing/tdc.sh | 1 + 3 files changed, 4 insertions(+), 7 deletions(-)
LGTM,
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Mon, 12 Jun 2023 09:57:08 +0200 you wrote:
Vlad Buslov (4):
selftests/tc-testing: Fix Error: Specified qdisc kind is unknown. selftests/tc-testing: Fix Error: failed to find target LOG selftests/tc-testing: Fix SFB db test selftests/tc-testing: Remove configs that no longer existtools/testing/selftests/tc-testing/config | 6 +----- tools/testing/selftests/tc-testing/tc-tests/qdiscs/sfb.json | 4 ++-- tools/testing/selftests/tc-testing/tdc.sh | 1 + 3 files changed, 4 insertions(+), 7 deletions(-)
Here is the summary with links:
- [net,1/4] selftests/tc-testing: Fix Error: Specified qdisc kind is unknown.
https://git.kernel.org/netdev/net/c/aef6e908b542 - [net,2/4] selftests/tc-testing: Fix Error: failed to find target LOG https://git.kernel.org/netdev/net/c/b849c566ee9c - [net,3/4] selftests/tc-testing: Fix SFB db test https://git.kernel.org/netdev/net/c/b39d8c41c7a8 - [net,4/4] selftests/tc-testing: Remove configs that no longer exist https://git.kernel.org/netdev/net/c/11b8b2e70a9b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html