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)
77ff30e19d
tod: Mark symbols that were added in 1.90 series as part of TOD 1.0.0
...
Otherwise we'd cause the symbols to disappear on such versions
2021-10-28 19:22:21 +02: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
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)
fdf86e65ec
TOD: Add changed functions in libfprint 1.92, a fallback version is needed
2021-09-03 19:41:17 +02:00
Marco Trevisan (Treviño)
71827856c9
tod: Update version file to include new APIs per versions
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)
88cb452e05
fpi-device: Do not include config.h in headers
...
It should be included in files requiring it only.
2021-09-03 18:49:45 +02:00
Marco Trevisan (Treviño)
0a7473dce1
fpi-device: Do not include config.h in headers
...
It should be included in files requiring it only.
2021-09-02 13:43:43 +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
Marco Trevisan (Treviño)
df36c66730
tod: Use dynamically defined version script
...
So we don't have to manage the soname manually
2021-04-14 18:15:07 +02:00
Marco Trevisan (Treviño)
35bcd4326c
libfprint-tod.ver: Add new symbols to newer TOD subversion
...
This should be something to do every time, as it may allow to define
multiple symbol versions, if something changes upstream.
2021-04-14 18:14:35 +02:00
Marco Trevisan (Treviño)
00128e11fd
README: Link to TOD README file
2021-04-13 22:35:34 +02:00
Marco Trevisan (Treviño)
81ecee3ead
tests/tod-drivers: Add newly supported types
2021-04-13 22:35:34 +02:00
Marco Trevisan (Treviño)
18b3acdfb0
fpi-spi-transfer: Add structure padding
2021-04-13 22:35:34 +02:00
Marco Trevisan (Treviño)
1d7a561b0b
tod-inspector: Add support reading features
2021-04-13 22:35:28 +02:00
Marco Trevisan (Treviño)
a79a8d0e22
device: Keep device type ordering as default
2021-04-13 22:35:28 +02:00
Marco Trevisan (Treviño)
344d5cb2a9
fpi-device: Reduce padding on FpIdEntry to make space to new elements
2021-04-13 22:35:28 +02:00
Marco Trevisan (Treviño)
c906b30cba
tod: Add support for device features, keeping ABI compatibility
2021-04-13 22:35:28 +02:00
Marco Trevisan (Treviño)
eb329903b4
test-fp-device-tod: Ignore deprecated functions and use new ones
2021-04-13 22:17:39 +02:00
Marco Trevisan (Treviño)
20ac5c10a4
Merge branch 'origin/master' into tod
2021-04-13 22:17:37 +02:00
Marco Trevisan (Treviño)
58756ab62e
tests: Ensure that we don't break ABI with expected TODv1 structures
...
We can check whether each relevant structure element has not changed and
that the supported enum and flag values didn't change value.
2021-04-13 22:14:56 +02:00
Marco Trevisan (Treviño)
e5e999de2c
fpi-image: Add missing padding
...
This breaks the ABI with such TOD drivers, but we don't have any using
an image device so far, so it's a safe break.
2021-04-13 22:14:56 +02:00
Marco Trevisan (Treviño)
9aa3060d32
ci: Expose valgrind test logs
2021-04-13 19:39:50 +02:00
Marco Trevisan (Treviño)
9a1dcaa801
tests: Use native meson exec wrapper in test setups instead of our script
...
No need to provide a script that will break usage of `meson test --gdb`
when we can use a native and cleaner alternative.
We can then ignore LIBFPRINT_TEST_WRAPPER in basic tests, while it is
still needed by umockdev tests.
2021-04-13 19:38:58 +02:00
Marco Trevisan (Treviño)
683ac48e21
libfprint2-sections: Add missing FpFingerStatusFlags
2021-04-12 22:14:06 +02:00
Marco Trevisan (Treviño)
3b34fc9b5b
ci: Expose coverage report and meson logs in MRs
2021-04-12 22:14:06 +02:00
Marco Trevisan (Treviño)
41f8737b48
device: Deprecate fp_device_{supports,has}_* functions for has_feature
...
We can avoid having multiple device feature-check functions now and
just rely on a few.
Add uncrustify config to properly handle begin/end deprecation macros.
2021-04-12 22:14:06 +02:00
Marco Trevisan (Treviño)
ef805f2341
device: Expose supported features publicly as FpDeviceFeature
...
It can be convenient for device users to check what it supports, without
having multiple functions to check each single feature.
So expose this and add tests.
2021-04-12 22:14:06 +02:00
Marco Trevisan (Treviño)
bd99f865d8
fp-device: Gracefully handle capture calls on devices with no support
2021-04-12 22:14:06 +02:00
Marco Trevisan (Treviño)
3717468a8a
device: Make verification support optional
...
We always assumed a device can verify, but nothing prevents from having
a device that only can identify or capture.
So, given that we've more fine grained checks, let's stop the task if
this is the case.
2021-04-12 22:14:06 +02:00
Marco Trevisan (Treviño)
8d545a0b95
fpi-device: Add FpiDeviceFeature flags to FpDeviceClass
...
Allows drivers to define more fine grained features for devices, not
strictly depending on assumptions we can make depending on the
implemented vfuncs.
We keep this per class but could be in theory moved to each instance.
In any case, added an utility function to initialize it in the way we
can ensure that we've a consistent way for setting them across all the
devices.
2021-04-12 22:14:06 +02:00
Marco Trevisan (Treviño)
9321791d0e
ci: Do not use verbose logging for tests, just rely on artifacts
...
Only print errors if any
2021-04-01 18:01:29 +02:00
Marco Trevisan (Treviño)
4031bb62d7
device: Gracefully handle identify on devices with no support
...
We were crashing as trying to still call the identify vfunc, so check if
identification is supported and if not return a relative error.
Added test as well
2021-04-01 17:44:56 +02:00
Marco Trevisan (Treviño)
59767af552
doc/libfprint-2.types: Also include fp-image-device to get image type
2021-04-01 17:13:11 +02:00
Marco Trevisan (Treviño)
e8a7ff1033
tests/virtual-device: Add test checking close while we're still opening
2021-03-03 19:41:04 +01:00
Marco Trevisan (Treviño)
8ae27b4672
fpi-assemping: Do not include unneeded headers and do not use absolute search paths
2021-03-03 19:40:49 +01:00
Marco Trevisan (Treviño)
447cd3f7ba
fpi-assemping: Do not include unneeded headers and do not use absolute search paths
2021-03-03 19:35:16 +01:00
Marco Trevisan (Treviño)
08cf893e2e
examples: Add TOD inspector tool, to do some basic analysis of TOD drivers
...
Will print some drivers data
2021-03-03 19:30:38 +01:00
Marco Trevisan (Treviño)
8fd1fcbe49
virtual-device: Move shared functions into the internal scope
...
We are currently exporting such functions in the library, even though
they are meant to be only private.
2021-02-22 21:08:57 +01:00
Marco Trevisan (Treviño)
a1ae3cfdaa
meson: Bump version to 1.90.7+git20200222+tod1
2021-02-22 19:42:54 +01:00
Marco Trevisan (Treviño)
5804b25806
Merge libfprint/libfprint master branch into tod
2021-02-22 19:12:51 +01:00
Marco Trevisan (Treviño)
e4a297887b
virtual-image: Use explicit list of cases in which we want to listen
...
Depending on the enum order is ok, but not really maintainable so better
to explicitly list the states we want to listen.
2021-02-22 19:09:11 +01:00
Marco Trevisan (Treviño)
8b82ebeca5
Merge tag 'v1.90.7' into tod
...
Tag 1.90.7
Git-EVTag-v0-SHA512: 21642bcdac35b82cd3f56130603d09ebe62b321123f58ce4a491b8fa8f545ae86a7c3d670b212af474d561123efa91f0383ad416b07c3ce1d4df0d292e77bb94
2021-02-22 18:16:21 +01:00
Marco Trevisan (Treviño)
6a62d32c81
goodix: Consume the retry errors during verify/identify reports
...
We should not pass such kind of errors to complete functions, or we'll
fail the identification without ability to retry immediately.
2021-01-29 20:02:15 +01:00
Marco Trevisan (Treviño)
b2a64cc980
virtual-device: Do actual errors codes checks instead of regex checks
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño)
88117c172e
tests/virtual-device: Add enroll and verify script test
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño)
27a62443a1
virtual-device: Add SET_KEEP_ALIVE command, to keep the listener up
...
We may want to be able to talk with the device while it's closed to
queue commands to be performed once it opens (could be even a script),
so to do this we need to close the device first, send those commands and
eventually process them.
We used a trick to send an invalid command before that was ignored by
release, but having the device available is just easier to handle.
So, when keep alive is enabled we don't stop the listener when closing
but only on actual device disposition.
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño)
2f7c78eb97
virtual-device: Make possible to use a script to perform enroll operations
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño)
74f8a8ee27
virtual-device: Handle cancelled state gracefully in should_wait_to_sleep
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño)
acd0a10e76
virtual-device: Add test that open fails with a busy error if is still ongoing
...
The idea of the test was just checking what happens when we're opening a
device multiple times while a first request is still going.
However, it actually ends up also checking the previous commit change
because without it we'd stop the close iteration before the device is
actually closed and stop the open iteration before the device is
actually opened, leading to an infinite loop.
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño)
27c2466bda
fpi-device: Mark the device as open and notify it on idle callback
...
We're delaying any completed operation until we've completed an idle,
but the open/close state is changed and notified as soon as the device
completes the operation.
While this can be true, it means that we notify earlier than the finish
callback is actually called, while iterations are still needed to get
the actual state completed, and the current_task reset.
So if we'd open/close and iterate till fp_device_is_open() returns TRUE
we'd end up in a state in which the device is marked as ready, but it's
actually still busy since it's priv->current_task isn't unset yet.
The same if we'd try to do any action on notify::opened.
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño)
33ba248c44
virtual-device: Add test checking for early errors during dev API calls
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño)
43cf28b9da
fp-device: Do not try to deference potentially NULL task data
...
In case we do an early error return in verify and identify calls we
do not initialize the task data, but still in the finish functions we
still try to use it.
Avoid doing this, but just nullify the returned values.
2021-01-28 15:39:48 +01:00
Marco Trevisan (Treviño)
4da52f78f6
virtual-device: Check properties match the getters
2021-01-28 15:39:48 +01:00
Marco Trevisan (Treviño)
e4e0937848
tests/virtual-*: Check for enrolled prints properties
2021-01-28 15:39:48 +01:00
Marco Trevisan (Treviño)
25a6c916aa
fp-device: Fix property getters for enroll stages and driver ID
...
We were returning an invalid type for the enroll stages, while trying to
get the class from the private instance for the device driver
2021-01-28 15:39:48 +01:00
Marco Trevisan (Treviño)
51009b48a0
virtual-device: Process supported commands on device open
...
When opening the device we can process commands that we left for that
after the previous close, to do that we only have to inject an invalid
command that will be processed (and ignored) while closing, so that at
next device opening we will be able to proceed with the previously
sent commands.
Add tests to finally check this case!
2021-01-28 15:39:48 +01:00
Marco Trevisan (Treviño)
e1e3f6955e
virtual-device: Remove messages we can't process from queue when not scanning
...
Commands that are not valid for non-scan operations should be removed
from queue, or these may be re-proposed forever.
2021-01-28 15:38:57 +01:00
Marco Trevisan (Treviño)
c495b82000
virtual-device: Use python's with idiom to check GLib expected error messages
...
And we can properly provide a real traceback as well
2021-01-28 15:38:56 +01:00
Marco Trevisan (Treviño)
d90ee96df8
virtual-device: Return an duplicated data error if trying to re-enroll a print
2021-01-28 15:38:56 +01:00
Marco Trevisan (Treviño)
36304b736b
tests/virtual-device: Properly handle exceptions on enroll callback
...
We need to get them back to the caller function to be caught by the test
suite.
2021-01-28 15:38:29 +01:00
Marco Trevisan (Treviño)
31e34bd4bd
virtual-device: Emit data not found during verify/identify
...
If trying to identify a print not in the storage we emit data not found
error, this can be helpful to do further fprintd testing too
2021-01-28 15:38:29 +01:00
Marco Trevisan (Treviño)
ec4c7ca5a9
virtual-device-storage: Don't listed prints
2021-01-28 02:32:28 +01:00
Marco Trevisan (Treviño)
c4069065f9
virtual-device: Ensure we've an error before dereferencing it
2021-01-26 16:54:14 +01:00
Marco Trevisan (Treviño)
31541edc58
tests/virtual-device: Use a sleep multiplier when under valgrind
2021-01-26 16:54:14 +01:00
Marco Trevisan (Treviño)
549718753f
fpi-device: Fix argument name on report_finger_status() annotation
2021-01-26 16:54:14 +01:00
Marco Trevisan (Treviño)
cfde050220
virtual-device: Add ability to close a device with delay or with error
2021-01-26 16:54:14 +01:00
Marco Trevisan (Treviño)
88a38c38af
virtual-device: Add support for sleeping and sending errors on list and delete
2021-01-26 16:54:14 +01:00
Marco Trevisan (Treviño)
7ffcc2f9e7
virtual-device: Make possible to inject sleep events while verifying/identifying
...
Each command should be separated by SLEEP to be considered as something
we want to perform during the current operation, otherwise will be used
by next operation consuming it.
2021-01-26 16:53:24 +01:00
Marco Trevisan (Treviño)
1dae6796f7
virtual-device: Report finger presency when we receive a 'SCAN' event
2021-01-26 04:49:50 +01:00
Marco Trevisan (Treviño)
0bb0492025
virtual-device: Mark finger as needed only after we start scanning
...
In case we sent a sleep event to the device we may want to wait it to
emit the finger needed state before the timeout is completed.
So add a function to manage this for all the scan cases
2021-01-26 04:49:50 +01:00
Marco Trevisan (Treviño)
3db0858fb0
tests/virtual-device: Add a class function to wait for a timeout
2021-01-26 04:49:50 +01:00
Marco Trevisan (Treviño)
2382506491
virtual-device: Add checks for verify reports
2021-01-26 04:49:50 +01:00
Marco Trevisan (Treviño)
3693c39bc5
virtual-device: Make cancellation support toggable
...
We may want to have the device to sleep while releasing an operation,
this will allow to do it.
2021-01-25 17:40:49 +01:00
Marco Trevisan (Treviño)
993109a7f8
virtual-device: Implement cancel vfunc, to stop timeouts
2021-01-25 17:40:49 +01:00
Marco Trevisan (Treviño)
18db20d160
virtual-device: Add support for sleep command
...
It can be used to delay operations, simulating a busy device.
2021-01-25 17:40:48 +01:00
Marco Trevisan (Treviño)
89b4c4ee75
virtual-device: Test unplug operation while we're verifying
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
153b24a95a
virtual-device: Use identify function for verify tests when possible
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
8c45c0952e
virtual-device: Split verify check function in two parts to be reusable
...
We can so inject further operations in the middle, such as for the
finger status check
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
c3ece8621d
virtual-device: Implement UNPLUG operation
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
67cb61cc18
tests/virtual-device: Add identification tests
...
Reusing most of the logic of the `check_verify` utility function
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
33ffadf402
tests/virtual-device: Cleanup device storage on teardown
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
162a83e484
tests/virtual-device: Add ability to enroll with a retry step and test it
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
dfb27222eb
tests/virtual-device: Add function that figures out the command from type
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
81e53c422d
virtual-device: Add support for changing the device scan type
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
be0b4ae2bb
tests/virtual-device: Trigger new scans when we got progress callback
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
56bcf1ffdd
virtual-device: Add command to change the number of enroll stages
...
As per this don't use the class value anymore at enroll phase, as it may
differ.
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
665de7813b
fpi-device: Ensure we're receiving a valid number of enroll stages
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
a291d17f26
virtual-device: Properly cleanup the virtual devices data
...
Ensure we call the parent finalize function and cleanup local data
2021-01-25 17:40:15 +01:00