summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/hid
diff options
context:
space:
mode:
authorBenjamin Tissoires <bentiss@kernel.org>2024-05-06 16:36:12 +0200
committerBenjamin Tissoires <bentiss@kernel.org>2024-05-07 15:39:58 +0200
commit89ea968a9d759f71ac7b8d50949a8e5e5bcb1111 (patch)
tree4323a95fbcc36568a41235c3b4b28da5670230d7 /tools/testing/selftests/hid
parentb22cbfb42c19a378cca5fae3a98395225af05384 (diff)
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>
Diffstat (limited to 'tools/testing/selftests/hid')
-rw-r--r--tools/testing/selftests/hid/tests/base.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/hid/tests/base.py b/tools/testing/selftests/hid/tests/base.py
index 2d006c0f5fcd..3a465768e507 100644
--- a/tools/testing/selftests/hid/tests/base.py
+++ b/tools/testing/selftests/hid/tests/base.py
@@ -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: