2022-02-24 00:28:29 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
set -e
|
|
|
|
|
|
|
|
TEST_DESCRIPTION="cryptenroll/cryptsetup with TPM2 devices"
|
|
|
|
IMAGE_NAME="tpm2"
|
|
|
|
TEST_NO_NSPAWN=1
|
2023-06-02 18:28:41 +00:00
|
|
|
TEST_SETUP_SWTPM=1
|
2022-02-24 00:28:29 +00:00
|
|
|
TEST_REQUIRE_INSTALL_TESTS=0
|
|
|
|
|
|
|
|
# shellcheck source=test/test-functions
|
|
|
|
. "${TEST_BASE_DIR:?}/test-functions"
|
|
|
|
|
2023-07-25 00:04:28 +00:00
|
|
|
test_require_bin openssl swtpm tpm2_createprimary tpm2_dictionarylockout tpm2_evictcontrol tpm2_flushcontext tpm2_pcrextend tpm2_pcrread tpm2_readpublic
|
2022-02-24 00:28:29 +00:00
|
|
|
|
|
|
|
test_append_files() {
|
2023-06-02 18:56:12 +00:00
|
|
|
local workspace="${1:?}"
|
2022-02-24 00:28:29 +00:00
|
|
|
|
2023-09-18 18:31:54 +00:00
|
|
|
instmods tpm tpm_tis
|
|
|
|
machine="$(uname -m)"
|
|
|
|
if [ "${machine}" = "ppc64le" ]; then
|
|
|
|
# This module is only available on PPC hw
|
|
|
|
instmods tpm_ibmvtpm
|
|
|
|
fi
|
2023-06-02 18:56:12 +00:00
|
|
|
install_dmevent
|
|
|
|
generate_module_dependencies
|
2023-10-06 15:14:25 +00:00
|
|
|
inst_binary openssl
|
|
|
|
inst_binary tpm2_createprimary
|
2023-07-07 17:37:28 +00:00
|
|
|
inst_binary tpm2_dictionarylockout
|
2023-10-06 15:14:25 +00:00
|
|
|
inst_binary tpm2_evictcontrol
|
|
|
|
inst_binary tpm2_flushcontext
|
2023-06-02 18:56:12 +00:00
|
|
|
inst_binary tpm2_pcrextend
|
|
|
|
inst_binary tpm2_pcrread
|
2023-07-25 00:04:28 +00:00
|
|
|
inst_binary tpm2_readpublic
|
2022-02-24 00:28:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_test "$@"
|