-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It includes tpm smoke, content, async 15 test cases from kself-test and marked in the code file header. In order to be compatible and executed under LKVS, some compatibility adjustments like PYTHONPATH have been made. Signed-off-by: Pengfei Xu <[email protected]>
- Loading branch information
Showing
9 changed files
with
1,204 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
__pycache__ | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Trust Platform Module | ||
|
||
## Description | ||
Trust Platform Module(TPM) is a physical or embedded security technology | ||
(microcontroller) that resides on a computer's motherboard or in its processor. | ||
TPMs use cryptography to help securely store essential and critical information | ||
on PCs to enable platform authentication. | ||
|
||
The Intel® PTT is an integrated TPM that adheres to the 2.0 specifications | ||
and offers the same capabilities of a discrete TPM, only it resides in the | ||
system’s firmware, thus removing the need for dedicated processing or memory | ||
resources. | ||
|
||
TPM2 smoke test: test_smoke.sh | ||
``` | ||
# python3 -m unittest -v tpm2_tests.SmokeTest | ||
test_read_partial_overwrite (tpm2_tests.SmokeTest) ... ok | ||
test_read_partial_resp (tpm2_tests.SmokeTest) ... ok | ||
test_seal_with_auth (tpm2_tests.SmokeTest) ... ok | ||
test_seal_with_policy (tpm2_tests.SmokeTest) ... ok | ||
test_seal_with_too_long_auth (tpm2_tests.SmokeTest) ... ok | ||
test_send_two_cmds (tpm2_tests.SmokeTest) ... ok | ||
test_too_short_cmd (tpm2_tests.SmokeTest) ... ok | ||
test_unseal_with_wrong_auth (tpm2_tests.SmokeTest) ... ok | ||
test_unseal_with_wrong_policy (tpm2_tests.SmokeTest) ... ok | ||
---------------------------------------------------------------------- | ||
Ran 9 tests in 293.561s | ||
OK | ||
``` | ||
|
||
TPM2 space content test: test_space.sh | ||
``` | ||
# python3 -m unittest -v tpm2_tests.SpaceTest | ||
test_flush_context (tpm2_tests.SpaceTest) ... ok | ||
test_get_handles (tpm2_tests.SpaceTest) ... ok | ||
test_invalid_cc (tpm2_tests.SpaceTest) ... ok | ||
test_make_two_spaces (tpm2_tests.SpaceTest) ... ok | ||
---------------------------------------------------------------------- | ||
Ran 4 tests in 261.409s | ||
OK | ||
``` | ||
|
||
|
||
TPM2 sync test: test_async.sh | ||
``` | ||
# python3 -m unittest -v tpm2_tests.AsyncTest | ||
test_async (tpm2_tests.AsyncTest) ... ok | ||
test_flush_invalid_context (tpm2_tests.AsyncTest) ... ok | ||
---------------------------------------------------------------------- | ||
Ran 2 tests in 0.004s | ||
OK | ||
``` | ||
|
||
## Expected result | ||
All test results should show pass, no fail. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) | ||
|
||
# Kselftest framework requirement - SKIP code is 4. | ||
ksft_skip=4 | ||
|
||
[ -e /dev/tpm0 ] || exit $ksft_skip | ||
[ -e /dev/tpmrm0 ] || exit $ksft_skip | ||
|
||
# shellcheck disable=SC3028,SC3054 | ||
TPM_ROOT=$(realpath "$(dirname "${BASH_SOURCE[0]}")") | ||
export PYTHONPATH="$TPM_ROOT" | ||
python3 -m unittest -v tpm2_tests.AsyncTest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) | ||
|
||
# Kselftest framework requirement - SKIP code is 4. | ||
ksft_skip=4 | ||
|
||
[ -e /dev/tpm0 ] || exit $ksft_skip | ||
|
||
# shellcheck disable=SC3028,SC3054 | ||
TPM_ROOT=$(realpath "$(dirname "${BASH_SOURCE[0]}")") | ||
export PYTHONPATH="$TPM_ROOT" | ||
python3 -m unittest -v tpm2_tests.SmokeTest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) | ||
|
||
# Kselftest framework requirement - SKIP code is 4. | ||
ksft_skip=4 | ||
|
||
[ -e /dev/tpmrm0 ] || exit $ksft_skip | ||
|
||
# shellcheck disable=SC3028,SC3054 | ||
TPM_ROOT=$(realpath "$(dirname "${BASH_SOURCE[0]}")") | ||
export PYTHONPATH="$TPM_ROOT" | ||
python3 -m unittest -v tpm2_tests.SpaceTest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# This file collects Intel TPM(Trust Platform Module) tests on | ||
# Intel® Architecture-based platforms. | ||
# @hw_dep: [ -e "/dev/tpm0" ] @ No /dev/tpm0 device node to support TPM | ||
# @other_dep: general_test.sh -t kconfig -k "CONFIG_TCG_TPM=y" @ No TPM kconfig CONFIG_TCG_TPM=y | ||
# @other_warn: [ -e "/dev/tpmrm0" ] @ No /dev/tpmrm0 device node test_async.sh will skip with return 4 | ||
|
||
test_smoke.sh | ||
test_space.sh | ||
test_async.sh |
Oops, something went wrong.