mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-30 13:52:50 +01:00
selftests: devlink_lib: add check for devlink device existence
If user passes devlink handle over DEVLINK_DEV variable, check if the device exists. Signed-off-by: Jiri Pirko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
This commit is contained in:
1 parent
b14b27fffa
commit
557c4d2f78
1 file changed
+6
@@ -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
|
||||
|
||||
##############################################################################
|
||||
|
||||
Reference in new issue
Block a user