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 (foss.arm.com [217.140.101.70]) by ml01.01.org (Postfix) with ESMTP id 24C5021B02822 for ; Tue, 6 Nov 2018 00:48:24 -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 B3D3115AB; Tue, 6 Nov 2018 00:48:23 -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 65D5D3F5BD; Tue, 6 Nov 2018 00:48:22 -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:39 +0530 Message-Id: <1541494066-16288-5-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 05/12] uefi-sct/SctPkg: sbbr: Add test cases for SBBR v1.0 Appendix C 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:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 X-List-Received-Date: Tue, 06 Nov 2018 08:48:24 -0000 From: John Powell GenericTest/RequiredUefiProtocols covers part of Appendix C and GenericTest/EfiCompliant covers the remaining requirements. This patch also fixes a few small formatting issues in CommonGenFramework.sh and SBBR_SCT.dsc Change-Id: I541d425dfcc630725ecb6f874fc396cdd151221e Signed-off-by: John Powell --- uefi-sct/SctPkg/CommonGenFramework.sh | 16 ++- uefi-sct/SctPkg/Config/Data/Category.ini | 7 + .../SbbrRequiredUefiProtocols/BlackBoxTest/Guid.c | 61 +++++++++ .../SbbrRequiredUefiProtocols/BlackBoxTest/Guid.h | 66 +++++++++ .../BlackBoxTest/RequiredUefiProtocolsBBTest.inf | 81 +++++++++++ .../RequiredUefiProtocolsBBTestFunction.c | 149 +++++++++++++++++++++ .../RequiredUefiProtocolsBBTestFunction.h | 86 ++++++++++++ .../BlackBoxTest/RequiredUefiProtocolsBBTestMain.c | 130 ++++++++++++++++++ .../BlackBoxTest/RequiredUefiProtocolsBBTestMain.h | 88 ++++++++++++ uefi-sct/SctPkg/UEFI/SBBR_SCT.dsc | 8 ++ 10 files changed, 686 insertions(+), 6 deletions(-) create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/Guid.c create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/Guid.h create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTest.inf create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestFunction.c create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestFunction.h create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestMain.c create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestMain.h diff --git a/uefi-sct/SctPkg/CommonGenFramework.sh b/uefi-sct/SctPkg/CommonGenFramework.sh index bf94d8e..aecd21b 100755 --- a/uefi-sct/SctPkg/CommonGenFramework.sh +++ b/uefi-sct/SctPkg/CommonGenFramework.sh @@ -355,14 +355,14 @@ then # ********************************************* # Boot Services Tests - SBBR v1.0 Appendix A - cp $ProcessorType/EventTimerTaskPriorityServicesBBTest.efi $Framework/Test/ > NUL - cp $ProcessorType/ImageServicesBBTest.efi $Framework/Test/ > NUL - cp $ProcessorType/MemoryAllocationServicesBBTest.efi $Framework/Test/ > NUL - cp $ProcessorType/MiscBootServicesBBTest.efi $Framework/Test/ > NUL - cp $ProcessorType/ProtocolHandlerServicesBBTest.efi $Framework/Test/ > NUL + cp $ProcessorType/EventTimerTaskPriorityServicesBBTest.efi $Framework/Test/ > NUL + cp $ProcessorType/ImageServicesBBTest.efi $Framework/Test/ > NUL + cp $ProcessorType/MemoryAllocationServicesBBTest.efi $Framework/Test/ > NUL + cp $ProcessorType/MiscBootServicesBBTest.efi $Framework/Test/ > NUL + cp $ProcessorType/ProtocolHandlerServicesBBTest.efi $Framework/Test/ > NUL # Tests SBBR sections 3.3.1, 3.3.2, 3.3.3, and 3.3.4 - cp $ProcessorType/SysEnvConfigBBTest.efi $Framework/Test/ > NUL + cp $ProcessorType/SysEnvConfigBBTest.efi $Framework/Test/ > NUL # Runtime Services Tests - SBBR v1.0 Appendix B cp $ProcessorType/VariableServicesBBTest.efi $Framework/Test/ > NUL @@ -370,6 +370,10 @@ then cp $ProcessorType/MiscRuntimeServicesBBTest.efi $Framework/Test/ > NUL cp $ProcessorType/SBBRRuntimeServicesBBTest.efi $Framework/Test/ > NUL + # Tests SBBR Appendix C + cp $ProcessorType/RequiredUefiProtocolsBBTest.efi $Framework/Test/ > NUL + cp $ProcessorType/EfiCompliantBBTest.efi $Framework/Test/ > NUL + # ********************************************* # Copy ENTS binary # ********************************************* diff --git a/uefi-sct/SctPkg/Config/Data/Category.ini b/uefi-sct/SctPkg/Config/Data/Category.ini index a41cd0f..9576971 100644 --- a/uefi-sct/SctPkg/Config/Data/Category.ini +++ b/uefi-sct/SctPkg/Config/Data/Category.ini @@ -89,6 +89,13 @@ Description = [Category Data] Revision = 0x00010000 +CategoryGuid = 6b4d5d18-f55f-4fc5-8496-f10022375c04 +InterfaceGuid = 71652D04-BF38-434A-BCB8-6547D7FD8384 +Name = GenericTest\SbbrRequiredUefiProtocols +Description = Checks that UEFI protocols required by ARM SBBR are present. + +[Category Data] +Revision = 0x00010000 CategoryGuid = D84A6430-99F5-4660-8454-6E4C896A7E51 InterfaceGuid = 71652D04-BF38-434a-BCB8-6547D7FD8384 Name = GenericTest\SbbrSysEnvConfig diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/Guid.c new file mode 100644 index 0000000..1886989 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/Guid.c @@ -0,0 +1,61 @@ +/*++ + The material contained herein is not a license, either + expressly or impliedly, to any intellectual property owned + or controlled by any of the authors or developers of this + material or to any contribution thereto. The material + contained herein is provided on an "AS IS" basis and, to the + maximum extent permitted by applicable law, this information + is provided AS IS AND WITH ALL FAULTS, and the authors and + developers of this material hereby disclaim all other + warranties and conditions, either express, implied or + statutory, including, but not limited to, any (if any) + implied warranties, duties or conditions of merchantability, + of fitness for a particular purpose, of accuracy or + completeness of responses, of results, of workmanlike + effort, of lack of viruses and of lack of negligence, all + with regard to this material and any contribution thereto. + Designers must not rely on the absence or characteristics of + any features or instructions marked "reserved" or + "undefined." The Unified EFI Forum, Inc. reserves any + features or instructions so marked for future definition and + shall have no responsibility whatsoever for conflicts or + incompatibilities arising from future changes to them. ALSO, + THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, + QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR + NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY + CONTRIBUTION THERETO. + + IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR + ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR + THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST + PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, + CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER + UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY + WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS + DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF + THE POSSIBILITY OF SUCH DAMAGES. + + Copyright 2006 - 2016 Unified EFI, Inc. All + Rights Reserved, subject to all existing rights in all + matters included within this Test Suite, to which United + EFI, Inc. makes no claim of right. + + Copyright (c) 2016, ARM Corporation. All rights reserved. + +--*/ +/*++ + +Module Name: + + Guid.c + +Abstract: + + Global variable assignments for GUIDs used in test assertions. + +--*/ + +#include "Efi.h" +#include "Guid.h" + +EFI_GUID gRequiredUefiProtocolsAssertion001Guid = REQUIREDUEFIPROTOCOLS_ASSERTION_001_GUID; diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/Guid.h new file mode 100644 index 0000000..121ad19 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/Guid.h @@ -0,0 +1,66 @@ +/*++ + The material contained herein is not a license, either + expressly or impliedly, to any intellectual property owned + or controlled by any of the authors or developers of this + material or to any contribution thereto. The material + contained herein is provided on an "AS IS" basis and, to the + maximum extent permitted by applicable law, this information + is provided AS IS AND WITH ALL FAULTS, and the authors and + developers of this material hereby disclaim all other + warranties and conditions, either express, implied or + statutory, including, but not limited to, any (if any) + implied warranties, duties or conditions of merchantability, + of fitness for a particular purpose, of accuracy or + completeness of responses, of results, of workmanlike + effort, of lack of viruses and of lack of negligence, all + with regard to this material and any contribution thereto. + Designers must not rely on the absence or characteristics of + any features or instructions marked "reserved" or + "undefined." The Unified EFI Forum, Inc. reserves any + features or instructions so marked for future definition and + shall have no responsibility whatsoever for conflicts or + incompatibilities arising from future changes to them. ALSO, + THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, + QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR + NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY + CONTRIBUTION THERETO. + + IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR + ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR + THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST + PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, + CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER + UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY + WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS + DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF + THE POSSIBILITY OF SUCH DAMAGES. + + Copyright 2006 - 2016 Unified EFI, Inc. All + Rights Reserved, subject to all existing rights in all + matters included within this Test Suite, to which United + EFI, Inc. makes no claim of right. + + Copyright (c) 2016, ARM Corporation. All rights reserved. + +--*/ +/*++ + +Module Name: + + Guid.h + +Abstract: + + Definitions for GUIDs used in test assertions. + +--*/ + +#ifndef _REQUIREDUEFIPROTOCOLS_GUID_H_ +#define _REQUIREDUEFIPROTOCOLS_GUID_H_ + +#define REQUIREDUEFIPROTOCOLS_ASSERTION_001_GUID \ +{ 0x6092f275, 0x19ca, 0x413a, {0xac, 0xc8, 0x60, 0xd6, 0xe0, 0xca, 0x70, 0x54 }} + +extern EFI_GUID gRequiredUefiProtocolsAssertion001Guid; + +#endif /* _REQUIREDUEFIPROTOCOLS_GUID_H_ */ diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTest.inf new file mode 100644 index 0000000..674aba0 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTest.inf @@ -0,0 +1,81 @@ +# +# The material contained herein is not a license, either +# expressly or impliedly, to any intellectual property owned +# or controlled by any of the authors or developers of this +# material or to any contribution thereto. The material +# contained herein is provided on an "AS IS" basis and, to the +# maximum extent permitted by applicable law, this information +# is provided AS IS AND WITH ALL FAULTS, and the authors and +# developers of this material hereby disclaim all other +# warranties and conditions, either express, implied or +# statutory, including, but not limited to, any (if any) +# implied warranties, duties or conditions of merchantability, +# of fitness for a particular purpose, of accuracy or +# completeness of responses, of results, of workmanlike +# effort, of lack of viruses and of lack of negligence, all +# with regard to this material and any contribution thereto. +# Designers must not rely on the absence or characteristics of +# any features or instructions marked "reserved" or +# "undefined." The Unified EFI Forum, Inc. reserves any +# features or instructions so marked for future definition and +# shall have no responsibility whatsoever for conflicts or +# incompatibilities arising from future changes to them. ALSO, +# THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, +# QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR +# NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY +# CONTRIBUTION THERETO. +# +# IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR +# ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR +# THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST +# PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, +# CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER +# UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY +# WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS +# DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF +# THE POSSIBILITY OF SUCH DAMAGES. +# +# Copyright 2006 - 2016 Unified EFI, Inc. All +# Rights Reserved, subject to all existing rights in all +# matters included within this Test Suite, to which United +# EFI, Inc. makes no claim of right. +# +# Copyright (c) 2016, ARM Corporation. All rights reserved. +# +# +#/*++ +# +# Module Name: +# +# RequiredUefiProtocolsBBTest.inf +# +# Abstract: +# +# Component description file for RequiredUefiProtocols tests. +# +#--*/ + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = RequiredUefiProtocolsBBTest + FILE_GUID = acc875f3-9c75-4392-9b95-fcb97d48890e + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.0 + ENTRY_POINT = InitializeBBTestRequiredUefiProtocols + +[Sources.common] + RequiredUefiProtocolsBBTestMain.c + RequiredUefiProtocolsBBTestFunction.c + Guid.c + +[Packages] + MdePkg/MdePkg.dec + SctPkg/SctPkg.dec + SctPkg/UEFI/UEFI.dec + +[LibraryClasses] + UefiDriverEntryPoint + SctLib + EfiTestLib + +[Protocols] diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestFunction.c new file mode 100644 index 0000000..6b149ee --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestFunction.c @@ -0,0 +1,149 @@ +/*++ + The material contained herein is not a license, either + expressly or impliedly, to any intellectual property owned + or controlled by any of the authors or developers of this + material or to any contribution thereto. The material + contained herein is provided on an "AS IS" basis and, to the + maximum extent permitted by applicable law, this information + is provided AS IS AND WITH ALL FAULTS, and the authors and + developers of this material hereby disclaim all other + warranties and conditions, either express, implied or + statutory, including, but not limited to, any (if any) + implied warranties, duties or conditions of merchantability, + of fitness for a particular purpose, of accuracy or + completeness of responses, of results, of workmanlike + effort, of lack of viruses and of lack of negligence, all + with regard to this material and any contribution thereto. + Designers must not rely on the absence or characteristics of + any features or instructions marked "reserved" or + "undefined." The Unified EFI Forum, Inc. reserves any + features or instructions so marked for future definition and + shall have no responsibility whatsoever for conflicts or + incompatibilities arising from future changes to them. ALSO, + THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, + QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR + NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY + CONTRIBUTION THERETO. + + IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR + ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR + THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST + PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, + CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER + UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY + WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS + DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF + THE POSSIBILITY OF SUCH DAMAGES. + + Copyright 2006 - 2016 Unified EFI, Inc. All + Rights Reserved, subject to all existing rights in all + matters included within this Test Suite, to which United + EFI, Inc. makes no claim of right. + + Copyright (c) 2016, ARM Corporation. All rights reserved. + +--*/ +/*++ + +Module Name: + + RequiredUefiProtocolsBBTestFunction.c + +Abstract: + + Test case function definitions for RequiredUefiProtocols. + +--*/ + +#include "RequiredUefiProtocolsBBTestMain.h" +#include "RequiredUefiProtocolsBBTestFunction.h" +#include "SctLib.h" +#include "Guid.h" + +/** + * Entrypoint for MediaIoProtocols 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. + */ + +EFI_STATUS +BBTestMediaIoProtocolsTest ( + 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_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + EFI_HANDLE *HandleBuffer; + UINTN NumberOfHandles; + SBBR_REQUIRED_PROTOCOL Protocol[] = { + {EFI_LOAD_FILE_PROTOCOL_GUID, L"EFI_LOAD_FILE_PROTOCOL"}, + {EFI_LOAD_FILE2_PROTOCOL_GUID, L"EFI_LOAD_FILE2_PROTOCOL"}, + {gEfiNullGuid, 0} + }; + UINT32 i; + + // + // Get the Standard Library Interface + // + Status = gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + if (EFI_ERROR (Status)) { + return Status; + } + + // + // Looking for Protocols + // + i = 0; + while (SctCompareGuid (&Protocol[i].guid, &gEfiNullGuid) != 0){ + Status = gBS->LocateHandleBuffer ( + ByProtocol, + &Protocol[i].guid, + NULL, + &NumberOfHandles, + &HandleBuffer + ); + + if ((Status == EFI_NOT_FOUND) && (NumberOfHandles == 0)){ + // Protocol not found + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gRequiredUefiProtocolsAssertion001Guid, + L"MediaIoProtocols", + L"%a:%d:%s Not Found", + __FILE__, + __LINE__, + Protocol[i].name + ); + } + else { + // Protocol found + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_PASSED, + gRequiredUefiProtocolsAssertion001Guid, + L"MediaIoProtocols", + L"%a:%d:%s Found", + __FILE__, + __LINE__, + Protocol[i].name + ); + } + + i++; + } + + return EFI_SUCCESS; +} diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestFunction.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestFunction.h new file mode 100644 index 0000000..15009c9 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestFunction.h @@ -0,0 +1,86 @@ +/*++ + The material contained herein is not a license, either + expressly or impliedly, to any intellectual property owned + or controlled by any of the authors or developers of this + material or to any contribution thereto. The material + contained herein is provided on an "AS IS" basis and, to the + maximum extent permitted by applicable law, this information + is provided AS IS AND WITH ALL FAULTS, and the authors and + developers of this material hereby disclaim all other + warranties and conditions, either express, implied or + statutory, including, but not limited to, any (if any) + implied warranties, duties or conditions of merchantability, + of fitness for a particular purpose, of accuracy or + completeness of responses, of results, of workmanlike + effort, of lack of viruses and of lack of negligence, all + with regard to this material and any contribution thereto. + Designers must not rely on the absence or characteristics of + any features or instructions marked "reserved" or + "undefined." The Unified EFI Forum, Inc. reserves any + features or instructions so marked for future definition and + shall have no responsibility whatsoever for conflicts or + incompatibilities arising from future changes to them. ALSO, + THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, + QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR + NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY + CONTRIBUTION THERETO. + + IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR + ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR + THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST + PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, + CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER + UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY + WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS + DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF + THE POSSIBILITY OF SUCH DAMAGES. + + Copyright 2006 - 2016 Unified EFI, Inc. All + Rights Reserved, subject to all existing rights in all + matters included within this Test Suite, to which United + EFI, Inc. makes no claim of right. + + Copyright (c) 2016, ARM Corporation. All rights reserved. + +--*/ +/*++ + +Module Name: + + RequiredUefiProtocolsBBTestFunction.h + +Abstract: + + Contains definitions and prototypes for test case functions. + +--*/ + +#ifndef _REQUIREDUEFIPROTOCOLS_BB_TEST_FUNCTION_H_ +#define _REQUIREDUEFIPROTOCOLS_BB_TEST_FUNCTION_H_ + +/* + * GUIDs of protocols we're looking for are here as to avoid + * compilation errors in the case that they do not exist in the + * system. + */ + +#define EFI_LOAD_FILE_PROTOCOL_GUID \ +{0x56EC3091, 0x954C, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B}} + +#define EFI_LOAD_FILE2_PROTOCOL_GUID \ +{0x4006C0C1, 0xFCB3, 0x403E, {0x99, 0x6D, 0x4A, 0x6C, 0x87, 0x24, 0xE0, 0x6D}} + +typedef struct { + EFI_GUID guid; + UINT16 *name; +} SBBR_REQUIRED_PROTOCOL; + +EFI_STATUS +BBTestMediaIoProtocolsTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ); + +#endif /* _REQUIREDUEFIPROTOCOLS_BB_TEST_FUNCTION_H_ */ diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestMain.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestMain.c new file mode 100644 index 0000000..72056e0 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestMain.c @@ -0,0 +1,130 @@ +/*++ + The material contained herein is not a license, either + expressly or impliedly, to any intellectual property owned + or controlled by any of the authors or developers of this + material or to any contribution thereto. The material + contained herein is provided on an "AS IS" basis and, to the + maximum extent permitted by applicable law, this information + is provided AS IS AND WITH ALL FAULTS, and the authors and + developers of this material hereby disclaim all other + warranties and conditions, either express, implied or + statutory, including, but not limited to, any (if any) + implied warranties, duties or conditions of merchantability, + of fitness for a particular purpose, of accuracy or + completeness of responses, of results, of workmanlike + effort, of lack of viruses and of lack of negligence, all + with regard to this material and any contribution thereto. + Designers must not rely on the absence or characteristics of + any features or instructions marked "reserved" or + "undefined." The Unified EFI Forum, Inc. reserves any + features or instructions so marked for future definition and + shall have no responsibility whatsoever for conflicts or + incompatibilities arising from future changes to them. ALSO, + THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, + QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR + NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY + CONTRIBUTION THERETO. + + IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR + ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR + THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST + PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, + CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER + UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY + WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS + DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF + THE POSSIBILITY OF SUCH DAMAGES. + + Copyright 2006 - 2016 Unified EFI, Inc. All + Rights Reserved, subject to all existing rights in all + matters included within this Test Suite, to which United + EFI, Inc. makes no claim of right. + + Copyright (c) 2016, ARM Corporation. All rights reserved. + +--*/ +/*++ + +Module Name: + + RequiredUefiProtocolsBBTestMain.c + +Abstract: + + Test driver for RequiredUefiProtocols tests. + +--*/ + +#include "SctLib.h" +#include "RequiredUefiProtocolsBBTestMain.h" +#include "RequiredUefiProtocolsBBTestFunction.h" + +EFI_BB_TEST_PROTOCOL_FIELD gBBTestProtocolField = { + REQUIREDUEFIPROTOCOLS_TEST_REVISION, + REQUIREDUEFIPROTOCOLS_TEST_GUID, + L"RequiredUefiProtocols Tests", + L"Checks that UEFI protocols required by ARM SBBR are present." +}; + +EFI_GUID gSupportProtocolGuid[2] = { + EFI_STANDARD_TEST_LIBRARY_GUID, + EFI_NULL_GUID +}; + +EFI_BB_TEST_ENTRY_FIELD gBBTestEntryField[] = { + { + REQUIREDUEFIPROTOCOLS_MEDIAIOPROTOCOLS_GUID, + L"MediaIoProtocols", + L"Checks to make sure various media IO protocols are supported.", + EFI_TEST_LEVEL_DEFAULT, + gSupportProtocolGuid, + EFI_TEST_CASE_AUTO, + BBTestMediaIoProtocolsTest + }, + EFI_NULL_GUID +}; + +EFI_BB_TEST_PROTOCOL *gBBTestProtocolInterface; + +/** + * The driver's Unload function + * @param ImageHandle The test driver image handle + * @return EFI_SUCCESS Indicates the interface was Uninstalled +*/ +EFI_STATUS +BBTestRequiredUefiProtocolsUnload ( + IN EFI_HANDLE ImageHandle + ) +{ + return EfiUninstallAndFreeBBTestInterface ( + ImageHandle, + gBBTestProtocolInterface + ); +} + +/** + * Creates/installs the BlackBox Interface and eminating Entry Point + * node list. + * @param ImageHandle The test driver image handle + * @param SystemTable Pointer to System Table + * @return EFI_SUCCESS Indicates the interface was installed + * @return EFI_OUT_OF_RESOURCES Indicates space for the new handle could not be allocated + * @return EFI_INVALID_PARAMETER: One of the parameters has an invalid value. + */ +EFI_STATUS +InitializeBBTestRequiredUefiProtocols ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + + EfiInitializeTestLib (ImageHandle, SystemTable); + + return EfiInitAndInstallBBTestInterface ( + &ImageHandle, + &gBBTestProtocolField, + gBBTestEntryField, + BBTestRequiredUefiProtocolsUnload, + &gBBTestProtocolInterface + ); +} diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestMain.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestMain.h new file mode 100644 index 0000000..26e591c --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestMain.h @@ -0,0 +1,88 @@ +/*++ + The material contained herein is not a license, either + expressly or impliedly, to any intellectual property owned + or controlled by any of the authors or developers of this + material or to any contribution thereto. The material + contained herein is provided on an "AS IS" basis and, to the + maximum extent permitted by applicable law, this information + is provided AS IS AND WITH ALL FAULTS, and the authors and + developers of this material hereby disclaim all other + warranties and conditions, either express, implied or + statutory, including, but not limited to, any (if any) + implied warranties, duties or conditions of merchantability, + of fitness for a particular purpose, of accuracy or + completeness of responses, of results, of workmanlike + effort, of lack of viruses and of lack of negligence, all + with regard to this material and any contribution thereto. + Designers must not rely on the absence or characteristics of + any features or instructions marked "reserved" or + "undefined." The Unified EFI Forum, Inc. reserves any + features or instructions so marked for future definition and + shall have no responsibility whatsoever for conflicts or + incompatibilities arising from future changes to them. ALSO, + THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, + QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR + NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY + CONTRIBUTION THERETO. + + IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR + ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR + THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST + PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, + CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER + UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY + WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS + DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF + THE POSSIBILITY OF SUCH DAMAGES. + + Copyright 2006 - 2016 Unified EFI, Inc. All + Rights Reserved, subject to all existing rights in all + matters included within this Test Suite, to which United + EFI, Inc. makes no claim of right. + + Copyright (c) 2016, ARM Corporation. All rights reserved. + +--*/ +/*++ + +Module Name: + + RequiredUefiProtocolsBBTestMain.h + +Abstract: + + Contains definitions for test information and test GUIDs. + +--*/ + +#ifndef _REQUIREDUEFIPROTOCOLS_TEST_MAIN_H_ +#define _REQUIREDUEFIPROTOCOLS_TEST_MAIN_H_ + +#include "Efi.h" +#include "Guid.h" +#include + +#define REQUIREDUEFIPROTOCOLS_TEST_REVISION 0x00010000 + +#define REQUIREDUEFIPROTOCOLS_TEST_GUID \ +{ 0x6b4d5d18, 0xf55f, 0x4fc5, {0x84, 0x96, 0xf1, 0x00, 0x22, 0x37, 0x5c, 0x04 }} + +EFI_STATUS +InitializeBBTestRequiredUefiProtocols ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ); + +EFI_STATUS +BBTestBootRequiredUefiProtocols ( + IN EFI_HANDLE ImageHandle + ); + +// +// Entry GUIDs +// + +#define REQUIREDUEFIPROTOCOLS_MEDIAIOPROTOCOLS_GUID \ +{ 0x24d52c4c, 0xafeb, 0x49ea, {0xa7, 0x77, 0x8f, 0xe1, 0x9f, 0x32, 0x20, 0x66 }} + +#endif /* _REQUIREDUEFIPROTOCOLS_TEST_MAIN_H_ */ diff --git a/uefi-sct/SctPkg/UEFI/SBBR_SCT.dsc b/uefi-sct/SctPkg/UEFI/SBBR_SCT.dsc index 9020ade..ae0a009 100644 --- a/uefi-sct/SctPkg/UEFI/SBBR_SCT.dsc +++ b/uefi-sct/SctPkg/UEFI/SBBR_SCT.dsc @@ -246,6 +246,7 @@ SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Proto SctPkg/TestCase/UEFI/EFI/Generic/SbbrSysEnvConfig/BlackBoxTest/SysEnvConfigBBTest.inf #End of UEFI System Environment and Configuration Tests - SBBR v1.0 3.3 +# # Required UEFI Runtime Services Tests - SBBR v1.0 Appendix B # ## 1. EFI_GET_TIME @@ -271,6 +272,13 @@ SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRu # End of Runtime Services Tests - SBBR v1.0 Appendix B # +# UEFI Required Protocols Tests - SBBR Appendix C +# +SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTest.inf +SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTest_uefi.inf +# End of UEFI Required Protocols Tests - SBBR Appendix C + +# # Dependency files # -- 2.7.4