Commit graph

13 commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
59b3d2af8d tests/fprintd-utils: Call addCleanup actions in reverse order
unittest addCleanup calls are called in reverse order, so we need to reverse
the order of the calls as well, otherwise we won't correctly terminate the
subprocess children
2020-11-04 21:04:21 +01:00
Marco Trevisan (Treviño)
93bcac946e tests/fprintd-utils: Move verification tests to a single class
We can factorize various checks, so let's simplify test code
2020-11-04 21:04:19 +01:00
Marco Trevisan (Treviño)
a5063dc0e4 tests/fprintd-utils: Setup the device on setUp()
No need to repeat the action in every unit test, but move the tests to a
different class to easily allow adding another class with tests with no
such initialization
2020-11-04 20:20:29 +01:00
Marco Trevisan (Treviño)
5fbc38c938 tests/fprintd-utils: Run super setUp/tearDown functions 2020-11-04 20:04:21 +01:00
Marco Trevisan (Treviño)
714f499ab6 tests: Double the timeouts when testing with address sanitizer 2020-04-01 13:58:08 +00:00
Marco Trevisan (Treviño)
d27872ff86 test_fprintd_utils: Don't use hard-coded sleep time
Make sleep time on verification dependent on the environment, so that it's
different when under valgrind
2020-03-17 17:14:35 +01:00
Marco Trevisan (Treviño)
cfbded36e1 test_fprintd_utils: Use a non-blocking pipe to read output
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
2020-03-17 17:14:35 +01:00
Marco Trevisan (Treviño)
072fbc2b46 tests_fprintd_utils: Print the process output when done
This is particularly useful when using valgrind or address sanitizer to read
the output log
2020-03-17 17:14:35 +01:00
Marco Trevisan (Treviño)
7846359b65 test_fprintd_utils: De-duplicate utilities launching
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.
2020-03-17 17:14:35 +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
Bastien Nocera
f1517af09a tests: Add fprintd-verify test that uses scripting 2020-01-20 17:31:46 +01:00
Bastien Nocera
c0bf1515fd tests: Check that verify test doesn't succeed early 2020-01-20 17:31:08 +01:00
Bastien Nocera
431755becd tests: Add test for fprintd utils 2020-01-17 15:32:22 +01:00