mirror of https://gitee.com/openkylin/linux.git
Merge branch 'gretap-mirroring-selftests'
Petr Machata says: ==================== selftests: forwarding: Additions to mirror-to-gretap tests This patchset is for a handful of edge cases in mirror-to-gretap scenarios: removal of mirrored-to netdevice (#1), removal of underlay route for tunnel remote endpoint (#2) and cessation of mirroring upon removal of flower mirroring rule (#3). ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
180f848b8f
|
@ -12,6 +12,8 @@ ALL_TESTS="
|
||||||
test_tun_up
|
test_tun_up
|
||||||
test_egress_up
|
test_egress_up
|
||||||
test_remote_ip
|
test_remote_ip
|
||||||
|
test_tun_del
|
||||||
|
test_route_del
|
||||||
"
|
"
|
||||||
|
|
||||||
NUM_NETIFS=6
|
NUM_NETIFS=6
|
||||||
|
@ -159,6 +161,58 @@ test_span_gre_remote_ip()
|
||||||
log_test "$what: remote address change ($tcflags)"
|
log_test "$what: remote address change ($tcflags)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test_span_gre_tun_del()
|
||||||
|
{
|
||||||
|
local tundev=$1; shift
|
||||||
|
local type=$1; shift
|
||||||
|
local flags=$1; shift
|
||||||
|
local local_ip=$1; shift
|
||||||
|
local remote_ip=$1; shift
|
||||||
|
local what=$1; shift
|
||||||
|
|
||||||
|
RET=0
|
||||||
|
|
||||||
|
mirror_install $swp1 ingress $tundev "matchall $tcflags"
|
||||||
|
quick_test_span_gre_dir $tundev ingress
|
||||||
|
ip link del dev $tundev
|
||||||
|
fail_test_span_gre_dir $tundev ingress
|
||||||
|
|
||||||
|
tunnel_create $tundev $type $local_ip $remote_ip \
|
||||||
|
ttl 100 tos inherit $flags
|
||||||
|
|
||||||
|
# Recreating the tunnel doesn't reestablish mirroring, so reinstall it
|
||||||
|
# and verify it works for the follow-up tests.
|
||||||
|
mirror_uninstall $swp1 ingress
|
||||||
|
mirror_install $swp1 ingress $tundev "matchall $tcflags"
|
||||||
|
quick_test_span_gre_dir $tundev ingress
|
||||||
|
mirror_uninstall $swp1 ingress
|
||||||
|
|
||||||
|
log_test "$what: tunnel deleted ($tcflags)"
|
||||||
|
}
|
||||||
|
|
||||||
|
test_span_gre_route_del()
|
||||||
|
{
|
||||||
|
local tundev=$1; shift
|
||||||
|
local edev=$1; shift
|
||||||
|
local route=$1; shift
|
||||||
|
local what=$1; shift
|
||||||
|
|
||||||
|
RET=0
|
||||||
|
|
||||||
|
mirror_install $swp1 ingress $tundev "matchall $tcflags"
|
||||||
|
quick_test_span_gre_dir $tundev ingress
|
||||||
|
|
||||||
|
ip route del $route dev $edev
|
||||||
|
fail_test_span_gre_dir $tundev ingress
|
||||||
|
|
||||||
|
ip route add $route dev $edev
|
||||||
|
quick_test_span_gre_dir $tundev ingress
|
||||||
|
|
||||||
|
mirror_uninstall $swp1 ingress
|
||||||
|
|
||||||
|
log_test "$what: underlay route removal ($tcflags)"
|
||||||
|
}
|
||||||
|
|
||||||
test_ttl()
|
test_ttl()
|
||||||
{
|
{
|
||||||
test_span_gre_ttl gt4 gretap ip "mirror to gretap"
|
test_span_gre_ttl gt4 gretap ip "mirror to gretap"
|
||||||
|
@ -183,6 +237,20 @@ test_remote_ip()
|
||||||
test_span_gre_remote_ip gt6 ip6gretap 2001:db8:2::2 2001:db8:2::4 "mirror to ip6gretap"
|
test_span_gre_remote_ip gt6 ip6gretap 2001:db8:2::2 2001:db8:2::4 "mirror to ip6gretap"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test_tun_del()
|
||||||
|
{
|
||||||
|
test_span_gre_tun_del gt4 gretap "" \
|
||||||
|
192.0.2.129 192.0.2.130 "mirror to gretap"
|
||||||
|
test_span_gre_tun_del gt6 ip6gretap allow-localremote \
|
||||||
|
2001:db8:2::1 2001:db8:2::2 "mirror to ip6gretap"
|
||||||
|
}
|
||||||
|
|
||||||
|
test_route_del()
|
||||||
|
{
|
||||||
|
test_span_gre_route_del gt4 $swp3 192.0.2.128/28 "mirror to gretap"
|
||||||
|
test_span_gre_route_del gt6 $swp3 2001:db8:2::/64 "mirror to ip6gretap"
|
||||||
|
}
|
||||||
|
|
||||||
test_all()
|
test_all()
|
||||||
{
|
{
|
||||||
slow_path_trap_install $swp1 ingress
|
slow_path_trap_install $swp1 ingress
|
||||||
|
|
|
@ -67,6 +67,11 @@ test_span_gre_dir_acl()
|
||||||
test_span_gre_dir_ips "$@" 192.0.2.3 192.0.2.4
|
test_span_gre_dir_ips "$@" 192.0.2.3 192.0.2.4
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fail_test_span_gre_dir_acl()
|
||||||
|
{
|
||||||
|
fail_test_span_gre_dir_ips "$@" 192.0.2.3 192.0.2.4
|
||||||
|
}
|
||||||
|
|
||||||
full_test_span_gre_dir_acl()
|
full_test_span_gre_dir_acl()
|
||||||
{
|
{
|
||||||
local tundev=$1; shift
|
local tundev=$1; shift
|
||||||
|
@ -83,6 +88,9 @@ full_test_span_gre_dir_acl()
|
||||||
"$forward_type" "$backward_type"
|
"$forward_type" "$backward_type"
|
||||||
mirror_uninstall $swp1 $direction
|
mirror_uninstall $swp1 $direction
|
||||||
|
|
||||||
|
# Test lack of mirroring after ACL mirror is uninstalled.
|
||||||
|
fail_test_span_gre_dir_acl "$tundev" "$direction"
|
||||||
|
|
||||||
log_test "$direction $what ($tcflags)"
|
log_test "$direction $what ($tcflags)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue