Commit 617198cb authored by Jiri Pirko's avatar Jiri Pirko Committed by Paolo Abeni

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: default avatarJiri Pirko <jiri@nvidia.com>
Reviewed-by: default avatarBenjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 41ad836e
...@@ -283,6 +283,18 @@ if [[ "$(id -u)" -ne 0 ]]; then ...@@ -283,6 +283,18 @@ if [[ "$(id -u)" -ne 0 ]]; then
exit $ksft_skip exit $ksft_skip
fi 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 if [[ "$CHECK_TC" = "yes" ]]; then
check_tc_version check_tc_version
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment