From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=217.140.101.70; helo=foss.arm.com; envelope-from=sakar.arora@arm.com; receiver=edk2-devel@lists.01.org Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by ml01.01.org (Postfix) with ESMTP id 047E121B02822 for ; Tue, 6 Nov 2018 00:48:25 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8086A80D; Tue, 6 Nov 2018 00:48:25 -0800 (PST) Received: from u201365.usa.Arm.com (a75592.asiapac.arm.com [10.162.22.94]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 32DB13F5BD; Tue, 6 Nov 2018 00:48:23 -0800 (PST) From: Sakar Arora To: edk2-devel@lists.01.org Cc: Supreeth.Venkatesh@arm.com, prasanth.pulla@arm.com Date: Tue, 6 Nov 2018 14:17:40 +0530 Message-Id: <1541494066-16288-6-git-send-email-sakar.arora@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1541494066-16288-1-git-send-email-sakar.arora@arm.com> References: <1541494066-16288-1-git-send-email-sakar.arora@arm.com> Subject: [edk2-test][RFC PATCH 06/12] uefi-sct/SctPkg: sbbr: Add test cases for SBBR v1.0 3.5.4 and 3.5.5 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:26 -0000 From: John Powell 3.5.4 tests ResetSystem runtime service functions. The PSCI portion of this requirement will be handled later or removed completely. 3.5.5 tests non-volatile variable persistence across resets. Signed-off-by: John Powell --- .../SBBRRuntimeServices/BlackBoxTest/Guid.c | 6 + .../SBBRRuntimeServices/BlackBoxTest/Guid.h | 16 + .../BlackBoxTest/SBBRRuntimeServicesBBTest.inf | 1 + .../SBBRRuntimeServicesBBTestFunction.c | 391 +++++++++++++++++++++ .../SBBRRuntimeServicesBBTestFunction.h | 19 + .../BlackBoxTest/SBBRRuntimeServicesBBTestMain.c | 25 ++ .../BlackBoxTest/SBBRRuntimeServicesBBTestMain.h | 20 ++ 7 files changed, 478 insertions(+) diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/Guid.c index 374b767..11dcfac 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/Guid.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/Guid.c @@ -59,3 +59,9 @@ Abstract: #include "Guid.h" EFI_GUID gSBBRRuntimeServicesAssertion001Guid = SBBRRUNTIMESERVICES_ASSERTION_001_GUID; + +EFI_GUID gSBBRRuntimeServicesAssertion002Guid = SBBRRUNTIMESERVICES_ASSERTION_002_GUID; + +EFI_GUID gSBBRRuntimeServicesAssertion003Guid = SBBRRUNTIMESERVICES_ASSERTION_003_GUID; + +EFI_GUID gSBBRRuntimeServicesAssertion004Guid = SBBRRUNTIMESERVICES_ASSERTION_004_GUID; diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/Guid.h index 86165b3..29fcc1f 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/Guid.h +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/Guid.h @@ -62,4 +62,20 @@ Abstract: { 0x787ad247, 0xc901, 0x49d8, {0x84, 0x82, 0x91, 0x5e, 0x09, 0x61, 0xcf, 0x34 }} extern EFI_GUID gSBBRRuntimeServicesAssertion001Guid; + +#define SBBRRUNTIMESERVICES_ASSERTION_002_GUID \ +{ 0xcd4cedc0, 0xf8e3, 0x4f75, {0xbd, 0xec, 0x6d, 0xf2, 0xa6, 0x9f, 0xa4, 0x0f }} + +extern EFI_GUID gSBBRRuntimeServicesAssertion002Guid; + +#define SBBRRUNTIMESERVICES_ASSERTION_003_GUID \ +{ 0x5a353070, 0xc002, 0x48b7, {0xae, 0x15, 0x80, 0x77, 0xe2, 0x7a, 0x25, 0xaf }} + +extern EFI_GUID gSBBRRuntimeServicesAssertion003Guid; + +#define SBBRRUNTIMESERVICES_ASSERTION_004_GUID \ +{ 0xe8c528de, 0x4b69, 0x4c6b, {0xaa, 0xec, 0x69, 0x64, 0x59, 0x69, 0x26, 0x6f }} + +extern EFI_GUID gSBBRRuntimeServicesAssertion004Guid; + #endif /* _SBBRRUNTIMESERVICES_GUID_H_ */ diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTest.inf index f6c6856..fd4dae0 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTest.inf +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTest.inf @@ -79,3 +79,4 @@ UefiDriverEntryPoint [Protocols] + gEfiTestRecoveryLibraryGuid \ No newline at end of file diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestFunction.c index 1f19cef..3cee3ab 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestFunction.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestFunction.c @@ -56,8 +56,10 @@ Abstract: --*/ #include "Guid.h" #include "SctLib.h" +#include #include "SBBRRuntimeServicesBBTestMain.h" #include "SBBRRuntimeServicesBBTestFunction.h" +#include EFI_TEST_PROTOCOL_DEFINITION(TestRecoveryLibrary) @@ -216,3 +218,392 @@ BBTestRuntimeServices ( return EFI_SUCCESS; } + + +extern EFI_TPL TplArray []; + + +/** + * Entrypoint for gtRT->ResetSystem() Manual Test. + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// SBBR 3.5.4 +// +EFI_STATUS +BBTestResetShutdown ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_TEST_RECOVERY_LIBRARY_PROTOCOL *RecoveryLib; + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + UINTN Index; + EFI_TPL OldTpl; + UINT8 Buffer[1024]; + RESET_DATA *ResetData; + UINTN Size; + + // + // Get the Standard Library Interface + // + Status = gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR (Status)) { + return Status; + } + + // + // Get the Recovery Library Interface + // + Status = gtBS->HandleProtocol ( + SupportHandle, + &gEfiTestRecoveryLibraryGuid, + (VOID **) &RecoveryLib + ); + + if (EFI_ERROR (Status)) { + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"BS.HandleProtocol - Handle recovery library", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return Status; + } + + // + // Read reset record + // + Status = RecoveryLib->ReadResetRecord ( + RecoveryLib, + &Size, + Buffer + ); + ResetData = (RESET_DATA *)Buffer; + if (EFI_ERROR (Status) || (Size < sizeof (RESET_DATA))) { + // + // Step 1 + // + } else if (ResetData->Step == 1) { + // + // Step 2 + // + if (ResetData->TplIndex < TPL_ARRAY_SIZE) { + Index = ResetData->TplIndex; + AssertionType = EFI_TEST_ASSERTION_PASSED; + goto ManualTestStep2; + } + } else { + return EFI_LOAD_ERROR; + } + + for (Index = 0; Index < TPL_ARRAY_SIZE; Index++) { + // + // 4.2.2.1 ResetSystem must succeed when ResetType is EfiResetShutdown + // + ResetData->Step = 1; + ResetData->TplIndex = Index; + Status = RecoveryLib->WriteResetRecord ( + RecoveryLib, + sizeof (RESET_DATA), + Buffer + ); + if (EFI_ERROR (Status)) { + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"TestRecoveryLib - WriteResetRecord", + L"%a:%d:Status - %r, TPL - %d", + __FILE__, + (UINTN)__LINE__, + Status, + TplArray[Index] + ); + return Status; + } + + // + // Print out some information to avoid the user thought it is an error. + // + // And the stall a second is required to make sure the recovery data has + // been written into the storage device. + // + SctPrint (L"System will shut down (or cold reset) after 1 second..."); + gtBS->Stall (1000000); + + OldTpl = gtBS->RaiseTPL (TplArray[Index]); + gtRT->ResetSystem ( + EfiResetShutdown, + EFI_SUCCESS, + 0, + NULL + ); + gtBS->RestoreTPL (OldTpl); + AssertionType = EFI_TEST_ASSERTION_FAILED; + +ManualTestStep2: + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + Index==0? \ + gSBBRRuntimeServicesAssertion003Guid: \ + (Index == 1? \ + gSBBRRuntimeServicesAssertion002Guid: \ + gSBBRRuntimeServicesAssertion003Guid), + L"RT.ResetSystem - EfiResetShutdown", + L"%a:%d:Status - %r, TPL - %d", + __FILE__, + (UINTN)__LINE__, + Status, + TplArray[Index] + ); + } + + return EFI_SUCCESS; +} + +/** + * Entrypoint for NonVolatileVariable test. + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// SBBR 3.5.5 +// +EFI_STATUS +BBTestNonVolatileVariable ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_TEST_RECOVERY_LIBRARY_PROTOCOL *RecoveryLib; + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + UINT8 Buffer[20]; + EFI_GUID ResetGuid = SBBRRUNTIMESERVICES_NONVOLATILEVARIABLE_RESET_GUID; + EFI_GUID *TestResetGuid; + EFI_GUID VarVendorGuid = VENDOR_GUID; + UINTN Size; + UINT32 Attributes; + UINT32 VariableValue = UEFI_VARIABLE_TEST_VALUE; + UINT32 *TestVariableValue; + + // + // Get the Standard Library Interface + // + Status = gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the Recovery Library Interface + // + Status = gtBS->HandleProtocol ( + SupportHandle, + &gEfiTestRecoveryLibraryGuid, + (VOID **) &RecoveryLib + ); + if (EFI_ERROR(Status)) { + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"BS.HandleProtocol - Handle recovery library", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return Status; + } + + // + // Read reset record + // + Status = RecoveryLib->ReadResetRecord ( + RecoveryLib, + &Size, + Buffer + ); + TestResetGuid = (EFI_GUID *)Buffer; + if (EFI_ERROR(Status) || SctCompareGuid((void *)TestResetGuid, (void *)&ResetGuid) != 0) { + // + // Writing a new non-volatile variable for testing after making sure it doesn't already exist. + // + + // Making a variable of the same name and vendor GUID with a size of zero to delete anything that might be left over + Size = 0; + Status = gtRT->SetVariable ( + TEST_VAR_NAME, + &VarVendorGuid, + NULL, + Size, + NULL + ); + if (EFI_ERROR(Status) && Status != EFI_NOT_FOUND) { + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"RS.SetVariable", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return Status; + } + + // Writing a known value into the UEFI variable with nonvolatile flag + Size = sizeof (UINT32); + Attributes = EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS; + Status = gtRT->SetVariable ( + TEST_VAR_NAME, + &VarVendorGuid, + Attributes, + Size, + (VOID *)&VariableValue + ); + if (EFI_ERROR(Status)) { + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"RS.SetVariable", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return Status; + } + + // Writing reset record and doing a cold reset + SctPrint (L"System will cold reboot..."); + Status = RecoveryLib->WriteResetRecord ( + RecoveryLib, + sizeof (EFI_GUID), + &ResetGuid + ); + gtBS->Stall (1000000); + gtRT->ResetSystem ( + EfiResetCold, + EFI_SUCCESS, + 0, + NULL + ); + + // Execution should never get here + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"RT.ResetSystem", + L"%a:%d - System failed to reboot.", + __FILE__, + (UINTN)__LINE__ + ); + return EFI_ABORTED; + + } else if (SctCompareGuid((void *)TestResetGuid, (void *)&ResetGuid) == 0) { + // + // Reading non-volatile variable to see if it's value was retained. + // + + // Calling GetVariable to see if our new variable is still there. + Status = gtRT->GetVariable ( + TEST_VAR_NAME, + &VarVendorGuid, + &Attributes, + &Size, + Buffer + ); + if (EFI_ERROR(Status)) { + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"RS.GetVariable", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return Status; + } + + // Erasing the variable we created from the system + Size = 0; + Status = gtRT->SetVariable ( + TEST_VAR_NAME, + &VarVendorGuid, + NULL, + Size, + NULL + ); + if (EFI_ERROR(Status)) { + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"RS.SetVariable", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return Status; + } + + // Checking value received against value written. + TestVariableValue = (UINT32 *)Buffer; + if (*TestVariableValue == VariableValue) { + AssertionType = EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType = EFI_TEST_ASSERTION_FAILED; + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSBBRRuntimeServicesAssertion004Guid, + L"NonVolatileVariable", + L"%a:%d", + __FILE__, + (UINTN)__LINE__ + ); + + return EFI_SUCCESS; + } else { + return EFI_LOAD_ERROR; + } +} \ No newline at end of file diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestFunction.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestFunction.h index 25dd209..f8ae376 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestFunction.h +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestFunction.h @@ -60,6 +60,9 @@ Abstract: #include +#define TEST_VAR_NAME (L"SCT_NON_VOLATILE_TEST") +#define UEFI_VARIABLE_TEST_VALUE 0xDEADBEEF + EFI_STATUS BBTestRuntimeServices ( IN EFI_BB_TEST_PROTOCOL *This, @@ -68,4 +71,20 @@ BBTestRuntimeServices ( IN EFI_HANDLE SupportHandle ); +EFI_STATUS +BBTestResetShutdown ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ); + +EFI_STATUS +BBTestNonVolatileVariable ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ); + #endif /* _SBBRRUNTIMESERVICES_BB_TEST_FUNCTION_H_ */ diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestMain.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestMain.c index 4af06cc..8ce604d 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestMain.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestMain.c @@ -60,6 +60,12 @@ Abstract: #include "SBBRRuntimeServicesBBTestMain.h" +EFI_TPL TplArray [TPL_ARRAY_SIZE] = { + TPL_APPLICATION, + TPL_CALLBACK, + TPL_NOTIFY +}; + EFI_BB_TEST_PROTOCOL_FIELD gBBTestProtocolField = { SBBRRUNTIMESERVICES_TEST_REVISION, SBBRRUNTIMESERVICES_TEST_GUID, @@ -82,6 +88,24 @@ EFI_BB_TEST_ENTRY_FIELD gBBTestEntryField[] = { EFI_TEST_CASE_AUTO, BBTestRuntimeServices }, + { + SBBRRUNTIMESERVICES_TEST_CASE_RESETSHUTDOWN_GUID, + L"ResetSystem Shutdown Test", + L"Manual Test for ResetSystem Shutdown.", + EFI_TEST_LEVEL_DEFAULT, + gSupportProtocolGuid, + EFI_TEST_CASE_MANUAL, + BBTestResetShutdown + }, + { + SBBRRUNTIMESERVICES_TEST_CASE_NONVOLATILEVARIABLE_GUID, + L"Non-volatile Variable Reset Test", + L"Ensures that non-volatile UEFI variables can survive cold resets.", + EFI_TEST_LEVEL_DEFAULT, + gSupportProtocolGuid, + EFI_TEST_CASE_AUTO, + BBTestNonVolatileVariable + }, EFI_NULL_GUID }; @@ -120,6 +144,7 @@ InitializeBBTestSBBRRuntimeServices ( { EfiInitializeTestLib (ImageHandle, SystemTable); + SctInitializeLib (ImageHandle, SystemTable); return EfiInitAndInstallBBTestInterface ( &ImageHandle, diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestMain.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestMain.h index e14b9bb..5b46068 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestMain.h +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestMain.h @@ -65,6 +65,20 @@ Abstract: #define SBBRRUNTIMESERVICES_TEST_GUID \ { 0x52A69BBF, 0xE19F, 0x4e82, {0x93, 0xD6, 0xAA, 0xC4, 0x6E, 0x2E, 0x1E, 0x06 }} +#define SBBRRUNTIMESERVICES_NONVOLATILEVARIABLE_RESET_GUID \ +{ 0xf3a95660, 0xce09, 0x418b, {0x93, 0xfe, 0xd3, 0xfa, 0x9d, 0xe3, 0x9b, 0x45 }} + +#define VENDOR_GUID \ +{ 0xb110c08e, 0x9756, 0x4d88, {0xb5, 0x5a, 0x4a, 0x4f, 0x60, 0x3e, 0x71, 0x70 }} + +#define TPL_ARRAY_SIZE 3 + +typedef struct _RESET_DATA { + UINTN Step; + UINTN TplIndex; + UINT32 RepeatTimes; +} RESET_DATA; + EFI_STATUS InitializeBBTestSBBRRuntimeServices ( IN EFI_HANDLE ImageHandle, @@ -83,4 +97,10 @@ BBTestSBBRRuntimeServices ( #define SBBRRUNTIMESERVICES_TEST_CASE_GUID \ { 0xe867fa15, 0x942b, 0x4c69, {0xad, 0xee, 0xf9, 0x3b, 0x11, 0x71, 0xd0, 0x8c }} +#define SBBRRUNTIMESERVICES_TEST_CASE_RESETSHUTDOWN_GUID \ + { 0x877143a4, 0xad97, 0x4213, {0x8f, 0x7f, 0x7d, 0xd3, 0x7e, 0xa4, 0x63, 0xd5 }} + +#define SBBRRUNTIMESERVICES_TEST_CASE_NONVOLATILEVARIABLE_GUID \ + { 0xa5936aeb, 0x3642, 0x4d1d, {0xb2, 0x26, 0x09, 0xe0, 0xe0, 0xa5, 0x2b, 0xaf }} + #endif /* _SBBRRUNTIMESERVICES_TEST_MAIN_H_ */ -- 2.7.4