diff mbox series

[19/18] selftests/hid: skip tests with HID-BPF if udev-hid-bpf is not installed

Message ID 20240506143612.148031-1-bentiss@kernel.org
State Accepted
Commit 89ea968a9d759f71ac7b8d50949a8e5e5bcb1111
Headers show
Series [01/18] HID: do not assume HAT Switch logical max < 8 | expand

Commit Message

Benjamin Tissoires May 6, 2024, 2:36 p.m. UTC
From: Benjamin Tissoires <bentiss@kernel.org>

udev-hid-bpf is still not installed everywhere, and we should probably
not assume it is installed automatically.

Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
---

I wanted to apply this series given that it wasn't reviewed in a month,
but I thought that maybe I should not enforce ude-hid-bpf to be
installed everywhere.

I'll probably push this series tomorrow so it makes the 6.10 cut.

Cheers,
Benjamin

 tools/testing/selftests/hid/tests/base.py | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Peter Hutterer May 7, 2024, 5:43 a.m. UTC | #1
On Mon, May 06, 2024 at 04:36:12PM +0200, bentiss@kernel.org wrote:
> From: Benjamin Tissoires <bentiss@kernel.org>
> 
> udev-hid-bpf is still not installed everywhere, and we should probably
> not assume it is installed automatically.
> 
> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
> ---
> 
> I wanted to apply this series given that it wasn't reviewed in a month,

apologies. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

(I have a few improvement suggestions for the hidtools code but it's
better to do those there and then sync back).

Cheers,
  Peter

> but I thought that maybe I should not enforce ude-hid-bpf to be
> installed everywhere.
> 
> I'll probably push this series tomorrow so it makes the 6.10 cut.
> 
> Cheers,
> Benjamin
> 
>  tools/testing/selftests/hid/tests/base.py | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> 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:
> -- 
> 2.44.0
>
diff mbox series

Patch

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: