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

selftests: mirror: Drop dual SW/HW testing

The mirroring tests are currently run in a skip_hw and optionally a skip_sw
mode. The former tests the SW datapath, the latter the HW datapath, if
available. In order to be able to test SW datapath on HW loopbacks, traps
are installed on ingress to get traffic from the HW datapath to the SW one.
This adds an unnecessary complexity when it would be much simpler to just
use a veth-based topology to test the SW datapath. Thus drop all the code
that supports this dual testing.
Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
Reviewed-by: default avatarDanielle Ratson <danieller@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a86e0df9
...@@ -118,7 +118,7 @@ test_span_gre_ttl_inherit() ...@@ -118,7 +118,7 @@ test_span_gre_ttl_inherit()
RET=0 RET=0
ip link set dev $tundev type $type ttl inherit ip link set dev $tundev type $type ttl inherit
mirror_install $swp1 ingress $tundev "matchall $tcflags" mirror_install $swp1 ingress $tundev "matchall"
fail_test_span_gre_dir $tundev fail_test_span_gre_dir $tundev
ip link set dev $tundev type $type ttl 100 ip link set dev $tundev type $type ttl 100
...@@ -126,7 +126,7 @@ test_span_gre_ttl_inherit() ...@@ -126,7 +126,7 @@ test_span_gre_ttl_inherit()
quick_test_span_gre_dir $tundev quick_test_span_gre_dir $tundev
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
log_test "$what: no offload on TTL of inherit ($tcflags)" log_test "$what: no offload on TTL of inherit"
} }
test_span_gre_tos_fixed() test_span_gre_tos_fixed()
...@@ -138,14 +138,14 @@ test_span_gre_tos_fixed() ...@@ -138,14 +138,14 @@ test_span_gre_tos_fixed()
RET=0 RET=0
ip link set dev $tundev type $type tos 0x10 ip link set dev $tundev type $type tos 0x10
mirror_install $swp1 ingress $tundev "matchall $tcflags" mirror_install $swp1 ingress $tundev "matchall"
fail_test_span_gre_dir $tundev fail_test_span_gre_dir $tundev
ip link set dev $tundev type $type tos inherit ip link set dev $tundev type $type tos inherit
quick_test_span_gre_dir $tundev quick_test_span_gre_dir $tundev
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
log_test "$what: no offload on a fixed TOS ($tcflags)" log_test "$what: no offload on a fixed TOS"
} }
test_span_failable() test_span_failable()
...@@ -156,7 +156,7 @@ test_span_failable() ...@@ -156,7 +156,7 @@ test_span_failable()
RET=0 RET=0
mirror_install $swp1 ingress $tundev "matchall $tcflags" mirror_install $swp1 ingress $tundev "matchall"
if ((should_fail)); then if ((should_fail)); then
fail_test_span_gre_dir $tundev fail_test_span_gre_dir $tundev
else else
...@@ -164,7 +164,7 @@ test_span_failable() ...@@ -164,7 +164,7 @@ test_span_failable()
fi fi
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
log_test "$what: should_fail=$should_fail ($tcflags)" log_test "$what: should_fail=$should_fail"
} }
test_failable() test_failable()
...@@ -175,17 +175,6 @@ test_failable() ...@@ -175,17 +175,6 @@ test_failable()
test_span_failable $should_fail gt6-soft "mirror to gretap w/ soft underlay" test_span_failable $should_fail gt6-soft "mirror to gretap w/ soft underlay"
} }
test_sw()
{
slow_path_trap_install $swp1 ingress
slow_path_trap_install $swp1 egress
test_failable 0
slow_path_trap_uninstall $swp1 egress
slow_path_trap_uninstall $swp1 ingress
}
test_hw() test_hw()
{ {
test_failable 1 test_failable 1
...@@ -202,16 +191,6 @@ trap cleanup EXIT ...@@ -202,16 +191,6 @@ trap cleanup EXIT
setup_prepare setup_prepare
setup_wait setup_wait
if ! tc_offload_check; then
check_err 1 "Could not test offloaded functionality"
log_test "mlxsw-specific tests for mirror to gretap"
exit
fi
tcflags="skip_hw"
test_sw
tcflags="skip_sw"
test_hw test_hw
exit $EXIT_STATUS exit $EXIT_STATUS
...@@ -79,7 +79,7 @@ mirror_gre_tunnels_create() ...@@ -79,7 +79,7 @@ mirror_gre_tunnels_create()
cat >> $MIRROR_GRE_BATCH_FILE <<-EOF cat >> $MIRROR_GRE_BATCH_FILE <<-EOF
filter add dev $swp1 ingress pref 1000 \ filter add dev $swp1 ingress pref 1000 \
protocol ipv6 \ protocol ipv6 \
flower $tcflags dst_ip $match_dip \ flower skip_sw dst_ip $match_dip \
action mirred egress mirror dev $tun action mirred egress mirror dev $tun
EOF EOF
done done
...@@ -107,7 +107,7 @@ mirror_gre_tunnels_destroy() ...@@ -107,7 +107,7 @@ mirror_gre_tunnels_destroy()
done done
} }
__mirror_gre_test() mirror_gre_test()
{ {
local count=$1; shift local count=$1; shift
local should_fail=$1; shift local should_fail=$1; shift
...@@ -131,20 +131,6 @@ __mirror_gre_test() ...@@ -131,20 +131,6 @@ __mirror_gre_test()
done done
} }
mirror_gre_test()
{
local count=$1; shift
local should_fail=$1; shift
if ! tc_offload_check $TC_FLOWER_NUM_NETIFS; then
check_err 1 "Could not test offloaded functionality"
return
fi
tcflags="skip_sw"
__mirror_gre_test $count $should_fail
}
mirror_gre_setup_prepare() mirror_gre_setup_prepare()
{ {
h1=${NETIFS[p1]} h1=${NETIFS[p1]}
......
...@@ -74,7 +74,7 @@ test_span_gre_mac() ...@@ -74,7 +74,7 @@ test_span_gre_mac()
RET=0 RET=0
mirror_install $swp1 $direction $tundev "matchall $tcflags" mirror_install $swp1 $direction $tundev "matchall"
icmp_capture_install h3-${tundev} "src_mac $src_mac dst_mac $dst_mac" icmp_capture_install h3-${tundev} "src_mac $src_mac dst_mac $dst_mac"
mirror_test v$h1 192.0.2.1 192.0.2.2 h3-${tundev} 100 10 mirror_test v$h1 192.0.2.1 192.0.2.2 h3-${tundev} 100 10
...@@ -82,15 +82,15 @@ test_span_gre_mac() ...@@ -82,15 +82,15 @@ test_span_gre_mac()
icmp_capture_uninstall h3-${tundev} icmp_capture_uninstall h3-${tundev}
mirror_uninstall $swp1 $direction mirror_uninstall $swp1 $direction
log_test "$direction $what: envelope MAC ($tcflags)" log_test "$direction $what: envelope MAC"
} }
test_two_spans() test_two_spans()
{ {
RET=0 RET=0
mirror_install $swp1 ingress gt4 "matchall $tcflags" mirror_install $swp1 ingress gt4 "matchall"
mirror_install $swp1 egress gt6 "matchall $tcflags" mirror_install $swp1 egress gt6 "matchall"
quick_test_span_gre_dir gt4 8 0 quick_test_span_gre_dir gt4 8 0
quick_test_span_gre_dir gt6 0 8 quick_test_span_gre_dir gt6 0 8
...@@ -98,13 +98,13 @@ test_two_spans() ...@@ -98,13 +98,13 @@ test_two_spans()
fail_test_span_gre_dir gt4 8 0 fail_test_span_gre_dir gt4 8 0
quick_test_span_gre_dir gt6 0 8 quick_test_span_gre_dir gt6 0 8
mirror_install $swp1 ingress gt4 "matchall $tcflags" mirror_install $swp1 ingress gt4 "matchall"
mirror_uninstall $swp1 egress mirror_uninstall $swp1 egress
quick_test_span_gre_dir gt4 8 0 quick_test_span_gre_dir gt4 8 0
fail_test_span_gre_dir gt6 0 8 fail_test_span_gre_dir gt6 0 8
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
log_test "two simultaneously configured mirrors ($tcflags)" log_test "two simultaneously configured mirrors"
} }
test_gretap() test_gretap()
...@@ -131,30 +131,11 @@ test_ip6gretap_mac() ...@@ -131,30 +131,11 @@ test_ip6gretap_mac()
test_span_gre_mac gt6 egress "mirror to ip6gretap" test_span_gre_mac 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
}
trap cleanup EXIT trap cleanup EXIT
setup_prepare setup_prepare
setup_wait setup_wait
tcflags="skip_hw" tests_run
test_all
if ! tc_offload_check; then
echo "WARN: Could not test offloaded functionality"
else
tcflags="skip_sw"
test_all
fi
exit $EXIT_STATUS exit $EXIT_STATUS
...@@ -196,32 +196,11 @@ test_ip6gretap() ...@@ -196,32 +196,11 @@ test_ip6gretap()
full_test_span_gre_dir gt6 egress 0 8 "mirror to ip6gretap w/ UL" full_test_span_gre_dir gt6 egress 0 8 "mirror to ip6gretap w/ UL"
} }
test_all()
{
RET=0
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
}
trap cleanup EXIT trap cleanup EXIT
setup_prepare setup_prepare
setup_wait setup_wait
tcflags="skip_hw" tests_run
test_all
if ! tc_offload_check; then
echo "WARN: Could not test offloaded functionality"
else
tcflags="skip_sw"
test_all
fi
exit $EXIT_STATUS exit $EXIT_STATUS
...@@ -108,30 +108,11 @@ test_ip6gretap() ...@@ -108,30 +108,11 @@ test_ip6gretap()
full_test_span_gre_dir gt6 egress 0 8 "mirror to ip6gretap" full_test_span_gre_dir gt6 egress 0 8 "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
}
trap cleanup EXIT trap cleanup EXIT
setup_prepare setup_prepare
setup_wait setup_wait
tcflags="skip_hw" tests_run
test_all
if ! tc_offload_check; then
echo "WARN: Could not test offloaded functionality"
else
tcflags="skip_sw"
test_all
fi
exit $EXIT_STATUS exit $EXIT_STATUS
...@@ -104,30 +104,11 @@ test_ip6gretap_stp() ...@@ -104,30 +104,11 @@ test_ip6gretap_stp()
full_test_span_gre_stp gt6 $swp3.555 "mirror to ip6gretap" full_test_span_gre_stp gt6 $swp3.555 "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
}
trap cleanup EXIT trap cleanup EXIT
setup_prepare setup_prepare
setup_wait setup_wait
tcflags="skip_hw" tests_run
test_all
if ! tc_offload_check; then
echo "WARN: Could not test offloaded functionality"
else
tcflags="skip_sw"
test_all
fi
exit $EXIT_STATUS exit $EXIT_STATUS
...@@ -104,30 +104,11 @@ test_ip6gretap() ...@@ -104,30 +104,11 @@ test_ip6gretap()
full_test_span_gre_dir gt6 egress 0 8 "mirror to ip6gretap" full_test_span_gre_dir gt6 egress 0 8 "mirror to ip6gretap"
} }
tests()
{
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
}
trap cleanup EXIT trap cleanup EXIT
setup_prepare setup_prepare
setup_wait setup_wait
tcflags="skip_hw" tests_run
tests
if ! tc_offload_check; then
echo "WARN: Could not test offloaded functionality"
else
tcflags="skip_sw"
tests
fi
exit $EXIT_STATUS exit $EXIT_STATUS
...@@ -227,10 +227,10 @@ test_lag_slave() ...@@ -227,10 +227,10 @@ test_lag_slave()
RET=0 RET=0
tc filter add dev $swp1 ingress pref 999 \ tc filter add dev $swp1 ingress pref 999 \
proto 802.1q flower vlan_ethtype arp $tcflags \ proto 802.1q flower vlan_ethtype arp \
action pass action pass
mirror_install $swp1 ingress gt4 \ mirror_install $swp1 ingress gt4 \
"proto 802.1q flower vlan_id 333 $tcflags" "proto 802.1q flower vlan_id 333"
# Test connectivity through $up_dev when $down_dev is set down. # Test connectivity through $up_dev when $down_dev is set down.
ip link set dev $down_dev down ip link set dev $down_dev down
...@@ -252,7 +252,7 @@ test_lag_slave() ...@@ -252,7 +252,7 @@ test_lag_slave()
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
tc filter del dev $swp1 ingress pref 999 tc filter del dev $swp1 ingress pref 999
log_test "$what ($tcflags)" log_test "$what"
} }
test_mirror_gretap_first() test_mirror_gretap_first()
...@@ -265,30 +265,11 @@ test_mirror_gretap_second() ...@@ -265,30 +265,11 @@ test_mirror_gretap_second()
test_lag_slave $h4 $swp4 $swp3 "mirror to gretap: LAG second slave" test_lag_slave $h4 $swp4 $swp3 "mirror to gretap: LAG second slave"
} }
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
}
trap cleanup EXIT trap cleanup EXIT
setup_prepare setup_prepare
setup_wait setup_wait
tcflags="skip_hw" tests_run
test_all
if ! tc_offload_check; then
echo "WARN: Could not test offloaded functionality"
else
tcflags="skip_sw"
test_all
fi
exit $EXIT_STATUS exit $EXIT_STATUS
...@@ -73,7 +73,7 @@ test_span_gre_ttl() ...@@ -73,7 +73,7 @@ test_span_gre_ttl()
RET=0 RET=0
mirror_install $swp1 ingress $tundev \ mirror_install $swp1 ingress $tundev \
"prot ip flower $tcflags ip_prot icmp" "prot ip flower ip_prot icmp"
tc filter add dev $h3 ingress pref 77 prot $prot \ tc filter add dev $h3 ingress pref 77 prot $prot \
flower skip_hw ip_ttl 50 action pass flower skip_hw ip_ttl 50 action pass
...@@ -87,7 +87,7 @@ test_span_gre_ttl() ...@@ -87,7 +87,7 @@ test_span_gre_ttl()
tc filter del dev $h3 ingress pref 77 tc filter del dev $h3 ingress pref 77
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
log_test "$what: TTL change ($tcflags)" log_test "$what: TTL change"
} }
test_span_gre_tun_up() test_span_gre_tun_up()
...@@ -98,7 +98,7 @@ test_span_gre_tun_up() ...@@ -98,7 +98,7 @@ test_span_gre_tun_up()
RET=0 RET=0
ip link set dev $tundev down ip link set dev $tundev down
mirror_install $swp1 ingress $tundev "matchall $tcflags" mirror_install $swp1 ingress $tundev "matchall"
fail_test_span_gre_dir $tundev fail_test_span_gre_dir $tundev
ip link set dev $tundev up ip link set dev $tundev up
...@@ -106,7 +106,7 @@ test_span_gre_tun_up() ...@@ -106,7 +106,7 @@ test_span_gre_tun_up()
quick_test_span_gre_dir $tundev quick_test_span_gre_dir $tundev
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
log_test "$what: tunnel down/up ($tcflags)" log_test "$what: tunnel down/up"
} }
test_span_gre_egress_up() test_span_gre_egress_up()
...@@ -118,7 +118,7 @@ test_span_gre_egress_up() ...@@ -118,7 +118,7 @@ test_span_gre_egress_up()
RET=0 RET=0
ip link set dev $swp3 down ip link set dev $swp3 down
mirror_install $swp1 ingress $tundev "matchall $tcflags" mirror_install $swp1 ingress $tundev "matchall"
fail_test_span_gre_dir $tundev fail_test_span_gre_dir $tundev
# After setting the device up, wait for neighbor to get resolved so that # After setting the device up, wait for neighbor to get resolved so that
...@@ -130,7 +130,7 @@ test_span_gre_egress_up() ...@@ -130,7 +130,7 @@ test_span_gre_egress_up()
quick_test_span_gre_dir $tundev quick_test_span_gre_dir $tundev
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
log_test "$what: egress down/up ($tcflags)" log_test "$what: egress down/up"
} }
test_span_gre_remote_ip() test_span_gre_remote_ip()
...@@ -144,14 +144,14 @@ test_span_gre_remote_ip() ...@@ -144,14 +144,14 @@ test_span_gre_remote_ip()
RET=0 RET=0
ip link set dev $tundev type $type remote $wrong_ip ip link set dev $tundev type $type remote $wrong_ip
mirror_install $swp1 ingress $tundev "matchall $tcflags" mirror_install $swp1 ingress $tundev "matchall"
fail_test_span_gre_dir $tundev fail_test_span_gre_dir $tundev
ip link set dev $tundev type $type remote $correct_ip ip link set dev $tundev type $type remote $correct_ip
quick_test_span_gre_dir $tundev quick_test_span_gre_dir $tundev
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
log_test "$what: remote address change ($tcflags)" log_test "$what: remote address change"
} }
test_span_gre_tun_del() test_span_gre_tun_del()
...@@ -165,7 +165,7 @@ test_span_gre_tun_del() ...@@ -165,7 +165,7 @@ test_span_gre_tun_del()
RET=0 RET=0
mirror_install $swp1 ingress $tundev "matchall $tcflags" mirror_install $swp1 ingress $tundev "matchall"
quick_test_span_gre_dir $tundev quick_test_span_gre_dir $tundev
ip link del dev $tundev ip link del dev $tundev
fail_test_span_gre_dir $tundev fail_test_span_gre_dir $tundev
...@@ -176,11 +176,11 @@ test_span_gre_tun_del() ...@@ -176,11 +176,11 @@ test_span_gre_tun_del()
# Recreating the tunnel doesn't reestablish mirroring, so reinstall it # Recreating the tunnel doesn't reestablish mirroring, so reinstall it
# and verify it works for the follow-up tests. # and verify it works for the follow-up tests.
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
mirror_install $swp1 ingress $tundev "matchall $tcflags" mirror_install $swp1 ingress $tundev "matchall"
quick_test_span_gre_dir $tundev quick_test_span_gre_dir $tundev
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
log_test "$what: tunnel deleted ($tcflags)" log_test "$what: tunnel deleted"
} }
test_span_gre_route_del() test_span_gre_route_del()
...@@ -192,7 +192,7 @@ test_span_gre_route_del() ...@@ -192,7 +192,7 @@ test_span_gre_route_del()
RET=0 RET=0
mirror_install $swp1 ingress $tundev "matchall $tcflags" mirror_install $swp1 ingress $tundev "matchall"
quick_test_span_gre_dir $tundev quick_test_span_gre_dir $tundev
ip route del $route dev $edev ip route del $route dev $edev
...@@ -203,7 +203,7 @@ test_span_gre_route_del() ...@@ -203,7 +203,7 @@ test_span_gre_route_del()
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
log_test "$what: underlay route removal ($tcflags)" log_test "$what: underlay route removal"
} }
test_ttl() test_ttl()
...@@ -244,30 +244,11 @@ test_route_del() ...@@ -244,30 +244,11 @@ test_route_del()
test_span_gre_route_del gt6 $swp3 2001:db8:2::/64 "mirror to ip6gretap" test_span_gre_route_del gt6 $swp3 2001:db8:2::/64 "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
}
trap cleanup EXIT trap cleanup EXIT
setup_prepare setup_prepare
setup_wait setup_wait
tcflags="skip_hw" tests_run
test_all
if ! tc_offload_check; then
echo "WARN: Could not test offloaded functionality"
else
tcflags="skip_sw"
test_all
fi
exit $EXIT_STATUS exit $EXIT_STATUS
...@@ -91,7 +91,7 @@ full_test_span_gre_dir_acl() ...@@ -91,7 +91,7 @@ full_test_span_gre_dir_acl()
RET=0 RET=0
mirror_install $swp1 $direction $tundev \ mirror_install $swp1 $direction $tundev \
"protocol ip flower $tcflags dst_ip $match_dip" "protocol ip flower dst_ip $match_dip"
fail_test_span_gre_dir $tundev fail_test_span_gre_dir $tundev
test_span_gre_dir_acl "$tundev" "$forward_type" "$backward_type" test_span_gre_dir_acl "$tundev" "$forward_type" "$backward_type"
mirror_uninstall $swp1 $direction mirror_uninstall $swp1 $direction
...@@ -99,7 +99,7 @@ full_test_span_gre_dir_acl() ...@@ -99,7 +99,7 @@ full_test_span_gre_dir_acl()
# Test lack of mirroring after ACL mirror is uninstalled. # Test lack of mirroring after ACL mirror is uninstalled.
fail_test_span_gre_dir_acl "$tundev" fail_test_span_gre_dir_acl "$tundev"
log_test "$direction $what ($tcflags)" log_test "$direction $what"
} }
test_gretap() test_gretap()
...@@ -114,30 +114,11 @@ test_ip6gretap() ...@@ -114,30 +114,11 @@ test_ip6gretap()
full_test_span_gre_dir_acl gt6 egress 0 8 192.0.2.3 "ACL mirror to ip6gretap" full_test_span_gre_dir_acl gt6 egress 0 8 192.0.2.3 "ACL 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
}
trap cleanup EXIT trap cleanup EXIT
setup_prepare setup_prepare
setup_wait setup_wait
tcflags="skip_hw" tests_run
test_all
if ! tc_offload_check; then
echo "WARN: Could not test offloaded functionality"
else
tcflags="skip_sw"
test_all
fi
exit $EXIT_STATUS exit $EXIT_STATUS
...@@ -223,7 +223,7 @@ test_lag_slave() ...@@ -223,7 +223,7 @@ test_lag_slave()
RET=0 RET=0
mirror_install $swp1 ingress gt4 \ mirror_install $swp1 ingress gt4 \
"proto 802.1q flower vlan_id 333 $tcflags" "proto 802.1q flower vlan_id 333"
vlan_capture_install gt4-dst "vlan_ethtype ipv4 ip_proto icmp type 8" vlan_capture_install gt4-dst "vlan_ethtype ipv4 ip_proto icmp type 8"
# Move $down_dev away from the team. That will prompt change in # Move $down_dev away from the team. That will prompt change in
...@@ -250,7 +250,7 @@ test_lag_slave() ...@@ -250,7 +250,7 @@ test_lag_slave()
# Wait for ${h,swp}{3,4}. # Wait for ${h,swp}{3,4}.
setup_wait setup_wait
log_test "$what ($tcflags)" log_test "$what"
} }
test_mirror_gretap_first() test_mirror_gretap_first()
...@@ -263,30 +263,11 @@ test_mirror_gretap_second() ...@@ -263,30 +263,11 @@ test_mirror_gretap_second()
test_lag_slave $h4 $h3 "mirror to gretap: LAG second slave" test_lag_slave $h4 $h3 "mirror to gretap: LAG second slave"
} }
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
}
trap cleanup EXIT trap cleanup EXIT
setup_prepare setup_prepare
setup_wait setup_wait
tcflags="skip_hw" tests_run
test_all
if ! tc_offload_check; then
echo "WARN: Could not test offloaded functionality"
else
tcflags="skip_sw"
test_all
fi
exit $EXIT_STATUS exit $EXIT_STATUS
...@@ -47,12 +47,12 @@ full_test_span_gre_dir_ips() ...@@ -47,12 +47,12 @@ full_test_span_gre_dir_ips()
RET=0 RET=0
mirror_install $swp1 $direction $tundev "matchall $tcflags" mirror_install $swp1 $direction $tundev "matchall"
test_span_dir_ips "h3-$tundev" "$forward_type" \ test_span_dir_ips "h3-$tundev" "$forward_type" \
"$backward_type" "$ip1" "$ip2" "$backward_type" "$ip1" "$ip2"
mirror_uninstall $swp1 $direction mirror_uninstall $swp1 $direction
log_test "$direction $what ($tcflags)" log_test "$direction $what"
} }
full_test_span_gre_dir_vlan_ips() full_test_span_gre_dir_vlan_ips()
...@@ -68,7 +68,7 @@ full_test_span_gre_dir_vlan_ips() ...@@ -68,7 +68,7 @@ full_test_span_gre_dir_vlan_ips()
RET=0 RET=0
mirror_install $swp1 $direction $tundev "matchall $tcflags" mirror_install $swp1 $direction $tundev "matchall"
test_span_dir_ips "h3-$tundev" "$forward_type" \ test_span_dir_ips "h3-$tundev" "$forward_type" \
"$backward_type" "$ip1" "$ip2" "$backward_type" "$ip1" "$ip2"
...@@ -81,7 +81,7 @@ full_test_span_gre_dir_vlan_ips() ...@@ -81,7 +81,7 @@ full_test_span_gre_dir_vlan_ips()
mirror_uninstall $swp1 $direction mirror_uninstall $swp1 $direction
log_test "$direction $what ($tcflags)" log_test "$direction $what"
} }
quick_test_span_gre_dir() quick_test_span_gre_dir()
...@@ -151,7 +151,7 @@ full_test_span_gre_stp_ips() ...@@ -151,7 +151,7 @@ full_test_span_gre_stp_ips()
RET=0 RET=0
mirror_install $swp1 ingress $tundev "matchall $tcflags" mirror_install $swp1 ingress $tundev "matchall"
quick_test_span_gre_dir_ips $tundev $ip1 $ip2 \ quick_test_span_gre_dir_ips $tundev $ip1 $ip2 \
"$forward_type" "$backward_type" "$forward_type" "$backward_type"
...@@ -166,7 +166,7 @@ full_test_span_gre_stp_ips() ...@@ -166,7 +166,7 @@ full_test_span_gre_stp_ips()
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
log_test "$what: STP state ($tcflags)" log_test "$what: STP state"
} }
full_test_span_gre_stp() full_test_span_gre_stp()
......
...@@ -67,13 +67,13 @@ test_span_gre_neigh() ...@@ -67,13 +67,13 @@ test_span_gre_neigh()
RET=0 RET=0
ip neigh replace dev $swp3 $addr lladdr 00:11:22:33:44:55 ip neigh replace dev $swp3 $addr lladdr 00:11:22:33:44:55
mirror_install $swp1 $direction $tundev "matchall $tcflags" mirror_install $swp1 $direction $tundev "matchall"
fail_test_span_gre_dir $tundev "$forward_type" "$backward_type" fail_test_span_gre_dir $tundev "$forward_type" "$backward_type"
ip neigh del dev $swp3 $addr ip neigh del dev $swp3 $addr
quick_test_span_gre_dir $tundev "$forward_type" "$backward_type" quick_test_span_gre_dir $tundev "$forward_type" "$backward_type"
mirror_uninstall $swp1 $direction mirror_uninstall $swp1 $direction
log_test "$direction $what: neighbor change ($tcflags)" log_test "$direction $what: neighbor change"
} }
test_gretap() test_gretap()
...@@ -88,30 +88,11 @@ test_ip6gretap() ...@@ -88,30 +88,11 @@ test_ip6gretap()
test_span_gre_neigh 2001:db8:2::2 gt6 egress 0 8 "mirror to ip6gretap" test_span_gre_neigh 2001:db8:2::2 gt6 egress 0 8 "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
}
trap cleanup EXIT trap cleanup EXIT
setup_prepare setup_prepare
setup_wait setup_wait
tcflags="skip_hw" tests_run
test_all
if ! tc_offload_check; then
echo "WARN: Could not test offloaded functionality"
else
tcflags="skip_sw"
test_all
fi
exit $EXIT_STATUS exit $EXIT_STATUS
...@@ -75,7 +75,7 @@ cleanup() ...@@ -75,7 +75,7 @@ cleanup()
test_gretap() test_gretap()
{ {
RET=0 RET=0
mirror_install $swp1 ingress gt4 "matchall $tcflags" mirror_install $swp1 ingress gt4 "matchall"
# For IPv4, test that there's no mirroring without the route directing # For IPv4, test that there's no mirroring without the route directing
# the traffic to tunnel remote address. Then add it and test that # the traffic to tunnel remote address. Then add it and test that
...@@ -88,29 +88,18 @@ test_gretap() ...@@ -88,29 +88,18 @@ test_gretap()
ip route del 192.0.2.130/32 via 192.0.2.162 ip route del 192.0.2.130/32 via 192.0.2.162
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
log_test "mirror to gre with next-hop remote ($tcflags)" log_test "mirror to gre with next-hop remote"
} }
test_ip6gretap() test_ip6gretap()
{ {
RET=0 RET=0
mirror_install $swp1 ingress gt6 "matchall $tcflags" mirror_install $swp1 ingress gt6 "matchall"
quick_test_span_gre_dir gt6 quick_test_span_gre_dir gt6
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
log_test "mirror to ip6gre with next-hop remote ($tcflags)" log_test "mirror to ip6gre with next-hop remote"
}
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
} }
trap cleanup EXIT trap cleanup EXIT
...@@ -118,14 +107,6 @@ trap cleanup EXIT ...@@ -118,14 +107,6 @@ trap cleanup EXIT
setup_prepare setup_prepare
setup_wait setup_wait
tcflags="skip_hw" tests_run
test_all
if ! tc_offload_check; then
echo "WARN: Could not test offloaded functionality"
else
tcflags="skip_sw"
test_all
fi
exit $EXIT_STATUS exit $EXIT_STATUS
...@@ -63,30 +63,11 @@ test_gretap() ...@@ -63,30 +63,11 @@ test_gretap()
full_test_span_gre_dir gt4 egress 0 8 "mirror to gretap" full_test_span_gre_dir gt4 egress 0 8 "mirror to gretap"
} }
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
}
trap cleanup EXIT trap cleanup EXIT
setup_prepare setup_prepare
setup_wait setup_wait
tcflags="skip_hw" tests_run
test_all
if ! tc_offload_check; then
echo "WARN: Could not test offloaded functionality"
else
tcflags="skip_sw"
test_all
fi
exit $EXIT_STATUS exit $EXIT_STATUS
...@@ -153,7 +153,7 @@ test_span_gre_forbidden_cpu() ...@@ -153,7 +153,7 @@ test_span_gre_forbidden_cpu()
RET=0 RET=0
# Run the pass-test first, to prime neighbor table. # Run the pass-test first, to prime neighbor table.
mirror_install $swp1 ingress $tundev "matchall $tcflags" mirror_install $swp1 ingress $tundev "matchall"
quick_test_span_gre_dir $tundev quick_test_span_gre_dir $tundev
# Now forbid the VLAN at the bridge and see it fail. # Now forbid the VLAN at the bridge and see it fail.
...@@ -167,7 +167,7 @@ test_span_gre_forbidden_cpu() ...@@ -167,7 +167,7 @@ test_span_gre_forbidden_cpu()
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
log_test "$what: vlan forbidden at a bridge ($tcflags)" log_test "$what: vlan forbidden at a bridge"
} }
test_gretap_forbidden_cpu() test_gretap_forbidden_cpu()
...@@ -187,7 +187,7 @@ test_span_gre_forbidden_egress() ...@@ -187,7 +187,7 @@ test_span_gre_forbidden_egress()
RET=0 RET=0
mirror_install $swp1 ingress $tundev "matchall $tcflags" mirror_install $swp1 ingress $tundev "matchall"
quick_test_span_gre_dir $tundev quick_test_span_gre_dir $tundev
bridge vlan del dev $swp3 vid 555 bridge vlan del dev $swp3 vid 555
...@@ -202,7 +202,7 @@ test_span_gre_forbidden_egress() ...@@ -202,7 +202,7 @@ test_span_gre_forbidden_egress()
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
log_test "$what: vlan forbidden at a bridge egress ($tcflags)" log_test "$what: vlan forbidden at a bridge egress"
} }
test_gretap_forbidden_egress() test_gretap_forbidden_egress()
...@@ -223,7 +223,7 @@ test_span_gre_untagged_egress() ...@@ -223,7 +223,7 @@ test_span_gre_untagged_egress()
RET=0 RET=0
mirror_install $swp1 ingress $tundev "matchall $tcflags" mirror_install $swp1 ingress $tundev "matchall"
quick_test_span_gre_dir $tundev quick_test_span_gre_dir $tundev
quick_test_span_vlan_dir $h3 555 "$ul_proto" quick_test_span_vlan_dir $h3 555 "$ul_proto"
...@@ -246,7 +246,7 @@ test_span_gre_untagged_egress() ...@@ -246,7 +246,7 @@ test_span_gre_untagged_egress()
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
log_test "$what: vlan untagged at a bridge egress ($tcflags)" log_test "$what: vlan untagged at a bridge egress"
} }
test_gretap_untagged_egress() test_gretap_untagged_egress()
...@@ -267,7 +267,7 @@ test_span_gre_fdb_roaming() ...@@ -267,7 +267,7 @@ test_span_gre_fdb_roaming()
RET=0 RET=0
mirror_install $swp1 ingress $tundev "matchall $tcflags" mirror_install $swp1 ingress $tundev "matchall"
quick_test_span_gre_dir $tundev quick_test_span_gre_dir $tundev
while ((RET == 0)); do while ((RET == 0)); do
...@@ -279,7 +279,7 @@ test_span_gre_fdb_roaming() ...@@ -279,7 +279,7 @@ test_span_gre_fdb_roaming()
if ! bridge fdb sh dev $swp2 vlan 555 master \ if ! bridge fdb sh dev $swp2 vlan 555 master \
| grep -q $h3mac; then | grep -q $h3mac; then
printf "TEST: %-60s [RETRY]\n" \ printf "TEST: %-60s [RETRY]\n" \
"$what: MAC roaming ($tcflags)" "$what: MAC roaming"
# ARP or ND probably reprimed the FDB while the test # ARP or ND probably reprimed the FDB while the test
# was running. We would get a spurious failure. # was running. We would get a spurious failure.
RET=0 RET=0
...@@ -296,7 +296,7 @@ test_span_gre_fdb_roaming() ...@@ -296,7 +296,7 @@ test_span_gre_fdb_roaming()
mirror_uninstall $swp1 ingress mirror_uninstall $swp1 ingress
log_test "$what: MAC roaming ($tcflags)" log_test "$what: MAC roaming"
} }
test_gretap_fdb_roaming() test_gretap_fdb_roaming()
...@@ -319,30 +319,11 @@ test_ip6gretap_stp() ...@@ -319,30 +319,11 @@ test_ip6gretap_stp()
full_test_span_gre_stp gt6 $swp3 "mirror to ip6gretap" full_test_span_gre_stp gt6 $swp3 "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
}
trap cleanup EXIT trap cleanup EXIT
setup_prepare setup_prepare
setup_wait setup_wait
tcflags="skip_hw" tests_run
test_all
if ! tc_offload_check; then
echo "WARN: Could not test offloaded functionality"
else
tcflags="skip_sw"
test_all
fi
exit $EXIT_STATUS exit $EXIT_STATUS
...@@ -40,12 +40,16 @@ setup_prepare() ...@@ -40,12 +40,16 @@ setup_prepare()
vlan_create $h2 111 v$h2 192.0.2.18/28 vlan_create $h2 111 v$h2 192.0.2.18/28
bridge vlan add dev $swp2 vid 111 bridge vlan add dev $swp2 vid 111
trap_install $h3 ingress
} }
cleanup() cleanup()
{ {
pre_cleanup pre_cleanup
trap_uninstall $h3 ingress
vlan_destroy $h2 111 vlan_destroy $h2 111
vlan_destroy $h1 111 vlan_destroy $h1 111
vlan_destroy $h3 555 vlan_destroy $h3 555
...@@ -63,11 +67,11 @@ test_vlan_dir() ...@@ -63,11 +67,11 @@ test_vlan_dir()
RET=0 RET=0
mirror_install $swp1 $direction $swp3.555 "matchall $tcflags" mirror_install $swp1 $direction $swp3.555 "matchall"
test_span_dir "$h3.555" "$forward_type" "$backward_type" test_span_dir "$h3.555" "$forward_type" "$backward_type"
mirror_uninstall $swp1 $direction mirror_uninstall $swp1 $direction
log_test "$direction mirror to vlan ($tcflags)" log_test "$direction mirror to vlan"
} }
test_vlan() test_vlan()
...@@ -84,12 +88,12 @@ test_tagged_vlan_dir() ...@@ -84,12 +88,12 @@ test_tagged_vlan_dir()
RET=0 RET=0
mirror_install $swp1 $direction $swp3.555 "matchall $tcflags" mirror_install $swp1 $direction $swp3.555 "matchall"
do_test_span_vlan_dir_ips '>= 10' "$h3.555" 111 ip 192.0.2.17 192.0.2.18 do_test_span_vlan_dir_ips '>= 10' "$h3.555" 111 ip 192.0.2.17 192.0.2.18
do_test_span_vlan_dir_ips 0 "$h3.555" 555 ip 192.0.2.17 192.0.2.18 do_test_span_vlan_dir_ips 0 "$h3.555" 555 ip 192.0.2.17 192.0.2.18
mirror_uninstall $swp1 $direction mirror_uninstall $swp1 $direction
log_test "$direction mirror tagged to vlan ($tcflags)" log_test "$direction mirror tagged to vlan"
} }
test_tagged_vlan() test_tagged_vlan()
...@@ -98,32 +102,11 @@ test_tagged_vlan() ...@@ -98,32 +102,11 @@ test_tagged_vlan()
test_tagged_vlan_dir egress 0 8 test_tagged_vlan_dir egress 0 8
} }
test_all()
{
slow_path_trap_install $swp1 ingress
slow_path_trap_install $swp1 egress
trap_install $h3 ingress
tests_run
trap_uninstall $h3 ingress
slow_path_trap_uninstall $swp1 egress
slow_path_trap_uninstall $swp1 ingress
}
trap cleanup EXIT trap cleanup EXIT
setup_prepare setup_prepare
setup_wait setup_wait
tcflags="skip_hw" tests_run
test_all
if ! tc_offload_check; then
echo "WARN: Could not test offloaded functionality"
else
tcflags="skip_sw"
test_all
fi
exit $EXIT_STATUS exit $EXIT_STATUS
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