Message ID | 20211130004905.4146-1-yepeilin.cs@gmail.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,v2] selftests/fib_tests: ping from dummy0 in fib_rp_filter_test() | expand |
On 11/29/21 5:49 PM, Peilin Ye wrote: > diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh > index 5abe92d55b69..b8bceae00f8e 100755 > --- a/tools/testing/selftests/net/fib_tests.sh > +++ b/tools/testing/selftests/net/fib_tests.sh > @@ -453,15 +453,19 @@ fib_rp_filter_test() > $NS_EXEC sysctl -qw net.ipv4.conf.all.accept_local=1 > $NS_EXEC sysctl -qw net.ipv4.conf.all.route_localnet=1 > > + $NS_EXEC tc qd add dev dummy0 parent root handle 1: fq_codel > + $NS_EXEC tc filter add dev dummy0 parent 1: protocol arp basic action mirred egress redirect dev dummy1 > + $NS_EXEC tc filter add dev dummy0 parent 1: protocol ip basic action mirred egress redirect dev dummy1 > + > $NS_EXEC tc qd add dev dummy1 parent root handle 1: fq_codel > $NS_EXEC tc filter add dev dummy1 parent 1: protocol arp basic action mirred egress redirect dev lo > $NS_EXEC tc filter add dev dummy1 parent 1: protocol ip basic action mirred egress redirect dev lo > set +e > > - run_cmd "ip netns exec ns1 ping -I dummy1 -w1 -c1 198.51.100.1" > + run_cmd "ip netns exec ns1 ping -I dummy0 -w1 -c1 198.51.100.1" > log_test $? 0 "rp_filter passes local packets" > > - run_cmd "ip netns exec ns1 ping -I dummy1 -w1 -c1 127.0.0.1" > + run_cmd "ip netns exec ns1 ping -I dummy0 -w1 -c1 127.0.0.1" > log_test $? 0 "rp_filter passes loopback packets" > > cleanup > confused by the point of this test if you are going to change dummy1 to dummy0. dummy0 has 198.51.100.1 assigned to it, so the ping should always work.
Hi David, On Mon, Nov 29, 2021 at 06:16:48PM -0700, David Ahern wrote: > On 11/29/21 5:49 PM, Peilin Ye wrote: > > - run_cmd "ip netns exec ns1 ping -I dummy1 -w1 -c1 198.51.100.1" > > + run_cmd "ip netns exec ns1 ping -I dummy0 -w1 -c1 198.51.100.1" > > log_test $? 0 "rp_filter passes local packets" > > confused by the point of this test if you are going to change dummy1 to > dummy0. dummy0 has 198.51.100.1 assigned to it, so the ping should > always work. Ah... Thanks for pointing this out, I'll try to figure out a different way to test it in v3. Thanks, Peilin Ye
diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh index 5abe92d55b69..b8bceae00f8e 100755 --- a/tools/testing/selftests/net/fib_tests.sh +++ b/tools/testing/selftests/net/fib_tests.sh @@ -453,15 +453,19 @@ fib_rp_filter_test() $NS_EXEC sysctl -qw net.ipv4.conf.all.accept_local=1 $NS_EXEC sysctl -qw net.ipv4.conf.all.route_localnet=1 + $NS_EXEC tc qd add dev dummy0 parent root handle 1: fq_codel + $NS_EXEC tc filter add dev dummy0 parent 1: protocol arp basic action mirred egress redirect dev dummy1 + $NS_EXEC tc filter add dev dummy0 parent 1: protocol ip basic action mirred egress redirect dev dummy1 + $NS_EXEC tc qd add dev dummy1 parent root handle 1: fq_codel $NS_EXEC tc filter add dev dummy1 parent 1: protocol arp basic action mirred egress redirect dev lo $NS_EXEC tc filter add dev dummy1 parent 1: protocol ip basic action mirred egress redirect dev lo set +e - run_cmd "ip netns exec ns1 ping -I dummy1 -w1 -c1 198.51.100.1" + run_cmd "ip netns exec ns1 ping -I dummy0 -w1 -c1 198.51.100.1" log_test $? 0 "rp_filter passes local packets" - run_cmd "ip netns exec ns1 ping -I dummy1 -w1 -c1 127.0.0.1" + run_cmd "ip netns exec ns1 ping -I dummy0 -w1 -c1 127.0.0.1" log_test $? 0 "rp_filter passes loopback packets" cleanup