[PATCH net-next mlxsw] selftests: forwarding: mirror-to-GRE: Allow testlist override

Petr Machata petrm at mellanox.com
Wed May 2 00:39:21 AEST 2018


Signed-off-by: Petr Machata <petrm at mellanox.com>
---
 .../testing/selftests/net/forwarding/mirror_gre.sh | 36 +++++++++++++++++-----
 .../selftests/net/forwarding/mirror_gre_bound.sh   | 23 +++++++++++---
 .../selftests/net/forwarding/mirror_gre_changes.sh | 29 ++++++++++++++---
 .../selftests/net/forwarding/mirror_gre_flower.sh  | 23 +++++++++++---
 .../selftests/net/forwarding/mirror_gre_neigh.sh   | 22 ++++++++++---
 .../selftests/net/forwarding/mirror_gre_nh.sh      |  8 +++--
 6 files changed, 114 insertions(+), 27 deletions(-)

diff --git a/tools/testing/selftests/net/forwarding/mirror_gre.sh b/tools/testing/selftests/net/forwarding/mirror_gre.sh
index a8abc73..c6786d1 100755
--- a/tools/testing/selftests/net/forwarding/mirror_gre.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre.sh
@@ -10,6 +10,14 @@
 # traffic. Test that the payload is what is expected (ICMP ping request or
 # reply, depending on test).
 
+ALL_TESTS="
+	test_gretap
+	test_ip6gretap
+	test_gretap_mac
+	test_ip6gretap_mac
+	test_two_spans
+"
+
 NUM_NETIFS=6
 source lib.sh
 source mirror_lib.sh
@@ -100,22 +108,36 @@ test_two_spans()
 	log_test "two simultaneously configured mirrors ($tcflags)"
 }
 
-test_all()
+test_gretap()
 {
-	slow_path_trap_install $swp1 ingress
-	slow_path_trap_install $swp1 egress
-
 	full_test_span_gre_dir gt4 ingress 8 0 "mirror to gretap"
-	full_test_span_gre_dir gt6 ingress 8 0 "mirror to ip6gretap"
 	full_test_span_gre_dir gt4 egress 0 8 "mirror to gretap"
+}
+
+test_ip6gretap()
+{
+	full_test_span_gre_dir gt6 ingress 8 0 "mirror to ip6gretap"
 	full_test_span_gre_dir gt6 egress 0 8 "mirror to ip6gretap"
+}
 
+test_gretap_mac()
+{
 	test_span_gre_mac gt4 ingress ip "mirror to gretap"
-	test_span_gre_mac gt6 ingress ipv6 "mirror to ip6gretap"
 	test_span_gre_mac gt4 egress ip "mirror to gretap"
+}
+
+test_ip6gretap_mac()
+{
+	test_span_gre_mac gt6 ingress ipv6 "mirror to ip6gretap"
 	test_span_gre_mac gt6 egress ipv6 "mirror to ip6gretap"
+}
 
-	test_two_spans
+test_all()
+{
+	slow_path_trap_install $swp1 ingress
+	slow_path_trap_install $swp1 egress
+
+	tests_run
 
 	slow_path_trap_uninstall $swp1 egress
 	slow_path_trap_uninstall $swp1 ingress
diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_bound.sh b/tools/testing/selftests/net/forwarding/mirror_gre_bound.sh
index 3708ac0..360ca13 100755
--- a/tools/testing/selftests/net/forwarding/mirror_gre_bound.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre_bound.sh
@@ -42,6 +42,11 @@
 # underlay manner, i.e. with a bound dummy device that marks underlay VRF where
 # the encapsulated packed should be routed.
 
+ALL_TESTS="
+	test_gretap
+	test_ip6gretap
+"
+
 NUM_NETIFS=6
 source lib.sh
 source mirror_lib.sh
@@ -178,6 +183,18 @@ cleanup()
 	vrf_cleanup
 }
 
+test_gretap()
+{
+	full_test_span_gre_dir gt4 ingress 8 0 "mirror to gretap w/ UL"
+	full_test_span_gre_dir gt4 egress  0 8 "mirror to gretap w/ UL"
+}
+
+test_ip6gretap()
+{
+	full_test_span_gre_dir gt6 ingress 8 0 "mirror to ip6gretap w/ UL"
+	full_test_span_gre_dir gt6 egress  0 8 "mirror to ip6gretap w/ UL"
+}
+
 test_all()
 {
 	RET=0
@@ -185,11 +202,7 @@ test_all()
 	slow_path_trap_install $swp1 ingress
 	slow_path_trap_install $swp1 egress
 
-	full_test_span_gre_dir gt4 ingress 8 0 "mirror to gretap w/ UL"
-	full_test_span_gre_dir gt6 ingress 8 0 "mirror to ip6gretap w/ UL"
-
-	full_test_span_gre_dir gt4 egress  0 8 "mirror to gretap w/ UL"
-	full_test_span_gre_dir gt6 egress  0 8 "mirror to ip6gretap w/ UL"
+	tests_run
 
 	slow_path_trap_uninstall $swp1 egress
 	slow_path_trap_uninstall $swp1 ingress
diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh b/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh
index 0ed288a..fdb612f 100755
--- a/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh
@@ -7,6 +7,13 @@
 # Test how mirrors to gretap and ip6gretap react to changes to relevant
 # configuration.
 
+ALL_TESTS="
+	test_ttl
+	test_tun_up
+	test_egress_up
+	test_remote_ip
+"
+
 NUM_NETIFS=6
 source lib.sh
 source mirror_lib.sh
@@ -155,22 +162,36 @@ test_span_gre_remote_ip()
 	log_test "$what: remote address change ($tcflags)"
 }
 
-test_all()
+test_ttl()
 {
-	slow_path_trap_install $swp1 ingress
-	slow_path_trap_install $swp1 egress
-
 	test_span_gre_ttl gt4 gretap ip "mirror to gretap"
 	test_span_gre_ttl gt6 ip6gretap ipv6 "mirror to ip6gretap"
+}
 
+test_tun_up()
+{
 	test_span_gre_tun_up gt4 "mirror to gretap"
 	test_span_gre_tun_up gt6 "mirror to ip6gretap"
+}
 
+test_egress_up()
+{
 	test_span_gre_egress_up gt4 192.0.2.130 "mirror to gretap"
 	test_span_gre_egress_up gt6 2001:db8:2::2 "mirror to ip6gretap"
+}
 
+test_remote_ip()
+{
 	test_span_gre_remote_ip gt4 gretap 192.0.2.130 192.0.2.132 "mirror to gretap"
 	test_span_gre_remote_ip gt6 ip6gretap 2001:db8:2::2 2001:db8:2::4 "mirror to ip6gretap"
+}
+
+test_all()
+{
+	slow_path_trap_install $swp1 ingress
+	slow_path_trap_install $swp1 egress
+
+	tests_run
 
 	slow_path_trap_uninstall $swp1 egress
 	slow_path_trap_uninstall $swp1 ingress
diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_flower.sh b/tools/testing/selftests/net/forwarding/mirror_gre_flower.sh
index 178a42d..2e54407 100755
--- a/tools/testing/selftests/net/forwarding/mirror_gre_flower.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre_flower.sh
@@ -10,6 +10,11 @@
 # this address, mirroring takes place, whereas when pinging the other one,
 # there's no mirroring.
 
+ALL_TESTS="
+	test_gretap
+	test_ip6gretap
+"
+
 NUM_NETIFS=6
 source lib.sh
 source mirror_lib.sh
@@ -81,6 +86,18 @@ full_test_span_gre_dir_acl()
 	log_test "$direction $what ($tcflags)"
 }
 
+test_gretap()
+{
+	full_test_span_gre_dir_acl gt4 ingress 8 0 192.0.2.4 "ACL mirror to gretap"
+	full_test_span_gre_dir_acl gt4 egress 0 8 192.0.2.3 "ACL mirror to gretap"
+}
+
+test_ip6gretap()
+{
+	full_test_span_gre_dir_acl gt6 ingress 8 0 192.0.2.4 "ACL mirror to ip6gretap"
+	full_test_span_gre_dir_acl gt6 egress 0 8 192.0.2.3 "ACL mirror to ip6gretap"
+}
+
 test_all()
 {
 	RET=0
@@ -88,11 +105,7 @@ test_all()
 	slow_path_trap_install $swp1 ingress
 	slow_path_trap_install $swp1 egress
 
-	full_test_span_gre_dir_acl gt4 ingress 8 0 192.0.2.4 "ACL mirror to gretap"
-	full_test_span_gre_dir_acl gt6 ingress 8 0 192.0.2.4 "ACL mirror to ip6gretap"
-
-	full_test_span_gre_dir_acl gt4 egress 0 8 192.0.2.3 "ACL mirror to gretap"
-	full_test_span_gre_dir_acl gt6 egress 0 8 192.0.2.3 "ACL mirror to ip6gretap"
+	tests_run
 
 	slow_path_trap_uninstall $swp1 egress
 	slow_path_trap_uninstall $swp1 ingress
diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh b/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh
index 1ca29ba..fc0508e 100755
--- a/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh
@@ -9,6 +9,11 @@
 # is set up. Later on, the neighbor is deleted and it is expected to be
 # reinitialized using the usual ARP process, and the mirroring offload updated.
 
+ALL_TESTS="
+	test_gretap
+	test_ip6gretap
+"
+
 NUM_NETIFS=6
 source lib.sh
 source mirror_lib.sh
@@ -69,15 +74,24 @@ test_span_gre_neigh()
 	log_test "$direction $what: neighbor change ($tcflags)"
 }
 
-test_all()
+test_gretap()
 {
-	slow_path_trap_install $swp1 ingress
-	slow_path_trap_install $swp1 egress
-
 	test_span_gre_neigh 192.0.2.130 gt4 ingress "mirror to gretap"
 	test_span_gre_neigh 192.0.2.130 gt4 egress "mirror to gretap"
+}
+
+test_ip6gretap()
+{
 	test_span_gre_neigh 2001:db8:2::2 gt6 ingress "mirror to ip6gretap"
 	test_span_gre_neigh 2001:db8:2::2 gt6 egress "mirror to ip6gretap"
+}
+
+test_all()
+{
+	slow_path_trap_install $swp1 ingress
+	slow_path_trap_install $swp1 egress
+
+	tests_run
 
 	slow_path_trap_uninstall $swp1 egress
 	slow_path_trap_uninstall $swp1 ingress
diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_nh.sh b/tools/testing/selftests/net/forwarding/mirror_gre_nh.sh
index 9ac7097..a0d1ad4 100755
--- a/tools/testing/selftests/net/forwarding/mirror_gre_nh.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre_nh.sh
@@ -7,6 +7,11 @@
 # Test that gretap and ip6gretap mirroring works when the other tunnel endpoint
 # is reachable through a next-hop route (as opposed to directly-attached route).
 
+ALL_TESTS="
+	test_gretap
+	test_ip6gretap
+"
+
 NUM_NETIFS=6
 source lib.sh
 source mirror_lib.sh
@@ -92,8 +97,7 @@ test_all()
 	slow_path_trap_install $swp1 ingress
 	slow_path_trap_install $swp1 egress
 
-	test_gretap
-	test_ip6gretap
+	tests_run
 
 	slow_path_trap_uninstall $swp1 egress
 	slow_path_trap_uninstall $swp1 ingress
-- 
2.4.11



More information about the Linux-mlxsw mailing list