diff options
author | Danielle Ratson <danieller@mellanox.com> | 2020-02-27 08:50:12 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-02-27 11:10:14 -0800 |
commit | 05ef614c559ee8a496d590f0f468f9f883a06ca9 (patch) | |
tree | bf1bf1ec7f8ebf6674afa9b7975c33f3f9a16134 /tools/testing/selftests/net | |
parent | 0c22f993c91a7c215466b9aa833d25df05367dee (diff) |
selftests: mlxsw: Use busywait helper in vxlan test
Vxlan test uses offload indication checks.
Use a busywait helper and wait until the offload indication is set or
fail if it reaches timeout.
Signed-off-by: Danielle Ratson <danieller@mellanox.com>
Reviewed-by: Petr Machata <petrm@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>
Diffstat (limited to 'tools/testing/selftests/net')
-rw-r--r-- | tools/testing/selftests/net/forwarding/lib.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index 5ea33c72f468..83fd15e3e545 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -248,6 +248,28 @@ busywait() done } +not() +{ + "$@" + [[ $? != 0 ]] +} + +grep_bridge_fdb() +{ + local addr=$1; shift + local word + local flag + + if [ "$1" == "self" ] || [ "$1" == "master" ]; then + word=$1; shift + if [ "$1" == "-v" ]; then + flag=$1; shift + fi + fi + + $@ | grep $addr | grep $flag "$word" +} + wait_for_offload() { "$@" | grep -q offload |