diff --git a/tools/testing/selftests/net/forwarding/mirror_lib.sh b/tools/testing/selftests/net/forwarding/mirror_lib.sh index 04cbc38e71a2a1c4cf59d26fd2faa4fb125a0e39..67efe2556a4d180f6a1f919b8cdd96faeecac854 100644 --- a/tools/testing/selftests/net/forwarding/mirror_lib.sh +++ b/tools/testing/selftests/net/forwarding/mirror_lib.sh @@ -92,3 +92,38 @@ test_span_dir() { test_span_dir_ips "$@" 192.0.2.1 192.0.2.2 } + +do_test_span_vlan_dir_ips() +{ + local expect=$1; shift + local dev=$1; shift + local vid=$1; shift + local direction=$1; shift + local ip1=$1; shift + local ip2=$1; shift + + vlan_capture_install $dev "vlan_id $vid" + mirror_test v$h1 $ip1 $ip2 $dev 100 $expect + mirror_test v$h2 $ip2 $ip1 $dev 100 $expect + vlan_capture_uninstall $dev +} + +quick_test_span_vlan_dir_ips() +{ + do_test_span_vlan_dir_ips 10 "$@" +} + +fail_test_span_vlan_dir_ips() +{ + do_test_span_vlan_dir_ips 0 "$@" +} + +quick_test_span_vlan_dir() +{ + quick_test_span_vlan_dir_ips "$@" 192.0.2.1 192.0.2.2 +} + +fail_test_span_vlan_dir() +{ + fail_test_span_vlan_dir_ips "$@" 192.0.2.1 192.0.2.2 +} diff --git a/tools/testing/selftests/net/forwarding/mirror_vlan.sh b/tools/testing/selftests/net/forwarding/mirror_vlan.sh index 758b6d027971f354d36b8fa8b6d8e105e6d2a7ee..20b37a53657e07dee45a46ddcbde11da44d0f88e 100755 --- a/tools/testing/selftests/net/forwarding/mirror_vlan.sh +++ b/tools/testing/selftests/net/forwarding/mirror_vlan.sh @@ -76,21 +76,6 @@ test_vlan() test_vlan_dir egress 0 8 } -do_test_span_vlan_dir_ips() -{ - local expect=$1; shift - local dev=$1; shift - local vid=$1; shift - local direction=$1; shift - local ip1=$1; shift - local ip2=$1; shift - - vlan_capture_install $dev "vlan_id $vid" - mirror_test v$h1 $ip1 $ip2 $dev 100 $expect - mirror_test v$h2 $ip2 $ip1 $dev 100 $expect - vlan_capture_uninstall $dev -} - test_tagged_vlan_dir() { local direction=$1; shift