linux/tools/testing/selftests
Andrey Ignatov 5ecd8c2273 selftests/bpf: Selftest for bpf_skb_ancestor_cgroup_id
Add selftests for bpf_skb_ancestor_cgroup_id helper.

test_skb_cgroup_id.sh prepares testing interface and adds tc qdisc and
filter for it using BPF object compiled from test_skb_cgroup_id_kern.c
program.

BPF program in test_skb_cgroup_id_kern.c gets ancestor cgroup id using
the new helper at different levels of cgroup hierarchy that skb belongs
to, including root level and non-existing level, and saves it to the map
where the key is the level of corresponding cgroup and the value is its
id.

To trigger BPF program, user space program test_skb_cgroup_id_user is
run. It adds itself into testing cgroup and sends UDP datagram to
link-local multicast address of testing interface. Then it reads cgroup
ids saved in kernel for different levels from the BPF map and compares
them with those in user space. They must be equal for every level of
ancestry.

Example of run:
  # ./test_skb_cgroup_id.sh
  Wait for testing link-local IP to become available ... OK
  Note: 8 bytes struct bpf_elf_map fixup performed due to size mismatch!
  [PASS]

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2018-08-13 01:02:40 +02:00
..
android selftests: android: ion: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
bpf selftests/bpf: Selftest for bpf_skb_ancestor_cgroup_id 2018-08-13 01:02:40 +02:00
breakpoints selftests: breakpoints: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
capabilities License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cgroup kselftest/cgroup: fix a signedness bug 2018-06-07 13:44:30 -06:00
cpu-hotplug selftests: cpu-hotplug: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
cpufreq selftests: cpufreq: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
drivers selftests: mlxsw: Add TC flower test for Spectrum-2 2018-08-09 10:36:10 -07:00
efivarfs selftests: efivarfs: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
exec selftests: exec: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
filesystems selftests: filesystems: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
firmware selftests: firmware: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
ftrace selftests/ftrace: Add snapshot and tracing_on test case 2018-07-25 10:29:42 -04:00
futex selftests: futex: delete RUN_TESTS and EMIT_TESTS overrides 2018-05-30 15:21:52 -06:00
gpio selftests: gpio: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
ia64 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
intel_pstate selftests: intel_pstate: notification about privilege required to run intel_pstate testing script 2018-05-30 21:31:31 -06:00
ipc selftests: ipc: return Kselftest Skip code for skipped tests 2018-05-30 15:21:53 -06:00
kcmp License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kmod selftests: kmod: return Kselftest Skip code for skipped tests 2018-05-30 15:21:53 -06:00
kvm selftests: kvm: return Kselftest Skip code for skipped tests 2018-05-30 15:29:05 -06:00
lib selftests: lib: fix prime_numbers module search and skip logic 2018-05-30 21:32:55 -06:00
locking selftests: locking: return Kselftest Skip code for skipped tests 2018-05-30 15:29:06 -06:00
media_tests selftests: media_tests: return Kselftest Skip code for skipped tests 2018-05-30 15:29:06 -06:00
membarrier selftests: membarrier: return Kselftest Skip code for skipped tests 2018-05-30 15:29:06 -06:00
memfd selftests: memfd: split regular and hugetlbfs tests 2018-05-30 15:29:06 -06:00
memory-hotplug selftests: memory-hotplug: return Kselftest Skip code for skipped tests 2018-05-30 15:29:06 -06:00
mount selftests: mount: delete RUN_TESTS and EMIT_TESTS overrides 2018-05-30 15:21:52 -06:00
mqueue selftests: mqueue: return Kselftest Skip code for skipped tests 2018-05-30 15:29:06 -06:00
net selftests: forwarding: gre_multipath: Update next-hop statistics match criteria 2018-08-07 16:02:30 -07:00
networking/timestamping selftests/txtimestamp: Add more configurable parameters 2018-03-16 15:05:57 -04:00
nsfs tools/testing: Fix trailing semicolon 2018-01-12 11:41:33 -07:00
ntb NTB: ntb_test: Update ntb_perf tests 2018-01-28 22:17:24 -05:00
powerpc selftests/powerpc: Add perf breakpoint test 2018-06-03 21:16:44 +10:00
prctl License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
proc tools/testing/selftests/proc: test /proc/*/fd a bit (+ PF_KTHREAD is ABI!) 2018-06-07 17:34:38 -07:00
pstore selftests: pstore: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
ptp posix-timers: Prevent UB from shifting negative signed value 2018-01-04 14:57:10 +01:00
ptrace License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rcutorture torture: Make kvm-find-errors.sh find build warnings 2018-05-15 10:32:25 -07:00
rseq rseq/selftests: cleanup: Update comment above rseq_prepare_unload 2018-07-10 22:18:52 +02:00
rtc selftests: rtc: rework rtctest 2018-05-30 15:21:51 -06:00
seccomp seccomp: Add filter flag to opt-out of SSB mitigation 2018-05-05 00:51:44 +02:00
sigaltstack License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
size
sparc64 selftests: sparc64: Add missing SPDX License Identifiers 2018-06-18 09:29:20 -06:00
splice License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
static_keys selftests: static_keys: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
sync selftests: sync: add config fragment for testing sync framework 2018-06-18 09:11:10 -06:00
sysctl selftests: sysctl: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
tc-testing tc-tests: initial version of nat action unit tests 2018-08-07 15:55:38 -07:00
timers selftests: move RTC tests to rtc subfolder 2018-05-30 15:21:51 -06:00
uevent selftests: uevent filtering 2018-05-23 15:24:22 -04:00
user selftests: user: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
vDSO selftest/vDSO: fix O= 2018-02-13 11:35:01 -07:00
vm selftests: vm: return Kselftest Skip code for skipped tests 2018-06-18 09:11:10 -06:00
watchdog License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
x86 selftests/x86/sigreturn: Do minor cleanups 2018-06-27 09:36:56 +02:00
zram selftests: zram: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
.gitignore
gen_kselftest_tar.sh selftests: gen_kselftest_tar.h: Add SPDX license identifier 2018-01-12 11:44:31 -07:00
kselftest.h selftests: kselftest: change KSFT_SKIP=4 instead of KSFT_PASS 2018-05-30 15:21:52 -06:00
kselftest_harness.h selftests/seccomp: Allow get_metadata to XFAIL 2018-03-21 10:42:46 -06:00
kselftest_install.sh selftests: kselftest_install.sh: Add SPDX license identifier 2018-01-12 11:45:05 -07:00
lib.mk Merge branch 'core-rseq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-06-10 10:17:09 -07:00
Makefile Merge branch 'core-rseq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-06-10 10:17:09 -07:00