Skip to content

Commit

Permalink
esys tests: Fix layer check for TPM2_RC_COMMAND_CODE.
Browse files Browse the repository at this point in the history
Two integration tests failed for tests with /dev/tpmrm0 because the
layer of the return code was not checked.

Signed-off-by: Juergen Repp <[email protected]>
  • Loading branch information
JuergenReppSIT committed Jul 1, 2023
1 parent 8699ab3 commit 37aaaf3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion test/integration/esys-act-set-timeout.int.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ test_esys_act_set_timeout(ESYS_CONTEXT * esys_context)
}
}
/* If the TPM doesn't support it return skip */
if (r == TPM2_RC_COMMAND_CODE)
if ((r == TPM2_RC_COMMAND_CODE) ||
(r == (TPM2_RC_COMMAND_CODE | TSS2_RESMGR_RC_LAYER)) ||
(r == (TPM2_RC_COMMAND_CODE | TSS2_RESMGR_TPM_RC_LAYER)))
return EXIT_SKIP;
else
return EXIT_FAILURE;
Expand Down
4 changes: 3 additions & 1 deletion test/integration/esys-certifyX509.int.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ test_esys_certifyx509(ESYS_CONTEXT * esys_context)
Esys_Free(tbsDigest);

/* If the TPM doesn't support it return skip */
if (r == TPM2_RC_COMMAND_CODE)
if ((r == TPM2_RC_COMMAND_CODE) ||
(r == (TPM2_RC_COMMAND_CODE | TSS2_RESMGR_RC_LAYER)) ||
(r == (TPM2_RC_COMMAND_CODE | TSS2_RESMGR_TPM_RC_LAYER)))
return EXIT_SKIP;
else
return EXIT_FAILURE;
Expand Down

0 comments on commit 37aaaf3

Please sign in to comment.