All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-next] selftests: mptcp: verify nft JSON support
@ 2026-10-08 10:00 Hangbin Liu
  2026-10-08 11:00 ` MPTCP CI
  2026-10-08 11:09 ` Matthieu Baerts
  0 siblings, 2 replies; 7+ messages in thread
From: Hangbin Liu @ 2026-10-08 10:00 UTC (permalink / raw)
  To: MPTCP Linux; +Cc: Hangbin Liu, Hangbin Liu

From: Hangbin Liu <liuhangbin@kylinos.cn>

Use --version to check for nft presence, as older nft versions reject -V.
Ensure the nft tool has JSON support, since we need JSON output for
parsing with jq.

Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
---
 tools/testing/selftests/net/mptcp/mptcp_lib.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
index 0559bb168203..e5896bfc75d6 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
@@ -528,7 +528,14 @@ mptcp_lib_check_tools() {
 				exit ${KSFT_SKIP}
 			fi
 			;;
-		"nft" | "jq")
+		"nft")
+			if ! nft --version &> /dev/null || \
+				! nft -j list ruleset &> /dev/null; then
+				mptcp_lib_pr_skip "nft tool does not support MPTCP"
+				exit ${KSFT_SKIP}
+			fi
+			;;
+		"jq")
 			if ! "${tool}" -V &> /dev/null; then
 				mptcp_lib_pr_skip "Could not run all tests without ${tool}"
 				exit ${KSFT_SKIP}

---
base-commit: 9651c766735c19e7a6b90d731bab53ef7959def8
change-id: 20261008-mptcp_nft_version-9865d63066bf

Best regards,
-- 
Hangbin Liu <liuhangbin@kylinos.cn>


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-10-08 13:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-08 10:00 [PATCH mptcp-next] selftests: mptcp: verify nft JSON support Hangbin Liu
2026-10-08 11:00 ` MPTCP CI
2026-10-08 11:09 ` Matthieu Baerts
2026-10-08 11:55   ` Matthieu Baerts
2026-10-08 13:23     ` hangbin.liu
2026-10-08 13:45   ` hangbin.liu
2026-10-08 13:48     ` Matthieu Baerts

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.