|
@@ -1,53 +1,53 @@
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
|
-do_test_span_gre_dir_ips()
|
|
|
+source mirror_lib.sh
|
|
|
+
|
|
|
+quick_test_span_gre_dir_ips()
|
|
|
{
|
|
|
- local expect=$1; shift
|
|
|
local tundev=$1; shift
|
|
|
- local direction=$1; shift
|
|
|
- local ip1=$1; shift
|
|
|
- local ip2=$1; shift
|
|
|
|
|
|
- icmp_capture_install h3-$tundev
|
|
|
- mirror_test v$h1 $ip1 $ip2 h3-$tundev 100 $expect
|
|
|
- mirror_test v$h2 $ip2 $ip1 h3-$tundev 100 $expect
|
|
|
- icmp_capture_uninstall h3-$tundev
|
|
|
+ do_test_span_dir_ips 10 h3-$tundev "$@"
|
|
|
}
|
|
|
|
|
|
-quick_test_span_gre_dir_ips()
|
|
|
+fail_test_span_gre_dir_ips()
|
|
|
{
|
|
|
- do_test_span_gre_dir_ips 10 "$@"
|
|
|
+ local tundev=$1; shift
|
|
|
+
|
|
|
+ do_test_span_dir_ips 0 h3-$tundev "$@"
|
|
|
}
|
|
|
|
|
|
-fail_test_span_gre_dir_ips()
|
|
|
+test_span_gre_dir_ips()
|
|
|
{
|
|
|
- do_test_span_gre_dir_ips 0 "$@"
|
|
|
+ local tundev=$1; shift
|
|
|
+
|
|
|
+ test_span_dir_ips h3-$tundev "$@"
|
|
|
}
|
|
|
|
|
|
-test_span_gre_dir_ips()
|
|
|
+full_test_span_gre_dir_ips()
|
|
|
{
|
|
|
local tundev=$1; shift
|
|
|
local direction=$1; shift
|
|
|
local forward_type=$1; shift
|
|
|
local backward_type=$1; shift
|
|
|
+ local what=$1; shift
|
|
|
local ip1=$1; shift
|
|
|
local ip2=$1; shift
|
|
|
|
|
|
- quick_test_span_gre_dir_ips "$tundev" "$direction" "$ip1" "$ip2"
|
|
|
+ RET=0
|
|
|
|
|
|
- icmp_capture_install h3-$tundev "type $forward_type"
|
|
|
- mirror_test v$h1 $ip1 $ip2 h3-$tundev 100 10
|
|
|
- icmp_capture_uninstall h3-$tundev
|
|
|
+ mirror_install $swp1 $direction $tundev "matchall $tcflags"
|
|
|
+ test_span_dir_ips "h3-$tundev" "$direction" "$forward_type" \
|
|
|
+ "$backward_type" "$ip1" "$ip2"
|
|
|
+ mirror_uninstall $swp1 $direction
|
|
|
|
|
|
- icmp_capture_install h3-$tundev "type $backward_type"
|
|
|
- mirror_test v$h2 $ip2 $ip1 h3-$tundev 100 10
|
|
|
- icmp_capture_uninstall h3-$tundev
|
|
|
+ log_test "$direction $what ($tcflags)"
|
|
|
}
|
|
|
|
|
|
-full_test_span_gre_dir_ips()
|
|
|
+full_test_span_gre_dir_vlan_ips()
|
|
|
{
|
|
|
local tundev=$1; shift
|
|
|
local direction=$1; shift
|
|
|
+ local vlan_match=$1; shift
|
|
|
local forward_type=$1; shift
|
|
|
local backward_type=$1; shift
|
|
|
local what=$1; shift
|
|
@@ -57,8 +57,16 @@ full_test_span_gre_dir_ips()
|
|
|
RET=0
|
|
|
|
|
|
mirror_install $swp1 $direction $tundev "matchall $tcflags"
|
|
|
- test_span_gre_dir_ips "$tundev" "$direction" "$forward_type" \
|
|
|
- "$backward_type" "$ip1" "$ip2"
|
|
|
+
|
|
|
+ test_span_dir_ips "h3-$tundev" "$direction" "$forward_type" \
|
|
|
+ "$backward_type" "$ip1" "$ip2"
|
|
|
+
|
|
|
+ tc filter add dev $h3 ingress pref 77 prot 802.1q \
|
|
|
+ flower $vlan_match ip_proto 0x2f \
|
|
|
+ action pass
|
|
|
+ mirror_test v$h1 $ip1 $ip2 $h3 77 10
|
|
|
+ tc filter del dev $h3 ingress pref 77
|
|
|
+
|
|
|
mirror_uninstall $swp1 $direction
|
|
|
|
|
|
log_test "$direction $what ($tcflags)"
|
|
@@ -83,3 +91,8 @@ full_test_span_gre_dir()
|
|
|
{
|
|
|
full_test_span_gre_dir_ips "$@" 192.0.2.1 192.0.2.2
|
|
|
}
|
|
|
+
|
|
|
+full_test_span_gre_dir_vlan()
|
|
|
+{
|
|
|
+ full_test_span_gre_dir_vlan_ips "$@" 192.0.2.1 192.0.2.2
|
|
|
+}
|