projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b14b27f
)
selftests: devlink_lib: add check for devlink device existence
author
Jiri Pirko
<jiri@nvidia.com>
Thu, 27 May 2021 10:55:15 +0000
(12:55 +0200)
committer
Jakub Kicinski
<kuba@kernel.org>
Thu, 27 May 2021 21:49:07 +0000
(14:49 -0700)
If user passes devlink handle over DEVLINK_DEV variable, check if the
device exists.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Link:
https://lore.kernel.org/r/20210527105515.790330-1-jiri@resnulli.us
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/forwarding/devlink_lib.sh
patch
|
blob
|
history
diff --git
a/tools/testing/selftests/net/forwarding/devlink_lib.sh
b/tools/testing/selftests/net/forwarding/devlink_lib.sh
index 9c12c4fd3afc942699dc17f87ef0a6fd5a6ac9b9..c19e001f138ba21dd529305d7121e5baf915b758 100644
(file)
--- 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
##############################################################################