Bug 1473726

Summary: tpmtest: not sure what testcase runs
Product: Red Hat Enterprise Linux 7 Reporter: Vilém Maršík <vmarsik>
Component: tpm2-tssAssignee: Jerry Snitselaar <jsnitsel>
Status: CLOSED EOL QA Contact: Vilém Maršík <vmarsik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-12 12:48:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vilém Maršík 2017-07-21 13:52:45 UTC
Description of problem:

Some sections of "tpmtest" contain different number of testcases described and run, making it difficult/impossible to find out which testcases indeed ran/succeeded/failed:

Section; #Described; #Results
8; 14; 9
13; 5; 4
15; 34; 33
21; 3; 2

Additionally:
* section 2 is missing /:(Passed|Failed)/ for description of Tss2_Sys_Execute.
* sections 33-38 use string "PASSED!" in the description part, making it confusing on the first sight (looks like tests were already run there)

Example - section 8 - GET TEST RESULT TESTS - description:
PRINT DESCRIPTION ON ALL CASES IN THIS GROUP:
  Test the one-call interface:
        Tss2_Sys_GetTestResult:Passed
  Test the syncronous,non-one-call interface:
        Tss2_Sys_GetTestResult_Prepare:Passed
        Tss2_Sys_Execute:Passed
        Tss2_Sys_GetTestResult_Complete:Passed
  Test the asyncronous,non-one-call interface:
        Tss2_Sys_GetTestResult_Prepare:Passed
        Tss2_Sys_ExecuteAsync:Passed
        Tss2_Sys_ExecuteFinish(timeout:TSS2_TCTI_TIMEOUT_BLOCK):Passed
        Tss2_Sys_GetTestResult_Complete:Passed
  TpmReset Case:Passed
  Check case of ExecuteFinish receving TPM error code:
        Tss2_Sys_GetCapability_Prepare(capability:TPM_CAP_TPM_PROPERTIES,property:TPM_PT_ACTIVE_SESSIONS_MAX,propertyCount:1):Passed
        Tss2_Sys_ExecuteAsync:Passed
        Tss2_Sys_ExecuteFinish(timeout:TSS2_TCTI_TIMEOUT_BLOCK):Failed(0x100)
        Tss2_Sys_GetCapability_Complete:Failed(TSS2_SYS_RC_BAD_SEQUENCE)
  TPMS_Startup(TPM_SU_CLEAR):Passed

And results:
RUN ALL TEST CASES:

GET TEST RESULT TESTS:
        passing case:   PASSED!
        passing case:   PASSED!
        passing case:   PASSED!
        passing case:   PASSED!
        passing case:   PASSED!
        passing case:   PASSED!
        passing case:   PASSED!
        passing case:   PASSED!


Version-Release number of selected component (if applicable):
tpm2-tss-utils-1.0-5.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. start resourcemgr
2. for A in 8 13 15 21; do echo -e "$A\nd\n0\nq\nq" | tpmtest | tee $A.log; done
3. see *.log


Actual results:
see above


Expected results:
Logs with testcase results linked to testcase names, that can be simply parsed. E.g.:
TEST RESULTS:
\t(PASSED|FAILED)\t${testcase_name}
...

Additional info:
Not sure if this can be reproduced without TPM2 hardware.

Comment 2 Vilém Maršík 2018-09-12 12:48:59 UTC
That testsuite is obsolete, and not maintained anymore. Now we are using another testsuites, not needing this one anymore.