[edk2-devel] [PATCH 5/6] uefi-sct/SctPkg: TCG2 Protocol: add GetEventLog test
-add initial TCG2 protocol test for GetEventLog() -checkpoint for test function with invalid eventlog format -checkpoint for test function with valid eventlog format V2: -Change checkpoint names from HashLogExtendEvent to GetEventLog Signed-off-by: Joseph Hemann Change-Id: I5ca3a46b3d36e8f11848a788f6cfdcabeb5b04c8 --- .../EFI/Protocol/TCG2/BlackBoxTest/Guid.c | 8 + .../EFI/Protocol/TCG2/BlackBoxTest/Guid.h | 20 ++ .../TCG2/BlackBoxTest/TCG2ProtocolBBTest.h| 15 ++ .../TCG2ProtocolBBTestConformance.c | 204 +- uefi-sct/SctPkg/UEFI/Protocol/TCG2.h | 46 5 files changed, 292 insertions(+), 1 deletion(-) diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.c index ed013744..b5a4e5c7 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.c @@ -49,3 +49,11 @@ EFI_GUID gTcg2ConformanceTestAssertionGuid009 = EFI_TEST_TCG2CONFORMANCE_ASSERTI EFI_GUID gTcg2ConformanceTestAssertionGuid010 = EFI_TEST_TCG2CONFORMANCE_ASSERTION_010_GUID; EFI_GUID gTcg2ConformanceTestAssertionGuid011 = EFI_TEST_TCG2CONFORMANCE_ASSERTION_011_GUID; + +EFI_GUID gTcg2ConformanceTestAssertionGuid012 = EFI_TEST_TCG2CONFORMANCE_ASSERTION_012_GUID; + +EFI_GUID gTcg2ConformanceTestAssertionGuid013 = EFI_TEST_TCG2CONFORMANCE_ASSERTION_013_GUID; + +EFI_GUID gTcg2ConformanceTestAssertionGuid014 = EFI_TEST_TCG2CONFORMANCE_ASSERTION_014_GUID; + +EFI_GUID gTcg2ConformanceTestAssertionGuid015 = EFI_TEST_TCG2CONFORMANCE_ASSERTION_015_GUID; diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.h index 45c2b2b2..d3a18aee 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.h +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.h @@ -80,3 +80,23 @@ extern EFI_GUID gTcg2ConformanceTestAssertionGuid010; { 0x9cd6d636, 0x603a, 0x4b78, {0x80, 0xa3, 0xa3, 0xb9, 0xcc, 0x6a, 0x0b, 0x08 }} extern EFI_GUID gTcg2ConformanceTestAssertionGuid011; + +#define EFI_TEST_TCG2CONFORMANCE_ASSERTION_012_GUID \ +{ 0x0a938567, 0xb234, 0xad21, {0x2a, 0xa6, 0x11, 0x65, 0xaa, 0xde, 0x12, 0xc2 }} + +extern EFI_GUID gTcg2ConformanceTestAssertionGuid012; + +#define EFI_TEST_TCG2CONFORMANCE_ASSERTION_013_GUID \ +{ 0x45fa1a42, 0x912a, 0x5124, {0x84, 0xf4, 0x41, 0x67, 0xab, 0xb5, 0x89, 0x90 }} + +extern EFI_GUID gTcg2ConformanceTestAssertionGuid013; + +#define EFI_TEST_TCG2CONFORMANCE_ASSERTION_014_GUID \ +{ 0xfc80408e, 0x9a3c, 0x4054, {0x96, 0xf9, 0x31, 0x23, 0x35, 0xc2, 0x31, 0x35 }} + +extern EFI_GUID gTcg2ConformanceTestAssertionGuid014; + +#define EFI_TEST_TCG2CONFORMANCE_ASSERTION_015_GUID \ +{ 0xa76d2903, 0xbbcc, 0x8a72, {0x90, 0x23, 0xd3, 0xaa, 0xba, 0xb1, 0x52, 0x13 }} + +extern EFI_GUID gTcg2ConformanceTestAssertionGuid015; diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTest.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTest.h index 1b56852e..d9c23094 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTest.h +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTest.h @@ -45,6 +45,8 @@ Abstract: #define EV_POST_CODE 0x01 +#define EV_NO_ACTION 0x03 + #define EFI_TCG2_EXTEND_ONLY 0x0001 #define PE_COFF_IMAGE 0x0010 @@ -97,6 +99,19 @@ BBTestHashLogExtendEventConformanceTestCheckpoint2 ( IN EFI_TCG2_PROTOCOL *TCG2 ); +EFI_STATUS +BBTestGetEventLogConformanceTestCheckpoint1 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL*StandardLib, + IN EFI_TCG2_PROTOCOL *TCG2 + ); + +EFI_STATUS +BBTestGetEventLogConformanceTestCheckpoint2 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL*StandardLib, + IN EFI_TCG2_PROTOCOL *TCG2 + ); + + EFI_STATUS BBTestGetCapabilityConformanceTest ( IN EFI_BB_TEST_PROTOCOL *This, diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTestConformance.c index 874e4eb8..a7bec793 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTestConformance.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTestConformance.c @@ -137,7 +137,7 @@ BBTestGetActivePcrBanksConformanceTest ( /** * @brief Entrypoint for HashLogExtendEvent() Function Test. - * 2 checkpoints will be tested. + * 4 checkpoints will be tested. * @param This a pointer of EFI_BB_TEST_PROTOCOL * @param ClientInterface A pointer to the interface array under test * @param TestLevel Test "thoroughness"
[edk2-devel] [PATCH 5/6] uefi-sct/SctPkg: TCG2 Protocol: add GetEventLog test
From: Joseph Hemann -add initial TCG2 protocol test for GetEventLog() -checkpoint for test function with invalid eventlog format -checkpoint for test function with valid eventlog format Cc: G Edhaya Chandran Cc: Barton Gao Cc: Carolyn Gjertsen Cc: Samer El-Haj-Mahmoud Cc: Eric Jin Cc: Arvin Chen Cc: Supreeth Venkatesh Signed-off-by: Joseph Hemann --- .../EFI/Protocol/TCG2/BlackBoxTest/Guid.c | 8 + .../EFI/Protocol/TCG2/BlackBoxTest/Guid.h | 19 ++ .../TCG2/BlackBoxTest/TCG2ProtocolBBTest.h| 14 ++ .../TCG2ProtocolBBTestConformance.c | 204 +- uefi-sct/SctPkg/UEFI/Protocol/TCG2.h | 45 5 files changed, 289 insertions(+), 1 deletion(-) diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.c index 32438f967d41..89c4151752cd 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.c @@ -45,3 +45,11 @@ EFI_GUID gTcg2ConformanceTestAssertionGuid007 = EFI_TEST_TCG2CONFORMANCE_ASSERTI EFI_GUID gTcg2ConformanceTestAssertionGuid008 = EFI_TEST_TCG2CONFORMANCE_ASSERTION_008_GUID; EFI_GUID gTcg2ConformanceTestAssertionGuid009 = EFI_TEST_TCG2CONFORMANCE_ASSERTION_009_GUID; + +EFI_GUID gTcg2ConformanceTestAssertionGuid010 = EFI_TEST_TCG2CONFORMANCE_ASSERTION_010_GUID; + +EFI_GUID gTcg2ConformanceTestAssertionGuid011 = EFI_TEST_TCG2CONFORMANCE_ASSERTION_011_GUID; + +EFI_GUID gTcg2ConformanceTestAssertionGuid012 = EFI_TEST_TCG2CONFORMANCE_ASSERTION_012_GUID; + +EFI_GUID gTcg2ConformanceTestAssertionGuid013 = EFI_TEST_TCG2CONFORMANCE_ASSERTION_013_GUID; diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.h index 27908816bb81..2cb715105529 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.h +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.h @@ -71,3 +71,22 @@ extern EFI_GUID gTcg2ConformanceTestAssertionGuid008; extern EFI_GUID gTcg2ConformanceTestAssertionGuid009; +#define EFI_TEST_TCG2CONFORMANCE_ASSERTION_010_GUID \ +{ 0x0363d22f, 0xc66a, 0x4872, {0xa5, 0x46, 0x06, 0x7f, 0x6a, 0x0d, 0xdb, 0xcd }} + +extern EFI_GUID gTcg2ConformanceTestAssertionGuid010; + +#define EFI_TEST_TCG2CONFORMANCE_ASSERTION_011_GUID \ +{ 0x9cd6d636, 0x603a, 0x4b78, {0x80, 0xa3, 0xa3, 0xb9, 0xcc, 0x6a, 0x0b, 0x08 }} + +extern EFI_GUID gTcg2ConformanceTestAssertionGuid011; + +#define EFI_TEST_TCG2CONFORMANCE_ASSERTION_012_GUID \ +{ 0xfc80408e, 0x9a3c, 0x4054, {0x96, 0xf9, 0x31, 0x23, 0x35, 0xc2, 0x31, 0x35 }} + +extern EFI_GUID gTcg2ConformanceTestAssertionGuid012; + +#define EFI_TEST_TCG2CONFORMANCE_ASSERTION_013_GUID \ +{ 0x45fa1a42, 0x912a, 0x5124, {0x84, 0xf4, 0x41, 0x67, 0xab, 0xb5, 0x89, 0x90 }} + +extern EFI_GUID gTcg2ConformanceTestAssertionGuid013; diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTest.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTest.h index f552e833b42b..69fb358922df 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTest.h +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTest.h @@ -45,6 +45,8 @@ Abstract: #define EV_POST_CODE 0x01 +#define EV_NO_ACTION 0x03 + #define EFI_TCG2_EXTEND_ONLY 0x0001 #define PE_COFF_IMAGE 0x0010 @@ -91,6 +93,18 @@ BBTestHashLogExtendEventConformanceTestCheckpoint2 ( IN EFI_TCG2_PROTOCOL *TCG2 ); +EFI_STATUS +BBTestHashLogExtendEventConformanceTestCheckpoint3 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL*StandardLib, + IN EFI_TCG2_PROTOCOL *TCG2 + ); + +EFI_STATUS +BBTestHashLogExtendEventConformanceTestCheckpoint4 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL*StandardLib, + IN EFI_TCG2_PROTOCOL *TCG2 + ); + EFI_STATUS BBTestGetCapabilityConformanceTest ( IN EFI_BB_TEST_PROTOCOL *This, diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTestConformance.c index a3992c4709a6..d3aaf979c087 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTestConformance.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTestConformance.c @@ -126,7 +126,7 @@ BBTestGetActivePcrBanksConformanceTest ( /** * @brief Entrypoint for HashLogExtendEvent() Function Test. - * 2 checkpoints will be tested. + * 4 checkpoints will be tested. * @param This a pointer of EFI_BB_TEST_PROTOCOL * @param ClientInterface A pointer to the interface array under test * @param TestLevel Test "thoroughness" control @@ -
[edk2-devel] [PATCH 5/6] uefi-sct/SctPkg: TCG2 Protocol: add GetEventLog test
From: Joseph Hemann -add initial TCG2 protocol test for GetEventLog() -checkpoint for test function with invalid eventlog format -checkpoint for test function with valid eventlog format Signed-off-by: Joseph Hemann Change-Id: Ie5399f24622ce849d8f1140c56bd71cf886423e3 --- .../EFI/Protocol/TCG2/BlackBoxTest/Guid.c | 8 + .../EFI/Protocol/TCG2/BlackBoxTest/Guid.h | 19 ++ .../TCG2/BlackBoxTest/TCG2ProtocolBBTest.h| 14 ++ .../TCG2ProtocolBBTestConformance.c | 204 +- uefi-sct/SctPkg/UEFI/Protocol/TCG2.h | 45 5 files changed, 289 insertions(+), 1 deletion(-) diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.c index 32438f96..89c41517 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.c @@ -45,3 +45,11 @@ EFI_GUID gTcg2ConformanceTestAssertionGuid007 = EFI_TEST_TCG2CONFORMANCE_ASSERTI EFI_GUID gTcg2ConformanceTestAssertionGuid008 = EFI_TEST_TCG2CONFORMANCE_ASSERTION_008_GUID; EFI_GUID gTcg2ConformanceTestAssertionGuid009 = EFI_TEST_TCG2CONFORMANCE_ASSERTION_009_GUID; + +EFI_GUID gTcg2ConformanceTestAssertionGuid010 = EFI_TEST_TCG2CONFORMANCE_ASSERTION_010_GUID; + +EFI_GUID gTcg2ConformanceTestAssertionGuid011 = EFI_TEST_TCG2CONFORMANCE_ASSERTION_011_GUID; + +EFI_GUID gTcg2ConformanceTestAssertionGuid012 = EFI_TEST_TCG2CONFORMANCE_ASSERTION_012_GUID; + +EFI_GUID gTcg2ConformanceTestAssertionGuid013 = EFI_TEST_TCG2CONFORMANCE_ASSERTION_013_GUID; diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.h index 27908816..2cb71510 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.h +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/Guid.h @@ -71,3 +71,22 @@ extern EFI_GUID gTcg2ConformanceTestAssertionGuid008; extern EFI_GUID gTcg2ConformanceTestAssertionGuid009; +#define EFI_TEST_TCG2CONFORMANCE_ASSERTION_010_GUID \ +{ 0x0363d22f, 0xc66a, 0x4872, {0xa5, 0x46, 0x06, 0x7f, 0x6a, 0x0d, 0xdb, 0xcd }} + +extern EFI_GUID gTcg2ConformanceTestAssertionGuid010; + +#define EFI_TEST_TCG2CONFORMANCE_ASSERTION_011_GUID \ +{ 0x9cd6d636, 0x603a, 0x4b78, {0x80, 0xa3, 0xa3, 0xb9, 0xcc, 0x6a, 0x0b, 0x08 }} + +extern EFI_GUID gTcg2ConformanceTestAssertionGuid011; + +#define EFI_TEST_TCG2CONFORMANCE_ASSERTION_012_GUID \ +{ 0xfc80408e, 0x9a3c, 0x4054, {0x96, 0xf9, 0x31, 0x23, 0x35, 0xc2, 0x31, 0x35 }} + +extern EFI_GUID gTcg2ConformanceTestAssertionGuid012; + +#define EFI_TEST_TCG2CONFORMANCE_ASSERTION_013_GUID \ +{ 0x45fa1a42, 0x912a, 0x5124, {0x84, 0xf4, 0x41, 0x67, 0xab, 0xb5, 0x89, 0x90 }} + +extern EFI_GUID gTcg2ConformanceTestAssertionGuid013; diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTest.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTest.h index f552e833..69fb3589 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTest.h +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTest.h @@ -45,6 +45,8 @@ Abstract: #define EV_POST_CODE 0x01 +#define EV_NO_ACTION 0x03 + #define EFI_TCG2_EXTEND_ONLY 0x0001 #define PE_COFF_IMAGE 0x0010 @@ -91,6 +93,18 @@ BBTestHashLogExtendEventConformanceTestCheckpoint2 ( IN EFI_TCG2_PROTOCOL *TCG2 ); +EFI_STATUS +BBTestHashLogExtendEventConformanceTestCheckpoint3 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL*StandardLib, + IN EFI_TCG2_PROTOCOL *TCG2 + ); + +EFI_STATUS +BBTestHashLogExtendEventConformanceTestCheckpoint4 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL*StandardLib, + IN EFI_TCG2_PROTOCOL *TCG2 + ); + EFI_STATUS BBTestGetCapabilityConformanceTest ( IN EFI_BB_TEST_PROTOCOL *This, diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTestConformance.c index 5566645c..a3477ec9 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTestConformance.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2ProtocolBBTestConformance.c @@ -126,7 +126,7 @@ BBTestGetActivePcrBanksConformanceTest ( /** * @brief Entrypoint for HashLogExtendEvent() Function Test. - * 2 checkpoints will be tested. + * 4 checkpoints will be tested. * @param This a pointer of EFI_BB_TEST_PROTOCOL * @param ClientInterface A pointer to the interface array under test * @param TestLevel Test "thoroughness" control @@ -168,6 +168,12 @@ BBTestHashLogExtendEventConformanceTest ( //Test with correct size field BBTestHashLogExtendEvent