selftests: forwarding: mirror_gre_lib: Extract generic functions
authorPetr Machata <petrm@mellanox.com>
Thu, 24 May 2018 14:27:16 +0000 (16:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 May 2018 02:26:19 +0000 (22:26 -0400)
commitd5ea2bfc806a92bdeeed9a16e6dddfe44ebc37ec
treec706bb13409b86687687c5dcff5424efcba4fb9d
parent74ed089d48a483374656ce7e4f006d758a3a6228
selftests: forwarding: mirror_gre_lib: Extract generic functions

For non-GRE mirroring tests, a functions along the lines of
do_test_span_gre_dir_ips() and test_span_gre_dir_ips() are necessary,
but such that they don't assume tunnels are involved. Extract the code
from mirror_gre_lib.sh to mirror_lib.sh and convert to just use a given
device without assuming it's named "h3-$tundev". Convert the two
above-mentioned functions to wrappers that pass along the correct device
name.

Add test_span_dir() and fail_test_span_dir() to round up the API for use
by following patches.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
tools/testing/selftests/net/forwarding/mirror_lib.sh