diff options
author | Petr Machata <petrm@mellanox.com> | 2019-12-29 13:48:29 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-01-02 15:40:14 -0800 |
commit | c5341bcc337ca762faa58790c2065c76cd05f2e6 (patch) | |
tree | c337153cb6d0cf836bd5d74e57f21373d7974b14 /tools/testing/selftests/net/forwarding/lib.sh | |
parent | 379a00dd21618f4354d41b1ac148188e005dbc05 (diff) |
selftests: mlxsw: Add a self-test for port-default priority
Send non-IP traffic to a port and observe that it gets prioritized
according to the lldptool app=$prio,1,0 rules.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/net/forwarding/lib.sh')
-rw-r--r-- | tools/testing/selftests/net/forwarding/lib.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index a0b09bb6995e..8dc5fac98cbc 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -225,6 +225,29 @@ log_info() echo "INFO: $msg" } +busywait() +{ + local timeout=$1; shift + + local start_time="$(date -u +%s%3N)" + while true + do + local out + out=$("$@") + local ret=$? + if ((!ret)); then + echo -n "$out" + return 0 + fi + + local current_time="$(date -u +%s%3N)" + if ((current_time - start_time > timeout)); then + echo -n "$out" + return 1 + fi + done +} + setup_wait_dev() { local dev=$1; shift |