Commit Graph

212 Commits

Author SHA1 Message Date
Aris Lin a6c2509ca8 synaptics: check if current firmware supports during device probe
Fixes: #239 and #351
2021-01-12 18:49:36 +08:00
boger 8254b9e99e goodixmoc: support finger status report
there is no specific API for report finger status,
finger needed status is set when captrue sample cmd send, once cmd receive correct,
finger is pressing on sensor.
2021-01-05 13:36:17 +00:00
Bastien Nocera d6ca8ff2b0 tests: Fix typo in comment 2020-12-17 13:59:53 +01:00
Bastien Nocera b1b20f8ab9 tests: Mention permissions in test docs 2020-12-17 13:59:53 +01:00
Bastien Nocera 7e2b89791e tests: Fix typo in instructions 2020-12-17 13:59:53 +01:00
Marco Trevisan (Treviño) 52d30a88fc tests: Ensure we prepend the libfprint libraries path when testing TOD 2020-12-10 16:21:11 +01:00
Marco Trevisan (Treviño) f8cb985476 Merge tag 'v1.90.6' into tod
Tag 1.90.6

Git-EVTag-v0-SHA512: 1cca84a89332a674d822476e587e1d9f30dc11bfff13724548ec0be66ab32f910fb5e7a7c9403c9a813538fdd9e86661105af8e2a4865b0b30d301601c7bddab
2020-12-10 16:10:39 +01:00
Marco Trevisan (Treviño) c02771d16b goodixmoc: Add async identification test using on-owned deseralized prints
This simulates what fprintd does
2020-12-09 13:30:37 +01:00
Benjamin Berg 28ba6a0de9 test-fpi-device: Do deep comparison of gallery
The gallery needs to be copied, as such we must do a deep comparison
instead of comparing the pointers. We also can't do the comparison
afterwards, as the gallery is owned by the operation and that operation
is finished already.
2020-12-09 11:47:33 +01:00
Marco Trevisan (Treviño) faade91c39 test-fpi-device: Add function to create fake FpPrint's and galleries 2020-12-09 11:47:33 +01:00
Marco Trevisan (Treviño) 6ca8441df9 umockdev-tests: Don't fail when trying to save other errors 2020-12-09 10:26:58 +01:00
Marco Trevisan (Treviño) 8112da0358 umockdev-tests: Still raise an error when storing the exception output
Otherwise we won't ever fail
2020-12-09 10:26:58 +01:00
Marco Trevisan (Treviño) b5496fd257 fp-device: Ensure finger status is set to proper type on property getter
Finger status is a flag not an enum.

Add tests.
2020-12-04 12:15:22 +00:00
Marco Trevisan (Treviño) 80cf417b30 tests: Check if loading a pre-built binary keep working with libfprint
The libfprint tod fake library is built using using libtod v1.90.1+tod1
and we need to ensure that it will continue working until we won't
change ABI/API.
2020-12-04 02:16:16 +01:00
Marco Trevisan (Treviño) 7b0df77c49 tests: Get tod driver name from env variable 2020-12-04 02:06:54 +01:00
Marco Trevisan (Treviño) 4da4a7041a fp-device: Ensure finger status is set to proper type on property getter
Finger status is a flag not an enum.

Add tests.
2020-12-04 00:49:53 +01:00
Marco Trevisan (Treviño) c9579ab21b test: Run all the fpi-device tests with the dynamically loaded TOD driver
We can ensure better that it works as expected repeating all the device
tests for it too.

The nice part is that we can just do this by re-defininig its GType as
the gtype of the loaded driver.
2020-12-03 04:38:15 +01:00
Marco Trevisan (Treviño) 9cbb3e5f55 tests: Isolate more the TOD tests so that we build the driver without clashes 2020-12-03 04:35:41 +01:00
Marco Trevisan (Treviño) d83453de02 tests: Move tod context creation into test-utils-tod library 2020-12-03 02:39:33 +01:00
Marco Trevisan (Treviño) bbd113594d test-fpi-device: Always check the return values for the API calls
Ensure that the return value of the API calls match the expected one,
as we need to ensure that it also matches with the error/no-error case.
2020-12-03 01:34:44 +01:00
Marco Trevisan (Treviño) a3aadd8398 Merge tag 'v1.90.5' into tod
Tag 1.90.5

Git-EVTag-v0-SHA512: 05650e2a6cf2290542936271b140e79015f56e35fbffc4677e37bf30963b2a38b49eb699db80cee6677ff348ea9e8548514a9f1e06a767269e44d7fac3334c45
2020-12-03 01:32:45 +01:00
Marco Trevisan (Treviño) 12b0120a3d test-fpi-device: Always check the return values for the API calls
Ensure that the return value of the API calls match the expected one,
as we need to ensure that it also matches with the error/no-error case.
2020-12-02 16:28:36 +00:00
Benjamin Berg 1b5dd0057f tests: Add device removal test
This tests all relevant scenarios of device removal, i.e.:
 * device is not open
 * device is currently closing
 * device is open and idle
 * device is currently opening
 * device is open and active

The test ensures that in all scenarios the following holds true:
 * device "removed" signal is only emitted after the action completes
 * context "device-removed" signal is only emitted after the device has
   been closed

Note that the "opening" case is special. Here we confirm that a success
from "open" will not be overriden by a FP_DEVICE_ERROR_REMOVED error, in
order to correctly signal that the internal device state is open and it
needs to be closed.
2020-11-23 17:47:03 +01:00
Benjamin Berg 0051ff6352 device: Treat devices as closed even after a close failure
We require the close call, but as the underlying transport layer is
gone, it will generally just return an error.

In principle, it makes sense to think of close as a function that always
succeeds (i.e. it makes no sense to try again). Should the device be in
a bad state, then a subsequent open() will simply fail.
2020-11-23 17:47:03 +01:00
Marco Trevisan (Treviño) 0c56e0de6d synaptics: Report finger status to libfprint
The inactivation in case would be set back by libfprint
2020-11-07 13:23:30 +00:00
Marco Trevisan (Treviño) 893ff9c033 fp-image-device: Report finger status changes to the device
While the image device has its own finger status tracking, we use a simpler
version as public data information, so let's just report the finger-on/off
and when a finger is expected to the parent class.

Verify that this happens as expected using the virtual-image class
2020-11-07 13:23:30 +00:00
Marco Trevisan (Treviño) 42e4506b1b fp-device: Add finger-status property
It can be used by drivers to report the state of the finger on sensor
2020-11-07 13:23:30 +00:00
Benjamin Berg ae3baadcf9 tests: Add a new test for vfs301
See: #320
2020-11-05 15:55:09 +01:00
Benjamin Berg 4f29a32da8 tests: Store temporary directory on failure
It is not very useful to just delete the data again after a failure, as
it might be useful for debugging. Just store it into an "errors"
subdirectory of the PWD in the hope that this is a sane location.

Note that it'll error out if the directory already exists, but that
should be acceptable in all cases. i.e. it won't exist in the CI and
developers can just wipe the directory.
2020-11-05 15:52:54 +01:00
Benjamin Berg b03f9a502a tests: Remove old README-umockdev file
It has been superseeded by README.md.
2020-10-14 12:39:10 +02:00
Benjamin Berg 62edf93958 tests: Add AES3500 test case
Thanks for Federico Cupellini for providing test samples.
2020-09-29 10:35:48 +02:00
Marco Trevisan (Treviño) 52410c3310 Merge tag 'v1.90.3' into tod
Tag 1.90.3

Git-EVTag-v0-SHA512: 67e0d995146cb82107480520589b6c90583602b3945e03f71c2fdb5f0f2c681143c67e824e0572ae93995e75112c402efaad101f01be5e86a75389e4f1421821
2020-09-24 05:45:35 +02:00
boger.wang 3962372f47 tests: add identify test for driver goodixmoc
add identify ioctl file, modify custom.py add identify test
2020-09-14 09:55:55 +00:00
boger.wang c85f385191 tests: add test for goodixmoc driver 2020-09-01 16:39:06 +08:00
Marco Trevisan (Treviño) 0e123d0752 Merge tag 'v1.90.2' into tod
Tag 1.90.2
2020-06-19 16:27:51 +02:00
Benjamin Berg 390611d5c9 tests: Improve the instructions to create new umockdev captures
Thanks to Evgeny for much of the work and suggestions from Boger Wang.

Co-authored-by: Evgeny Gagauz <evgenij.gagauz@gmail.com>
2020-06-05 15:03:38 +00:00
Benjamin Berg 685052c605 tests: Add test for vfs0050 driver
This test is based on data captured by Evgeny.

Co-authored-by: Evgeny Gagauz <evgenij.gagauz@gmail.com>
2020-06-05 15:03:38 +00:00
Benjamin Berg 4f0b0fa526 tests: Ensure FpDevice checks enrolled prints for completeness
Enrolled prints need to have their type set. FpDevice should ensure that
is the case when a driver returns a print back.
2020-06-05 14:48:57 +00:00
Benjamin Berg 7f58556011 tests: An enrolled print needs to have a type set 2020-06-05 14:48:57 +00:00
Benjamin Berg e4f9935706 Uncrustify with newer version 2020-06-02 11:56:19 +00:00
Benjamin Berg a464f602ca nbis: Apply patch to fix scan-build warnings
Apply the newly added patch to the checkout.
2020-05-07 14:22:02 +00:00
Benjamin Berg 422fc5facf tests: Add unused annotation
The variables exist for memory management but are unused otherwise. Tag
them as such.
2020-05-07 14:22:02 +00:00
Benjamin Berg 6d542edf8a test: Remove unused initialisers
Make the static analysis happy.
2020-05-07 14:22:02 +00:00
Benjamin Berg 8d4d56b1f1 tests: Annotate a few variables as unused
These solely exist for memory management, but the static analysis
complains.
2020-05-07 14:22:02 +00:00
Marco Trevisan (Treviño) 41e05b1133 test-fpi-device: Don't compare error pointers that have been cleared
During verify/identify complete we replace the error pointer that the driver
returned with another error we created, after clearing that one.

However, when we initialize a new error the compiler may reuse the same
allocation of the cleared one, and this might lead to a test failure.

So, don't be so fragile and ignore the pointer check
2020-04-15 14:19:53 +02:00
Bastien Nocera d0751ae06b tests/elan: Fix typos 2020-04-14 13:51:02 +02:00
Marco Trevisan (Treviño) e7ff4f705c tests: Import FPrint only during execution not when parsing
The unittest_parser script would try to import FPrint gi module, but it
would fail as per the fact that none is installed yet, so make sure that
we don't load any FPrint module until we try to actually run the tests
2020-03-27 21:19:09 +00:00
Marco Trevisan (Treviño) 49fd3a5035 Merge tag 'v1.90.1' into tod
Tag 1.90.1
2020-02-27 05:24:32 +01:00
Benjamin Berg f4ec816a6b tests: Cast to correct pointer type rather than gpointer
This is just a small cleanup
2020-02-19 16:42:30 +01:00
Benjamin Berg 9e2a7235e3 tests: Fix reading of gboolean into pointer
Otherwise the payload will be lost later on when using GPOINTER_TO_INT
to cast it back.

See: #236
2020-02-19 16:42:30 +01:00