Skip to content

Commit b964641

Browse files
sbrivio-rhdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent de755a8 commit b964641

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

tools/testing/selftests/net/pmtu.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,7 @@ test_list_flush_ipv6_exception() {
12741274
"${ns_a}" veth_A-R2 "${ns_r2}" veth_R2-A \
12751275
"${ns_r2}" veth_R2-B "${ns_b}" veth_B-R2
12761276

1277-
dst1="${prefix6}:${b_r1}::1"
1277+
dst_prefix1="${prefix6}:${b_r1}::"
12781278
dst2="${prefix6}:${b_r2}::1"
12791279

12801280
# Set up initial MTU values
@@ -1290,20 +1290,26 @@ test_list_flush_ipv6_exception() {
12901290

12911291
fail=0
12921292

1293-
# Create route exceptions
1294-
run_cmd ${ns_a} ${ping6} -q -M want -i 0.1 -w 1 -s 1800 ${dst1}
1295-
run_cmd ${ns_a} ${ping6} -q -M want -i 0.1 -w 1 -s 1800 ${dst2}
1293+
# Add 100 addresses for veth endpoint on B reached by default A route
1294+
for i in $(seq 100 199); do
1295+
run_cmd ${ns_b} ip addr add "${dst_prefix1}${i}" dev veth_B-R1
1296+
done
12961297

1297-
if [ "$(${ns_a} ip -6 route list cache | wc -l)" -ne 2 ]; then
1298+
# Create 100 cached route exceptions for path via R1, one via R2
1299+
for i in $(seq 100 199); do
1300+
run_cmd ${ns_a} ping -q -M want -i 0.1 -w 1 -s 1800 "${dst_prefix1}${i}"
1301+
done
1302+
run_cmd ${ns_a} ping -q -M want -i 0.1 -w 1 -s 1800 "${dst2}"
1303+
if [ "$(${ns_a} ip -6 route list cache | wc -l)" -ne 101 ]; then
12981304
err " can't list cached exceptions"
12991305
fail=1
13001306
fi
13011307

13021308
run_cmd ${ns_a} ip -6 route flush cache
1303-
sleep 1
1304-
pmtu1="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst1})"
1309+
pmtu1="$(route_get_dst_pmtu_from_exception "${ns_a}" "${dst_prefix1}100")"
13051310
pmtu2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst2})"
1306-
if [ -n "${pmtu1}" ] || [ -n "${pmtu2}" ]; then
1311+
if [ -n "${pmtu1}" ] || [ -n "${pmtu2}" ] || \
1312+
[ -n "$(${ns_a} ip -6 route list cache)" ]; then
13071313
err " can't flush cached exceptions"
13081314
fail=1
13091315
fi

0 commit comments

Comments
 (0)