Skip to content

Commit 77442ff

Browse files
fmaurer-rhmarckleinebudde
authored andcommitted
selftests: can: Import tst-filter from can-tests
Tests for the can subsystem have been in the can-tests repository[1] so far. Start moving the tests to kernel selftests by importing the current tst-filter test. The test is now named test_raw_filter and is substantially updated to be more aligned with the kernel selftests, follow the coding style, and simplify the validation of received CAN frames. We also include documentation of the test design. The test verifies that the single filters on raw CAN sockets work as expected. We intend to import more tests from can-tests and add additional test cases in the future. The goal of moving the CAN selftests into the tree is to align the tests more closely with the kernel, improve testing of CAN in general, and to simplify running the tests automatically in the various kernel CI systems. [1]: https://github.com/linux-can/can-tests Signed-off-by: Felix Maurer <[email protected]> Reviewed-by: Vincent Mailhol <[email protected]> Link: https://patch.msgid.link/87d289f333cba7bbcc9d69173ea1c320e4b5c3b8.1747833283.git.fmaurer@redhat.com Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent b803c4a commit 77442ff

File tree

6 files changed

+458
-0
lines changed

6 files changed

+458
-0
lines changed

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5267,6 +5267,7 @@ F: include/uapi/linux/can/isotp.h
52675267
F: include/uapi/linux/can/raw.h
52685268
F: net/can/
52695269
F: net/sched/em_canid.c
5270+
F: tools/testing/selftests/net/can/
52705271

52715272
CAN-J1939 NETWORK LAYER
52725273
M: Robin van der Gracht <[email protected]>
@@ -17042,6 +17043,7 @@ X: net/ceph/
1704217043
X: net/mac80211/
1704317044
X: net/rfkill/
1704417045
X: net/wireless/
17046+
X: tools/testing/selftests/net/can/
1704517047

1704617048
NETWORKING [IPSEC]
1704717049
M: Steffen Klassert <[email protected]>

tools/testing/selftests/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ TARGETS += mseal_system_mappings
6666
TARGETS += nci
6767
TARGETS += net
6868
TARGETS += net/af_unix
69+
TARGETS += net/can
6970
TARGETS += net/forwarding
7071
TARGETS += net/hsr
7172
TARGETS += net/mptcp
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
test_raw_filter
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
top_srcdir = ../../../../..
4+
5+
CFLAGS += -Wall -Wl,--no-as-needed -O2 -g -I$(top_srcdir)/usr/include $(KHDR_INCLUDES)
6+
7+
TEST_PROGS := test_raw_filter.sh
8+
9+
TEST_GEN_FILES := test_raw_filter
10+
11+
include ../../lib.mk

0 commit comments

Comments
 (0)