diff options
author | Jiri Pirko <jiri@mellanox.com> | 2019-10-07 10:27:09 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-10-07 09:11:07 -0400 |
commit | 62ede55fe68c91c92ac7fdd65828c9413155faf6 (patch) | |
tree | 1efe2dc30240b8e5346bd24ae091c5e2c0944edf /tools/testing | |
parent | 8e23cc0319b185de49e35ed4fec174552bdf2f9a (diff) |
selftests: add netdevsim devlink dev info test
Add test to verify netdevsim driver name returned by devlink dev info.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing')
-rwxr-xr-x | tools/testing/selftests/drivers/net/netdevsim/devlink.sh | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tools/testing/selftests/drivers/net/netdevsim/devlink.sh b/tools/testing/selftests/drivers/net/netdevsim/devlink.sh index de3174431b8e..cb0f17e17abc 100755 --- a/tools/testing/selftests/drivers/net/netdevsim/devlink.sh +++ b/tools/testing/selftests/drivers/net/netdevsim/devlink.sh @@ -4,7 +4,7 @@ lib_dir=$(dirname $0)/../../../net/forwarding 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 source $lib_dir/lib.sh @@ -284,6 +284,25 @@ 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() { modprobe netdevsim |