selftests: forwarding: Exit with error when missing interfaces
authorIdo Schimmel <idosch@mellanox.com>
Sun, 11 Mar 2018 07:57:24 +0000 (09:57 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Mar 2018 02:44:24 +0000 (22:44 -0400)
Returning 0 gives a false sense of success when the required modules did
not even manage to be initialized and register the required net devices.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/forwarding/lib.sh

index 6ac8a98..e989d8a 100644 (file)
@@ -55,7 +55,7 @@ fi
 
 if [[ ! -v NUM_NETIFS ]]; then
        echo "SKIP: importer does not define \"NUM_NETIFS\""
-       exit 0
+       exit 1
 fi
 
 ##############################################################################
@@ -115,7 +115,7 @@ for i in $(eval echo {1..$NUM_NETIFS}); do
        ip link show dev ${NETIFS[p$i]} &> /dev/null
        if [[ $? -ne 0 ]]; then
                echo "SKIP: could not find all required interfaces"
-               exit 0
+               exit 1
        fi
 done