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>
This commit is contained in:
Benjamin Tissoires 2024-05-06 16:36:12 +02:00
parent b22cbfb42c
commit 89ea968a9d

View File

@ -8,6 +8,7 @@
import libevdev
import os
import pytest
import shutil
import subprocess
import time
@ -240,6 +241,10 @@ class BaseTestCase:
root_dir = (script_dir / "../../../../..").resolve()
bpf_dir = root_dir / "drivers/hid/bpf/progs"
udev_hid_bpf = shutil.which("udev-hid-bpf")
if not udev_hid_bpf:
pytest.skip("udev-hid-bpf not found in $PATH, skipping")
wait = False
for _, rdesc_fixup in self.hid_bpfs:
if rdesc_fixup: