test: exit with 0 if test not supported by hardware

`native_test` attempts tests that may not be supported by hardware.
In these cases, warnings are printed, but the exectuable should still
return 0 for success.
pull/149/head
Elms 2021-03-08 09:15:51 -08:00
parent 32d48cadb2
commit d9360f035a
1 changed files with 5 additions and 1 deletions

View File

@ -1341,7 +1341,11 @@ int TPM2_Native_TestArgs(void* userCtx, int argc, char *argv[])
cmdOut.encDec.outData.size) == 0) {
printf("Encrypt/Decrypt test success\n");
}
else if (rc != TPM_RC_COMMAND_CODE) {
else if (rc == TPM_RC_COMMAND_CODE) {
printf("Encrypt/Decrypt test result allowed as pass since hardware doesn't support.\n");
rc = TPM_RC_SUCCESS;
}
else {
printf("Encrypt/Decrypt test failed, result not as expected!\n");
goto exit;
}