aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/net/pmtu.sh
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2019-06-21 17:45:30 +0200
committerDavid S. Miller <davem@davemloft.net>2019-06-24 10:18:49 -0700
commitb964641e9925be1cb2c6dbf1d3ecaf6b594c15c0 (patch)
tree4bb0970296305c8b482997ca7cc1c3634cacda1c /tools/testing/selftests/net/pmtu.sh
parentselftests: pmtu: Introduce list_flush_ipv4_exception test case (diff)
downloadlinux-dev-b964641e9925be1cb2c6dbf1d3ecaf6b594c15c0.tar.xz
linux-dev-b964641e9925be1cb2c6dbf1d3ecaf6b594c15c0.zip
selftests: pmtu: Make list_flush_ipv6_exception test more demanding
Instead of just listing and flushing two cached exceptions, create a relatively big number of them, and count how many are listed. Single netlink dump messages contain approximately 25 entries each, and this way we can make sure the partial dump tracking mechanism is working properly. While at it, also ensure that no cached routes can be listed after flush, and remove 'sleep 1' calls, they are not actually needed. v7: No changes v6: - Merge this patch into series including fix, as it's also targeted for net-next. No actual changes Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/net/pmtu.sh')
-rwxr-xr-xtools/testing/selftests/net/pmtu.sh22
1 files changed, 14 insertions, 8 deletions
diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh
index f5004a9df229..ab367e75f095 100755
--- a/tools/testing/selftests/net/pmtu.sh
+++ b/tools/testing/selftests/net/pmtu.sh
@@ -1274,7 +1274,7 @@ test_list_flush_ipv6_exception() {
"${ns_a}" veth_A-R2 "${ns_r2}" veth_R2-A \
"${ns_r2}" veth_R2-B "${ns_b}" veth_B-R2
- dst1="${prefix6}:${b_r1}::1"
+ dst_prefix1="${prefix6}:${b_r1}::"
dst2="${prefix6}:${b_r2}::1"
# Set up initial MTU values
@@ -1290,20 +1290,26 @@ test_list_flush_ipv6_exception() {
fail=0
- # Create route exceptions
- run_cmd ${ns_a} ${ping6} -q -M want -i 0.1 -w 1 -s 1800 ${dst1}
- run_cmd ${ns_a} ${ping6} -q -M want -i 0.1 -w 1 -s 1800 ${dst2}
+ # Add 100 addresses for veth endpoint on B reached by default A route
+ for i in $(seq 100 199); do
+ run_cmd ${ns_b} ip addr add "${dst_prefix1}${i}" dev veth_B-R1
+ done
- if [ "$(${ns_a} ip -6 route list cache | wc -l)" -ne 2 ]; then
+ # Create 100 cached route exceptions for path via R1, one via R2
+ for i in $(seq 100 199); do
+ run_cmd ${ns_a} ping -q -M want -i 0.1 -w 1 -s 1800 "${dst_prefix1}${i}"
+ done
+ run_cmd ${ns_a} ping -q -M want -i 0.1 -w 1 -s 1800 "${dst2}"
+ if [ "$(${ns_a} ip -6 route list cache | wc -l)" -ne 101 ]; then
err " can't list cached exceptions"
fail=1
fi
run_cmd ${ns_a} ip -6 route flush cache
- sleep 1
- pmtu1="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst1})"
+ pmtu1="$(route_get_dst_pmtu_from_exception "${ns_a}" "${dst_prefix1}100")"
pmtu2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst2})"
- if [ -n "${pmtu1}" ] || [ -n "${pmtu2}" ]; then
+ if [ -n "${pmtu1}" ] || [ -n "${pmtu2}" ] || \
+ [ -n "$(${ns_a} ip -6 route list cache)" ]; then
err " can't flush cached exceptions"
fail=1
fi