Commit 62ede55f authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

selftests: add netdevsim devlink dev info test

Add test to verify netdevsim driver name returned by devlink dev info.
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8e23cc03
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
lib_dir=$(dirname $0)/../../../net/forwarding lib_dir=$(dirname $0)/../../../net/forwarding
ALL_TESTS="fw_flash_test params_test regions_test reload_test \ ALL_TESTS="fw_flash_test params_test regions_test reload_test \
netns_reload_test resource_test" netns_reload_test resource_test dev_info_test"
NUM_NETIFS=0 NUM_NETIFS=0
source $lib_dir/lib.sh source $lib_dir/lib.sh
...@@ -284,6 +284,25 @@ resource_test() ...@@ -284,6 +284,25 @@ resource_test()
log_test "resource test" log_test "resource test"
} }
info_get()
{
local name=$1
cmd_jq "devlink dev info $DL_HANDLE -j" ".[][][\"$name\"]" "-e"
}
dev_info_test()
{
RET=0
driver=$(info_get "driver")
check_err $? "Failed to get driver name"
[ "$driver" == "netdevsim" ]
check_err $? "Unexpected driver name $driver"
log_test "dev_info test"
}
setup_prepare() setup_prepare()
{ {
modprobe netdevsim modprobe netdevsim
......
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