Skip to content

Commit 672a37d

Browse files
committed
selftests/bpf: Add selftests for netkit
Add a bigger batch of test coverage to assert correct operation of netkit devices and their BPF program management: # ./test_progs -t tc_netkit [...] [ 1.166267] bpf_testmod: loading out-of-tree module taints kernel. [ 1.166831] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel [ 1.270957] tsc: Refined TSC clocksource calibration: 3407.988 MHz [ 1.272579] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x311fc932722, max_idle_ns: 440795381586 ns [ 1.275336] clocksource: Switched to clocksource tsc torvalds#257 tc_netkit_basic:OK torvalds#258 tc_netkit_device:OK torvalds#259 tc_netkit_multi_links:OK torvalds#260 tc_netkit_multi_opts:OK torvalds#261 tc_netkit_neigh_links:OK Summary: 5/0 PASSED, 0 SKIPPED, 0 FAILED [...] Signed-off-by: Daniel Borkmann <[email protected]>
1 parent 0a2ea81 commit 672a37d

File tree

4 files changed

+705
-0
lines changed

4 files changed

+705
-0
lines changed

tools/testing/selftests/bpf/config

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ CONFIG_NETFILTER_SYNPROXY=y
7171
CONFIG_NETFILTER_XT_CONNMARK=y
7272
CONFIG_NETFILTER_XT_MATCH_STATE=y
7373
CONFIG_NETFILTER_XT_TARGET_CT=y
74+
CONFIG_NETKIT=y
7475
CONFIG_NF_CONNTRACK=y
7576
CONFIG_NF_CONNTRACK_MARK=y
7677
CONFIG_NF_DEFRAG_IPV4=y

tools/testing/selftests/bpf/prog_tests/tc_helpers.h

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
#define TC_HELPERS
55
#include <test_progs.h>
66

7+
#ifndef loopback
8+
# define loopback 1
9+
#endif
10+
711
static inline __u32 id_from_prog_fd(int fd)
812
{
913
struct bpf_prog_info prog_info = {};

0 commit comments

Comments
 (0)