On Thu, Aug 15, 2024 at 4:28 AM Jordan Rome <linux@xxxxxxxxxxxxxx> wrote: > > This adds tests for both the happy path and > the error path. > > Signed-off-by: Jordan Rome <linux@xxxxxxxxxxxxxx> > --- > .../selftests/bpf/prog_tests/attach_probe.c | 8 ++-- > .../selftests/bpf/prog_tests/read_vsyscall.c | 1 + > .../selftests/bpf/progs/read_vsyscall.c | 9 ++++- > .../selftests/bpf/progs/test_attach_probe.c | 38 +++++++++++++++++-- > 4 files changed, 49 insertions(+), 7 deletions(-) > As I mentioned in the first patch, it would be better to have a bit more extensive testing. All those rare conditions: - dst_size is zero - dst_size is one - string is empty - string exactly fits - string is truncated - plus various error conditions. > diff --git a/tools/testing/selftests/bpf/prog_tests/attach_probe.c b/tools/testing/selftests/bpf/prog_tests/attach_probe.c > index 7175af39134f..329c7862b52d 100644 > --- a/tools/testing/selftests/bpf/prog_tests/attach_probe.c > +++ b/tools/testing/selftests/bpf/prog_tests/attach_probe.c > @@ -283,9 +283,11 @@ static void test_uprobe_sleepable(struct test_attach_probe *skel) > trigger_func3(); > [...]