Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH net-next,v2] selftests/tc-testing: replace mq with invalid parent ID
@ 2023-06-01  1:22 Zhengchao Shao
  2023-06-01 12:35 ` Pedro Tammela
  2023-06-02  5:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Zhengchao Shao @ 2023-06-01  1:22 UTC (permalink / raw)
  To: netdev, linux-kselftest, jhs, xiyou.wangcong, jiri, shuah
  Cc: kuba, victor, peilin.ye, weiyongjun1, yuehaibing, shaozhengchao,
	pctammela

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>
---
 .../tc-testing/tc-tests/qdiscs/mq.json        | 25 ++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/mq.json b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/mq.json
index 44fbfc6caec7..e3d2de5c184f 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/mq.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/mq.json
@@ -155,5 +155,28 @@
             "teardown": [
                 "echo \"1\" > /sys/bus/netdevsim/del_device"
             ]
-        }
+	},
+	{
+		"id": "0531",
+		"name": "Replace mq with invalid parent ID",
+		"category": [
+			"qdisc",
+			"mq"
+		],
+		"plugins": {
+			"requires": "nsPlugin"
+		},
+		"setup": [
+			"echo \"1 1 16\" > /sys/bus/netdevsim/new_device",
+			"$TC qdisc add dev $ETH root handle ffff: mq"
+		],
+		"cmdUnderTest": "$TC qdisc replace dev $ETH parent ffff:fff1 handle ffff: mq",
+		"expExitCode": "2",
+		"verifyCmd": "$TC qdisc show dev $ETH",
+		"matchPattern": "qdisc [a-zA-Z0-9_]+ 0: parent ffff",
+		"matchCount": "16",
+		"teardown": [
+			"echo \"1\" > /sys/bus/netdevsim/del_device"
+		]
+	}
 ]
-- 
2.34.1


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

* Re: [PATCH net-next,v2] selftests/tc-testing: replace mq with invalid parent ID
  2023-06-01  1:22 [PATCH net-next,v2] selftests/tc-testing: replace mq with invalid parent ID Zhengchao Shao
@ 2023-06-01 12:35 ` Pedro Tammela
  2023-06-02  5:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Pedro Tammela @ 2023-06-01 12:35 UTC (permalink / raw)
  To: Zhengchao Shao, netdev, linux-kselftest, jhs, xiyou.wangcong,
	jiri, shuah
  Cc: kuba, victor, peilin.ye, weiyongjun1, yuehaibing

On 31/05/2023 22:22, Zhengchao Shao wrote:
> 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>

LGTM,

Reviewed-by: Pedro Tammela <pctammela@mojatatu.com>

> ---
>   .../tc-testing/tc-tests/qdiscs/mq.json        | 25 ++++++++++++++++++-
>   1 file changed, 24 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/mq.json b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/mq.json
> index 44fbfc6caec7..e3d2de5c184f 100644
> --- a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/mq.json
> +++ b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/mq.json
> @@ -155,5 +155,28 @@
>               "teardown": [
>                   "echo \"1\" > /sys/bus/netdevsim/del_device"
>               ]
> -        }
> +	},
> +	{
> +		"id": "0531",
> +		"name": "Replace mq with invalid parent ID",
> +		"category": [
> +			"qdisc",
> +			"mq"
> +		],
> +		"plugins": {
> +			"requires": "nsPlugin"
> +		},
> +		"setup": [
> +			"echo \"1 1 16\" > /sys/bus/netdevsim/new_device",
> +			"$TC qdisc add dev $ETH root handle ffff: mq"
> +		],
> +		"cmdUnderTest": "$TC qdisc replace dev $ETH parent ffff:fff1 handle ffff: mq",
> +		"expExitCode": "2",
> +		"verifyCmd": "$TC qdisc show dev $ETH",
> +		"matchPattern": "qdisc [a-zA-Z0-9_]+ 0: parent ffff",
> +		"matchCount": "16",
> +		"teardown": [
> +			"echo \"1\" > /sys/bus/netdevsim/del_device"
> +		]
> +	}
>   ]


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

* Re: [PATCH net-next,v2] selftests/tc-testing: replace mq with invalid parent ID
  2023-06-01  1:22 [PATCH net-next,v2] selftests/tc-testing: replace mq with invalid parent ID Zhengchao Shao
  2023-06-01 12:35 ` Pedro Tammela
@ 2023-06-02  5:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-06-02  5:00 UTC (permalink / raw)
  To: Zhengchao Shao
  Cc: netdev, linux-kselftest, jhs, xiyou.wangcong, jiri, shuah, kuba,
	victor, peilin.ye, weiyongjun1, yuehaibing, pctammela

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 1 Jun 2023 09:22:50 +0800 you wrote:
> 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
> 
> [...]

Here is the summary with links:
  - [net-next,v2] selftests/tc-testing: replace mq with invalid parent ID
    https://git.kernel.org/netdev/net-next/c/a395b8d1c7c3

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] 3+ messages in thread

end of thread, other threads:[~2023-06-02  5:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-01  1:22 [PATCH net-next,v2] selftests/tc-testing: replace mq with invalid parent ID Zhengchao Shao
2023-06-01 12:35 ` Pedro Tammela
2023-06-02  5:00 ` 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