mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 20:51:44 +00:00
selftests: forwarding: devlink_lib: Support port-less topologies
Some selftests may not need any actual ports. Technically those are not forwarding selftests, but devlink_lib can still be handy. Fall back on NETIF_NO_CABLE in those cases. Signed-off-by: Petr Machata <petrm@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
294f44c19f
commit
5b3a53c9c8
@ -5,7 +5,7 @@
|
||||
# Defines
|
||||
|
||||
if [[ ! -v DEVLINK_DEV ]]; then
|
||||
DEVLINK_DEV=$(devlink port show "${NETIFS[p1]}" -j \
|
||||
DEVLINK_DEV=$(devlink port show "${NETIFS[p1]:-$NETIF_NO_CABLE}" -j \
|
||||
| jq -r '.port | keys[]' | cut -d/ -f-2)
|
||||
if [ -z "$DEVLINK_DEV" ]; then
|
||||
echo "SKIP: ${NETIFS[p1]} has no devlink device registered for it"
|
||||
|
Loading…
Reference in New Issue
Block a user