Skip to content

Commit

Permalink
selftests/bpf: Add selftests for meta
Browse files Browse the repository at this point in the history
Add a bigger batch of test coverage to assert correct operation of
meta device and its BPF program management:

  # ./vmtest.sh -- ./test_progs -t tc_meta
  [...]
  ./test_progs -t tc_meta
  [    1.211407] bpf_testmod: loading out-of-tree module taints kernel.
  [    1.211805] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel
  [    1.271692] tsc: Refined TSC clocksource calibration: 3407.989 MHz
  [    1.274015] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x311fc9c9451, max_idle_ns: 440795361646 ns
  [    1.275241] clocksource: Switched to clocksource tsc
  #255     tc_meta_basic:OK
  #256     tc_meta_device:OK
  #257     tc_meta_multi_links:OK
  #258     tc_meta_multi_opts:OK
  #259     tc_meta_neigh_links:OK
  Summary: 5/0 PASSED, 0 SKIPPED, 0 FAILED
  [...]

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
borkmann authored and Kernel Patches Daemon committed Sep 26, 2023
1 parent 4efa123 commit b6df942
Show file tree
Hide file tree
Showing 4 changed files with 668 additions and 0 deletions.
1 change: 1 addition & 0 deletions tools/testing/selftests/bpf/config
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ CONFIG_IPV6_TUNNEL=y
CONFIG_KEYS=y
CONFIG_LIRC=y
CONFIG_LWTUNNEL=y
CONFIG_META=y
CONFIG_MODULE_SIG=y
CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_MODULE_UNLOAD=y
Expand Down
4 changes: 4 additions & 0 deletions tools/testing/selftests/bpf/prog_tests/tc_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#define TC_HELPERS
#include <test_progs.h>

#ifndef loopback
# define loopback 1
#endif

static inline __u32 id_from_prog_fd(int fd)
{
struct bpf_prog_info prog_info = {};
Expand Down
Loading

0 comments on commit b6df942

Please sign in to comment.