aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Machata <petrm@mellanox.com>2018-05-31 13:52:20 -0400
committerDavid S. Miller <davem@davemloft.net>2018-06-01 14:11:02 -0400
commitf52f460ca9714c1aed3a4ec73b4dbd502bfba10c (patch)
tree0d205efadcb278e9a746b086f0de4aa271e87c8b
parent275225fb4e3981a55b19ad0caad2eeb2821ae3d5 (diff)
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: Petr Machata <petrm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--tools/testing/selftests/net/forwarding/mirror_gre_lib.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
index 92ef6dde98bd..619b469365be 100644
--- a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
@@ -96,3 +96,35 @@ full_test_span_gre_dir_vlan()
96{ 96{
97 full_test_span_gre_dir_vlan_ips "$@" 192.0.2.1 192.0.2.2 97 full_test_span_gre_dir_vlan_ips "$@" 192.0.2.1 192.0.2.2
98} 98}
99
100full_test_span_gre_stp_ips()
101{
102 local tundev=$1; shift
103 local nbpdev=$1; shift
104 local what=$1; shift
105 local ip1=$1; shift
106 local ip2=$1; shift
107 local h3mac=$(mac_get $h3)
108
109 RET=0
110
111 mirror_install $swp1 ingress $tundev "matchall $tcflags"
112 quick_test_span_gre_dir_ips $tundev ingress $ip1 $ip2
113
114 bridge link set dev $nbpdev state disabled
115 sleep 1
116 fail_test_span_gre_dir_ips $tundev ingress $ip1 $ip2
117
118 bridge link set dev $nbpdev state forwarding
119 sleep 1
120 quick_test_span_gre_dir_ips $tundev ingress $ip1 $ip2
121
122 mirror_uninstall $swp1 ingress
123
124 log_test "$what: STP state ($tcflags)"
125}
126
127full_test_span_gre_stp()
128{
129 full_test_span_gre_stp_ips "$@" 192.0.2.1 192.0.2.2
130}