Skip to content

Commit 89ea968

Browse files
author
Benjamin Tissoires
committed
selftests/hid: skip tests with HID-BPF if udev-hid-bpf is not installed
udev-hid-bpf is still not installed everywhere, and we should probably not assume it is installed automatically. Link: https://lore.kernel.org/r/20240506143612.148031-1-bentiss@kernel.org Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
1 parent b22cbfb commit 89ea968

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • tools/testing/selftests/hid/tests

tools/testing/selftests/hid/tests/base.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import libevdev
99
import os
1010
import pytest
11+
import shutil
1112
import subprocess
1213
import time
1314

@@ -240,6 +241,10 @@ def load_hid_bpfs(self):
240241
root_dir = (script_dir / "../../../../..").resolve()
241242
bpf_dir = root_dir / "drivers/hid/bpf/progs"
242243

244+
udev_hid_bpf = shutil.which("udev-hid-bpf")
245+
if not udev_hid_bpf:
246+
pytest.skip("udev-hid-bpf not found in $PATH, skipping")
247+
243248
wait = False
244249
for _, rdesc_fixup in self.hid_bpfs:
245250
if rdesc_fixup:

0 commit comments

Comments
 (0)