Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: mptcp: diag: unique 'cestab' subtest names

It is important to have a unique (sub)test name in TAP, because some CI
environments drop tests with duplicated name.

Some 'cestab' subtests from the diag selftest had the same names, e.g.:

....chk 0 cestab

Now the previous value is taken, to have different names, e.g.:

....chk 2->0 cestab after flush

While at it, the 'after flush' info is added, similar to what is done
with the 'in use' subtests. Also inspired by these 'in use' subtests,
'many' is displayed instead of a large number:

many msk socket present [ ok ]
....chk many msk in use [ ok ]
....chk many cestab [ ok ]
....chk many->0 msk in use after flush [ ok ]
....chk many->0 cestab after flush [ ok ]

Fixes: 81ab772819da ("selftests: mptcp: diag: check CURRESTAB counters")
Cc: stable@vger.kernel.org
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Matthieu Baerts (NGI0) and committed by
David S. Miller
4103d848 645c1dc9

+11 -6
+11 -6
tools/testing/selftests/net/mptcp/diag.sh
··· 189 189 # $1: cestab nr 190 190 chk_msk_cestab() 191 191 { 192 - local cestab=$1 192 + local expected=$1 193 + local msg="....chk ${2:-${expected}} cestab" 194 + 195 + if [ "${expected}" -eq 0 ]; then 196 + msg+=" after flush" 197 + fi 193 198 194 199 __chk_nr "mptcp_lib_get_counter ${ns} MPTcpExtMPCurrEstab" \ 195 - "${cestab}" "....chk ${cestab} cestab" "" 200 + "${expected}" "${msg}" "" 196 201 } 197 202 198 203 wait_connected() ··· 241 236 flush_pids 242 237 243 238 chk_msk_inuse 0 "2->0" 244 - chk_msk_cestab 0 239 + chk_msk_cestab 0 "2->0" 245 240 246 241 echo "a" | \ 247 242 timeout ${timeout_test} \ ··· 261 256 flush_pids 262 257 263 258 chk_msk_inuse 0 "1->0" 264 - chk_msk_cestab 0 259 + chk_msk_cestab 0 "1->0" 265 260 266 261 NR_CLIENTS=100 267 262 for I in `seq 1 $NR_CLIENTS`; do ··· 283 278 284 279 wait_msk_nr $((NR_CLIENTS*2)) "many msk socket present" 285 280 chk_msk_inuse $((NR_CLIENTS*2)) "many" 286 - chk_msk_cestab $((NR_CLIENTS*2)) 281 + chk_msk_cestab $((NR_CLIENTS*2)) "many" 287 282 flush_pids 288 283 289 284 chk_msk_inuse 0 "many->0" 290 - chk_msk_cestab 0 285 + chk_msk_cestab 0 "many->0" 291 286 292 287 mptcp_lib_result_print_all_tap 293 288 exit $ret