swtpm/tests
Stefan Berger 5677f2caf5 tests: Set OPENSSL_ENABLE_SHA1_SIGNATURES=1 for IBMTSS2 test
The IBMTSS2 tests suite creates signatures over SHA1 that may now fail on
RHEL 9.x and CentOS 9. To have these tests succeed set
OPENSSL_ENABLE_SHA1_SIGNATURES=1 so the tests do not need to be modified
and also check that the TPM 2 can handle SHA1 signatures as before.
'swtpm socket --tpm2' should set this environment variable automatically
if needed.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-08-21 12:13:26 -04:00
..
data tests: Add test case for testing profiles across libtpms versions 2024-07-22 09:46:58 -04:00
patches tests: Remove unncessary patches for ibmtss2 test suite 2024-07-22 11:57:12 -04:00
_test_encrypted_state tests: Fix spelling mistakes 2023-07-17 20:46:43 -04:00
_test_getcap tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_hashing tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_hashing2 tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_init tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_locality tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_migration_key tests: Fix spelling mistakes 2023-07-17 20:46:43 -04:00
_test_migration_key_2 tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
_test_print_capabilities swtpm_setup: Print profile names as part of capabilities JSON 2024-07-22 09:46:58 -04:00
_test_print_states tests: Add test cases for using swtpm --print-states while swtpm is running 2024-06-11 08:43:01 -04:00
_test_resume_volatile tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_save_load_encrypted_state tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_save_load_state tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_setbuffersize tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_swtpm_bios tests: teach them to run installed 2024-07-15 10:38:38 -04:00
_test_tpm2_avoid_da_lockout tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_tpm2_derived_keys tests: Remove unnecessary '\' before '/' 2024-01-08 15:04:38 -05:00
_test_tpm2_encrypted_state tests: Fix spelling mistakes 2023-07-17 20:46:43 -04:00
_test_tpm2_file_permissions tests: use swtpm_setup.conf from tests 2024-07-15 10:38:38 -04:00
_test_tpm2_getcap tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_tpm2_hashing tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_hashing2 tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_hashing3 tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_tpm2_init tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_tpm2_locality tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_tpm2_migration_key tests: Fix spelling mistakes 2023-07-17 20:46:43 -04:00
_test_tpm2_print_capabilities swtpm_setup: Print profile names as part of capabilities JSON 2024-07-22 09:46:58 -04:00
_test_tpm2_print_states tests: Use regex to compare --print-states sizes output 2024-06-17 12:49:14 -04:00
_test_tpm2_probe tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_tpm2_resume_volatile tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_save_load_encrypted_state tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_tpm2_save_load_state tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_tpm2_save_load_state_da_timeout tests: Fix spelling mistakes 2023-07-17 20:46:43 -04:00
_test_tpm2_save_load_state_locking tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_savestate tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_tpm2_setbuffersize tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_swtpm_bios tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_volatilestate tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_tpm2_wrongorder tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_tpm_probe tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_volatilestate tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
_test_wrongorder tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
common tests: drop the need to set INSTALLED=1 when running tests 2024-07-15 10:38:38 -04:00
create_certs.sh scripting: Use #!/usr/bin/env bash rather than /bin/bash 2018-09-10 16:49:12 +00:00
installed-runner.sh tests: drop the need to set INSTALLED=1 when running tests 2024-07-15 10:38:38 -04:00
load_vtpm_proxy tests: Fix shellcheck issue SC2148 by adding a shell directive 2023-01-30 18:25:45 -05:00
Makefile.am tests: Remove unncessary patches for ibmtss2 test suite 2024-07-22 11:57:12 -04:00
Readme.md tests: Add a Readme describing how to run the swtpm tests 2021-03-17 19:19:10 -04:00
softhsm_setup tests: Add softhsm_setup to shellcheck'ed files and fix issues 2023-11-22 07:16:44 -05:00
swtpm_setup.conf treewide: remove executable bit from config files and c-code 2018-01-17 10:45:25 -05:00
test_clientfds.py swtpm: Implement CMD_LOCK_STORAGE to lock storage 2022-09-06 14:08:45 -04:00
test_commandline tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
test_common tests: Fix shellcheck issue SC2148 by adding a shell directive 2023-01-30 18:25:45 -05:00
test_config.in build: remove hardcoded tss user and group 2015-11-02 20:47:37 -05:00
test_ctrlchannel tests: Fix 2 cases of shellcheck SC2001 using bash search-replace 2023-01-30 18:25:45 -05:00
test_ctrlchannel2 tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
test_ctrlchannel3 tests: Fix code to pass shellcheck with some errors disabled 2023-01-13 13:59:02 -05:00
test_ctrlchannel4 tests: Fix code to pass shellcheck with some errors disabled 2023-01-13 13:59:02 -05:00
test_cuse tests: Fix spelling mistakes 2023-07-17 20:46:43 -04:00
test_encrypted_state tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_getcap tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_hashing tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_hashing2 tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_init tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_locality tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_migration_key tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_parameters tests: teach them to run installed 2024-07-15 10:38:38 -04:00
test_print_capabilities tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_print_states tests: Add test cases for using swtpm --print-states while swtpm is running 2024-06-11 08:43:01 -04:00
test_resume_volatile tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_samples_create_tpmca tests: Fix shellcheck issue SC2115 by using "${var:?}" 2023-01-29 15:04:00 -05:00
test_save_load_encrypted_state tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_save_load_state tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_setbuffersize tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_setdatafd.py tests: Replicate test_ctrlchannel3 for TPM 2 to test_tpm2_ctrlchannel3 2022-09-22 13:27:38 -04:00
test_swtpm_bios tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_swtpm_cert tests: teach them to run installed 2024-07-15 10:38:38 -04:00
test_swtpm_setup_create_cert tests: teach them to run installed 2024-07-15 10:38:38 -04:00
test_swtpm_setup_file_backend tests: use swtpm_setup.conf from tests 2024-07-15 10:38:38 -04:00
test_swtpm_setup_misc tests: Rearrange order of test cases to run some also as 'root' 2024-03-19 14:28:01 -04:00
test_swtpm_setup_overwrite tests: use swtpm_setup.conf from tests 2024-07-15 10:38:38 -04:00
test_tpm2_avoid_da_lockout tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_chroot_chardev tests: Fix code to pass shellcheck with some errors disabled 2023-01-13 13:59:02 -05:00
test_tpm2_chroot_cuse tests: Fix code to pass shellcheck with some errors disabled 2023-01-13 13:59:02 -05:00
test_tpm2_chroot_socket tests: Fix code to pass shellcheck with some errors disabled 2023-01-13 13:59:02 -05:00
test_tpm2_ctrlchannel2 tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
test_tpm2_ctrlchannel3 tests: Fix code to pass shellcheck with some errors disabled 2023-01-13 13:59:02 -05:00
test_tpm2_derived_keys tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_encrypted_state tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_file_permissions tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_getcap tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_hashing tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_hashing2 tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_hashing3 tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_ibmtss2 tests: Set OPENSSL_ENABLE_SHA1_SIGNATURES=1 for IBMTSS2 test 2024-08-21 12:13:26 -04:00
test_tpm2_init tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_libtpms_versions_profiles tests: Extend test case testing across libtpms versions 2024-07-24 20:46:42 -04:00
test_tpm2_locality tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_migration_key tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_parameters tests: teach them to run installed 2024-07-15 10:38:38 -04:00
test_tpm2_partial_reads tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
test_tpm2_print_capabilities tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_print_states tests: Add test cases for using swtpm --print-states while swtpm is running 2024-06-11 08:43:01 -04:00
test_tpm2_probe tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_resume_volatile tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_samples_create_tpmca.test tests: Fix shellcheck issue SC2115 by using "${var:?}" 2023-01-29 15:04:00 -05:00
test_tpm2_save_load_encrypted_state tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_save_load_state tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_save_load_state_2 tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
test_tpm2_save_load_state_2_block tests: Fix 3 occurrences of stray '\' before '-' 2024-06-10 19:40:31 -04:00
test_tpm2_save_load_state_2_linear tests: Fix code to pass shellcheck with some errors disabled 2023-01-13 13:59:02 -05:00
test_tpm2_save_load_state_3 tests: Fix spelling mistakes 2023-07-17 20:46:43 -04:00
test_tpm2_save_load_state_da_timeout tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_save_load_state_locking tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_savestate tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_setbuffersize tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_swtpm_bios tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_swtpm_cert tests: teach them to run installed 2024-07-15 10:38:38 -04:00
test_tpm2_swtpm_cert_ecc tests: teach them to run installed 2024-07-15 10:38:38 -04:00
test_tpm2_swtpm_localca tests: teach them to run installed 2024-07-15 10:38:38 -04:00
test_tpm2_swtpm_localca_pkcs11.test tests: teach them to run installed 2024-07-15 10:38:38 -04:00
test_tpm2_swtpm_setup_create_cert tests: teach them to run installed 2024-07-15 10:38:38 -04:00
test_tpm2_swtpm_setup_overwrite tests: use swtpm_setup.conf from tests 2024-07-15 10:38:38 -04:00
test_tpm2_swtpm_setup_profile tests: Add missing 7th parameter to function call 2024-08-20 11:39:03 -04:00
test_tpm2_volatilestate tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_vtpm_proxy tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
test_tpm2_wrongorder tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm12 tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
test_tpm_probe tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_volatilestate tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_vtpm_proxy tests: Fix newly detected shellcheck issues SC2086 by quoting 2023-06-26 20:50:01 -04:00
test_wrongorder tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00

This directory contains the swtpm tests.

To run the tests you need to build swtpm first and then you can run the tests using the following command line:

SWTPM_TEST_EXPENSIVE=1 SWTPM_TEST_STORE_VOLATILE=1 SWTPM_TEST_IBMTSS2=1 make check

You may omit the environment variables if you don't want to run the more time-consuming tests.

SWTPM_TEST_EXPENSIVE=1 enables the following tests:

  • test_tpm12
  • test_tpm2_ibmtss2

SWTPM_TEST_STORE_VOLATILE=1 enables storing and restoring of the volatile state at every step of the test_tpm2_ibmtss2 test. This environment variable only has an effect if SWTPM_TEST_EXPENSIVE=1 is set.

SWTPM_TEST_IBMTSS2=1 enables the following tests

  • test_tpm2_save_load_state_2
  • test_tpm2_save_load_state_3

Some tests require root rights, especially those involving the CUSE TPM and the vTPM proxy device. To run these and all the other ones you can use the following command line:

sudo bash -c "SWTPM_TEST_EXPENSIVE=1 SWTPM_TEST_STORE_VOLATILE=1 SWTPM_TEST_IBMTSS2=1 make check"