Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+5
+5
tools/testing/selftests/hid/tests/base.py
··· 8 8 import libevdev 9 9 import os 10 10 import pytest 11 + import shutil 11 12 import subprocess 12 13 import time 13 14 ··· 240 239 script_dir = Path(os.path.dirname(os.path.realpath(__file__))) 241 240 root_dir = (script_dir / "../../../../..").resolve() 242 241 bpf_dir = root_dir / "drivers/hid/bpf/progs" 242 + 243 + udev_hid_bpf = shutil.which("udev-hid-bpf") 244 + if not udev_hid_bpf: 245 + pytest.skip("udev-hid-bpf not found in $PATH, skipping") 243 246 244 247 wait = False 245 248 for _, rdesc_fixup in self.hid_bpfs: