mirror of
https://github.com/raspberrypi/linux.git
synced 2026-01-03 08:14:12 +00:00
selftests: forwarding: add check_driver() helper
Add a helper to be used to check if the netdevice is backed by specified driver. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Benjamin Poirier <bpoirier@nvidia.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
@@ -283,6 +283,18 @@ if [[ "$(id -u)" -ne 0 ]]; then
|
||||
exit $ksft_skip
|
||||
fi
|
||||
|
||||
check_driver()
|
||||
{
|
||||
local dev=$1; shift
|
||||
local expected=$1; shift
|
||||
local driver_name=`driver_name_get $dev`
|
||||
|
||||
if [[ $driver_name != $expected ]]; then
|
||||
echo "SKIP: expected driver $expected for $dev, got $driver_name instead"
|
||||
exit $ksft_skip
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ "$CHECK_TC" = "yes" ]]; then
|
||||
check_tc_version
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user