aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2019-02-25 10:08:36 -0500
committerDavid S. Miller <davem@davemloft.net>2019-02-28 00:28:59 -0500
commit651eb32e569e50564803891cf2a8d22e49e979a5 (patch)
treedd4ec8410bb10ee902d4d967ced2abb0eee1c2c0
parent72a7d452b0f09dcd5d3e18cff1e3839f8b1acc1f (diff)
selftests: pmtu: disable DAD in all namespaces
Otherwise, the configured IPv6 address could be still "tentative" at test time, possibly causing tests failures. We can also drop some sleep along the code and decrease the timeout for most commands so that the test runtime decreases. v1 -> v2: - fix comment (Stefano) Fixes: d1f1b9cbf34c ("selftests: net: Introduce first PMTU test") Signed-off-by: Paolo Abeni <pabeni@redhat.com> Reviewed-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rwxr-xr-xtools/testing/selftests/net/pmtu.sh28
1 files changed, 13 insertions, 15 deletions
diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh
index e2c94e47707c..89aec2fdf4fa 100755
--- a/tools/testing/selftests/net/pmtu.sh
+++ b/tools/testing/selftests/net/pmtu.sh
@@ -263,8 +263,6 @@ setup_fou_or_gue() {
263 263
264 ${ns_a} ip link set ${encap}_a up 264 ${ns_a} ip link set ${encap}_a up
265 ${ns_b} ip link set ${encap}_b up 265 ${ns_b} ip link set ${encap}_b up
266
267 sleep 1
268} 266}
269 267
270setup_fou44() { 268setup_fou44() {
@@ -302,6 +300,10 @@ setup_gue66() {
302setup_namespaces() { 300setup_namespaces() {
303 for n in ${NS_A} ${NS_B} ${NS_R1} ${NS_R2}; do 301 for n in ${NS_A} ${NS_B} ${NS_R1} ${NS_R2}; do
304 ip netns add ${n} || return 1 302 ip netns add ${n} || return 1
303
304 # Disable DAD, so that we don't have to wait to use the
305 # configured IPv6 addresses
306 ip netns exec ${n} sysctl -q net/ipv6/conf/default/accept_dad=0
305 done 307 done
306} 308}
307 309
@@ -337,8 +339,6 @@ setup_vti() {
337 339
338 ${ns_a} ip link set vti${proto}_a up 340 ${ns_a} ip link set vti${proto}_a up
339 ${ns_b} ip link set vti${proto}_b up 341 ${ns_b} ip link set vti${proto}_b up
340
341 sleep 1
342} 342}
343 343
344setup_vti4() { 344setup_vti4() {
@@ -375,8 +375,6 @@ setup_vxlan_or_geneve() {
375 375
376 ${ns_a} ip link set ${type}_a up 376 ${ns_a} ip link set ${type}_a up
377 ${ns_b} ip link set ${type}_b up 377 ${ns_b} ip link set ${type}_b up
378
379 sleep 1
380} 378}
381 379
382setup_geneve4() { 380setup_geneve4() {
@@ -588,8 +586,8 @@ test_pmtu_ipvX() {
588 mtu "${ns_b}" veth_B-R2 1500 586 mtu "${ns_b}" veth_B-R2 1500
589 587
590 # Create route exceptions 588 # Create route exceptions
591 ${ns_a} ${ping} -q -M want -i 0.1 -w 2 -s 1800 ${dst1} > /dev/null 589 ${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s 1800 ${dst1} > /dev/null
592 ${ns_a} ${ping} -q -M want -i 0.1 -w 2 -s 1800 ${dst2} > /dev/null 590 ${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s 1800 ${dst2} > /dev/null
593 591
594 # Check that exceptions have been created with the correct PMTU 592 # Check that exceptions have been created with the correct PMTU
595 pmtu_1="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst1})" 593 pmtu_1="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst1})"
@@ -621,7 +619,7 @@ test_pmtu_ipvX() {
621 # Decrease remote MTU on path via R2, get new exception 619 # Decrease remote MTU on path via R2, get new exception
622 mtu "${ns_r2}" veth_R2-B 400 620 mtu "${ns_r2}" veth_R2-B 400
623 mtu "${ns_b}" veth_B-R2 400 621 mtu "${ns_b}" veth_B-R2 400
624 ${ns_a} ${ping} -q -M want -i 0.1 -w 2 -s 1400 ${dst2} > /dev/null 622 ${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s 1400 ${dst2} > /dev/null
625 pmtu_2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst2})" 623 pmtu_2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst2})"
626 check_pmtu_value "lock 552" "${pmtu_2}" "exceeding MTU, with MTU < min_pmtu" || return 1 624 check_pmtu_value "lock 552" "${pmtu_2}" "exceeding MTU, with MTU < min_pmtu" || return 1
627 625
@@ -638,7 +636,7 @@ test_pmtu_ipvX() {
638 check_pmtu_value "1500" "${pmtu_2}" "increasing local MTU" || return 1 636 check_pmtu_value "1500" "${pmtu_2}" "increasing local MTU" || return 1
639 637
640 # Get new exception 638 # Get new exception
641 ${ns_a} ${ping} -q -M want -i 0.1 -w 2 -s 1400 ${dst2} > /dev/null 639 ${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s 1400 ${dst2} > /dev/null
642 pmtu_2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst2})" 640 pmtu_2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst2})"
643 check_pmtu_value "lock 552" "${pmtu_2}" "exceeding MTU, with MTU < min_pmtu" || return 1 641 check_pmtu_value "lock 552" "${pmtu_2}" "exceeding MTU, with MTU < min_pmtu" || return 1
644} 642}
@@ -687,7 +685,7 @@ test_pmtu_ipvX_over_vxlanY_or_geneveY_exception() {
687 685
688 mtu "${ns_a}" ${type}_a $((${ll_mtu} + 1000)) 686 mtu "${ns_a}" ${type}_a $((${ll_mtu} + 1000))
689 mtu "${ns_b}" ${type}_b $((${ll_mtu} + 1000)) 687 mtu "${ns_b}" ${type}_b $((${ll_mtu} + 1000))
690 ${ns_a} ${ping} -q -M want -i 0.1 -w 2 -s $((${ll_mtu} + 500)) ${dst} > /dev/null 688 ${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s $((${ll_mtu} + 500)) ${dst} > /dev/null
691 689
692 # Check that exception was created 690 # Check that exception was created
693 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst})" 691 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst})"
@@ -767,7 +765,7 @@ test_pmtu_ipvX_over_fouY_or_gueY() {
767 765
768 mtu "${ns_a}" ${encap}_a $((${ll_mtu} + 1000)) 766 mtu "${ns_a}" ${encap}_a $((${ll_mtu} + 1000))
769 mtu "${ns_b}" ${encap}_b $((${ll_mtu} + 1000)) 767 mtu "${ns_b}" ${encap}_b $((${ll_mtu} + 1000))
770 ${ns_a} ${ping} -q -M want -i 0.1 -w 2 -s $((${ll_mtu} + 500)) ${dst} > /dev/null 768 ${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s $((${ll_mtu} + 500)) ${dst} > /dev/null
771 769
772 # Check that exception was created 770 # Check that exception was created
773 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst})" 771 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst})"
@@ -825,13 +823,13 @@ test_pmtu_vti4_exception() {
825 823
826 # Send DF packet without exceeding link layer MTU, check that no 824 # Send DF packet without exceeding link layer MTU, check that no
827 # exception is created 825 # exception is created
828 ${ns_a} ping -q -M want -i 0.1 -w 2 -s ${ping_payload} ${tunnel4_b_addr} > /dev/null 826 ${ns_a} ping -q -M want -i 0.1 -w 1 -s ${ping_payload} ${tunnel4_b_addr} > /dev/null
829 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${tunnel4_b_addr})" 827 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${tunnel4_b_addr})"
830 check_pmtu_value "" "${pmtu}" "sending packet smaller than PMTU (IP payload length ${esp_payload_rfc4106})" || return 1 828 check_pmtu_value "" "${pmtu}" "sending packet smaller than PMTU (IP payload length ${esp_payload_rfc4106})" || return 1
831 829
832 # Now exceed link layer MTU by one byte, check that exception is created 830 # Now exceed link layer MTU by one byte, check that exception is created
833 # with the right PMTU value 831 # with the right PMTU value
834 ${ns_a} ping -q -M want -i 0.1 -w 2 -s $((ping_payload + 1)) ${tunnel4_b_addr} > /dev/null 832 ${ns_a} ping -q -M want -i 0.1 -w 1 -s $((ping_payload + 1)) ${tunnel4_b_addr} > /dev/null
835 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${tunnel4_b_addr})" 833 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${tunnel4_b_addr})"
836 check_pmtu_value "${esp_payload_rfc4106}" "${pmtu}" "exceeding PMTU (IP payload length $((esp_payload_rfc4106 + 1)))" 834 check_pmtu_value "${esp_payload_rfc4106}" "${pmtu}" "exceeding PMTU (IP payload length $((esp_payload_rfc4106 + 1)))"
837} 835}
@@ -847,7 +845,7 @@ test_pmtu_vti6_exception() {
847 mtu "${ns_b}" veth_b 4000 845 mtu "${ns_b}" veth_b 4000
848 mtu "${ns_a}" vti6_a 5000 846 mtu "${ns_a}" vti6_a 5000
849 mtu "${ns_b}" vti6_b 5000 847 mtu "${ns_b}" vti6_b 5000
850 ${ns_a} ${ping6} -q -i 0.1 -w 2 -s 60000 ${tunnel6_b_addr} > /dev/null 848 ${ns_a} ${ping6} -q -i 0.1 -w 1 -s 60000 ${tunnel6_b_addr} > /dev/null
851 849
852 # Check that exception was created 850 # Check that exception was created
853 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${tunnel6_b_addr})" 851 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${tunnel6_b_addr})"