Commit Graph

235 Commits

Author SHA1 Message Date
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
Benjamin Berg 71e0c29f28 device: Always use an internal cancellable for tasks
This will allow libfprint to cancel operations internally in the future.

If the internal cancellation method is used, then the private
current_cancellation_reason variable must be set to the GError. This
error will be returned when set.
2021-08-09 16:08:17 +02:00
Benjamin Berg 96e5888110 tests: Show error message in more failure cases
This just simplifies matters a bit when one messes up during test
development.
2021-08-09 16:08:10 +02:00
Benjamin Berg 1f5e0821e0 tests: Bump required version for pcap replay
Some tests require control transfer replay. This was added shortly after
the actual pcap replay, so simply require a new enough umockdev.
2021-07-12 17:13:43 +02:00
Benjamin Berg d6b4adec73 tests: Add upektc_img test 2021-07-12 17:06:43 +02:00
Saeed/Ali Rk a07011bac2 tests: Add test for egistec0570 2021-07-08 13:42:22 +02:00
Benjamin Berg 29048c51db tests: Add elanmoc CI test 2021-07-07 13:35:59 +02:00
Benjamin Berg d5fda36bc0 tests: Detect tests by checking any matching file prefix
We were testing only for .ioctl files, but we may now have .pcap file
and ended up simply not running the synaptics test unless there was
still a .ioctl file present.
2021-06-28 16:17:56 +02:00
Benjamin Berg 8a5bec6619 device: Add API to update features during probe
This allows updating the supported feature bitfield during probe.
2021-06-25 17:38:28 +02:00
Benjamin Berg dbd89929b9 tests: Increase timeout of umockdev tests
The new elanspi driver in particular needs a lot of ioctl's during the
test. On a normal machine, this would run quite quickly (less than 5s),
however, in busy CI environments this can take longer than 30s, causing
timeouts currently.

Increase the timeout from 10s to 15s. For CI this means the timeout now
is 45s which is hopefully enough.
2021-06-25 08:39:17 +00:00
Bastien Nocera 01663c1fb5 tests: Allow multiple tests per driver
Allow multiple tests per driver by using the first section of the
directory name, before the separating '-', as the driver name.
2021-06-25 10:23:42 +02:00
Benjamin Berg 2ba60d0a52 tests: Improved umockdev version check
The new features will be added in 0.16, so match against that. Also,
match against CI_PROJECT_NAME to detect our CI environment (and assume
that umockdev has been patched to the point of supporting all tests).
2021-06-25 08:05:13 +00:00
Matthew Mirvish 059ab65081 tests: Add capture test for elanspi 2021-06-23 20:42:52 +00:00
Benjamin Berg 7893278cc6 tests: Add handling for SPI ioctl replay
This will only be supported with umockdev version 0.15.6.
2021-06-23 20:42:52 +00:00
Matthew Mirvish 0697191387 tests: Allow multiple mock devices per driver
Instead of only loading `DRIVER/device`, now we also load all files
matching device-*[!~] in the DRIVER folder..
2021-06-23 20:42:52 +00:00
Benjamin Berg 51cab75b1e assembling: Fix copying only partial tile on overhang
If the tile in question was hanging over the left edge we would not be
copying the full available width. Fix this and change the test to catch
the error condition (by forcing a too small image and overlap both
ways).

Simplify the code by only selecting the starting point inside the
image/frame and then just checking the both image and frame boundary in
the loop. Not quite as efficient, but it really shouldn't matter too
much here.
2021-06-23 22:33:07 +02:00
Benjamin Berg 7ff95dc39a tests: Add clear_storage related tests
Closes: #382
2021-06-21 16:50:18 +02:00
Benjamin Berg 90cbcd7fb5 tests: Update README to describe pcapng replay 2021-06-17 14:35:47 +02:00
Benjamin Berg 182367a079 tests: Use pcap recording for synaptics and test clear_storage 2021-06-17 14:35:47 +02:00
Benjamin Berg daaafc80c3 tests: Detect pcap vs. ioctl recording and run correct one 2021-06-17 14:21:08 +02:00