summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPetr Machata <petrm@mellanox.com>2018-05-31 19:52:20 +0200
committerDavid S. Miller <davem@davemloft.net>2018-06-01 14:11:02 -0400
commitf52f460ca9714c1aed3a4ec73b4dbd502bfba10c (patch)
tree0d205efadcb278e9a746b086f0de4aa271e87c8b /tools
parent275225fb4e3981a55b19ad0caad2eeb2821ae3d5 (diff)
downloadlinux-0-day-f52f460ca9714c1aed3a4ec73b4dbd502bfba10c.tar.gz
linux-0-day-f52f460ca9714c1aed3a4ec73b4dbd502bfba10c.tar.xz
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>
Diffstat (limited to 'tools')
-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 92ef6dde98bd9..619b469365be1 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()
{
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
+}