Commit Graph

244 Commits

Author SHA1 Message Date
xiaofei
631da4654f focaltechmoc:Support FocalTech moc devices
Supported UID: 0x2808
    Supported PIDs: 0x9E48, 0xD979, 0xa959
2024-02-13 14:34:12 +01:00
Mohammed Anas
1701d72ff9 tests: make mktemp command call work with Chimera Linux's mktemp
On Chimera Linux, which uses FreeBSD's userland tools, the original call
fails with the following error:

mktemp: mkstemp failed on /tmp/libfprint-XXXXXX.hwdb: Invalid argument

Moving the X's to the end of the template passed to `mktemp` fixes the
error, and also works with GNU's `mktemp`.
2024-01-22 15:52:46 +00:00
Mohammed Anas
d3ec9a80d3 tests: remove Bash dependency in favor of sh
The script works just fine with `sh`.

Also replace nonstandard `test` operator `==` with the standard `=`.

The other changes are mostly cosmetic.
2024-01-22 15:27:33 +00:00
huan_huang
79be91831c drivers: add realtek rts5813 driver 2023-10-27 13:21:06 +00:00
Marco Trevisan (Treviño)
af3dca9003 tests/egis0570/capture.pcapng: Remove execution permission 2023-08-22 23:08:55 +00:00
Marco Trevisan (Treviño)
1372d6f081 tests: Use native GTest utils to generate assets names 2023-08-21 14:19:27 +00:00
Marco Trevisan (Treviño)
ba3cc04e84 tests: Add support for installed tests
They allow distrubtions to check whether libfprint continues working as
expected, in different contexts.
2023-06-28 16:35:16 +02:00
Marco Trevisan (Treviño)
f49879b522 tests/virtual-image: Support passing specific FP_PRINTS_PATH env variable 2023-06-24 00:28:04 +02:00
Marco Trevisan (Treviño)
5e0bf2446b meson: Bump requirements to 0.56 and adapt deprecated functions 2023-06-24 00:28:04 +02:00
Marco Trevisan (Treviño)
4d96a3efaa tests/virtual-device: Check that removed devices are not in context anymore 2023-06-23 18:20:04 +02:00
Marco Trevisan (Treviño)
c27d72e3a1 tests/virtual-device: Do not preserve context on unplug tests
The unplug tests assume that the device is removed from the context once
they run, however we may have left the device around in a removed state
causing other tests to fail.

So isolate them in a new class where we create context and device
instances every time we run a test case.
2023-06-22 06:59:00 +02:00
Marco Trevisan (Treviño)
28579239a6 tests/virtual-device: Reset keep alive status when test is done
We don't want this to be preserved across tests, since it's meant to be
used inside a single test case.
2023-06-22 06:55:44 +02:00
Marco Trevisan (Treviño)
e48d2b467a tests/virtual-device: Restore default enroll steps on tearDown
When running the tests as a single script we may leave the device in an
inconsistent state, so reset the enroll steps when done.
2023-06-22 06:55:44 +02:00
Marco Trevisan (Treviño)
b6223a9d0a test-fpi-device: Only push pragma -wdanging-pointer in newer GCC versions
It may not be supported and warn otherwise
2023-03-15 15:23:17 +00:00
Enrik Berkhan
86566e8d0b goodixmoc: Fix missing "enroll create" state
After the driver internal duplicate check had been removed in
46669e9f53, all templates were saved with
an all-zeroes template ID.

By going through FP_ENROLL_CREATE before starting to capture, the
template ID returned from the device is taken into account again.

Signed-off-by: Enrik Berkhan <Enrik.Berkhan@inka.de>
2023-01-19 20:28:33 +01:00
Zoltán Böszörményi
5e52ad2ad1 upektc_img: Add new unit test for the TCS1s chip variant 2023-01-17 19:50:21 +00:00
Vasily Khoruzhick
db2fa81358 tests: valgrind: update python and libfprint suppressions list 2023-01-10 11:15:17 -08:00
Vasily Khoruzhick
d492901c3e tests: valgrind: generate suppressions list for new tests-suppress-new-valgrind-errors-in-python
That will help with updating suppresions lists in future
2023-01-10 11:14:51 -08:00
Marco Trevisan (Treviño)
1f1ed80dbf test-device-fake: Add more logging showing the current device action 2022-10-13 20:31:28 +00:00
Marco Trevisan (Treviño)
892c9767a2 tests: Be stricter on valgrind leak checks
We used to ignore leaks, and we are ending up in having various of them,
so let's make valgrind to exit with error when using the valgrind test
setup (so in CI) to catch them better.
2022-10-13 05:20:28 +02:00
Marco Trevisan (Treviño)
abd7c66833 fp-device: Do not setup current action before updating temperature
At every action we update the device temperature, and this can
potentially lead to a failure, if the temperature is too hot.

However in such case we were failing a task that we had just stolen,
causing an error, tasks never returning and the device was left in an
undefined state.

So, just return early in case temperature is too hot, as we don't really
need to have the current task or action set at this point because
there's no active action to cancel yet.

This was causing random errors when running tests under valgrind
2022-10-13 05:04:03 +02:00
Marco Trevisan (Treviño)
a86ab6c854 test-fpi-device: Cleanup the device ID / driver before overriding it
Otherwise we'd leak the one that was initially set.
2022-10-13 05:04:02 +02:00
Marco Trevisan (Treviño)
b04eed0aea test-device-fake: Consume the identify print if we're returning with error 2022-10-13 05:04:02 +02:00
Marco Trevisan (Treviño)
0b6a92150c tests/fpcmoc: Ensure python tests exit with error on every exception
We ignored assertions happening on callbacks as they only raise
exceptions that does not stop the execution.

So ensure that this is happening in all the tests as synaptics was
doing already

Same as commit: be8888431
2022-10-13 04:26:58 +02:00
Haowei Lo
cca2b6a624 fpcmoc: Support FPC moc devices
Supported PID: 0xFFE0/A305/D805/DA04/D205
2022-10-11 08:11:38 +00:00
Marco Trevisan (Treviño)
b718f4d567 tests/meson: Avoid searching for programs multiple times 2022-09-28 01:23:58 +02:00
Marco Trevisan (Treviño)
be88884315 tests: Ensure python tests exit with error on every exception
We ignored assertions happening on callbacks as they only raise
exceptions that does not stop the execution.

So ensure that this is happening in all the tests as synaptics was
doing already
2022-09-28 01:22:15 +02:00
Marco Trevisan (Treviño)
d2a0eda56c synaptics, goodix: Properly check for finger status during enroll progress
It may contain other values, but for sure we finger must be neeeded
2022-09-28 01:21:31 +02:00
Marco Trevisan (Treviño)
70dc61d647 libfprint: Add top-level sync-udev-hwdb target for updating DB 2022-09-27 16:32:09 +02:00
Marco Trevisan (Treviño)
c429052e5e tests: Do not use deprecated declarations in virtual device tests 2022-09-27 12:52:38 +02:00
Bastien Nocera
114097718a build: Fix run_command() warning
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: https://github.com/mesonbuild/meson/issues/9300
2022-08-26 11:48:32 +02:00
Bastien Nocera
96013a03c5 test-generated-hwdb: Add missing test dep
E: UDEV_HWDB (/run/build/libfprint/_flatpak_build/libfprint/fprint-list-udev-hwdb) unset or not executable.
2022-08-16 17:14:07 +02:00
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
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
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)
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