selftests/bpf: Test bpf_sysctl_{get,set}_new_value helpers
authorAndrey Ignatov <rdna@fb.com>
Fri, 8 Mar 2019 23:22:03 +0000 (15:22 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 12 Apr 2019 20:54:59 +0000 (13:54 -0700)
commit786047dd08de3334722af036e2827ce3b34205cc
tree1278e008d968e38c7539f0c0ad76a28bc2450271
parent11ff34f74e32f5a4ec1f71621508789cd60775b3
selftests/bpf: Test bpf_sysctl_{get,set}_new_value helpers

Test that new value provided by user space on sysctl write can be read
by bpf_sysctl_get_new_value and overridden by bpf_sysctl_set_new_value.

  # ./test_sysctl
  ...
  Test case: sysctl_get_new_value sysctl:read EINVAL .. [PASS]
  Test case: sysctl_get_new_value sysctl:write ok .. [PASS]
  Test case: sysctl_get_new_value sysctl:write ok long .. [PASS]
  Test case: sysctl_get_new_value sysctl:write E2BIG .. [PASS]
  Test case: sysctl_set_new_value sysctl:read EINVAL .. [PASS]
  Test case: sysctl_set_new_value sysctl:write ok .. [PASS]
  Summary: 22 PASSED, 0 FAILED

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/test_sysctl.c