Skip to content

Commit 4240dbd

Browse files
Shalom Toledodavem330
authored andcommitted
selftests: mlxsw: Add mlxsw lib
Add mlxsw lib for common defines, helpers etc. Signed-off-by: Shalom Toledo <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9fb7473 commit 4240dbd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: GPL-2.0
3+
4+
##############################################################################
5+
# Defines
6+
7+
if [[ ! -v MLXSW_CHIP ]]; then
8+
MLXSW_CHIP=$(devlink -j dev info $DEVLINK_DEV | jq -r '.[][]["driver"]')
9+
if [ -z "$MLXSW_CHIP" ]; then
10+
echo "SKIP: Device $DEVLINK_DEV doesn't support devlink info command"
11+
exit 1
12+
fi
13+
fi

0 commit comments

Comments
 (0)