Marco Trevisan (Treviño)
086ceb98ab
tests/fprintd: Ensure enroll fails on storage save failure
2020-03-17 17:10:17 +01:00
Marco Trevisan (Treviño)
8bdbc7e2b0
tests/fprintd: Ensure that we can't verify without enrolled fingers
2020-03-17 17:10:17 +01:00
Marco Trevisan (Treviño)
1f8bb1abd4
tests/fprintd: Ensure that devices are available on name appeared
...
Given we don't support adding devices after we created the manager (yet) we
must ensure that once the name appeared we have them all
2020-03-17 17:10:17 +01:00
Marco Trevisan (Treviño)
47d55a97c4
tests/fprintd: Add tests for Manager methods
2020-03-17 17:10:17 +01:00
Marco Trevisan (Treviño)
657b90a066
tests/fprintd: Move assertFprintError to FPrintdTest
...
This may be used by any class inheriting FPrintdTest, so let's move it at
lower level.
2020-03-17 17:10:17 +01:00
Marco Trevisan (Treviño)
3821b96ca5
tests/fprintd: Only enable 'virtual_image' driver
...
When we run tests in a system with real devices, we may try to initialize
the real ones, while we can just ignore them all in tests.
We do it in setUp instead of setUpClass to allow tests to change this if
they need to, but just for temporary.
2020-03-17 17:10:17 +01:00
Marco Trevisan (Treviño)
22ad9b5ae8
tests/fprintd: Check all the error types during verify/enroll
...
Ensure that we properly handle all the errors that a driver may return us
2020-03-17 17:10:17 +01:00
Marco Trevisan (Treviño)
2ddc8a86a2
tests/fprind: Add verify retry tests for all the cases
...
The tests are repeated for both verify and identify actions
2020-03-17 17:10:17 +01:00
Marco Trevisan (Treviño)
930cae4647
tests/fprind: Add enroll retry tests for all the cases
2020-03-17 17:10:17 +01:00
Marco Trevisan (Treviño)
af18aa35e5
tests/fprintd: Add tests to verify permissions on prints management
2020-03-17 17:10:16 +01:00
Marco Trevisan (Treviño)
0d7a703200
tests/fprintd: Split claimed device tests to a single class
...
Avoid doing fo reach test the Claim/Release procedure manually if it is just
a prerequisite for the test.
2020-03-17 17:09:19 +01:00
Marco Trevisan (Treviño)
ad19c49e2e
tests/fprintd: Move tests which need a claimed device
2020-03-17 17:09:19 +01:00
Marco Trevisan (Treviño)
a8de1003a4
tests/fprintd: Use addCleanup to always terminate daemons
...
Ensure that the daemons are always terminated after each test, even on
failure, so that we don't have to do hacks such as always trying to stop
them
2020-03-17 17:09:19 +01:00
Marco Trevisan (Treviño)
cefe939141
tests/fprintd: Use addCleanup to ensure we remove the test dir
2020-03-17 17:09:19 +01:00
Marco Trevisan (Treviño)
24cd986476
tests/fprintd: Use GTestDBus unset to undefine envs
...
Unset the dbus environment that may affect the dbus tests using GTestDBus
utility, instead of doing it manually.
2020-03-17 17:09:19 +01:00
Marco Trevisan (Treviño)
06480c7994
tests/fprintd: Use a new bus for each test unit
...
When creating a new unit we used to get the system bus via Gio.bus_get_sync,
however this has a singleton implementation, and so would always return the
same connection, creating issues in tests when a new test suite is added
because the newly got connection would be already closed.
So, just manually create a new bus connection, also close the bus and
cleanup the test bus in dbus.
2020-03-17 17:09:19 +01:00
Marco Trevisan (Treviño)
b2ad590891
tests/fprintd: Call the super class on setup
2020-03-17 17:09:19 +01:00
Marco Trevisan (Treviño)
85aad7bb01
tests/fprintd: Remove usage of never-used self.client variable
2020-03-17 17:09:19 +01:00
Marco Trevisan (Treviño)
0fb4f3b021
tests/fprintd: Cleanup the client proxies on tearDown
...
Ensure we nullify them when the test is done.
2020-03-17 17:09:19 +01:00
Marco Trevisan (Treviño)
21564885ea
tests/fprintd: Do the parent tearDown after we've done our stuff
2020-03-17 17:09:19 +01:00
Marco Trevisan (Treviño)
6064e30200
tests/fprintd: Remove the force-exit timeout
...
Since we rely on meson now to do this, we don't need to have manual
management of the timeout
2020-03-17 17:09:19 +01:00
Marco Trevisan (Treviño)
fd8297306c
tests/fprintd: Ensure that we get an error on early release
...
Ensure that we get an error when releasing a device that is in process of
enrollment, verification or identification
2020-03-17 17:09:19 +01:00
Marco Trevisan (Treviño)
0e993d92e2
device: Return 'verify-no-match' on cancelled verification
...
We were returning a 'verify-unknown-error' while we actually know what
happened, so better to return a soft operation failure.
2020-03-17 17:09:19 +01:00
Marco Trevisan (Treviño)
b312a5e540
device: Return 'enroll-failed' on cancelled enrollment
...
We were returning an 'enroll-unknown-error' while we actually know what
happened, so better to return a soft operation failure.
2020-03-17 17:09:19 +01:00
Marco Trevisan (Treviño)
c12778ec5b
tests/fprintd: Verify that each enroll stage happens
...
Instead of automatically replying with the 'whorl' image for every enroll
state signal with result 'enroll-stage-passed', only perform the number
of required enroll stages and ensure that we get the expected results.
This also will allow to manually perform enroll steps in other tests.
2020-03-17 17:09:19 +01:00
Marco Trevisan (Treviño)
dbabd4d7d3
tests/fprintd: Deduplicate enrollment code
2020-03-17 15:54:14 +01:00
Marco Trevisan (Treviño)
db1865eb3e
tests/fprintd: Deduplicate result wait code
2020-03-17 15:49:40 +01:00
Bastien Nocera
73625233f6
build: Remove autotools support
2020-02-05 16:54:54 +01:00
Marco Trevisan (Treviño)
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
Marco Trevisan (Treviño)
75aeff4acd
tests: Increase debugging level for PAM tests
2020-02-05 15:25:35 +01:00
Marco Trevisan (Treviño)
bebd3d2a98
tests: Increase debugging for daemon tests
2020-02-05 15:25:35 +01:00
Marco Trevisan (Treviño)
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
Marco Trevisan (Treviño)
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
Marco Trevisan (Treviño)
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
Marco Trevisan (Treviño)
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
Marco Trevisan (Treviño)
33a21b5089
tests/fprintd: Test error conditions on Claim()/Release()
2020-02-04 15:36:06 +01:00
Marco Trevisan (Treviño)
dd006382f5
tests/fprintd: Test ListEnrolledFingers() method
2020-02-04 15:33:09 +01:00
Marco Trevisan (Treviño)
a34432ccf9
tests/fprintd: Add assertFprintError to check errors
2020-02-04 15:28:57 +01:00
Marco Trevisan (Treviño)
f2804921a3
tests/fprintd: Use unittest assertions more often
2020-02-04 15:27:24 +01:00
Marco Trevisan (Treviño)
74577a6806
tests/fprintd: Add a FPrintdVirtualDeviceTest to avoid repeating setup
2020-02-04 15:21:50 +01:00
Bastien Nocera
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
Bastien Nocera
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
Bastien Nocera
affffaf134
pam: Return PAM_MAXTRIES after too many tries
2020-01-24 00:51:13 +01:00
Bastien Nocera
6ab270fb1a
tests: Reduce the default timeout in tests
2020-01-24 00:51:13 +01:00
Bastien Nocera
2d0bed6b13
tests: Add PAM timeout test
2020-01-24 00:51:13 +01:00
Bastien Nocera
c43134e36f
tests: Add PAM test with 2 readers
2020-01-24 00:51:13 +01:00
Bastien Nocera
b9d23ddb87
tests: Fix dbusmock template when adding > 1 reader
2020-01-24 00:51:13 +01:00
Bastien Nocera
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
Bastien Nocera
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
Bastien Nocera
f1517af09a
tests: Add fprintd-verify test that uses scripting
2020-01-20 17:31:46 +01:00