Skip to content

Commit 2745aea

Browse files
Thadeu Lima de Souza Cascardodavem330
authored andcommitted
selftests: pmtu: use -oneline for ip route list cache
Some versions of iproute2 will output more than one line per entry, which will cause the test to fail, like: TEST: ipv6: list and flush cached exceptions [FAIL] can't list cached exceptions That happens, for example, with iproute2 4.15.0. When using the -oneline option, this will work just fine: TEST: ipv6: list and flush cached exceptions [ OK ] This also works just fine with a more recent version of iproute2, like 5.4.0. For some reason, two lines are printed for the IPv4 test no matter what version of iproute2 is used. Use the same -oneline parameter there instead of counting the lines twice. Fixes: b964641 ("selftests: pmtu: Make list_flush_ipv6_exception test more demanding") Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]> Acked-by: Stefano Brivio <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent aaa3425 commit 2745aea

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tools/testing/selftests/net/pmtu.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,8 +1249,7 @@ test_list_flush_ipv4_exception() {
12491249
done
12501250
run_cmd ${ns_a} ping -q -M want -i 0.1 -c 2 -s 1800 "${dst2}"
12511251

1252-
# Each exception is printed as two lines
1253-
if [ "$(${ns_a} ip route list cache | wc -l)" -ne 202 ]; then
1252+
if [ "$(${ns_a} ip -oneline route list cache | wc -l)" -ne 101 ]; then
12541253
err " can't list cached exceptions"
12551254
fail=1
12561255
fi
@@ -1300,7 +1299,7 @@ test_list_flush_ipv6_exception() {
13001299
run_cmd ${ns_a} ping -q -M want -i 0.1 -w 1 -s 1800 "${dst_prefix1}${i}"
13011300
done
13021301
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
1302+
if [ "$(${ns_a} ip -oneline -6 route list cache | wc -l)" -ne 101 ]; then
13041303
err " can't list cached exceptions"
13051304
fail=1
13061305
fi

0 commit comments

Comments
 (0)