Commit Graph
306 Commits
Author SHA1 Message Date
Marco Trevisan (Treviño) ffdb0a84b8 ci/build: Use meson compile rather than ninja 2026-07-24 10:44:26 +00:00
Marco Trevisan (Treviño) 5113f7ec3b ci: Use sync unsupported devices tool to check for diffs 2026-07-24 10:44:26 +00:00
Marco Trevisan (Treviño) b72feabc58 build: Add script to update the unsupported devices from wiki
Avoid some more manual labor
2026-07-24 10:44:26 +00:00
Marco Trevisan (Treviño)andShengyu Qu 87a7023831 aes2550: Add basic test to check too-short errors
Traces provided by Shengyu Qu

Co-Authored-By: Shengyu Qu <wiagn@4d2.org>
2026-07-23 14:36:02 +02:00
Marco Trevisan (Treviño) 44f3bbc43a build: Allow to run umockdev tests separately 2026-07-23 14:36:02 +02:00
Marco Trevisan (Treviño) fc9fd638a8 tests/umocdev-test: Allow to run just one test at time 2026-07-23 14:36:02 +02:00
Marco Trevisan (Treviño) c02d58a369 tests/create-driver-test: Use argparse and allow to record only one case 2026-07-23 14:36:02 +02:00
Marco Trevisan (Treviño) 71cff7966e tests/create-driver-tests.py: Allow to create both capture and custom tests
A device may provide both tests, so let's make this easier to achieve
2026-07-23 13:08:54 +02:00
Shengyu Qu 56516db045 tests: Add aes2550 driver replay test
Signed-off-by: Shengyu Qu <wiagn@4d2.org>
2026-07-23 18:40:35 +08:00
Marco Trevisan (Treviño) 6df065c399 Revert "fpi-print: Add function to check if two prints match"
This reverts commit b4d78e7c0f.
2026-07-13 12:10:21 +02:00
Marco Trevisan (Treviño) 0abe22bd94 virtual-image: Do print enroll and verification using transformed images
We used to enroll and verify always the same prints, which made
generating the very same enrolled prints, that simplifies the libfprint
matching.

To make this a bit more real, let's apply some transformations to the
print images before sending them each time
2026-07-13 11:24:10 +02:00
Marco Trevisan (Treviño) 55b934b02e tests/fpi-device: Increase warmup/cooldown test timeouts
The slack of 250ms wasn't enough on loaded CI systems, causing frequent
flaky failures (e.g. 2276ms actual vs 2250ms limit, or 2294ms vs 2250ms).

Double the slacks to 500ms for the 2s transitions and 1000ms for the
5s transition to absorb system load noise while still catching real
timing regressions.
2026-07-12 13:17:35 +02:00
Marco Trevisan (Treviño) 3cae9ea4ae build/tests: Add ability to define more per-test meson parameters 2026-07-12 13:17:35 +02:00
Marco Trevisan (Treviño) 91dd69475f tests/fpi-device: Add test identifying with an empty gallery
We're still going into the device in this case because technically the
identify operation may still return a print, although never a match of
course.

Adding tests so that we are not tempted to modify the behavior of the
identify function to return an error on prints->len == 0 or to just not
call the driver on such case.
2026-07-12 13:17:35 +02:00
Marco Trevisan (Treviño) 7e579f0f36 fpi-device: Warn if a device returns a scanned print that is not matching match
Devices can scan even without a match, but if they do match a print then
they must match.

Ensure this in code to prevent drivers to return inconsistent data.
2026-07-12 13:17:34 +02:00
Marco Trevisan (Treviño) 2f6b46b91f tests-fpi-device: Do not hardcode the gallery random pick limit 2026-07-12 13:16:33 +02:00
Marco Trevisan (Treviño) b4d78e7c0f fpi-print: Add function to check if two prints match
While for raw prints this is just an equality check, for NBIS prints
they match if at least one of the minutiae match
2026-07-12 13:16:33 +02:00
Marco Trevisan (Treviño) 3ac3c7b082 tests-fpi-device: Add unit tests for prints equality 2026-07-12 13:16:33 +02:00
Marco Trevisan (Treviño) 7fee92884d fp-device: Implement verify using identification
In case a device has not support for verification through an explicit
verify function, the verification can still be implemented using
identification with a gallery of a single print.

In fact that's what most of drivers these days do it, so let's just
avoid to them to handle this duplication unless a driver has really some
specific commands to do it.
2026-07-12 12:58:50 +02:00
Marco Trevisan (Treviño) 72188c0eb8 aes2501: Fix endianness of instogram 2026-07-02 02:14:37 +02:00
Marco Trevisan (Treviño) e821d0f83f build: Enable elanspi in big endian archs
It works fine so no need to do anything there
2026-07-01 17:49:34 +02:00
Marco Trevisan (Treviño) 5c6fcb8f00 build: Define variable early enough 2026-06-19 16:08:52 +02:00
Marco Trevisan (Treviño) f800bbd485 fpi-device: Get the emulation mode only through compile-time defined libs
In test mode, dynamically load libraries in well known locations that can
allow to override the libfprint behavior.

It would still be possible to potentially inject code by replicating the
distro build directory and adding a library there, but if one is able to
access there, they would already be able to access any path.

Plus the env variable check is still there, so again they would need to
be able to change the fprintd environment
2026-06-19 15:55:13 +02:00
Marco Trevisan (Treviño) 3933e5d468 fpi-device: Only use emulation mode by pre-loading a library
Rather than just do it in production if set, make it more difficult to
potentially inject the test mode.

So rely on a weak definition of fpi_device_emulation_mode_enabled() that
can be only set externally
2026-06-19 15:50:18 +02:00
Marco Trevisan (Treviño) 59ecce0a99 virtual-device: Use consistent sleep/wait multiplier under valgrind 2026-06-19 15:43:09 +02:00
Marco Trevisan (Treviño) b587e78b09 test-utils: Do not include the header multiple times 2026-06-19 15:43:09 +02:00
Marco Trevisan (Treviño) 2373769e5b tests/build: Increase the focaltech_moc test timeout
As per commit bad930503c the test data is way bigger than it used to
be, so the test duration is longer.

Thus increase the timeout not to have failures
2026-06-19 15:43:09 +02:00
Marco Trevisan (Treviño) bf91b0ede8 tests/build: Allow to define per-test parameters via a dict 2026-06-19 15:43:09 +02:00
Marco Trevisan (Treviño) 6498a64f3a tests/hwdb: Use all hwdb-related variables for that test only 2026-06-19 12:10:33 +02:00
Marco Trevisan (Treviño) 169d9addc9 focaltech_moc: Do not set delete feature for 6553 2026-06-18 18:10:39 +02:00
Sid1803andMarco Trevisan (Treviño) 8d2462dad1 focaltech-moc: Add storage clear for 2808:6553 2026-06-18 18:10:39 +02:00
Marco Trevisan (Treviño) 4f743766a5 mafpmoc/custom: Improve test script checking for identified match 2026-06-18 15:49:25 +02:00
王毅andMarco Trevisan (Treviño) 7cf358d42a mafpmoc: Support Microarray Inc. series fingerprint sensor PID 8012 2026-06-18 15:47:34 +02:00
Jared VacantiandMarco Trevisan (Treviño) 5b34908a21 Add driver for SecuGen Hamster Pro 20
Add support for the SecuGen Hamster Pro 20 (1162:2200), a 500 DPI
press-type optical scanner built around the SIDO020A sensor.

The protocol was reverse-engineered from USB packet captures. The
sensor is configured over I2C-tunneled vendor control transfers and
streams 956x688 raw frames over the bulk endpoint, read in 64KB
chunks so the standard pcap-based test tooling can record full
frames (the kernel usbmon interface truncates single URBs at
ring_size/5). Frames are processed with band compensation, an
edge-aware unsharp mask, a fixed-point bilinear downsample to
300x400, flat-field blending and directional sharpening, driven by
per-device factory calibration data read from the device firmware.
The fixed-point pipeline keeps the output bit-identical across
compilers and architectures for the image comparison test.

The sensor has no proximity hardware and its GET_STATUS request
always returns zeros, so finger presence is detected by polling
preview frames and comparing the mean brightness of the central
region against a calibration background frame.

Includes a umockdev capture/replay test with a reference image.

Closes: https://gitlab.freedesktop.org/libfprint/libfprint/-/work_items/353
2026-06-17 19:47:23 +02:00
Daniel SchaeferandMarco Trevisan 20f5ce682e tests: /usr/bin/env shebang
Not all distros have /usr/bin/python3. Using env is more portable.

Signed-off-by: Daniel Schaefer <git@danielschaefer.me>
2026-06-11 15:47:32 +00:00
Daniel SchaeferandMarco Trevisan bad930503c focal: Add clear_storage
Signed-off-by: Daniel Schaefer <git@danielschaefer.me>
2026-06-10 08:23:00 +00:00
Jason HuangandMarco Trevisan (Treviño) 9bddd90f06 egis_etu905: Add 1c7a:05ae and 1c7a:9201 fingerprint readers 2026-06-10 10:14:47 +02:00
FIM43-RedeyeandMarco Trevisan 66b1ada0d6 tests: Update goodixmoc capture for verify finger-up wait
Re-record the umockdev USB capture to include the new
GOODIX_VERIFY_WAIT_FINGER_UP state's USB exchanges during
verify and identify operations.

Captured on a Goodix MOC sensor (27c6:609c, Framework Laptop 13)
with FP_DEVICE_EMULATION=1 as required by the test framework.
2026-03-17 17:55:38 +00:00
Marco Trevisan (Treviño) cc41f805f2 tests/valgrind-python.supp: Ignore PyGObject leaks
They are unrelated to fprint itself, so let's ignore them
2026-02-10 06:33:00 +01:00
Danny 596b5f8032 fpcmoc: add 10a5:a306 fingerprint reader 2025-08-08 21:30:32 +02:00
Marco Trevisan (Treviño) c37da8568f build: Use fs to get files basename
We can safely bump meson
2025-02-20 18:41:27 +01:00
Marco Trevisan (Treviño) e401fc10e8 build: Do not use deprecated features in meson 2025-02-20 18:28:15 +01:00
Marco Trevisan (Treviño) 7208b29756 tests: Ignore testing external tools with valgrind 2025-02-20 15:50:46 +00:00
Marco Trevisan (Treviño) c6ca915067 tests: Validate the generated metainfo if appstreamcli is available 2025-02-20 15:50:46 +00:00
Marco Trevisan (Treviño) 0c315b4f0a tests/goodixmoc: Add explicit test on print description
So that we can ensure that what we get from device matches
2025-02-13 23:51:52 +00:00
Marco Trevisan (Treviño) 3e653fe85b build/tests: Increase timeout multiplier in valgrind
CI is quite slow these days, so let's give valgrind more time
2025-02-13 23:51:52 +00:00
Marco Trevisan (Treviño) 830a9977c0 build: Support running tests with memory sanitizers
When memory sanitizers are set, tests may fail because we are indirectly
LD_PRELOAD'ing (through umockdev). While we could ensure that sanitizer
libraries are loaded first, it's just something we don't care because we
don't want to test the launcher wrappers themselves.

So, let's just ignore the link order and live with it
2025-02-13 23:51:52 +00:00
Marco Trevisan (Treviño) 57c535d0cb libfprint.supp: Ignore libusb context init potential leak 2025-02-13 18:52:24 +00:00
Marco Trevisan (Treviño) 6702c32b2b tests/meson: Ignore debug messages when generating hwdb 2025-02-13 19:31:16 +01:00
Marco Trevisan (Treviño) b8ed4b5d63 tests/virtual-image: Use sleep multiplier when running under valgrind 2025-02-13 18:46:15 +01:00