mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 06:33:07 +00:00
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>
This commit is contained in:
parent
cea6c4d969
commit
d9db1bb55f
1 changed files with 2 additions and 1 deletions
|
@ -640,7 +640,8 @@ TEST_F(hid_bpf, test_attach_detach)
|
||||||
|
|
||||||
/* pin the first program and immediately unpin it */
|
/* pin the first program and immediately unpin it */
|
||||||
#define PIN_PATH "/sys/fs/bpf/hid_first_event"
|
#define PIN_PATH "/sys/fs/bpf/hid_first_event"
|
||||||
bpf_program__pin(self->skel->progs.hid_first_event, PIN_PATH);
|
err = bpf_program__pin(self->skel->progs.hid_first_event, PIN_PATH);
|
||||||
|
ASSERT_OK(err) TH_LOG("error while calling bpf_program__pin");
|
||||||
remove(PIN_PATH);
|
remove(PIN_PATH);
|
||||||
#undef PIN_PATH
|
#undef PIN_PATH
|
||||||
usleep(100000);
|
usleep(100000);
|
||||||
|
|
Loading…
Reference in a new issue