selftests: forwarding: move shblock tc support check to a separate helper
authorJiri Pirko <jiri@mellanox.com>
Mon, 23 Jul 2018 07:24:05 +0000 (09:24 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Jul 2018 03:44:13 +0000 (20:44 -0700)
The shared block support is only needed for tc_shblock.sh. No need to
require that for other test.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/forwarding/lib.sh
tools/testing/selftests/net/forwarding/tc_shblocks.sh

index 2bb9cf3..ec94395 100644 (file)
@@ -33,7 +33,10 @@ check_tc_version()
                echo "SKIP: iproute2 too old; tc is missing JSON support"
                exit 1
        fi
+}
 
+check_tc_shblock_support()
+{
        tc filter help 2>&1 | grep block &> /dev/null
        if [[ $? -ne 0 ]]; then
                echo "SKIP: iproute2 too old; tc is missing shared block support"
index b5b9172..9826a44 100755 (executable)
@@ -105,6 +105,8 @@ cleanup()
        ip link set $swp2 address $swp2origmac
 }
 
+check_tc_shblock_support
+
 trap cleanup EXIT
 
 setup_prepare