martinpitt / umockdev

Mock hardware devices for creating unit tests and bug reporting
https://launchpad.net/umockdev
GNU Lesser General Public License v2.1
308 stars 54 forks source link

Add support for Chromium OS EC devices #249

Closed fandango96 closed 2 months ago

fandango96 commented 2 months ago

This PR adds the CROS_EC_DEV_IOCXCMD_V2 and CROS_EC_DEV_IOCEVENTMASK_V2 ioctls necessary for testing Chromium OS EC devices. My main use-case is to add support for the FPMCU to allow automated testing in libfprint.

PR showing use of the newly added ioctls here: https://gitlab.freedesktop.org/libfprint/libfprint/-/merge_requests/493

fandango96 commented 2 months ago

not sure why the build fails only on s390x

martinpitt commented 2 months ago

Thanks @fandango96 ! Sorry, I don't have much time this week for a detailed review, as I'm travelling. But for s390 the build log shows a unit test failure:

# DEBUG: umockdev-ioctl.vala:904: Aborting client because ioctl tree for /dev/cros_fp is empty
stderr:
ioctl_varlenstruct_init_from_text: ioctl C014EC00: expected data length 67108884, but got 24 bytes from text data
ERROR: libumockdev-preload: Server requested abort on device /dev/cros_fp, exiting
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

s390x is big endian, this smells like reading a 32 bit int the wrong way around?

fandango96 commented 2 months ago

Thank you @martinpitt, that was it - fixed.

fandango96 commented 2 months ago

This looks fine, thanks! Do you need this in a new release, or is git main enough for the libfprint MR?

Thanks! git main is enough for the libfprint MR