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 04/12] uefi-sct/SctPkg: sbbr: Add Required UEFI Runtime Services tests.
Date: Tue,  6 Nov 2018 14:17:38 +0530	[thread overview]
Message-ID: <1541494066-16288-4-git-send-email-sakar.arora@arm.com> (raw)
In-Reply-To: <1541494066-16288-1-git-send-email-sakar.arora@arm.com>

Required UEFI Runtime Services Tests - SBBR v1.0 Appendix B
1. EFI_GET_TIME
2. EFI_SET_TIME
3. EFI_GET_WAKEUP_TIME
4. EFI_SET_WAKEUP_TIME
5. EFI_GET_VARIABLE
6. EFI_GET_NEXT_VARIABLE_NAME
7. EFI_SET_VARIABLE
8. EFI_QUERY_VARIABLE_INFO
9. EFI_QUERY_CAPSULE_CAPABILITIES
10. EFI_UPDATE_CAPSULE
11. EFI_RESET_SYSTEM
12. EFI_SET_VIRTUAL_ADDRESS_MAP
13. EFI_CONVERT_POINTER

Signed-off-by: Sakar Arora <sakar.arora@arm.com>
---
 uefi-sct/SctPkg/CommonGenFramework.sh              |   6 +
 uefi-sct/SctPkg/Config/Data/Category.ini           |  11 +-
 .../SBBRRuntimeServices/BlackBoxTest/Guid.c        |  61 ++++++
 .../SBBRRuntimeServices/BlackBoxTest/Guid.h        |  65 ++++++
 .../BlackBoxTest/SBBRRuntimeServicesBBTest.inf     |  81 ++++++++
 .../SBBRRuntimeServicesBBTestFunction.c            | 218 +++++++++++++++++++++
 .../SBBRRuntimeServicesBBTestFunction.h            |  71 +++++++
 .../BlackBoxTest/SBBRRuntimeServicesBBTestMain.c   | 131 +++++++++++++
 .../BlackBoxTest/SBBRRuntimeServicesBBTestMain.h   |  86 ++++++++
 uefi-sct/SctPkg/UEFI/SBBR_SCT.dsc                  |  24 +++
 10 files changed, 752 insertions(+), 2 deletions(-)
 create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/Guid.c
 create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/Guid.h
 create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTest.inf
 create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestFunction.c
 create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestFunction.h
 create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestMain.c
 create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestMain.h

diff --git a/uefi-sct/SctPkg/CommonGenFramework.sh b/uefi-sct/SctPkg/CommonGenFramework.sh
index c9b6ca9..bf94d8e 100755
--- a/uefi-sct/SctPkg/CommonGenFramework.sh
+++ b/uefi-sct/SctPkg/CommonGenFramework.sh
@@ -364,6 +364,12 @@ then
     # Tests SBBR sections 3.3.1, 3.3.2, 3.3.3, and 3.3.4
     cp $ProcessorType/SysEnvConfigBBTest.efi                            $Framework/Test/ > NUL
 
+    # Runtime Services Tests - SBBR v1.0 Appendix B
+    cp $ProcessorType/VariableServicesBBTest.efi               $Framework/Test/ > NUL
+    cp $ProcessorType/TimeServicesBBTest.efi                   $Framework/Test/ > NUL
+    cp $ProcessorType/MiscRuntimeServicesBBTest.efi            $Framework/Test/ > NUL
+    cp $ProcessorType/SBBRRuntimeServicesBBTest.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 9a81c1d..a41cd0f 100644
--- a/uefi-sct/SctPkg/Config/Data/Category.ini
+++ b/uefi-sct/SctPkg/Config/Data/Category.ini
@@ -173,8 +173,15 @@ Description   =
 
 [Category Data]
 Revision      = 0x00010000
-CategoryGuid  = 5B1B31A1-9562-11D2-8E3F-00A0C969723B
-InterfaceGuid = 5B1B31A1-9562-11D2-8E3F-00A0C969723B
+CategoryGuid  = 52A69BBF-E19F-4e82-93D6-AAC46E2E1E06
+InterfaceGuid = AFF115FB-387B-4c18-8C41-6AFC7F03BB90
+Name          = RuntimeServicesTest\SBBRRuntimeServicesTest
+Description   =
+
+[Category Data]
+Revision      = 0x00010000
+CategoryGuid  = 5B1B31A1-9562-11d2-8E3F-00A0C969723B
+InterfaceGuid = 5B1B31A1-9562-11d2-8E3F-00A0C969723B
 Name          = LoadedImageProtocolTest
 Description   =
 
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
new file mode 100644
index 0000000..374b767
--- /dev/null
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/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.<BR>
+
+--*/
+/*++
+
+Module Name:
+
+  Guid.c
+
+Abstract:
+
+  GUIDs auto-generated for EFI test assertion.
+
+--*/
+
+#include "Efi.h"
+#include "Guid.h"
+
+EFI_GUID gSBBRRuntimeServicesAssertion001Guid = SBBRRUNTIMESERVICES_ASSERTION_001_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
new file mode 100644
index 0000000..86165b3
--- /dev/null
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/Guid.h
@@ -0,0 +1,65 @@
+/*++
+  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.<BR>
+
+--*/
+/*++
+
+Module Name:
+
+  Guid.h
+
+Abstract:
+
+  GUIDs auto-generated for EFI test assertion.
+
+--*/
+
+#ifndef _SBBRRUNTIMESERVICES_GUID_H_
+#define _SBBRRUNTIMESERVICES_GUID_H_
+
+#define SBBRRUNTIMESERVICES_ASSERTION_001_GUID \
+{ 0x787ad247, 0xc901, 0x49d8, {0x84, 0x82, 0x91, 0x5e, 0x09, 0x61, 0xcf, 0x34 }}
+
+extern EFI_GUID gSBBRRuntimeServicesAssertion001Guid;
+#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
new file mode 100644
index 0000000..f6c6856
--- /dev/null
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTest.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. All rights reserved.<BR>
+#
+#
+#/*++
+#
+# Module Name:
+#
+#   SBBRRuntimeServicesBBTest.inf
+#
+# Abstract:
+#
+#   Component description file for SBBRRuntimeServices tests.
+#
+#--*/
+
+[Defines]
+  INF_VERSION          = 0x00010005
+  BASE_NAME            = SBBRRuntimeServicesBBTest
+  FILE_GUID            = 8906d7fb-39d8-4f90-ba35-ee838fee1805
+  MODULE_TYPE          = UEFI_DRIVER
+  VERSION_STRING       = 1.0
+  ENTRY_POINT          = InitializeBBTestSBBRRuntimeServices
+
+[Sources.common]
+  Guid.c
+  SBBRRuntimeServicesBBTestFunction.c
+  SBBRRuntimeServicesBBTestMain.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  SctPkg/SctPkg.dec
+  SctPkg/UEFI/UEFI.dec
+
+[LibraryClasses]
+  EfiTestLib
+  SctLib
+  UefiDriverEntryPoint
+
+[Protocols]
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
new file mode 100644
index 0000000..1f19cef
--- /dev/null
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestFunction.c
@@ -0,0 +1,218 @@
+/*++
+  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.<BR>
+
+--*/
+/*++
+
+Module Name:
+
+  SBBRRuntimeServicesBBTestFunction.c
+
+Abstract:
+
+  Test cases for SBBRRuntimeServices.
+
+--*/
+#include "Guid.h"
+#include "SctLib.h"
+#include "SBBRRuntimeServicesBBTestMain.h"
+#include "SBBRRuntimeServicesBBTestFunction.h"
+
+
+
+
+/**
+ *  Entrypoint for Runtime Services 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
+BBTestRuntimeServices (
+  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;
+  UINT32              CRC32;
+  UINT32              LocalCRC32;
+
+  //
+  // Get the Standard Library Interface
+  //
+  Status = gtBS->HandleProtocol (
+                   SupportHandle,
+                   &gEfiStandardTestLibraryGuid,
+                   (VOID **) &StandardLib
+                   );
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  //
+  // Check the EFI Runtime Services Table
+  //
+  CRC32 = gtRT->Hdr.CRC32;
+  gtRT->Hdr.CRC32 = 0;
+
+  LocalCRC32 = 0;
+  Status = SctCalculateCrc32 ((UINT8 *)gtRT, gtRT->Hdr.HeaderSize, &LocalCRC32);
+  if (EFI_ERROR (Status)) {
+    AssertionType = EFI_TEST_ASSERTION_FAILED;
+  } else {
+    if ((gtRT->Hdr.Signature             == EFI_RUNTIME_SERVICES_SIGNATURE) &&
+        (gtRT->Hdr.Revision              >= 0x00020000                    ) &&
+        (gtRT->Hdr.Reserved              == 0x00000000                    ) &&
+        (gtRT->GetTime                   != NULL                          ) &&
+        (gtRT->SetTime                   != NULL                          ) &&
+        (gtRT->GetWakeupTime             != NULL                          ) &&
+        (gtRT->SetWakeupTime             != NULL                          ) &&
+        (gtRT->SetVirtualAddressMap      != NULL                          ) &&
+        (gtRT->ConvertPointer            != NULL                          ) &&
+        (gtRT->GetVariable               != NULL                          ) &&
+        (gtRT->GetNextVariableName       != NULL                          ) &&
+        (gtRT->SetVariable               != NULL                          ) &&
+        (gtRT->GetNextHighMonotonicCount != NULL                          ) &&
+        (gtRT->ResetSystem               != NULL                          ) &&
+        (gtRT->QueryVariableInfo         != NULL                          ) &&
+        (gtRT->QueryCapsuleCapabilities  != NULL                          ) &&
+        (gtRT->UpdateCapsule             != NULL                          ) &&
+        (LocalCRC32                      == CRC32                         )) {
+      AssertionType = EFI_TEST_ASSERTION_PASSED;
+    } else {
+      AssertionType = EFI_TEST_ASSERTION_FAILED;
+    }
+
+    gtRT->Hdr.CRC32 = CRC32;
+  }
+
+  StandardLib->RecordAssertion (
+                 StandardLib,
+                 AssertionType,
+                 gSBBRRuntimeServicesAssertion001Guid,
+                 L"UEFI Compliant - EFI Runtime Services Table must be implemented",
+                 L"%a:%d:Signature - %lX, Expected - %lX",
+                 __FILE__,
+                 (UINTN)__LINE__,
+                 gtRT->Hdr.Signature,
+                 EFI_RUNTIME_SERVICES_SIGNATURE
+                 );
+
+  //
+  // Record the entire EFI Runtime Services Table
+  //
+  StandardLib->RecordMessage (
+                 StandardLib,
+                 EFI_VERBOSE_LEVEL_DEFAULT,
+                 L"  Hdr.Signature             : %lX\n"
+                 L"  Hdr.Revision              : %X\n"
+                 L"  Hdr.HeaderSize            : %X\n"
+                 L"  Hdr.CRC32                 : %X\n"
+                 L"  Hdr.Reserved              : %X\n",
+                 gtRT->Hdr.Signature,
+                 gtRT->Hdr.Revision,
+                 gtRT->Hdr.HeaderSize,
+                 gtRT->Hdr.CRC32,
+                 gtRT->Hdr.Reserved
+                 );
+
+
+  StandardLib->RecordMessage (
+                 StandardLib,
+                 EFI_VERBOSE_LEVEL_DEFAULT,
+                 L"  GetTime                   : %X\n"
+                 L"  SetTime                   : %X\n"
+                 L"  GetWakeupTime             : %X\n"
+                 L"  SetWakeupTime             : %X\n"
+                 L"  SetVirtualAddressMap      : %X\n"
+                 L"  ConvertPointer            : %X\n"
+                 L"  GetVariable               : %X\n"
+                 L"  GetNextVariableName       : %X\n"
+                 L"  SetVariable               : %X\n"
+                 L"  GetNextHighMonotonicCount : %X\n"
+                 L"  ResetSystem               : %X\n"
+                 L"  QueryVariableInfo         : %X\n"
+                 L"  QueryCapsuleCapabilities  : %X\n"
+                 L"  UpdateCapsule             : %X\n",
+                 gtRT->GetTime,
+                 gtRT->SetTime,
+                 gtRT->GetWakeupTime,
+                 gtRT->SetWakeupTime,
+                 gtRT->SetVirtualAddressMap,
+                 gtRT->ConvertPointer,
+                 gtRT->GetVariable,
+                 gtRT->GetNextVariableName,
+                 gtRT->SetVariable,
+                 gtRT->GetNextHighMonotonicCount,
+                 gtRT->ResetSystem,
+                 gtRT->QueryVariableInfo,
+                 gtRT->QueryCapsuleCapabilities,
+                 gtRT->UpdateCapsule
+                 );
+
+  //
+  // Done
+  //
+
+  //
+  // Function calls like above are used to record test results.
+  // The actual return value of this function is used to tell
+  // the framework whether the tests completed successfully or
+  // if there was some fault in the test itself.  For example, not
+  // being able to allocate a buffer because the system is out of
+  // memory would return an error, but a test case failing because
+  // a register being checked does not contain the right value
+  // would return EFI_SUCCESS.
+  //
+
+  return EFI_SUCCESS;
+}
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
new file mode 100644
index 0000000..25dd209
--- /dev/null
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestFunction.h
@@ -0,0 +1,71 @@
+/*++
+  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.<BR>
+
+--*/
+/*++
+
+Module Name:
+
+  SBBRRuntimeServicesBBTestFunction.h
+
+Abstract:
+
+  Header file for SBBRRuntimeServicesBBTestFunction.h.
+
+--*/
+
+#ifndef _SBBRRUNTIMESERVICES_BB_TEST_FUNCTION_H_
+#define _SBBRRUNTIMESERVICES_BB_TEST_FUNCTION_H_
+
+#include <Library/EfiTestLib.h>
+
+EFI_STATUS
+BBTestRuntimeServices (
+  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
new file mode 100644
index 0000000..4af06cc
--- /dev/null
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestMain.c
@@ -0,0 +1,131 @@
+/*++
+  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.<BR>
+
+--*/
+/*++
+
+Module Name:
+
+  SBBRRuntimeServicesBBTestMain.c
+
+Abstract:
+
+  Test driver for SBBRRuntimeServices tests.
+
+--*/
+
+#include "SctLib.h"
+#include "SBBRRuntimeServicesBBTestFunction.h"
+#include "SBBRRuntimeServicesBBTestMain.h"
+
+
+EFI_BB_TEST_PROTOCOL_FIELD gBBTestProtocolField = {
+  SBBRRUNTIMESERVICES_TEST_REVISION,
+  SBBRRUNTIMESERVICES_TEST_GUID,
+  L"SBBRRuntimeServices Tests",
+  L"Tests to test Runtime Services Exception Level, Memory Map, Real Time Clock , Reset, Shutdown and Set Variable."
+};
+
+EFI_GUID gSupportProtocolGuid[2] = {
+  EFI_STANDARD_TEST_LIBRARY_GUID,
+  EFI_NULL_GUID
+};
+
+EFI_BB_TEST_ENTRY_FIELD gBBTestEntryField[] = {
+  {
+    SBBRRUNTIMESERVICES_TEST_CASE_GUID,
+    L"Runtime Services Test",
+    L"Test to check runtime services exist or not.",
+    EFI_TEST_LEVEL_DEFAULT,
+    gSupportProtocolGuid,
+    EFI_TEST_CASE_AUTO,
+    BBTestRuntimeServices
+  },
+  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
+BBTestSBBRRuntimeServicesUnload (
+  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
+InitializeBBTestSBBRRuntimeServices (
+  IN EFI_HANDLE           ImageHandle,
+  IN EFI_SYSTEM_TABLE     *SystemTable
+  )
+{
+
+  EfiInitializeTestLib (ImageHandle, SystemTable);
+
+  return EfiInitAndInstallBBTestInterface (
+           &ImageHandle,
+           &gBBTestProtocolField,
+           gBBTestEntryField,
+           BBTestSBBRRuntimeServicesUnload,
+           &gBBTestProtocolInterface
+           );
+}
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
new file mode 100644
index 0000000..e14b9bb
--- /dev/null
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTestMain.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.<BR>
+
+--*/
+/*++
+
+Module Name:
+
+  SBBRRuntimeServicesBBTestMain.h
+
+Abstract:
+
+  Header file for SBBRRuntimeServicesBBTestMain.c.
+
+--*/
+
+#ifndef _SBBRRUNTIMESERVICES_TEST_MAIN_H_
+#define _SBBRRUNTIMESERVICES_TEST_MAIN_H_
+
+#include "Efi.h"
+
+#define SBBRRUNTIMESERVICES_TEST_REVISION 0x00010000
+
+#define SBBRRUNTIMESERVICES_TEST_GUID     \
+  { 0x52A69BBF, 0xE19F, 0x4e82, {0x93, 0xD6, 0xAA, 0xC4, 0x6E, 0x2E, 0x1E, 0x06 }}
+
+EFI_STATUS
+InitializeBBTestSBBRRuntimeServices (
+  IN EFI_HANDLE           ImageHandle,
+  IN EFI_SYSTEM_TABLE     *SystemTable
+  );
+
+EFI_STATUS
+BBTestSBBRRuntimeServices (
+  IN EFI_HANDLE       ImageHandle
+  );
+
+//
+// Entry GUIDs
+//
+
+#define SBBRRUNTIMESERVICES_TEST_CASE_GUID \
+  { 0xe867fa15, 0x942b, 0x4c69, {0xad, 0xee, 0xf9, 0x3b, 0x11, 0x71, 0xd0, 0x8c }}
+
+#endif /* _SBBRRUNTIMESERVICES_TEST_MAIN_H_ */
diff --git a/uefi-sct/SctPkg/UEFI/SBBR_SCT.dsc b/uefi-sct/SctPkg/UEFI/SBBR_SCT.dsc
index 3a637e2..9020ade 100644
--- a/uefi-sct/SctPkg/UEFI/SBBR_SCT.dsc
+++ b/uefi-sct/SctPkg/UEFI/SBBR_SCT.dsc
@@ -246,6 +246,30 @@ 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
+##  2. EFI_SET_TIME
+##  3. EFI_GET_WAKEUP_TIME
+##  4. EFI_SET_WAKEUP_TIME
+SctPkg/TestCase/UEFI/EFI/RuntimeServices/TimeServices/BlackBoxTest/TimeServicesBBTest.inf
+#
+##  5. EFI_GET_VARIABLE
+##  6. EFI_GET_NEXT_VARIABLE_NAME
+##  7. EFI_SET_VARIABLE
+##  8. EFI_QUERY_VARIABLE_INFO
+SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/VariableServicesBBTest.inf
+#
+##  9. EFI_QUERY_CAPSULE_CAPABILITIES
+## 10. EFI_UPDATE_CAPSULE
+## 11. EFI_RESET_SYSTEM
+SctPkg/TestCase/UEFI/EFI/RuntimeServices/MiscRuntimeServices/BlackBoxTest/MiscRuntimeServicesBBTest.inf
+#
+## 12. EFI_SET_VIRTUAL_ADDRESS_MAP
+## 13. EFI_CONVERT_POINTER
+SctPkg/TestCase/UEFI/EFI/RuntimeServices/SBBRRuntimeServices/BlackBoxTest/SBBRRuntimeServicesBBTest.inf
+# End of Runtime Services Tests - SBBR v1.0 Appendix B
+
 #
 # 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 ` Sakar Arora [this message]
2018-11-06 17:40   ` [edk2-test][RFC PATCH 04/12] uefi-sct/SctPkg: sbbr: Add Required UEFI Runtime Services tests Leif Lindholm
2018-11-06  8:47 ` [edk2-test][RFC PATCH 05/12] uefi-sct/SctPkg: sbbr: Add test cases for SBBR v1.0 Appendix C Sakar Arora
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-4-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