public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Sakar Arora <sakar.arora@arm.com>
To: edk2-devel@lists.01.org
Cc: Supreeth.Venkatesh@arm.com, prasanth.pulla@arm.com
Subject: [edk2-test][RFC PATCH 05/12] uefi-sct/SctPkg: sbbr: Add test cases for SBBR v1.0 Appendix C
Date: Tue,  6 Nov 2018 14:17:39 +0530	[thread overview]
Message-ID: <1541494066-16288-5-git-send-email-sakar.arora@arm.com> (raw)
In-Reply-To: <1541494066-16288-1-git-send-email-sakar.arora@arm.com>

From: John Powell <john.powell@arm.com>

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 <john.powell@arm.com>
---
 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 <Library/EfiTestLib.h>
+
+#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



  parent reply	other threads:[~2018-11-06  8:48 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06  8:47 [edk2-test][RFC PATCH 01/12] uefi-sct/SctPkg: sbbr: Add support to build SBBR v1.0 test cases Sakar Arora
2018-11-06  8:47 ` [edk2-test][RFC PATCH 02/12] uefi-sct/SctPkg: sbbr: Add boot services test cases for SBBR v1.0 Sakar Arora
2018-11-06 17:30   ` Leif Lindholm
2018-11-06  8:47 ` [edk2-test][RFC PATCH 03/12] uefi-sct/SctPkg: sbbr: Add System Environment Configuration Test Cases Sakar Arora
2018-11-06 17:38   ` Leif Lindholm
2018-11-06  8:47 ` [edk2-test][RFC PATCH 04/12] uefi-sct/SctPkg: sbbr: Add Required UEFI Runtime Services tests Sakar Arora
2018-11-06 17:40   ` Leif Lindholm
2018-11-06  8:47 ` Sakar Arora [this message]
2018-11-06  8:47 ` [edk2-test][RFC PATCH 06/12] uefi-sct/SctPkg: sbbr: Add test cases for SBBR v1.0 3.5.4 and 3.5.5 Sakar Arora
2018-11-06  8:47 ` [edk2-test][RFC PATCH 07/12] uefi-sct/SctPkg: sbbr: Add test cases for SBBR v1.0 boot services Sakar Arora
2018-11-06 17:46   ` Leif Lindholm
2018-11-07 20:55     ` Supreeth Venkatesh
2018-11-06  8:47 ` [edk2-test][RFC PATCH 08/12] uefi-sct/SctPkg: sbbr: UEFI Version Verification Test Sakar Arora
2018-11-06 17:48   ` Leif Lindholm
2018-11-06  8:47 ` [edk2-test][RFC PATCH 09/12] uefi-sct/SctPkg: sbbr: UEFI SMBIOS Base Requirements Sakar Arora
2018-11-06  8:47 ` [edk2-test][RFC PATCH 10/12] uefi-sct/SctPkg: sbbr: Corrected path to ArmBaseLib.inf in SBBR_SCT.dsc Sakar Arora
2018-11-06 17:51   ` Leif Lindholm
2018-11-06  8:47 ` [edk2-test][RFC PATCH 11/12] uefi-sct/SctPkg: sbbr: Bugfix for MemoryMap Check Test Sakar Arora
2018-11-06 17:53   ` Leif Lindholm
2018-11-20  7:55   ` Jin, Eric
2018-11-06  8:47 ` [edk2-test][RFC PATCH 12/12] uefi-sct/SctPkg: sbbr: Modify SBBR description file to add missing dependencies Sakar Arora
2018-11-06 17:56   ` Leif Lindholm
2018-11-06 12:45 ` [edk2-test][RFC PATCH 01/12] uefi-sct/SctPkg: sbbr: Add support to build SBBR v1.0 test cases Leif Lindholm
2018-11-06 17:39   ` Supreeth Venkatesh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1541494066-16288-5-git-send-email-sakar.arora@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox