Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/tc-testing: replace mq with invalid parent ID

The test case shown in [1] triggers the kernel to access the null pointer.
Therefore, add related test cases to mq.
The test results are as follows:

./tdc.py -e 0531
1..1
ok 1 0531 - Replace mq with invalid parent ID

./tdc.py -c mq
1..8
ok 1 ce7d - Add mq Qdisc to multi-queue device (4 queues)
ok 2 2f82 - Add mq Qdisc to multi-queue device (256 queues)
ok 3 c525 - Add duplicate mq Qdisc
ok 4 128a - Delete nonexistent mq Qdisc
ok 5 03a9 - Delete mq Qdisc twice
ok 6 be0f - Add mq Qdisc to single-queue device
ok 7 1023 - Show mq class
ok 8 0531 - Replace mq with invalid parent ID

[1] https://lore.kernel.org/all/20230527093747.3583502-1-shaozhengchao@huawei.com/
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Reviewed-by: Pedro Tammela <pctammela@mojatatu.com>
Link: https://lore.kernel.org/r/20230601012250.52738-1-shaozhengchao@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Zhengchao Shao and committed by
Jakub Kicinski
a395b8d1 e8b6f79b

+24 -1
+24 -1
tools/testing/selftests/tc-testing/tc-tests/qdiscs/mq.json
··· 155 155 "teardown": [ 156 156 "echo \"1\" > /sys/bus/netdevsim/del_device" 157 157 ] 158 - } 158 + }, 159 + { 160 + "id": "0531", 161 + "name": "Replace mq with invalid parent ID", 162 + "category": [ 163 + "qdisc", 164 + "mq" 165 + ], 166 + "plugins": { 167 + "requires": "nsPlugin" 168 + }, 169 + "setup": [ 170 + "echo \"1 1 16\" > /sys/bus/netdevsim/new_device", 171 + "$TC qdisc add dev $ETH root handle ffff: mq" 172 + ], 173 + "cmdUnderTest": "$TC qdisc replace dev $ETH parent ffff:fff1 handle ffff: mq", 174 + "expExitCode": "2", 175 + "verifyCmd": "$TC qdisc show dev $ETH", 176 + "matchPattern": "qdisc [a-zA-Z0-9_]+ 0: parent ffff", 177 + "matchCount": "16", 178 + "teardown": [ 179 + "echo \"1\" > /sys/bus/netdevsim/del_device" 180 + ] 181 + } 159 182 ]