* [PATCH net-next] net: netconsole: selftests: Check if netdevsim is available
@ 2024-11-08 14:59 Breno Leitao
2024-11-11 16:01 ` Simon Horman
2024-11-12 3:40 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Breno Leitao @ 2024-11-08 14:59 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Shuah Khan
Cc: netdev, linux-kselftest, linux-kernel, Breno Leitao
The netconsole selftest relies on the availability of the netdevsim module.
To ensure the test can run correctly, we need to check if the netdevsim
module is either loaded or built-in before proceeding.
Update the netconsole selftest to check for the existence of
the /sys/bus/netdevsim/new_device file before running the test. If the
file is not found, the test is skipped with an explanation that the
CONFIG_NETDEVSIM kernel config option may not be enabled.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
tools/testing/selftests/drivers/net/netcons_basic.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/drivers/net/netcons_basic.sh b/tools/testing/selftests/drivers/net/netcons_basic.sh
index 182eb1a97e59f3b4c9eea0e5b9e64a7fff656e2b..b175f4d966e5056ddb62e335f212c03e55f50fb0 100755
--- a/tools/testing/selftests/drivers/net/netcons_basic.sh
+++ b/tools/testing/selftests/drivers/net/netcons_basic.sh
@@ -39,6 +39,7 @@ NAMESPACE=""
# IDs for netdevsim
NSIM_DEV_1_ID=$((256 + RANDOM % 256))
NSIM_DEV_2_ID=$((512 + RANDOM % 256))
+NSIM_DEV_SYS_NEW="/sys/bus/netdevsim/new_device"
# Used to create and delete namespaces
source "${SCRIPTDIR}"/../../net/lib.sh
@@ -46,7 +47,6 @@ source "${SCRIPTDIR}"/../../net/net_helper.sh
# Create netdevsim interfaces
create_ifaces() {
- local NSIM_DEV_SYS_NEW=/sys/bus/netdevsim/new_device
echo "$NSIM_DEV_2_ID" > "$NSIM_DEV_SYS_NEW"
echo "$NSIM_DEV_1_ID" > "$NSIM_DEV_SYS_NEW"
@@ -212,6 +212,11 @@ function check_for_dependencies() {
exit "${ksft_skip}"
fi
+ if [ ! -f "${NSIM_DEV_SYS_NEW}" ]; then
+ echo "SKIP: file ${NSIM_DEV_SYS_NEW} does not exist. Check if CONFIG_NETDEVSIM is enabled" >&2
+ exit "${ksft_skip}"
+ fi
+
if [ ! -d "${NETCONS_CONFIGFS}" ]; then
echo "SKIP: directory ${NETCONS_CONFIGFS} does not exist. Check if NETCONSOLE_DYNAMIC is enabled" >&2
exit "${ksft_skip}"
---
base-commit: 4861333b42178fa3d8fd1bb4e2cfb2fedc968dba
change-id: 20241108-netcon_selftest_deps-83f26456f095
Best regards,
--
Breno Leitao <leitao@debian.org>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: netconsole: selftests: Check if netdevsim is available
2024-11-08 14:59 [PATCH net-next] net: netconsole: selftests: Check if netdevsim is available Breno Leitao
@ 2024-11-11 16:01 ` Simon Horman
2024-11-12 3:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2024-11-11 16:01 UTC (permalink / raw)
To: Breno Leitao
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Shuah Khan, netdev, linux-kselftest, linux-kernel
On Fri, Nov 08, 2024 at 06:59:25AM -0800, Breno Leitao wrote:
> The netconsole selftest relies on the availability of the netdevsim module.
> To ensure the test can run correctly, we need to check if the netdevsim
> module is either loaded or built-in before proceeding.
>
> Update the netconsole selftest to check for the existence of
> the /sys/bus/netdevsim/new_device file before running the test. If the
> file is not found, the test is skipped with an explanation that the
> CONFIG_NETDEVSIM kernel config option may not be enabled.
>
> Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: netconsole: selftests: Check if netdevsim is available
2024-11-08 14:59 [PATCH net-next] net: netconsole: selftests: Check if netdevsim is available Breno Leitao
2024-11-11 16:01 ` Simon Horman
@ 2024-11-12 3:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-11-12 3:40 UTC (permalink / raw)
To: Breno Leitao
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, shuah, netdev,
linux-kselftest, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 08 Nov 2024 06:59:25 -0800 you wrote:
> The netconsole selftest relies on the availability of the netdevsim module.
> To ensure the test can run correctly, we need to check if the netdevsim
> module is either loaded or built-in before proceeding.
>
> Update the netconsole selftest to check for the existence of
> the /sys/bus/netdevsim/new_device file before running the test. If the
> file is not found, the test is skipped with an explanation that the
> CONFIG_NETDEVSIM kernel config option may not be enabled.
>
> [...]
Here is the summary with links:
- [net-next] net: netconsole: selftests: Check if netdevsim is available
https://git.kernel.org/netdev/net-next/c/43271bb5bf67
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:[~2024-11-12 3:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-08 14:59 [PATCH net-next] net: netconsole: selftests: Check if netdevsim is available Breno Leitao
2024-11-11 16:01 ` Simon Horman
2024-11-12 3: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;
as well as URLs for NNTP newsgroup(s).