Commit Graph

67 Commits

Author SHA1 Message Date
0994cc314e main: Ensure that a gcov flush happens on SIGTERM
When coverage is enabled fprintd test won't generate any .gcda file and so
apparently no data, this happens because gcov doesn't handle properly the
process termination when SIGTERM is used, and so when in fprintd.py we
terminate the process no coverage data is reported.

To avoid this, quit the main loop cleanly on SIGTERM, so that we will exit
from the main function cleanly, making libc to perform a gcov flush when we
exit the program.
2020-02-05 16:45:57 +01:00
75aeff4acd tests: Increase debugging level for PAM tests 2020-02-05 15:25:35 +01:00
bebd3d2a98 tests: Increase debugging for daemon tests 2020-02-05 15:25:35 +01:00
eb6dbb6953 build: Add meson build system
Reuse the generated dbus interface .xml files from fprintd to avoid
unnecessary copies.
2020-02-05 15:25:35 +01:00
5c5849dca7 build: Don't hardcode libtool specific build path
Don't hardcode the libtool specific build path in the configuration
file, but in the build declaration instead.
2020-02-05 13:43:27 +01:00
048181ae7f test_fprintd_utils: Support running under valgrind
Like for the fprintd test, run the tests under valgrind if the `VALGRIND`
environment variable is set, and use the contents of the variable as the
path to the suppression file.
2020-02-04 15:39:01 +01:00
8e3345a60f tests: Fix num-enroll-stages signature in dbusmock template
It's marked as a signed integer, not an unsigned one in the API.
2020-02-04 15:38:17 +01:00
33a21b5089 tests/fprintd: Test error conditions on Claim()/Release() 2020-02-04 15:36:06 +01:00
dd006382f5 tests/fprintd: Test ListEnrolledFingers() method 2020-02-04 15:33:09 +01:00
a34432ccf9 tests/fprintd: Add assertFprintError to check errors 2020-02-04 15:28:57 +01:00
f2804921a3 tests/fprintd: Use unittest assertions more often 2020-02-04 15:27:24 +01:00
74577a6806 tests/fprintd: Add a FPrintdVirtualDeviceTest to avoid repeating setup 2020-02-04 15:21:50 +01:00
319d859107 tests: Add PAM test that succeeds on last try
Exhaust all the tries (minus 1) before having a match on the last try.
This should not throw a warning.
2020-02-04 13:35:48 +01:00
5a8da0022a tests: Make warnings fatal in PAM tests
This will catch problems with GLib being unloaded when the PAM module is
unloaded, which would have crashed when using dbus-glib.

This serves as a test for https://gitlab.freedesktop.org/libfprint/fprintd/issues/2

Closes: #2
2020-01-24 17:03:32 +01:00
affffaf134 pam: Return PAM_MAXTRIES after too many tries 2020-01-24 00:51:13 +01:00
6ab270fb1a tests: Reduce the default timeout in tests 2020-01-24 00:51:13 +01:00
2d0bed6b13 tests: Add PAM timeout test 2020-01-24 00:51:13 +01:00
c43134e36f tests: Add PAM test with 2 readers 2020-01-24 00:51:13 +01:00
b9d23ddb87 tests: Fix dbusmock template when adding > 1 reader 2020-01-24 00:51:13 +01:00
205dedae4f tests: Add dbus-monitor'ing to PAM tests
Should prove useful debugging the PAM module if we need it.
2020-01-24 00:51:13 +01:00
00b79d1a2f tests: Add test for the PAM module
Test the PAM module using pam_wrapper and our mock fprintd.

See https://lwn.net/Articles/671094/

Note that this requires a version of pam_wrapper with this bug fixed:
https://bugzilla.samba.org/show_bug.cgi?id=14245
2020-01-22 15:34:02 +01:00
f1517af09a tests: Add fprintd-verify test that uses scripting 2020-01-20 17:31:46 +01:00
c0bf1515fd tests: Check that verify test doesn't succeed early 2020-01-20 17:31:08 +01:00
872089883c tests: Add scripting capabilities to the verification process
Add scripting capabilities to the verification process so that the mock
daemon can send its own results without needing the client to prod it to
do that. This is incredibly useful when the client is single threaded
and blocking.

Note that there are barely any safeguards, so the scripting task is not
cancelled if an error occurs, or the VerifyStatus signals are sent out
of order.
2020-01-20 17:26:24 +01:00
431755becd tests: Add test for fprintd utils 2020-01-17 15:32:22 +01:00
0a42b90390 tests: Add dbusmock template for fprintd daemon 2020-01-17 15:18:43 +01:00
74838f9efc tests: Add basic integration test
This test uses the virtual image driver included in libfprint for
testing.
2019-12-03 17:08:04 +01:00
54ba81191e tests: Add test prints from libfprint
These can be freely redistributed as they are in the public domain. See
the included README.
2019-12-03 17:08:03 +01:00
3db69c2c2f utils: Move test binaries into utils
These utilities are generally useful beyond only testing purproses. And,
since it is desirable to have automated tests inside the tests
subdirecty, it makes sense to move them elsewhere.
2019-12-03 17:08:03 +01:00
06ea385260 tests: call g_type_init only if using an old glib
Calling g_type_init() is not needed anymore and deprecated since
glib version 2.36.

https://bugs.freedesktop.org/show_bug.cgi?id=99812
2017-02-14 17:14:20 +01:00
56683b1098 tests: Fix listing/deleting with more than one reader
We were always reading the information for reader 0.
2015-02-03 16:44:31 +01:00
f7c51b0d58 tests: Fix segfault in verify when used without -f
We tried to use strcmp on a NULL string.

https://bugs.freedesktop.org/show_bug.cgi?id=85736
2014-11-02 16:34:02 +01:00
73ed60a60d tests: Fix possible crash in fprintd-verify
https://bugs.freedesktop.org/show_bug.cgi?id=75111
2014-02-18 18:32:48 +01:00
d7e326a776 tests: List possible values for finger when enrolling
When the "-f" parameter of fprintd-enroll is incorrect, list
the possible values.
2014-02-18 18:32:08 +01:00
7eb1f0fd86 tests: Support -f 'finger' option for enroll
Add support for -f 'finger' option to fprintd-enroll.
Update docs accordingly.

https://bugs.freedesktop.org/show_bug.cgi?id=62644
2013-06-26 13:10:17 +02:00
71bc81468f tests: Another uninitialised variable use
The GError was used without being initialised.

https://bugs.freedesktop.org/show_bug.cgi?id=53900
2012-08-28 22:10:39 +01:00
b80f7359c3 tests: Fix uninitialised variable use
The GError was used without being initialised.

https://bugs.freedesktop.org/show_bug.cgi?id=53900
2012-08-28 19:29:20 +01:00
ebe1a062e0 tests: Remove unused variables 2011-03-30 16:40:35 +01:00
5a90a806dc Remove all use of g_error()
Otherwise we get bug reports about crashers that aren't crashers.
2010-08-16 19:33:45 +01:00
4ea1c48f9f Detect when a device is disconnected
Pretty hacky way to detect whether the device we're handling has
been disconnected during a verify or enrollment. This should allow
us to avoid users having to wait when somebody pulls the plug.
2009-01-27 16:45:47 -03:00
3941c3bff2 Add fprintd-delete program
Deletes all the fingerprints on all the registered devices.
2008-12-04 13:23:51 +00:00
5ba723e3f2 Fix program description
In the source header
2008-12-04 13:23:51 +00:00
4efa0d4878 Fix stupidness in the fprintd-enroll
This fixes fprintd-enroll not working on devices that require
more than one swipe.
2008-12-04 13:23:51 +00:00
af5b8a6e37 Don't error out when there's no fingerprints
Instead, print out some information about the device, and carry
on to the next one.
2008-12-04 13:23:50 +00:00
6fc861a154 Use dbus_g_proxy_new_from_proxy
Removes the need to have the dbus connection around.
2008-11-24 17:20:45 +00:00
c9fdeb47aa Use D-Bus properties instead of GetProperties
- Use D-Bus native properties instead of a GetProperties call.
- Fix a number of front-ends by registering the right signals and
marshallers following the "done" signal argument addition
- Fix VerifyStart call in the pam module
2008-11-22 13:00:48 +00:00
26aab5dc28 Add a done argument to result signals
For verify and enroll, add a done argument so that front-end
know easily when they should be closing the device.
2008-11-21 18:15:51 +00:00
874d8164b4 Add ScanType and NumberEnrollStages properties
Export the type of scan the device performs, and, when the device
is claimed, the number of enrollment stages.
2008-11-21 18:15:50 +00:00
f7186c7ff0 Remove all uses of enums in the API
The clients aren't supposed to know the magic numbers for enums,
so use strings instead.
2008-11-21 18:15:50 +00:00
5426b1a472 Use GetDefaultDevice
As we're not using the non-default device anyway.
2008-11-21 18:15:21 +00:00