lib/Kselftests/parsers/net/run_afpackettests.pm

parse_line

parse_line($string);

run_afpackettests (and run_netsocktests) announce a subtest with 'echo "running NAME test"', then run the test binary, whose own verbose output comes in between, and finally print the bracketed status alone on its own line once the binary exits, e.g.:

# running psock_fanout test
# --------------------
# ... (output from the psock_fanout binary) ...
# [PASS]

The subtest name from the last 'running ... test' line is kept and used once the bracketed status line shows up. A SKIP status is left untouched rather than converted (see net.pm).