Commit f52f460c authored by Petr Machata's avatar Petr Machata Committed by David S. Miller

selftests: forwarding: mirror_gre_lib: Add STP test

Add a reusable full test that toggles STP state of a given bridge port
and checks that the mirroring reacts appropriately. The test will be
used by bridge tests in follow-up patches.
Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 275225fb
...@@ -96,3 +96,35 @@ full_test_span_gre_dir_vlan() ...@@ -96,3 +96,35 @@ full_test_span_gre_dir_vlan()
{ {
full_test_span_gre_dir_vlan_ips "$@" 192.0.2.1 192.0.2.2 full_test_span_gre_dir_vlan_ips "$@" 192.0.2.1 192.0.2.2
} }
full_test_span_gre_stp_ips()
{
local tundev=$1; shift
local nbpdev=$1; shift
local what=$1; shift
local ip1=$1; shift
local ip2=$1; shift
local h3mac=$(mac_get $h3)
RET=0
mirror_install $swp1 ingress $tundev "matchall $tcflags"
quick_test_span_gre_dir_ips $tundev ingress $ip1 $ip2
bridge link set dev $nbpdev state disabled
sleep 1
fail_test_span_gre_dir_ips $tundev ingress $ip1 $ip2
bridge link set dev $nbpdev state forwarding
sleep 1
quick_test_span_gre_dir_ips $tundev ingress $ip1 $ip2
mirror_uninstall $swp1 ingress
log_test "$what: STP state ($tcflags)"
}
full_test_span_gre_stp()
{
full_test_span_gre_stp_ips "$@" 192.0.2.1 192.0.2.2
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment