On Fri, Nov 1, 2019 at 2:53 AM Toke Høiland-Jørgensen <toke@xxxxxxxxxx> wrote: > > From: Toke Høiland-Jørgensen <toke@xxxxxxxxxx> > > This adds a new BPF selftest to exercise the new automatic map pinning > code. > > Acked-by: Andrii Nakryiko <andriin@xxxxxx> I don't believe I acked this patch before, must have been added by mistake. But either way thanks for improving tests and testing a good variety of scenarios, I appreciate the work. Please fix bpf_object leak below and keep my Acked-by :) > Signed-off-by: Toke Høiland-Jørgensen <toke@xxxxxxxxxx> > --- > tools/testing/selftests/bpf/prog_tests/pinning.c | 208 ++++++++++++++++++++ > tools/testing/selftests/bpf/progs/test_pinning.c | 31 +++ > .../selftests/bpf/progs/test_pinning_invalid.c | 16 ++ > 3 files changed, 255 insertions(+) > create mode 100644 tools/testing/selftests/bpf/prog_tests/pinning.c > create mode 100644 tools/testing/selftests/bpf/progs/test_pinning.c > create mode 100644 tools/testing/selftests/bpf/progs/test_pinning_invalid.c > [...] > + /* should fail because of map parameter mismatch */ > + err = bpf_object__load(obj); > + if (CHECK(err != -EINVAL, "param mismatch load", "err %d errno %d\n", err, errno)) > + goto out; > + You need to close obj here, before overwriting it below? > + /* test auto-pinning at custom path with open opt */ > + obj = bpf_object__open_file(file, &opts); > + if (CHECK_FAIL(libbpf_get_error(obj))) { > + obj = NULL; > + goto out; > + } [...]