lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231207-b4-wip-selftests-v1-1-c4e13fe04a70@kernel.org>
Date:   Thu, 07 Dec 2023 13:22:39 +0100
From:   Benjamin Tissoires <bentiss@...nel.org>
To:     Jiri Kosina <jikos@...nel.org>,
        Benjamin Tissoires <benjamin.tissoires@...hat.com>,
        Shuah Khan <shuah@...nel.org>,
        Peter Hutterer <peter.hutterer@...-t.net>
Cc:     Jiri Kosina <jkosina@...e.com>,
        Benjamin Tissoires <bentiss@...nel.org>,
        linux-input@...r.kernel.org, linux-kselftest@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] selftests/hid: fix failing tablet button tests

An overlook from commit 74452d6329be ("selftests/hid: tablets: add
variants of states with buttons"), where I don't use the Enum...

Fixes: 74452d6329be ("selftests/hid: tablets: add variants of states with buttons")
Signed-off-by: Benjamin Tissoires <bentiss@...nel.org>
---
Not sure what happened, but I mustn't have run the tests before
sending the series, and they fail blatently.
I'm deeply sorry for that, I thought these failures were fixed.

Cheers,
Benjamin
---
 tools/testing/selftests/hid/tests/test_tablet.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/hid/tests/test_tablet.py b/tools/testing/selftests/hid/tests/test_tablet.py
index dc8b0fe9e7f3..903f19f7cbe9 100644
--- a/tools/testing/selftests/hid/tests/test_tablet.py
+++ b/tools/testing/selftests/hid/tests/test_tablet.py
@@ -115,7 +115,7 @@ class PenState(Enum):
         # we take only the highest button in account
         for b in [libevdev.EV_KEY.BTN_STYLUS, libevdev.EV_KEY.BTN_STYLUS2]:
             if bool(evdev.value[b]):
-                button = b
+                button = BtnPressed(b)
 
         # the kernel tends to insert an EV_SYN once removing the tool, so
         # the button will be released after
@@ -155,7 +155,7 @@ class PenState(Enum):
                 if button_found:
                     raise ValueError(f"duplicated BTN_STYLUS* in {events}")
                 button_found = True
-                button = ev.code if ev.value else None
+                button = BtnPressed(ev.code) if ev.value else None
 
         # the kernel tends to insert an EV_SYN once removing the tool, so
         # the button will be released after

---
base-commit: f556aa957df8cb3e98af0f54bf1fa65f59ae47a3
change-id: 20231207-b4-wip-selftests-c1565d4d4578

Best regards,
-- 
Benjamin Tissoires <bentiss@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ