All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH can-next v2 0/9] selftests: can: add J1939 socket and transport tests
@ 2026-11-04 16:17 Oleksij Rempel
  2026-11-04 16:17 ` [PATCH can-next v2 1/9] selftests: can: install net/lib.sh with the CAN tests Oleksij Rempel
                   ` (9 more replies)
  0 siblings, 10 replies; 19+ messages in thread
From: Oleksij Rempel @ 2026-11-04 16:17 UTC (permalink / raw)
  To: Robin van der Gracht, Oliver Hartkopp, Marc Kleine-Budde,
	Shuah Khan
  Cc: kernel, linux-can, linux-kernel, linux-kselftest, Felix Maurer,
	Vincent Mailhol, Alexander Hölzl, Quchaosheng, Tetsuo Handa,
	Oleksij Rempel

net/can/j1939 has had no in-tree selftests. This series adds a kselftest
suite for the J1939 socket layer and the TP/ETP transport, run on vcan with
a CAN_RAW socket as an independent on-the-wire peer.

The timer checks are relaxed by default, for slow CI machines;
J1939_STRICT_TIMING selects tight bounds. Not covered yet: the ETP abort
and timeout paths, and a received Connection Abort on a kernel TX
session, which the stack currently ignores.

Known issue: the stack updates a session from the loopback echo of its
own CTS, RTS and DT frames, and a CAN_RAW peer can see that echo before
the stack does. A peer frame that follows quickly can then cancel the
session and fail a multi test. I have not seen this in QEMU runs. The fix
belongs in the stack, not in these tests.

I used an LLM coding assistant to write most of the test code and to
review it. I have read, edited and run all of it myself, on vcan under
QEMU.

v1: https://lore.kernel.org/all/20261014154435.3577983-1-o.rempel@pengutronix.de/

---
Oleksij Rempel (9):
      selftests: can: install net/lib.sh with the CAN tests
      selftests: can: add J1939 test helper header and library
      selftests: can: add J1939 base functional tests
      selftests: can: add J1939 socket option and metadata tests
      selftests: can: add J1939 addressing and concurrency tests
      selftests: can: add J1939 wire-format tests against CAN_RAW
      selftests: can: add J1939 TP/ETP multi-frame tests against CAN_RAW
      selftests: can: cover J1939 transport abort and timeout paths
      selftests: can: check SO_J1939_PROMISC receive effect

 tools/testing/selftests/net/can/.gitignore         |   5 +
 tools/testing/selftests/net/can/Makefile           |  18 +-
 tools/testing/selftests/net/can/config             |   2 +
 tools/testing/selftests/net/can/j1939_lib.sh       |  86 ++
 tools/testing/selftests/net/can/j1939_tests.h      | 804 +++++++++++++++++++
 tools/testing/selftests/net/can/test_j1939_addr.c  | 679 ++++++++++++++++
 tools/testing/selftests/net/can/test_j1939_addr.sh |   4 +
 tools/testing/selftests/net/can/test_j1939_base.c  | 180 +++++
 tools/testing/selftests/net/can/test_j1939_base.sh |   4 +
 tools/testing/selftests/net/can/test_j1939_multi.c | 869 +++++++++++++++++++++
 .../testing/selftests/net/can/test_j1939_multi.sh  |   4 +
 tools/testing/selftests/net/can/test_j1939_opts.c  | 326 ++++++++
 tools/testing/selftests/net/can/test_j1939_opts.sh |   4 +
 tools/testing/selftests/net/can/test_j1939_wire.c  | 186 +++++
 tools/testing/selftests/net/can/test_j1939_wire.sh |   4 +
 15 files changed, 3173 insertions(+), 2 deletions(-)
---
base-commit: 734bef548a96e8774d6eef5dfa2026c6edc4e80b
change-id: 20261104-j1939-selftests-12fc860698c0

Best regards,
-- 
Oleksij Rempel <o.rempel@pengutronix.de>


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

end of thread, other threads:[~2026-11-06 10:30 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04 16:17 [PATCH can-next v2 0/9] selftests: can: add J1939 socket and transport tests Oleksij Rempel
2026-11-04 16:17 ` [PATCH can-next v2 1/9] selftests: can: install net/lib.sh with the CAN tests Oleksij Rempel
2026-11-04 16:17 ` [PATCH can-next v2 2/9] selftests: can: add J1939 test helper header and library Oleksij Rempel
2026-11-04 16:37   ` sashiko-bot
2026-11-06  5:35   ` netdev-bot+sashiko
2026-11-04 16:17 ` [PATCH can-next v2 3/9] selftests: can: add J1939 base functional tests Oleksij Rempel
2026-11-06  5:35   ` netdev-bot+sashiko
2026-11-04 16:17 ` [PATCH can-next v2 4/9] selftests: can: add J1939 socket option and metadata tests Oleksij Rempel
2026-11-06  5:35   ` netdev-bot+sashiko
2026-11-04 16:17 ` [PATCH can-next v2 5/9] selftests: can: add J1939 addressing and concurrency tests Oleksij Rempel
2026-11-06  5:35   ` netdev-bot+sashiko
2026-11-04 16:17 ` [PATCH can-next v2 6/9] selftests: can: add J1939 wire-format tests against CAN_RAW Oleksij Rempel
2026-11-06  5:35   ` netdev-bot+sashiko
2026-11-04 16:17 ` [PATCH can-next v2 7/9] selftests: can: add J1939 TP/ETP multi-frame " Oleksij Rempel
2026-11-06  5:35   ` netdev-bot+sashiko
2026-11-04 16:17 ` [PATCH can-next v2 8/9] selftests: can: cover J1939 transport abort and timeout paths Oleksij Rempel
2026-11-04 16:17 ` [PATCH can-next v2 9/9] selftests: can: check SO_J1939_PROMISC receive effect Oleksij Rempel
2026-11-06  5:35   ` netdev-bot+sashiko
2026-11-06 10:30 ` [PATCH can-next v2 0/9] selftests: can: add J1939 socket and transport tests Oleksij Rempel

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.