13 Commits
Author SHA1 Message Date
Stefan Berger 1fa820468f tests: Fix newly detected shellcheck issues SC2086 by quoting
Shellcheck v0.9 detected more SC2086 issues.

Signed-off-by: Stefan Berger <[email protected]>
2023-06-26 20:50:01 -04:00
Stefan Berger 5704342aa8 tests: Fix shellcheck issue SC2181 by if cmd; ...
Signed-off-by: Stefan Berger <[email protected]>
2023-01-27 11:58:54 -05:00
Stefan Berger 4cad2bb32e tests: Fix shellcheck issue SC2143 by using grep -q
Signed-off-by: Stefan Berger <[email protected]>
2023-01-26 08:12:59 -05:00
Stefan Berger fd7a812b24 tests: Fix code to pass shellcheck with some errors disabled
Fix the test cases to pass shellcheck with some of the errors
disable.

Signed-off-by: Stefan Berger <[email protected]>
2023-01-13 13:59:02 -05:00
Stefan Berger cce7503cbf tests: exit with error code if mktemp fails
Signed-off-by: Stefan Berger <[email protected]>
2021-11-02 08:35:49 -04:00
Stefan Berger 468f7e61c3 tests: Fix spelling error swptm->swtpm
This patch fixes issue #410.

Signed-off-by: Stefan Berger <[email protected]>
2021-02-05 16:48:55 -05:00
Stefan Berger f759520c02 tests: Check expected error output against expected error message
Some tests are expected to fail. Capture the error output and test it
against epected error output. This also makes the test output less
noisy.

Also remove some other output noise.

Signed-off-by: Stefan Berger <[email protected]>
2018-10-08 06:43:30 -04:00
Stefan Berger 45d2d092f3 tests: Increase timeout for shutdown for running with valgrind
To avoid timeouts when running the tests with valgrind, increase
the timeout until the swtpm process must have terminated after a
shutdown signal to 4 seconds.

Signed-off-by: Stefan Berger <[email protected]>
2018-10-01 12:52:20 -04:00
Stefan Berger 47c7ea7783 tests: Make the killing of processes less noisy
Signed-off-by: Stefan Berger <[email protected]>
2018-08-07 12:19:47 -04:00
Stefan Berger 313cf75c42 tests: Enable running tests in out-of-source builds
Pass the top_builddir and top_srcdir via TESTS_ENVIRONMENT
variable in Makefile.am.

Use TESTDIR for the path to the test directory and replace
previously used DIR in all occurences.

Signed-off-by: Stefan Berger <[email protected]>
2018-08-07 12:19:47 -04:00
Stefan Berger 36407c937b tests: Use wait_process_gone rather than kill -0
Have the test cases wait for the process to be gone after 1s using
wait_process_gone rather than trying use kill -0 once after 0.5s.

Signed-off-by: Stefan Berger <[email protected]>
2018-07-02 08:26:53 -04:00
Stefan Berger d0f4f18352 tests: Also TPM 1.2 a valid buffer size range
Adapt the test case to check whether the TPM accepted the 4000 byte
buffer size.

Signed-off-by: Stefan Berger <[email protected]>
2017-12-18 20:45:56 -05:00
Stefan Berger 688c8e2400 swtpm: Implemented support for PTM_SET_BUFFERSIZE command
Implement a command for setting and querying the buffer size the
TPM implementation (libtpms) is using. The setting of the
buffersize allows to reduce the size of the buffer to a size
that the interface can support so that these two sizes match
and the TPM will not produce larger responses than what the
interface can support.

Extend swtpm_ioctl with an option to set the buffersize.

Adapt the existing tests to reflect the newly supported command.
Implement a new test for getting/setting of the buffer size.

Signed-off-by: Stefan Berger <[email protected]>
2017-11-05 14:53:00 -05:00