* [patch net-next] selftests: devlink_lib: add check for devlink device existence
@ 2021-05-27 10:55 Jiri Pirko
2021-05-27 21:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Jiri Pirko @ 2021-05-27 10:55 UTC (permalink / raw)
To: netdev; +Cc: davem, kuba, mlxsw
From: Jiri Pirko <jiri@nvidia•com>
If user passes devlink handle over DEVLINK_DEV variable, check if the
device exists.
Signed-off-by: Jiri Pirko <jiri@nvidia•com>
---
tools/testing/selftests/net/forwarding/devlink_lib.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/testing/selftests/net/forwarding/devlink_lib.sh b/tools/testing/selftests/net/forwarding/devlink_lib.sh
index 9c12c4fd3afc..c19e001f138b 100644
--- a/tools/testing/selftests/net/forwarding/devlink_lib.sh
+++ b/tools/testing/selftests/net/forwarding/devlink_lib.sh
@@ -18,6 +18,12 @@ if [[ ! -v DEVLINK_DEV ]]; then
DEVLINK_VIDDID=$(lspci -s $(echo $DEVLINK_DEV | cut -d"/" -f2) \
-n | cut -d" " -f3)
+else
+ devlink dev show $DEVLINK_DEV &> /dev/null
+ if [ $? -ne 0 ]; then
+ echo "SKIP: devlink device \"$DEVLINK_DEV\" not found"
+ exit 1
+ fi
fi
##############################################################################
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch net-next] selftests: devlink_lib: add check for devlink device existence
2021-05-27 10:55 [patch net-next] selftests: devlink_lib: add check for devlink device existence Jiri Pirko
@ 2021-05-27 21:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-27 21:50 UTC (permalink / raw)
To: Jiri Pirko; +Cc: netdev, davem, kuba, mlxsw
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Thu, 27 May 2021 12:55:15 +0200 you wrote:
> From: Jiri Pirko <jiri@nvidia•com>
>
> If user passes devlink handle over DEVLINK_DEV variable, check if the
> device exists.
>
> Signed-off-by: Jiri Pirko <jiri@nvidia•com>
>
> [...]
Here is the summary with links:
- [net-next] selftests: devlink_lib: add check for devlink device existence
https://git.kernel.org/netdev/net-next/c/557c4d2f780c
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] 2+ messages in thread
end of thread, other threads:[~2021-05-27 21:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-27 10:55 [patch net-next] selftests: devlink_lib: add check for devlink device existence Jiri Pirko
2021-05-27 21:50 ` 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