Commit Graph

18 Commits

Author SHA1 Message Date
084e5bfafd tests/dbusmock/polkitd: Remove unwanted method, from a fprintd copy-paste 2021-03-23 19:00:33 +01:00
d53eaa7d89 tests/dbusmock/polkitd: Do not look for mock object again
We already get it as the parameter of the load function, so no need
to find it
2021-03-23 19:00:23 +01:00
29a83ec49a tests/dbusmock/fprintd: Do not redefine device object methods multiple times
They will picked anyways by python dbusmock
2021-03-23 18:59:22 +01:00
6f355797f8 device: Throw a NoEnrolledPrints error if trying to delete a device with no prints
Adjust tests accordingly
2021-03-03 19:49:07 +01:00
a170a3a09f tests: Check that PAM stops if the device could not be claimed 2020-12-07 15:27:14 +01:00
3242b99410 dbusmock/fprintd: Support more complex verify scripts
This now allows:
 * Sending signals before and after method return
 * Exiting the daemon
 * Emulating NoEnrolledPrints DBus method error

Co-authored-by: Benjamin Berg <bberg@redhat.com>
2020-12-07 15:27:14 +01:00
8c46fddd03 verify: Fix verify script to work correctly
The verify script would start an async routine. However, this blocks the
dbus return, which really is needed.

Also, we should only return one item of the script for each VerifyStart
run. So, fix things by pop'ing the first item and putting it on the bus
from a GLib.add_timeout handler.
2020-12-07 15:27:14 +01:00
9d6c7eb1a9 dbusmock/polkitd: Add ability to simulate call hangs or delays
Added various methods that allow to make methods to delay to return a
value, both by using timing functions and using a way to manually
stop and restart the calls.

This is mostly done using async callbacks in dbus methods
2020-11-10 14:45:59 +01:00
5611317c72 tests: Add standalone PolkitD implementation
We need to be able to hack this to be an async daemon to perform some
multi-thread tests, so replacing default implementation with a simple
one that for now just does same of default
2020-11-10 14:45:59 +01:00
6797928884 dbusmock/fprintd: Add ability to add a device with Identification support
Devices which have identification support "any" finger and do not fallback
to a single-finger check.
2020-11-04 21:06:13 +01:00
d6c70be822 dbusmock/fprintd: Add ability to remove devices 2020-11-04 21:06:13 +01:00
94d3a18dcd tests/fprintd-utils: Check that verify returns an error if no finger is set 2020-11-04 21:06:13 +01:00
ac98b881be dbusmock/fprintd: Make possible to retrieve the finger selected for verification
So that we can ensure that the client requested the one we expect
2020-11-04 21:06:13 +01:00
629f7fcc11 dbusmock/fprintd: Reset the current action on release
So it happens in the real daemon
2020-11-04 21:06:13 +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
b9d23ddb87 tests: Fix dbusmock template when adding > 1 reader 2020-01-24 00:51:13 +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
0a42b90390 tests: Add dbusmock template for fprintd daemon 2020-01-17 15:18:43 +01:00