selftests: mptcp: add evts_get_info helper
authorGeliang Tang <geliang.tang@suse.com>
Tue, 28 Nov 2023 23:18:46 +0000 (15:18 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 30 Nov 2023 04:06:17 +0000 (20:06 -0800)
commit06848c0f341ee3f9226ed01e519c72e4d2b6f001
tree1716d596df10b2c6b62bcb560fb4711a63b0d7fd
parent6ebf6f90ab4ac09a76172a6d387e8819d3259595
selftests: mptcp: add evts_get_info helper

This patch adds a new helper get_info_value(), using 'sed' command to
parse the value of the given item name in the line with the given keyword,
to make chk_mptcp_info() and pedit_action_pkts() more readable.

Also add another helper evts_get_info() to use get_info_value() to parse
the output of 'pm_nl_ctl events' command, to make all the userspace pm
selftests more readable, both in mptcp_join.sh and userspace_pm.sh.

Reviewed-by: Matthieu Baerts <matttbe@kernel.org>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Signed-off-by: Mat Martineau <martineau@kernel.org>
Link: https://lore.kernel.org/r/20231128-send-net-next-2023107-v4-2-8d6b94150f6b@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/mptcp/mptcp_join.sh
tools/testing/selftests/net/mptcp/mptcp_lib.sh
tools/testing/selftests/net/mptcp/userspace_pm.sh