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-prev] [day] [month] [year] [list]
Message-ID: <CA+hkOd6b9LhN4jRFjDiQQ3DxdBLD2xRrrGXnhO-YsTO1cEGJyQ@mail.gmail.com>
Date: Thu, 20 Nov 2025 09:42:26 -0800
From: Alex Tran <alex.t.tran@...il.com>
To: Benjamin Tissoires <bentiss@...nel.org>
Cc: jikos@...nel.org, shuah@...nel.org, linux-input@...r.kernel.org, 
	linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] selftests: hid: tests: test_wacom_generic: add base
 test for display devices and opaque devices

On Thu, Nov 20, 2025 at 2:53 AM Benjamin Tissoires <bentiss@...nel.org> wrote:
>
> Hi Alex,
>
> On Nov 16 2025, Alex Tran wrote:
> > Verify Wacom devices set INPUT_PROP_DIRECT appropriately on display devices
> > and INPUT_PROP_POINTER appropriately on opaque devices. Tests are defined
> > in the base class and disabled for inapplicable device types.
> >
> > Signed-off-by: Alex Tran <alex.t.tran@...il.com>
> > ---
> >  .../selftests/hid/tests/test_wacom_generic.py       | 13 +++++++++----
> >  1 file changed, 9 insertions(+), 4 deletions(-)
> >
> > diff --git a/tools/testing/selftests/hid/tests/test_wacom_generic.py b/tools/testing/selftests/hid/tests/test_wacom_generic.py
> > index 2d6d04f0f..aa2a175f2 100644
> > --- a/tools/testing/selftests/hid/tests/test_wacom_generic.py
> > +++ b/tools/testing/selftests/hid/tests/test_wacom_generic.py
> > @@ -600,15 +600,17 @@ class BaseTest:
> >
> >          def test_prop_direct(self):
> >              """
> > -            Todo: Verify that INPUT_PROP_DIRECT is set on display devices.
> > +            Verify that INPUT_PROP_DIRECT is set on display devices.
> >              """
> > -            pass
> > +            evdev = self.uhdev.get_evdev()
> > +            assert libevdev.INPUT_PROP_DIRECT in evdev.properties
> >
> >          def test_prop_pointer(self):
> >              """
> > -            Todo: Verify that INPUT_PROP_POINTER is set on opaque devices.
> > +            Verify that INPUT_PROP_POINTER is set on opaque devices.
> >              """
> > -            pass
> > +            evdev = self.uhdev.get_evdev()
> > +            assert libevdev.INPUT_PROP_POINTER in evdev.properties
> >
> >
> >  class PenTabletTest(BaseTest.TestTablet):
> > @@ -622,6 +624,8 @@ class TouchTabletTest(BaseTest.TestTablet):
> >
> >
> >  class TestOpaqueTablet(PenTabletTest):
> > +    test_prop_direct = None
>
> That seems very awkward to do.
>
> Why not drop the 2 tests from the TestTablet class, move
> `test_prop_direct()` in that subclass (TestOpaqueTablet), and add a new
> TestDirectTablet class that TestDTH2452Tablet will be a subclass of?
>
> Basically try to make better use of subclassing instead of adding the
> tests at the top level class and selectively remove them in the
> subclasses.
>
> Cheers,
> Benjamin
>
> > +
> >      def create_device(self):
> >          return OpaqueTablet()
> >
> > @@ -864,6 +868,7 @@ class TestPTHX60_Pen(TestOpaqueCTLTablet):
> >
> >  class TestDTH2452Tablet(test_multitouch.BaseTest.TestMultitouch, TouchTabletTest):
> >      ContactIds = namedtuple("ContactIds", "contact_id, tracking_id, slot_num")
> > +    test_prop_pointer = None
> >
> >      def create_device(self):
> >          return test_multitouch.Digitizer(
> > --
> > 2.51.0
> >

Thanks for the review. Yes, it seems like a good idea to restructure
the class hierarchy instead of disabling the
tests like this. I'll send in a v2 with the changes soon.

Regards,
-- 
Alex Tran

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ