parse_line($string);
Most of the net selftests share the log_test_result() helper from net/lib.sh, which prints one line per subtest, for example:
# TEST: IPv4 packets over UDPv4 [ OK ]
# TEST: rule6 check: oif redirect to table [ OK ]
This is used as the default parser for the whole 'net' collection, so every test relying on this helper (e.g. 'bareudp.sh', 'pmtu.sh' or 'fib_rule_tests.sh') gets valid KTAP subtest results without needing an individual parser.
A few older scripts (e.g. 'rtnetlink.sh' or 'netdevice.sh') use their own, simpler log_test(), printing lines such as:
# PASS: bridge setup
# FAIL: bridge_parent_id
# XFAIL: veth0: ethtool dump not supported
These are recognized as well. Lines that do not match either format are returned unchanged.