swtpm/tests
Stefan Berger e5ccc7bb37 tests: Fix shellcheck issue SC2115 by using "${var:?}"
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2023-01-29 15:04:00 -05:00
..
data test: Recreate TPM 2 state files with header 2022-05-09 10:15:08 -04:00
patches tests: Patch IBM TSS2 test suite for OpenSSL 3.x 2022-05-03 13:27:13 -04:00
_test_encrypted_state tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_getcap tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_hashing tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_hashing2 tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_init tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_locality tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_migration_key tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_migration_key_2 tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
_test_print_capabilities tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_print_states tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05: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 shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_save_load_state tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_setbuffersize tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_swtpm_bios tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_avoid_da_lockout tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_derived_keys tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_encrypted_state tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_file_permissions tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_getcap tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05: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 shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_init tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_locality tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_migration_key tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_print_capabilities tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_print_states tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_probe tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05: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 shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_save_load_state tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_save_load_state_da_timeout tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05: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 shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05: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 shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm2_wrongorder tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_tpm_probe tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_volatilestate tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
_test_wrongorder tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
common tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
create_certs.sh scripting: Use #!/usr/bin/env bash rather than /bin/bash 2018-09-10 16:49:12 +00:00
load_vtpm_proxy tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
Makefile.am tests: Fix shellcheck issue SC2115 by using "${var:?}" 2023-01-29 15:04:00 -05: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: Enable softhsm_setup to work with a temporary directory 2020-08-27 20:26:27 -04: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 SC2126 by using 'grep -c' 2023-01-14 13:31:53 -05:00
test_config.in build: remove hardcoded tss user and group 2015-11-02 20:47:37 -05:00
test_ctrlchannel tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -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 shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05: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: Fix shellcheck issue SC2115 by using "${var:?}" 2023-01-29 15:04:00 -05:00
test_print_capabilities tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_print_states tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05: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: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
test_swtpm_setup_create_cert tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
test_swtpm_setup_file_backend tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
test_swtpm_setup_misc tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
test_swtpm_setup_overwrite tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05: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: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
test_tpm2_init tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05: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: Fix shellcheck issue SC2115 by using "${var:?}" 2023-01-29 15:04:00 -05: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: Fix issues related to SC2164 2023-01-13 21:02:51 -05: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 shellcheck issue SC2143 by using grep -q 2023-01-26 08:12:59 -05: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 shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05: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: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
test_tpm2_swtpm_cert_ecc tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
test_tpm2_swtpm_localca tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
test_tpm2_swtpm_localca_pkcs11.test tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
test_tpm2_swtpm_setup_create_cert tests: Fix shellcheck issue SC2143 by using grep -q 2023-01-26 08:12:59 -05:00
test_tpm2_swtpm_setup_overwrite tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05:00
test_tpm2_volatilestate tests: Fix issues related to SC2164 2023-01-13 21:02:51 -05:00
test_tpm2_vtpm_proxy tests: Fix shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05: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 shellcheck issue SC2181 by if cmd; ... 2023-01-27 11:58:54 -05: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"