selftests/bpf: Add test cases for bpf_strncmp()
authorHou Tao <houtao1@huawei.com>
Fri, 10 Dec 2021 14:16:52 +0000 (22:16 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 12 Dec 2021 01:40:23 +0000 (17:40 -0800)
commitbdbee82beca4514496c52a2dc035f2a26f0c1b88
tree8f12996f3395a51aed6906f48497ca3be84da125
parent9c42652f8be3202ad11cf4fbc358688003cff21c
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
tools/testing/selftests/bpf/prog_tests/test_strncmp.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/strncmp_test.c [new file with mode: 0644]