Skip to content

Commit d9db1bb

Browse files
bentissJiri Kosina
authored andcommitted
selftests: hid: ensure the program is correctly pinned
Turns out that if bpffs was not mounted, the test was silently passing. So ensure it passes by checking the mount command result. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent cea6c4d commit d9db1bb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tools/testing/selftests/hid/hid_bpf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,8 @@ TEST_F(hid_bpf, test_attach_detach)
640640

641641
/* pin the first program and immediately unpin it */
642642
#define PIN_PATH "/sys/fs/bpf/hid_first_event"
643-
bpf_program__pin(self->skel->progs.hid_first_event, PIN_PATH);
643+
err = bpf_program__pin(self->skel->progs.hid_first_event, PIN_PATH);
644+
ASSERT_OK(err) TH_LOG("error while calling bpf_program__pin");
644645
remove(PIN_PATH);
645646
#undef PIN_PATH
646647
usleep(100000);

0 commit comments

Comments
 (0)