selftests/bpf: Add test cases for bpf_strncmp()

Four test cases are added:
(1) ensure the return value is expected
(2) ensure no const string size is rejected
(3) ensure writable target is rejected
(4) ensure no null-terminated target is rejected

Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211210141652.877186-5-houtao1@huawei.com
This commit is contained in:
Hou Tao 2021-12-10 22:16:52 +08:00 • committed by Alexei Starovoitov
commit bdbee82bec
2 changed files with 221 additions and 0 deletions