• Andrey Ignatov's avatar
    selftests/bpf: Test bpf_sysctl_{get,set}_new_value helpers · 786047dd
    Andrey Ignatov authored
    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: default avatarAndrey Ignatov <rdna@fb.com>
    Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
    786047dd
test_sysctl.c 23.5 KB