Skip to content

Commit 96b8419

Browse files
matttbekuba-moo
authored andcommitted
selftests: mptcp: join: uniform listener tests
The alignment was different from the other tests because tabs were used instead of spaces. While at it, also use 'echo' instead of 'printf' to print the result to keep the same style as done in the other sub-tests. And, even if it should be better with, also remove 'stdbuf' and sed's '--unbuffered' option because they are not used in the other subtests and they are not available when using a minimal environment with busybox. Link: multipath-tcp/mptcp_net-next#368 Fixes: 178d023 ("selftests: mptcp: listener test for in-kernel PM") Cc: stable@vger.kernel.org Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 0471bb4 commit 96b8419

1 file changed

Lines changed: 14 additions & 16 deletions

File tree

tools/testing/selftests/net/mptcp/mptcp_join.sh

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2765,43 +2765,41 @@ verify_listener_events()
27652765
local family
27662766
local saddr
27672767
local sport
2768+
local name
27682769

27692770
if [ $e_type = $LISTENER_CREATED ]; then
2770-
stdbuf -o0 -e0 printf "\t\t\t\t\t CREATE_LISTENER %s:%s"\
2771-
$e_saddr $e_sport
2771+
name="LISTENER_CREATED"
27722772
elif [ $e_type = $LISTENER_CLOSED ]; then
2773-
stdbuf -o0 -e0 printf "\t\t\t\t\t CLOSE_LISTENER %s:%s "\
2774-
$e_saddr $e_sport
2773+
name="LISTENER_CLOSED"
2774+
else
2775+
name="$e_type"
27752776
fi
27762777

2778+
printf "%-${nr_blank}s %s %s:%s " " " "$name" "$e_saddr" "$e_sport"
2779+
27772780
if ! mptcp_lib_kallsyms_has "mptcp_event_pm_listener$"; then
27782781
printf "[skip]: event not supported\n"
27792782
return
27802783
fi
27812784

2782-
type=$(grep "type:$e_type," $evt |
2783-
sed --unbuffered -n 's/.*\(type:\)\([[:digit:]]*\).*$/\2/p;q')
2784-
family=$(grep "type:$e_type," $evt |
2785-
sed --unbuffered -n 's/.*\(family:\)\([[:digit:]]*\).*$/\2/p;q')
2786-
sport=$(grep "type:$e_type," $evt |
2787-
sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q')
2785+
type=$(grep "type:$e_type," $evt | sed -n 's/.*\(type:\)\([[:digit:]]*\).*$/\2/p;q')
2786+
family=$(grep "type:$e_type," $evt | sed -n 's/.*\(family:\)\([[:digit:]]*\).*$/\2/p;q')
2787+
sport=$(grep "type:$e_type," $evt | sed -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q')
27882788
if [ $family ] && [ $family = $AF_INET6 ]; then
2789-
saddr=$(grep "type:$e_type," $evt |
2790-
sed --unbuffered -n 's/.*\(saddr6:\)\([0-9a-f:.]*\).*$/\2/p;q')
2789+
saddr=$(grep "type:$e_type," $evt | sed -n 's/.*\(saddr6:\)\([0-9a-f:.]*\).*$/\2/p;q')
27912790
else
2792-
saddr=$(grep "type:$e_type," $evt |
2793-
sed --unbuffered -n 's/.*\(saddr4:\)\([0-9.]*\).*$/\2/p;q')
2791+
saddr=$(grep "type:$e_type," $evt | sed -n 's/.*\(saddr4:\)\([0-9.]*\).*$/\2/p;q')
27942792
fi
27952793

27962794
if [ $type ] && [ $type = $e_type ] &&
27972795
[ $family ] && [ $family = $e_family ] &&
27982796
[ $saddr ] && [ $saddr = $e_saddr ] &&
27992797
[ $sport ] && [ $sport = $e_sport ]; then
2800-
stdbuf -o0 -e0 printf "[ ok ]\n"
2798+
echo "[ ok ]"
28012799
return 0
28022800
fi
28032801
fail_test
2804-
stdbuf -o0 -e0 printf "[fail]\n"
2802+
echo "[fail]"
28052803
}
28062804

28072805
add_addr_ports_tests()

0 commit comments

Comments
 (0)