diff options
| author | Maurice Hieronymus <mhi@mailbox.org> | 2025-11-23 12:18:09 +0100 |
|---|---|---|
| committer | Jarkko Sakkinen <jarkko@kernel.org> | 2025-12-03 22:55:27 +0200 |
| commit | cffc934c0d81c9dea3d63cc108e6f925a4bac18e (patch) | |
| tree | e531ad9389ff51e64c56b9bb61b43c2092976c17 | |
| parent | a619fe35ab41fded440d3762d4fbad84ff86a4d4 (diff) | |
selftests: tpm2: Fix ill defined assertions
Remove parentheses around assert statements in Python. With parentheses,
assert always evaluates to True, making the checks ineffective.
Signed-off-by: Maurice Hieronymus <mhi@mailbox.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
| -rw-r--r-- | tools/testing/selftests/tpm2/tpm2.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/tpm2/tpm2.py b/tools/testing/selftests/tpm2/tpm2.py index bba8cb54548e..3d130c30bc7c 100644 --- a/tools/testing/selftests/tpm2/tpm2.py +++ b/tools/testing/selftests/tpm2/tpm2.py @@ -437,7 +437,7 @@ class Client: def extend_pcr(self, i, dig, bank_alg = TPM2_ALG_SHA1): ds = get_digest_size(bank_alg) - assert(ds == len(dig)) + assert ds == len(dig) auth_cmd = AuthCommand() @@ -589,7 +589,7 @@ class Client: def seal(self, parent_key, data, auth_value, policy_dig, name_alg = TPM2_ALG_SHA1): ds = get_digest_size(name_alg) - assert(not policy_dig or ds == len(policy_dig)) + assert not policy_dig or ds == len(policy_dig) attributes = 0 if not policy_dig: |