Commit Graph

304 Commits

Author SHA1 Message Date
Bastien Nocera 3b3fc573da test-generated-hwdb: Add more debug on error 2022-08-16 17:14:07 +02:00
Bastien Nocera e782de3747 tests: Fix umockdev version detection
Traceback (most recent call last):
  File "/builds/libfprint/libfprint/tests/umockdev-test.py", line 17, in <module>
    version = tuple(int(_) for _ in umockdev_version.split(b'.'))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builds/libfprint/libfprint/tests/umockdev-test.py", line 17, in <genexpr>
    version = tuple(int(_) for _ in umockdev_version.split(b'.'))
                    ^^^^^^
ValueError: invalid literal for int() with base 10: b'g9049374\n'
2022-08-16 17:14:07 +02:00
Marco Trevisan (Treviño) fb9e054637 test-fp-device: Add few tests to check identification init errors 2022-07-14 21:35:30 +02:00
hermanlin 24e7e1f100 elanmoc: Make sure sensor in the right mode at identity
Signed-off-by: hermanlin <herman.lin@emc.com.tw>
2022-07-11 15:39:11 +00:00
Benjamin Berg 8552290bec goodix: Reset device if storage listing fails
When opening the device, query the stored prints. This should usually
always succeed (and it should be fast). If it fails, then we are very
likely dealing with a corrupted template storage on the device. In that
case, emit the command to clear the storage in order to reset the device
and get it back into a usable state.
2022-06-22 15:40:12 +00:00
Benjamin Berg 1f925fef7c tests: Test suspend/resume and sysfs attributes in synaptics 2022-05-17 20:29:00 +02:00
Benjamin Berg 7b0093b4c6 tests: Reset the USB device before testing
The kernel caches URBs to get descriptor values. Doing a reset before
starting the record ensures that we will see any descriptor reads in the
usbmon trace and can therefore correctly replay them (possibly not true
if they happen multiple times).
2022-05-17 20:29:00 +02:00
Marco Trevisan (Treviño) a1340485b6 tests/tod-drivers: Add tests for 1.94.3-built tod drivers 2022-02-15 13:07:31 +01:00
Benjamin Berg 20de7400c6 tests: Avoid -Wdangling-pointer warning
The code is correct, but gcc thinks the pointer is still NULL after the
call. As obvious workaround don't seem to work, just disable the warning
for now.
2022-02-14 19:00:10 +01:00
Marco Trevisan (Treviño) a328dfe1d9 tests/tod-drivers: Add tests for FpDeviceFeature on 1.94.3 2022-02-14 18:50:47 +01:00
Marco Trevisan (Treviño) b6ef314434 tests/tod-drivers: Move FpDeviceFeature definitions to base-fp-device
They're public enums, so put there in the expected file.
2022-02-14 18:50:11 +01:00
Marco Trevisan (Treviño) 600e6f2107 tests/meson: Remove unsupported sources_dir from gnome mkenums 2022-02-14 18:49:40 +01:00
Benjamin Berg 5fb3b8b43a tests: Avoid -Wdangling-pointer warning
The code is correct, but gcc thinks the pointer is still NULL after the
call. As obvious workaround don't seem to work, just disable the warning
for now.
2022-02-14 17:57:59 +01:00
Marco Trevisan (Treviño) 6b894dbd5c Merge tag 'v1.94.3' into tod
2021-11-02: v1.94.3 release

Highlights:
 * Ensure idle mainloop before completing enumeration (fprintd#119)
 * It is now possible to extend already enrolled prints
 * elanspi: Fix timeout error with some hardware (#438)
 * elanspi: Fix cancellation issues
 * goodixmoc: Return matching device print; fixes duplicate checking (#444)
 * goodixmoc: Support clearing the storage (usually unused)

Git-EVTag-v0-SHA512: 779b560b97bc7da5972d9a4854be5b74f8d310a22ac782fde50fa02c869cf93cc11254d75519076ac8ee59f81c8a9fc0466030eb249519827343ab84eb45e640
2022-02-14 17:03:21 +01:00
Devyn Cairns 3568051686 goodixmoc: support for clear_storage
The internal storage of this device can get messed up by other operating
systems, so it's handy to be able to clear it.

I'm not 100% sure whether the commands I've sent to the device are
exactly what is supposed to be used (just a guess), but it did seem to
work, and it even fixed another issue I had.
2022-02-11 18:08:53 +00:00
mincrmatt12 7565562903 elanspi: Adjust register tables (fixes #438)
New values taken from a newer version of the official driver.
2021-12-22 00:20:57 -05:00
Dmitrii Shcherbakov 999bca076c Allow FpPrint data to be extended on enrollment.
* Allow FPI_PRINT_NBIS to be extended rather than overridden if a user
  supplies an existing FpPrint template with data;
* Prints will only be extended if a device has the required feature.
  For image-based devices this feature is added by default since they
  typically do not have storage (this can be overridden at the child
  class level).

Extending an existing FpPrint requires passing a template print with
existing data during the enrollment process. This is done because the
caller is responsible for maintaining the fingerprint database and doing
the necessary deserialization operations if needed. The existing
example program is updated to show how to do that.
2021-12-16 12:53:41 +01:00
Marco Trevisan (Treviño) fef4120ae1 test-fpi-todv1-types: Check missing device class members for 1.94
Not a problem now, as we're still on 1.94, but will be needed to ensure
that future versions will be checked.
2021-10-31 23:28:21 +01:00
Marco Trevisan (Treviño) 608a9f10df libfprint: Use a macro to easily compute TOD padding 2021-10-31 23:09:30 +01:00
Marco Trevisan (Treviño) ec8a9ba0fd fpi-device: Adjust padding based on actual gpointer size
In some architectures pointer size is different. So let's adapt it to it
2021-10-31 22:31:01 +01:00
Marco Trevisan (Treviño) 1153fc85a5 Merge with libfprint 1.94.1 and followup fixup commits 2021-10-28 15:46:02 +02:00
Marco Trevisan (Treviño) de46e1e4b8 tests: Add missing trailing new lines on devices attributes
This as per the same reasons of commit 63bfaf4, and without trailing new
lines such attributes aren't picked by umockdev in ubuntu and debian.
2021-10-27 02:01:50 +02:00
Benjamin Berg 46669e9f53 goodixmoc: Do not run identify step during enroll
While useful, there are advantages for this to be done by the
surrounding code (i.e. fprintd). As such, remove the identify stage from
the goodix driver and rely on fprintd doing it for us.

One can probably argue that neither solution is perfect. Ideally, we
would probably return the information required to delete the old print
to the upper stack and let the driver/device handle the duplicate
checking.

However, for now this works well. We may need to reconsider this if we
get devices that do the duplicate checking transparently and just throw
an enroll error.

NOTE: The driver did not report any progress for the identify step. As
such, the number of enroll steps reported by the device remain the same.

Closes: #415
2021-09-24 14:24:47 +02:00
Benjamin Berg 20e8355c01 tests: Run custom.py from test creation helper when available
This allows creating tests both for image and non-image devices using
the same script.
2021-09-21 19:13:02 +02:00
Benjamin Berg df41ed56f6 meson: Use source_root() to not require meson 0.56
This fixes the flatpak build.
2021-09-15 15:43:33 +02:00
Bastien Nocera aff063c23c tests: Simplify capture of driver behaviour for regression tests
And update instructions for the simpler method.

Co-authored-by: Benjamin Berg <bberg@redhat.com>
2021-09-15 13:24:08 +00:00
Bastien Nocera 9515cc2e59 tests: Add U.are.U 4500 test 2021-09-09 10:54:48 +02:00
Bastien Nocera b3cfc40dea tests: Add uru4000 test
This test requires control transfer replay fixes that will be contained
in umockdev 0.16.3. Bump the requirement accordingly.

Closes: #412
2021-09-08 20:37:00 +02:00
Bastien Nocera 40b3923ca6 tests: Add (another) elan driver replay test
This capture was made using a "COBO" branded device, and uses the new
pcapng format.
2021-09-08 15:36:35 +02:00
Bastien Nocera d7e7d8e036 tests: Add aes2501 driver replay test 2021-09-08 15:25:14 +02:00
Bastien Nocera ec53abfc3a tests: Simplify multiple tests per driver code 2021-09-08 15:24:59 +02:00
Bastien Nocera e22497d51b Revert "tests: Simplify capture of driver behaviour for regression tests"
This reverts commit 0dcb4be4d3.
2021-09-06 17:34:15 +02:00
Bastien Nocera 0dcb4be4d3 tests: Simplify capture of driver behaviour for regression tests
And update instructions for the simpler method.
2021-09-06 17:32:05 +02:00
Marco Trevisan (Treviño) 312b75fe66 test-fp-todv1-types: Ensure we check all the enum values
We were ignoring enum values when there were gaps, so let's check that
all the values in the old version enums are present in the current one.
2021-09-04 04:13:15 +02:00
Marco Trevisan (Treviño) 125d6e276f tests: Repeat tests for TOD drivers compiled for each supported version 2021-09-04 03:20:58 +02:00
Marco Trevisan (Treviño) 4a337393a6 tests: Use more versioned types for fpi types tests
Also move images into its own header
2021-09-04 01:00:34 +02:00
Marco Trevisan (Treviño) 9c37ffa4be tests: Run TOD driver-independent tests alone 2021-09-03 20:18:36 +02:00
Marco Trevisan (Treviño) c63455d289 TOD: Add wrappers for SSM functions that are not compatible with 1.90
Expose new versioned symbols that work with previous API so that we can
keep compatibility with old drivers without having to recompile them.

We disable the GCancellable API in delayed SSM actions since that was
something that wasn't really needed and prone to errors, instead of
just re-implementing it as it was in the TOD case.
2021-09-03 20:18:36 +02:00
Marco Trevisan (Treviño) e4ef2ed7a0 tests: Do add TOD testing for SSM API
Driver is coming from the TOD drivers testing project [1].

https://gitlab.freedesktop.org/3v1n0/libfprint-tod-test-drivers
2021-09-03 19:41:17 +02:00
Marco Trevisan (Treviño) d0aa30a435 tod: Check the message emission if the tod path isn't readable 2021-09-03 19:41:17 +02:00
Marco Trevisan (Treviño) 29b904b93d tests: Add versions check on TOD drivers based on their IDs
Recompile tod drivers using libfprint-tod-test-drivers project [1] so
that we don't have to reorder the private driver structure, plus use a
versioned driver ID and parse it to check whether a feature is supported
for such TOD test driver.

https://gitlab.freedesktop.org/3v1n0/libfprint-tod-test-drivers
2021-09-03 19:41:17 +02:00
Marco Trevisan (Treviño) 4ed67f9084 build: Use host machine family from meson 2021-09-02 13:23:30 +02:00
Marco Trevisan (Treviño) 2d20c6a8f2 fpi-device: Ensure FpDeviceClass is still compatible with TODv1 ABI
Tests are ensuring it, adapt internal tests to ignore new features when
using old drivers
2021-08-28 03:07:23 +02:00
Marco Trevisan (Treviño) 2e00b03a43 Merge tag 'v1.94.0' into tod
Tag 1.94.0

Git-EVTag-v0-SHA512: 7cf9d7defb02433140f575589099569a5848ab34e8ecb0a4a90bb3c9eb1c228a16438afe1b23c381b59c1506f189a845752fead3dbd3c1c11f686cf47302cb1b
2021-08-28 02:19:40 +02:00
Benjamin Berg 3108ac3144 virtual-device: Return empty no-match if unknown SCAN id is passed
This matches the expectation. i.e. we return no-match and we do not
return a scanned print as we don't have anything for it. If we did
indeed return a scanned print, then fprintd would try to delete it
during enroll and would then fail.

Note that we do *not* return a DATA_NOT_FOUND error in the storage
device if the print does not exist. This is because not all devices
support reporting this error. It is therefore more sensible to handle it
gracefully and expect test setups to set the error explicitly for
testing purposes.
2021-08-19 18:59:38 +02:00
hermanlin 62448492af elanmoc: Adjustments to protocol change (passing an empty user ID) 2021-08-10 16:22:54 +08:00
Benjamin Berg 8147372bdd tests: Add suspend/resume tests
Also update the critical section test to check the order in which the
requests are processed.
2021-08-09 16:08:21 +02:00
Benjamin Berg 968331c383 tests: Add full USB device hierarchy
The suspend/resume code tries to set sysfs attributes. To do so, the
full hierarchy is needed in order to build the corresponding sysfs path.
2021-08-09 16:08:21 +02:00
Benjamin Berg ff6caca2e3 tests: Add test for critical section API 2021-08-09 16:08:17 +02:00
Benjamin Berg 23a4f5b77a tests: Add temperature and overheating cancellation tests 2021-08-09 16:08:17 +02:00