]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: Add test for overriding global data value before load
authorToke Høiland-Jørgensen <toke@redhat.com>
Sun, 29 Mar 2020 13:22:53 +0000 (15:22 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Sun, 29 Mar 2020 23:17:35 +0000 (01:17 +0200)
commit33a3c25cc78c5cd4bc32bd3792a8ead161b89854
treed347b0b3979feee72d5b4a87edd55fb03a1fc0e8
parent8a1a2531f237bdc95ea26fe01f3e239ded1670b8
selftests: Add test for overriding global data value before load

This adds a test to exercise the new bpf_map__set_initial_value() function.
The test simply overrides the global data section with all zeroes, and
checks that the new value makes it into the kernel map on load.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200329132253.232541-2-toke@redhat.com
tools/testing/selftests/bpf/prog_tests/global_data_init.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_global_data.c