* [PATCH bpf-next] selftests/bpf: don't check for btf fd in test_btf
@ 2020-01-18 1:05 Stanislav Fomichev
2020-01-18 4:45 ` John Fastabend
2020-01-20 22:16 ` Daniel Borkmann
0 siblings, 2 replies; 3+ messages in thread
From: Stanislav Fomichev @ 2020-01-18 1:05 UTC (permalink / raw)
To: netdev, bpf; +Cc: davem, ast, daniel, Stanislav Fomichev
After commit 0d13bfce023a ("libbpf: Don't require root for
bpf_object__open()") we no longer load BTF during bpf_object__open(),
so let's remove the expectation from test_btf that the fd is not -1.
The test currently fails.
Before:
BTF libbpf test[1] (test_btf_haskv.o): do_test_file:4152:FAIL bpf_object__btf_fd: -1
BTF libbpf test[2] (test_btf_newkv.o): do_test_file:4152:FAIL bpf_object__btf_fd: -1
BTF libbpf test[3] (test_btf_nokv.o): do_test_file:4152:FAIL bpf_object__btf_fd: -1
After:
BTF libbpf test[1] (test_btf_haskv.o): OK
BTF libbpf test[2] (test_btf_newkv.o): OK
BTF libbpf test[3] (test_btf_nokv.o): OK
Fixes: 0d13bfce023a ("libbpf: Don't require root forbpf_object__open()")
Signed-off-by: Stanislav Fomichev <sdf@google.com>
---
tools/testing/selftests/bpf/test_btf.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_btf.c b/tools/testing/selftests/bpf/test_btf.c
index 3d617e806054..93040ca83e60 100644
--- a/tools/testing/selftests/bpf/test_btf.c
+++ b/tools/testing/selftests/bpf/test_btf.c
@@ -4148,10 +4148,6 @@ static int do_test_file(unsigned int test_num)
if (CHECK(IS_ERR(obj), "obj: %ld", PTR_ERR(obj)))
return PTR_ERR(obj);
- err = bpf_object__btf_fd(obj);
- if (CHECK(err == -1, "bpf_object__btf_fd: -1"))
- goto done;
-
prog = bpf_program__next(NULL, obj);
if (CHECK(!prog, "Cannot find bpf_prog")) {
err = -1;
--
2.25.0.341.g760bfbb309-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH bpf-next] selftests/bpf: don't check for btf fd in test_btf
2020-01-18 1:05 [PATCH bpf-next] selftests/bpf: don't check for btf fd in test_btf Stanislav Fomichev
@ 2020-01-18 4:45 ` John Fastabend
2020-01-20 22:16 ` Daniel Borkmann
1 sibling, 0 replies; 3+ messages in thread
From: John Fastabend @ 2020-01-18 4:45 UTC (permalink / raw)
To: Stanislav Fomichev, netdev, bpf; +Cc: davem, ast, daniel, Stanislav Fomichev
Stanislav Fomichev wrote:
> After commit 0d13bfce023a ("libbpf: Don't require root for
> bpf_object__open()") we no longer load BTF during bpf_object__open(),
> so let's remove the expectation from test_btf that the fd is not -1.
> The test currently fails.
>
> Before:
> BTF libbpf test[1] (test_btf_haskv.o): do_test_file:4152:FAIL bpf_object__btf_fd: -1
> BTF libbpf test[2] (test_btf_newkv.o): do_test_file:4152:FAIL bpf_object__btf_fd: -1
> BTF libbpf test[3] (test_btf_nokv.o): do_test_file:4152:FAIL bpf_object__btf_fd: -1
>
> After:
> BTF libbpf test[1] (test_btf_haskv.o): OK
> BTF libbpf test[2] (test_btf_newkv.o): OK
> BTF libbpf test[3] (test_btf_nokv.o): OK
>
> Fixes: 0d13bfce023a ("libbpf: Don't require root forbpf_object__open()")
> Signed-off-by: Stanislav Fomichev <sdf@google.com>
> ---
Acked-by: John Fastabend <john.fastabend@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next] selftests/bpf: don't check for btf fd in test_btf
2020-01-18 1:05 [PATCH bpf-next] selftests/bpf: don't check for btf fd in test_btf Stanislav Fomichev
2020-01-18 4:45 ` John Fastabend
@ 2020-01-20 22:16 ` Daniel Borkmann
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2020-01-20 22:16 UTC (permalink / raw)
To: Stanislav Fomichev, netdev, bpf; +Cc: davem, ast
On 1/18/20 2:05 AM, Stanislav Fomichev wrote:
> After commit 0d13bfce023a ("libbpf: Don't require root for
> bpf_object__open()") we no longer load BTF during bpf_object__open(),
> so let's remove the expectation from test_btf that the fd is not -1.
> The test currently fails.
>
> Before:
> BTF libbpf test[1] (test_btf_haskv.o): do_test_file:4152:FAIL bpf_object__btf_fd: -1
> BTF libbpf test[2] (test_btf_newkv.o): do_test_file:4152:FAIL bpf_object__btf_fd: -1
> BTF libbpf test[3] (test_btf_nokv.o): do_test_file:4152:FAIL bpf_object__btf_fd: -1
>
> After:
> BTF libbpf test[1] (test_btf_haskv.o): OK
> BTF libbpf test[2] (test_btf_newkv.o): OK
> BTF libbpf test[3] (test_btf_nokv.o): OK
>
> Fixes: 0d13bfce023a ("libbpf: Don't require root forbpf_object__open()")
> Signed-off-by: Stanislav Fomichev <sdf@google.com>
Applied, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-01-20 22:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-18 1:05 [PATCH bpf-next] selftests/bpf: don't check for btf fd in test_btf Stanislav Fomichev
2020-01-18 4:45 ` John Fastabend
2020-01-20 22:16 ` Daniel Borkmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).