]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: devlink_lib: Fix bouncing of netdevsim DEVLINK_DEV
authorPetr Machata <petrm@nvidia.com>
Tue, 8 Jun 2021 12:44:10 +0000 (15:44 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Jun 2021 21:39:07 +0000 (14:39 -0700)
commitab0c56e2fe897047da6dd4d20a2762641c6bf34e
tree617ff1d9bb07066ff734a9e443c77bf75738fec7
parent1ac373ffb3bc0f65e219fd8afbfd312047fb767e
selftests: devlink_lib: Fix bouncing of netdevsim DEVLINK_DEV

In the commit referenced below, a check was added to devlink_lib that
asserts the existence of a devlink device referenced by $DEVLINK_DEV.
Unfortunately, several netdevsim tests point DEVLINK_DEV at a device that
does not exist at the time that devlink_lib is sourced. Thus these tests
spuriously fail.

Fix this by introducing an override. By setting DEVLINK_DEV to an empty
string, the user declares their intention to handle DEVLINK_DEV management
on their own.

In all netdevsim tests that use devlink_lib and set DEVLINK_DEV, set
instead an empty DEVLINK_DEV just before sourcing devlink_lib, and set it
to the correct value right afterwards.

Fixes: 78eb58f2a435 ("selftests: devlink_lib: add check for devlink device existence")
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/drivers/net/netdevsim/devlink_trap.sh
tools/testing/selftests/drivers/net/netdevsim/fib.sh
tools/testing/selftests/drivers/net/netdevsim/nexthop.sh
tools/testing/selftests/drivers/net/netdevsim/psample.sh
tools/testing/selftests/net/forwarding/devlink_lib.sh