diff options
author | Petr Machata <petrm@mellanox.com> | 2020-02-27 08:50:06 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-02-27 11:10:14 -0800 |
commit | 4113b04823948e40eda1c54dfadadad4bc01dcdb (patch) | |
tree | 55c014a5489f5e7b07a87dccf8fa175f6024833c /tools | |
parent | 2b99e54b30ed56201dedd91e6049ed83aa9d2302 (diff) | |
download | linux-4113b04823948e40eda1c54dfadadad4bc01dcdb.tar.gz linux-4113b04823948e40eda1c54dfadadad4bc01dcdb.tar.bz2 linux-4113b04823948e40eda1c54dfadadad4bc01dcdb.zip |
selftests: forwarding: lib.sh: Add start_tcp_traffic
Extract a helper __start_traffic() configurable by protocol type. Allow
passing through extra mausezahn arguments. Add a wrapper,
start_tcp_traffic().
Signed-off-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')
-rw-r--r-- | tools/testing/selftests/net/forwarding/lib.sh | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index 2f5da414aaa7..f80f384978ce 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -1132,18 +1132,29 @@ flood_test() flood_multicast_test $br_port $host1_if $host2_if } -start_traffic() +__start_traffic() { + local proto=$1; shift local h_in=$1; shift # Where the traffic egresses the host local sip=$1; shift local dip=$1; shift local dmac=$1; shift $MZ $h_in -p 8000 -A $sip -B $dip -c 0 \ - -a own -b $dmac -t udp -q & + -a own -b $dmac -t "$proto" -q "$@" & sleep 1 } +start_traffic() +{ + __start_traffic udp "$@" +} + +start_tcp_traffic() +{ + __start_traffic tcp "$@" +} + stop_traffic() { # Suppress noise from killing mausezahn. |