- 07 Apr, 2020 1 commit
-
-
Bastien Nocera authored
This error is supposed to help replicate the problems encountered in: #59
-
- 01 Apr, 2020 5 commits
-
-
-
-
An application terminating because of a signal like SIGSEGV, SIGABRT and friends, will exit with a signal number that is 128 + $SIGNAL_NUMBER, so let's ensure that the daemon has not been terminated because of a such error This makes even more sense with address sanitizer builds, as the daemon would exit with abort.
-
Make possible to run tests with address sanitizer to quickly check for memory errors, although we have to disable the error exit code in case of leaks because we have some which are due to something else down in the stack (and LSAN suppression files doesn't allow to define the stack to ignore as we can in valgrind). However, we'd abort in case of memory errors anyways, so this still helps to prevent major problems, while still logging the leaks. In order to run pam module tests with ASAN we need to manually pass the library to LD_PRELOAD, as we do for the wrapper.
-
In order to run pam module tests we need to pass the libraries via LD_PRELOAD, this supports a list of library paths, so use the compiler in order to find their full paths (with soname) and check their presence. In order to support linker scripts we need to introduce a workaround. See meson issue https://github.com/mesonbuild/meson/issues/6880
-
- 31 Mar, 2020 1 commit
-
-
Marco Trevisan authored
Meson supports checking for default arguments natively without having to do this for each one, so just use this feature. Not doing this will become a warning as per meson 0.52.0 [1]. [1] https://github.com/mesonbuild/meson/pull/5627
-
- 27 Mar, 2020 8 commits
-
-
Marco Trevisan authored
The test doesn't need any assertion because we're calling DeleteEnrolledFingers and in case it fails a net.reactivated.Fprint.Error.PermissionDenied error would be thrown, and thus an exception would be raised at python level, making the test to fail.
-
Bastien Nocera authored
-
Bastien Nocera authored
As per systemd's documentation: If multiple directories are set, then in the environment variable the paths are concatenated with colon (":"). Handle that case by splitting the paths if there's a ":" in the variable. Closes: #50
-
Bastien Nocera authored
test_claim_from_other_client_is_released_when_vanished would fail on the CI but work on a local system because we wouldn't want long enough for the "vanished" code path to be taken into account. Add a small timeout to make sure it works on the CI as well.
-
Bastien Nocera authored
enroll_image() was always waiting for enroll-completed rather than for what the caller expected as the result. ====================================================================== FAIL: test_enroll_invalid_storage_dir (__main__.FPrintdVirtualDeviceClaimedTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/hadess/Projects/jhbuild/fprintd/tests/fprintd.py", line 661, in test_enroll_invalid_storage_dir self.enroll_image('whorl', expected_result='enroll-failed') File "/home/hadess/Projects/jhbuild/fprintd/tests/fprintd.py", line 384, in enroll_image self.wait_for_result('enroll-completed') File "/home/hadess/Projects/jhbuild/fprintd/tests/fprintd.py", line 373, in wait_for_result self.assertEqual(self._last_result, expected) AssertionError: 'enroll-failed' != 'enroll-completed' - enroll-failed + enroll-completed
-
Marco Trevisan authored
We run a certain number of tests right now, without being able to easily run them separated or to check which one failed. So add a script to inspect all the available unittests per each python script and use it to figure out the tests we can run in meson. As per this, define a global 'python_tests' variable in meson that allows to register new python tests easily without having to repeat the settings for all the tests. For each test we have, we check if we can fetch a list of unit tests, and if possible we create a meson test for each one. Otherwise we just fallback to normal behavior. This is something that can be hopefully implemented into upstream meson [1]. [1] https://github.com/mesonbuild/meson/issues/6851
-
Marco Trevisan authored
Use unittest_inspector that we provide for meson tests inspection as well
-
Marco Trevisan authored
The unit tests files are provided as python files, adding a tool that allows to list them in order to be able to run them easily via python3 -m unittest module.Class.test_method
-
- 24 Mar, 2020 3 commits
-
-
Bastien Nocera authored
The CI definition needs to be updated to work with the new fdo templates. Adapted from libfprint@bd4f118b
-
Bastien Nocera authored
This reverts commit 01ea517a.
-
Bastien Nocera authored
This reverts commit 10a3e759.
-
- 23 Mar, 2020 2 commits
-
-
Timothy Gu authored
On my laptop it takes 48 seconds to run.
-
Timothy Gu authored
The test file calls self.daemon_start() in order to start fprintd and locate the virtual image device that's needed for the test to run. However, since the virtual image driver is not available on all libfprint installations, the test should be skipped if the driver is not available. The skipping mechanism used to work, by checking if self.device is None. This is based on the assumption that self.device would be set to None in cases where the driver is not available. However, even in the past self.device is only set to None in the tearDown method and not in setUp, so presumably in edge cases it didn't entirely work. However, since 0fb4f3b0 which consistently removes the self.device attribute rather than setting it to None, the "self.device is None" check no longer works. In particular, the following error message is shown: test_manager_get_default_device (__main__.FPrintdManagerTests) ... Did not find virtual device! Probably libfprint was build without the corresponding driver! ERROR After this patch, the following is shown: test_manager_get_default_device (__main__.FPrintdManagerTests) ... Did not find virtual device! Probably libfprint was build without the corresponding driver! skipped 'Need virtual_image device to run the test' We fix this bug by consistently setting self.device to None, in both the setUp method before daemon_start gets called, and in tearDown. We also make the same change to self.manager for consistency. The issue was not caught on CI, as the CI configuration always installs a libfprint version that has the virtual_image device explicitly enabled in the preparation phase.
-
- 20 Mar, 2020 1 commit
-
-
Timothy Gu authored
The include is present in all other binaries in utils/.
-
- 17 Mar, 2020 19 commits
-
-
Make sleep time on verification dependent on the environment, so that it's different when under valgrind
-
Avoid using a temporary file for reading the utilities output, so we can read it as it comes, ignoring the previous one, and avoiding open/closing the file. To keep the output printing on cleanup working, adding an utility function that reads the output and save it for later printing
-
This is particularly useful when using valgrind or address sanitizer to read the output log
-
Avoid repeating the same operation to launch the utilities all the times, but provide instead a function that allows to start a process and saves its output without having to handle this in every test. Simplify the operation when we just want the final output, still reusing the same code.
-
-
Add support to run fprintd-utils to test fprint daemon, and ensure that a device is released and its operation cancelled once a caller goes away. Related to libfprint/fprintd#37
-
-
-
Throw a NoEnrolledPrints error if the requested finger isn't present in the gallery.
-
-
-
When starting an enroll when verification is in progress (and vice-versa) we emit an AlreadyInUse error, however when calling VerifyStop() during an enrollment (and vice-versa) we just return a NoActionInProgress error, which is not the case. So let's be consistent and change the error type.
-
-
-
-
-
-
-
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
-