selftests: devlink_lib: Check devlink info command is supported
authorShalom Toledo <shalomt@mellanox.com>
Thu, 27 Feb 2020 07:50:15 +0000 (08:50 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Feb 2020 19:10:15 +0000 (11:10 -0800)
Sanity check for devlink info command.

Signed-off-by: Shalom Toledo <shalomt@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/forwarding/devlink_lib.sh

index 24798ae846de7c4b64fa6f715d07c6ea5ac4ec34..07e360e2f275e8dd592e96788ce8c497f42e0333 100644 (file)
@@ -35,6 +35,12 @@ if [ $? -ne 0 ]; then
        exit 1
 fi
 
+devlink dev help 2>&1 | grep info &> /dev/null
+if [ $? -ne 0 ]; then
+       echo "SKIP: iproute2 too old, missing devlink dev info support"
+       exit 1
+fi
+
 ##############################################################################
 # Devlink helpers