From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: microchip.com, ip: 68.232.147.91, mailfrom: shrishail.patil@microchip.com) Received: from esa1.microchip.iphmx.com (esa1.microchip.iphmx.com [68.232.147.91]) by groups.io with SMTP; Wed, 07 Aug 2019 02:54:15 -0700 Received-SPF: Pass (esa1.microchip.iphmx.com: domain of Shrishail.Patil@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Shrishail.Patil@microchip.com"; x-sender="Shrishail.Patil@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com a:mx1.microchip.iphmx.com a:mx2.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa1.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Shrishail.Patil@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa1.microchip.iphmx.com; dkim=none (message not signed) header.i=none; spf=Pass smtp.mailfrom=Shrishail.Patil@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: iYk21goM6EIfsj+RKeiODNa0XIawKHBlrilFZRNe8kOcw8NWd+BA++Hjq8kUqEA1VsCWX016Ms XgnF8jP0YTVWCAyHO+VJWK0/sLsnJv7STmvpBVzAYsmnUnDs3AxLHFB+7N7GYcRwm1KcRlkl1t DmKiI/ksh0Tctsg4eb1dXUbEWkghKNNHbvUC0yEE7DG/8Z5+D+O4hKoOFtBLxhXC6xiyAnyLEu oBXpgik9zIu18863moNl+00QgQ+owfwwy3typaF/C2p3R42sh3L5EZ7qOtXBngJyS1a8UqmJft 5a4= X-IronPort-AV: E=Sophos;i="5.64,357,1559545200"; d="scan'208";a="45642054" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Aug 2019 02:54:14 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 7 Aug 2019 02:54:14 -0700 Received: from INB-LT-I31184A.mchp-main.com (10.10.85.251) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Wed, 7 Aug 2019 02:54:07 -0700 From: "shrishail" To: CC: , , , Shrishail Patil , shrishail patil Subject: [edk2-test][PATCH V3 1/3] Adding FMP to IHVSCT. Date: Wed, 7 Aug 2019 15:23:44 +0530 Message-ID: <20190807095344.1688-1-shrishail.patil@microchip.com> X-Mailer: git-send-email 2.22.0.windows.1 MIME-Version: 1.0 Return-Path: shrishail.patil@microchip.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Shrishail Patil =0D Adding Firmware Management Protocol to IHVSCT.=0D This patch contains source code which is copied from=0D UEFISCT and added into IHVSCT.=0D Addressed the review comments relating to commented code.=0D Contributed-under: TianoCore Contribution Agreement 1.1=0D Signed-off-by: shrishail patil =0D ---=0D .../FirmwareManagementBBTestConformance.c | 3613 +++++++++++++++++=0D .../FirmwareManagementBBTestFunction.c | 872 ++++=0D .../FirmwareManagementBBTestMain.c | 168 +=0D .../FirmwareManagementBBTestMain.h | 205 +=0D .../FirmwareManagement/BlackBoxTest/Guid.c | 83 +=0D .../FirmwareManagement/BlackBoxTest/Guid.h | 153 +=0D .../IhvFirmwareManagementBBTest.inf | 52 +=0D 7 files changed, 5146 insertions(+)=0D create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/=0D FirmwareManagement/BlackBoxTest/FirmwareManagementBBTestConformance.c=0D create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/=0D FirmwareManagement/BlackBoxTest/FirmwareManagementBBTestFunction.c=0D create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/=0D FirmwareManagement/BlackBoxTest/FirmwareManagementBBTestMain.c=0D create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/=0D FirmwareManagement/BlackBoxTest/FirmwareManagementBBTestMain.h=0D create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/=0D FirmwareManagement/BlackBoxTest/Guid.c=0D create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/=0D FirmwareManagement/BlackBoxTest/Guid.h=0D create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/=0D FirmwareManagement/BlackBoxTest/IhvFirmwareManagementBBTest.inf=0D =0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/FirmwareManagement/= BlackBoxTest/FirmwareManagementBBTestConformance.c b/uefi-sct/SctPkg/TestCa= se/UEFI/IHV/Protocol/FirmwareManagement/BlackBoxTest/FirmwareManagementBBTe= stConformance.c=0D new file mode 100644=0D index 00000000..c4bf5d7d=0D --- /dev/null=0D +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/FirmwareManagement/BlackBo= xTest/FirmwareManagementBBTestConformance.c=0D @@ -0,0 +1,3613 @@=0D +/** @file=0D +=0D + Copyright 2006 - 2016 Unified EFI, Inc.
=0D + Copyright (c) 2010 - 2016, Dell Inc. All rights reserved.
=0D + Copyright (c) 2019,Microchip Technology Inc.
=0D + This program and the accompanying materials=0D + are licensed and made available under the terms and conditions of the BS= D License=0D + which accompanies this distribution. The full text of the license may b= e found at=0D + http://opensource.org/licenses/bsd-license.php=0D +=0D + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=0D + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED.=0D +=0D +**/=0D +/*++=0D +=0D +Module Name:=0D + FirmwareManagementBBTestConformance.c=0D +=0D +Abstract:=0D + Firmware Management Protocol's conformance tests.=0D +=0D +--*/=0D +=0D +#define DEBUG_ALL 0=0D +#define DEBUG_GET_IMAGE_INFO 0=0D +#define DEBUG_GET_IMAGE 0=0D +#define DEBUG_SET_IMAGE 0=0D +#define DEBUG_CHECK_IMAGE 0=0D +#define DEBUG_SET_PACKAGE_INFO 0=0D +=0D +#include "SctLib.h"=0D +#include "FirmwareManagementBBTestMain.h"=0D +=0D +// ***********************************************************************= *****=0D +// Support Routines=0D +// ***********************************************************************= *****=0D +=0D +EFI_STATUS=0D +CheckForSupportGetImage (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +CheckForSupportSetImage (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +=0D +EFI_STATUS=0D +CheckForSupportCheckImage (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +CheckForSupportSetPackageInfo (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +// ***********************************************************************= *****=0D +// Check Points=0D +// ***********************************************************************= *****=0D +=0D +EFI_STATUS=0D +BBTestGetImageInfoConformanceTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +BBTestGetImageInfoConformanceTestCheckpoint2 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +BBTestGetImageConformanceTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +BBTestGetImageConformanceTestCheckpoint2 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +BBTestGetImageConformanceTestCheckpoint3 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +BBTestGetImageConformanceTestCheckpoint4 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +BBTestSetImageConformanceTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +BBTestSetImageConformanceTestCheckpoint2 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +BBTestSetImageConformanceTestCheckpoint3 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +BBTestSetImageConformanceTestCheckpoint4 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +BBTestCheckImageConformanceTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +BBTestCheckImageConformanceTestCheckpoint2 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +BBTestSetPackageInfoConformanceTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +BBTestSetPackageInfoConformanceTestCheckpoint2 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +BBTestSetPackageInfoConformanceTestCheckpoint3 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +BBTestSetPackageInfoConformanceTestCheckpoint4 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +// ***********************************************************************= *****=0D +// Support Routines=0D +//=0D +//=0D +// ***********************************************************************= *****=0D +=0D +// ***********************************************************************= *****=0D +// Support Routine: Progress=0D +// ***********************************************************************= *****=0D +=0D +EFI_STATUS=0D +Progress (=0D + IN UINTN Completion=0D +)=0D +{=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Support Routine: CheckForSupportGetImage=0D +// ***********************************************************************= *****=0D +=0D +EFI_STATUS=0D +CheckForSupportGetImage (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D +)=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D +=0D + UINT8 ImageIndex;=0D + VOID *Image;=0D + UINTN ImageSize;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceSupportGuid001;=0D + ResultMessageLabel =3D L"GetImage, function support check";=0D +=0D + ImageIndex =3D 0;=0D + Image =3D NULL;=0D + ImageSize =3D 0;=0D +=0D + //=0D + // Check if function is supported=0D + //=0D +=0D + Status =3D FirmwareManagement->GetImage (=0D + FirmwareManagement,=0D + ImageIndex,=0D + Image,=0D + &ImageSize=0D + );=0D +=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + if (Status =3D=3D EFI_UNSUPPORTED) {=0D + ResultMessageData =3D L"function is NOT supported";=0D + } else {=0D + ResultMessageData =3D L"function is supported.";=0D + }=0D +=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (Image !=3D NULL) {=0D + gtBS->FreePool (Image);=0D + }=0D +=0D + if (Status =3D=3D EFI_UNSUPPORTED) {=0D + return EFI_UNSUPPORTED;=0D + } else {=0D + return EFI_SUCCESS;=0D + }=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Support Routine: CheckForSupportSetImage=0D +// ***********************************************************************= *****=0D +=0D +EFI_STATUS=0D +CheckForSupportSetImage (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D +)=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D +=0D + UINT8 ImageIndex;=0D + VOID *Image;=0D + UINTN ImageSize;=0D + CHAR16 *AbortReason;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceSupportGuid002;=0D + ResultMessageLabel =3D L"SetImage, function support check";=0D +=0D + ImageIndex =3D 0;=0D + Image =3D NULL;=0D + ImageSize =3D 0;=0D + AbortReason =3D NULL;=0D +=0D + //=0D + // Check if function is supported=0D + //=0D +=0D + Status =3D FirmwareManagement->SetImage (=0D + FirmwareManagement,=0D + ImageIndex,=0D + Image,=0D + ImageSize,=0D + NULL, // VendorCode=0D + Progress,=0D + &AbortReason=0D + );=0D +=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + if (Status =3D=3D EFI_UNSUPPORTED) {=0D + ResultMessageData =3D L"function is NOT supported";=0D + } else {=0D + ResultMessageData =3D L"function is supported.";=0D + }=0D +=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (AbortReason !=3D NULL) {=0D + gtBS->FreePool (AbortReason);=0D + }=0D +=0D + if (Status =3D=3D EFI_UNSUPPORTED) {=0D + return EFI_UNSUPPORTED;=0D + } else {=0D + return EFI_SUCCESS;=0D + }=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Support Routine: CheckForSupportCheckImage=0D +// ***********************************************************************= *****=0D +=0D +EFI_STATUS=0D +CheckForSupportCheckImage (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D +)=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D +=0D + UINT8 ImageIndex;=0D + VOID *Image;=0D + UINTN ImageSize;=0D + UINT32 ImageUpdatable;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceSupportGuid003;=0D + ResultMessageLabel =3D L"CheckImage, function support check";=0D +=0D + ImageIndex =3D 0;=0D + Image =3D NULL;=0D + ImageSize =3D 0;=0D +=0D + //=0D + // Check if function is supported=0D + //=0D +=0D + Status =3D FirmwareManagement->CheckImage (=0D + FirmwareManagement,=0D + ImageIndex,=0D + Image,=0D + ImageSize,=0D + &ImageUpdatable=0D + );=0D +=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + if (Status =3D=3D EFI_UNSUPPORTED) {=0D + ResultMessageData =3D L"function is NOT supported";=0D + } else {=0D + ResultMessageData =3D L"function is supported.";=0D + }=0D +=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (Status =3D=3D EFI_UNSUPPORTED) {=0D + return EFI_UNSUPPORTED;=0D + } else {=0D + return EFI_SUCCESS;=0D + }=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Support Routine: CheckForSupportSetPackageInfo=0D +// ***********************************************************************= *****=0D +=0D +EFI_STATUS=0D +CheckForSupportSetPackageInfo (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D +)=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D +=0D + VOID *Image;=0D + UINTN ImageSize;=0D + VOID *VendorCode;=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceSupportGuid004;=0D + ResultMessageLabel =3D L"SetPackageInfo, function support check";=0D +=0D + Image =3D NULL;=0D + ImageSize =3D 0;=0D + VendorCode =3D NULL;=0D + PackageVersion =3D 0;=0D + PackageVersionName =3D NULL;=0D +=0D + //=0D + // Check if function is supported=0D + //=0D +=0D + Status =3D FirmwareManagement->SetPackageInfo (=0D + FirmwareManagement,=0D + Image,=0D + ImageSize,=0D + VendorCode,=0D + PackageVersion,=0D + PackageVersionName=0D + );=0D +=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + if (Status =3D=3D EFI_UNSUPPORTED) {=0D + ResultMessageData =3D L"function is NOT supported";=0D + } else {=0D + ResultMessageData =3D L"function is supported.";=0D + }=0D +=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (Status =3D=3D EFI_UNSUPPORTED) {=0D + return EFI_UNSUPPORTED;=0D + } else {=0D + return EFI_SUCCESS;=0D + }=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Test Case: GetImageInfo=0D +// ***********************************************************************= *****=0D +=0D +EFI_STATUS=0D +BBTestGetImageInfoConformanceTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + )=0D +{=0D + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;=0D + EFI_STATUS Status;=0D + EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + FirmwareManagement =3D (EFI_FIRMWARE_MANAGEMENT_PROTOCOL*)ClientInterfac= e;=0D +=0D + Status =3D gtBS->HandleProtocol (=0D + SupportHandle,=0D + &gEfiStandardTestLibraryGuid,=0D + (VOID **) &StandardLib=0D + );=0D + if (EFI_ERROR(Status)) {=0D + return Status;=0D + }=0D +=0D + //=0D + // Call check point(s)=0D + //=0D +=0D + BBTestGetImageInfoConformanceTestCheckpoint1 (StandardLib, FirmwareManag= ement);=0D + BBTestGetImageInfoConformanceTestCheckpoint2 (StandardLib, FirmwareManag= ement);=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Test Case: GetImage=0D +// ***********************************************************************= *****=0D +=0D +EFI_STATUS=0D +BBTestGetImageConformanceTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + )=0D +{=0D + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;=0D + EFI_STATUS Status;=0D + EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + FirmwareManagement =3D (EFI_FIRMWARE_MANAGEMENT_PROTOCOL*)ClientInterfac= e;=0D +=0D + Status =3D gtBS->HandleProtocol (=0D + SupportHandle,=0D + &gEfiStandardTestLibraryGuid,=0D + (VOID **) &StandardLib=0D + );=0D + if (EFI_ERROR(Status)) {=0D + return Status;=0D + }=0D +=0D + //=0D + // Check if function is supported=0D + //=0D +=0D + Status =3D CheckForSupportGetImage (StandardLib, FirmwareManagement);=0D + if (Status =3D=3D EFI_UNSUPPORTED) {=0D + return Status;=0D + }=0D +=0D + //=0D + // Call check point(s)=0D + //=0D +=0D + BBTestGetImageConformanceTestCheckpoint1 (StandardLib, FirmwareManagemen= t);=0D + BBTestGetImageConformanceTestCheckpoint2 (StandardLib, FirmwareManagemen= t);=0D + BBTestGetImageConformanceTestCheckpoint3 (StandardLib, FirmwareManagemen= t);=0D + BBTestGetImageConformanceTestCheckpoint4 (StandardLib, FirmwareManagemen= t);=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Test Case: SetImage=0D +// ***********************************************************************= *****=0D +=0D +EFI_STATUS=0D +BBTestSetImageConformanceTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + )=0D +{=0D + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;=0D + EFI_STATUS Status;=0D + EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + FirmwareManagement =3D (EFI_FIRMWARE_MANAGEMENT_PROTOCOL*)ClientInterfac= e;=0D +=0D + Status =3D gtBS->HandleProtocol (=0D + SupportHandle,=0D + &gEfiStandardTestLibraryGuid,=0D + (VOID **) &StandardLib=0D + );=0D + if (EFI_ERROR(Status)) {=0D + return Status;=0D + }=0D +=0D + //=0D + // Check if function is supported=0D + //=0D +=0D + Status =3D CheckForSupportSetImage (StandardLib, FirmwareManagement);=0D + if (Status =3D=3D EFI_UNSUPPORTED) {=0D + return Status;=0D + }=0D +=0D + //=0D + // Call check point(s)=0D + //=0D +=0D + BBTestSetImageConformanceTestCheckpoint1 (StandardLib, FirmwareManagemen= t);=0D + //BBTestSetImageConformanceTestCheckpoint2 (StandardLib, FirmwareManagem= ent);=0D + BBTestSetImageConformanceTestCheckpoint3 (StandardLib, FirmwareManagemen= t);=0D + BBTestSetImageConformanceTestCheckpoint4 (StandardLib, FirmwareManagemen= t);=0D +=0D + return Status;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Test Case: CheckImage=0D +// ***********************************************************************= *****=0D +=0D +EFI_STATUS=0D +BBTestCheckImageConformanceTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + )=0D +{=0D + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;=0D + EFI_STATUS Status;=0D + EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + FirmwareManagement =3D (EFI_FIRMWARE_MANAGEMENT_PROTOCOL*)ClientInterfac= e;=0D +=0D + Status =3D gtBS->HandleProtocol (=0D + SupportHandle,=0D + &gEfiStandardTestLibraryGuid,=0D + (VOID **) &StandardLib=0D + );=0D + if (EFI_ERROR(Status)) {=0D + return Status;=0D + }=0D +=0D + //=0D + // Check if function is supported=0D + //=0D +=0D + Status =3D CheckForSupportCheckImage (StandardLib, FirmwareManagement);= =0D + if (Status =3D=3D EFI_UNSUPPORTED) {=0D + return Status;=0D + }=0D +=0D + //=0D + // Call check point(s)=0D + //=0D +=0D + BBTestCheckImageConformanceTestCheckpoint1 (StandardLib, FirmwareManagem= ent);=0D + BBTestCheckImageConformanceTestCheckpoint2 (StandardLib, FirmwareManagem= ent);=0D +=0D + return Status;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Test Case: SetPackageInfo=0D +// ***********************************************************************= *****=0D +=0D +EFI_STATUS=0D +BBTestSetPackageInfoConformanceTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + )=0D +{=0D + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;=0D + EFI_STATUS Status;=0D + EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + FirmwareManagement =3D (EFI_FIRMWARE_MANAGEMENT_PROTOCOL*)ClientInterfac= e;=0D +=0D + Status =3D gtBS->HandleProtocol (=0D + SupportHandle,=0D + &gEfiStandardTestLibraryGuid,=0D + (VOID **) &StandardLib=0D + );=0D + if (EFI_ERROR(Status)) {=0D + return Status;=0D + }=0D +=0D + //=0D + // Check if function is supported=0D + //=0D +=0D + Status =3D CheckForSupportSetPackageInfo (StandardLib, FirmwareManagemen= t);=0D + if (Status =3D=3D EFI_UNSUPPORTED) {=0D + return Status;=0D + }=0D +=0D + //=0D + // Call check point(s)=0D + //=0D +=0D + BBTestSetPackageInfoConformanceTestCheckpoint1 (StandardLib, FirmwareMan= agement);=0D + BBTestSetPackageInfoConformanceTestCheckpoint2 (StandardLib, FirmwareMan= agement);=0D + BBTestSetPackageInfoConformanceTestCheckpoint3 (StandardLib, FirmwareMan= agement);=0D + BBTestSetPackageInfoConformanceTestCheckpoint4 (StandardLib, FirmwareMan= agement);=0D +=0D + return Status;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Check Points=0D +//=0D +//=0D +// ***********************************************************************= *****=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: GetImageInfo, 1=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - Calls function with valid parameters, except ImageInfoSize =3D 1.=0D + The function should return EFI_BUFFER_TOO_SMALL and ImageInfoSize > = 1.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestGetImageInfoConformanceTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D +=0D + UINTN ImageInfoSize;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo;=0D + UINT32 DescriptorVersion;=0D + UINT8 DescriptorCount;=0D + UINTN DescriptorSize;=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceAssertionGuid001;=0D + ResultMessageLabel =3D L"GetImageInfo, conformance checkpoint #1";=0D + ResultMessageData =3D L"correctly returned EFI_BUFFER_TOO_SMALL.";=0D +=0D + ImageInfo =3D NULL;=0D + PackageVersionName =3D NULL;=0D +=0D + ImageInfoSize =3D (sizeof (EFI_FIRMWARE_IMAGE_DESCRIPTOR)) * 20;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + ImageInfoSize =3D 1;=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D +=0D + if (Status !=3D EFI_BUFFER_TOO_SMALL) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_BUFFER_TOO_SMALL.";=0D + goto Exit;=0D + }=0D + if (ImageInfoSize <=3D 1) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to update *ImageInfoSize.";=0D + }=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D + if (ImageInfo !=3D NULL) {=0D + gtBS->FreePool (ImageInfo);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: GetImageInfo, 2=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - Calls function with valid parameters, except &ImageInfoSize =3D NULL= .=0D + The function should return EFI_INVALID_PARAMETER.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestGetImageInfoConformanceTestCheckpoint2 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D +=0D + UINTN ImageInfoSize;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo;=0D + UINT32 DescriptorVersion;=0D + UINT8 DescriptorCount;=0D + UINTN DescriptorSize;=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceAssertionGuid002;=0D + ResultMessageLabel =3D L"GetImageInfo, conformance checkpoint #2";=0D + ResultMessageData =3D L"correctly returned EFI_INVALID_PARAMETER.";=0D +=0D + ImageInfo =3D NULL;=0D + PackageVersionName =3D NULL;=0D +=0D + ImageInfoSize =3D (sizeof (EFI_FIRMWARE_IMAGE_DESCRIPTOR)) * 20;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + NULL, // &ImageInfoSize=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D +=0D + if (Status !=3D EFI_INVALID_PARAMETER) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_INVALID_PARAMETER.";=0D + }=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D + if (ImageInfo !=3D NULL) {=0D + gtBS->FreePool (ImageInfo);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: GetImage, 1=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - Calls function with valid parameters, except ImageSize =3D 1.=0D + The function should return EFI_BUFFER_TOO_SMALL and ImageSize > 1.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestGetImageConformanceTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *BufferImageInfo;=0D + VOID *BufferImage;=0D +=0D + UINTN ImageInfoSize;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo;=0D + UINT32 DescriptorVersion;=0D + UINT8 DescriptorCount;=0D + UINTN DescriptorSize;=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D +=0D + VOID *Image;=0D + UINTN ImageSize;=0D +=0D + UINTN i;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *p;=0D + UINTN FunctionTested;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceAssertionGuid003;=0D + ResultMessageLabel =3D L"GetImage, conformance checkpoint #1";=0D +=0D + BufferImageInfo =3D NULL;=0D + BufferImage =3D NULL;=0D + ImageInfo =3D NULL;=0D + Image =3D NULL;=0D + PackageVersionName =3D NULL;=0D + FunctionTested =3D 0;=0D +=0D + // Use a sufficiently large buffer to obtain EFI_SUCCESS,=0D + // since some implementation does NOT correctly return EFI_BUFFER_TOO_SM= ALL.=0D + // Check for EFI_BUFFER_TOO_SMALL in another conformance test.=0D +=0D + ImageInfoSize =3D (sizeof (EFI_FIRMWARE_IMAGE_DESCRIPTOR)) * 20;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D +=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) {=0D + gtBS->FreePool (ImageInfo);=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status !=3D EFI_SUCCESS) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + BufferImageInfo =3D ImageInfo;=0D + goto Exit;=0D + }=0D + }=0D + BufferImageInfo =3D ImageInfo;=0D +=0D + if (DescriptorSize =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"*DescriptorSize is 0.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D + if ((DescriptorCount * DescriptorSize) > ImageInfoSize) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"((*DescriptorCount) * (*DescriptorSize)) > *Im= ageInfoSize.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + for (i =3D 0; i < DescriptorCount; i++) {=0D + p =3D (EFI_FIRMWARE_IMAGE_DESCRIPTOR *) (((UINT8 *) ImageInfo) + (i * = DescriptorSize));=0D +=0D + if (((p->AttributesSupported & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED= ) =3D=3D=0D + IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) &&=0D + ((p->AttributesSetting & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) = =3D=3D=0D + IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED)) {=0D + continue;=0D + }=0D + if (p->Size =3D=3D 0) {=0D + continue;=0D + }=0D + if ((p->AttributesSupported & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) !=3D IM= AGE_ATTRIBUTE_IMAGE_UPDATABLE) {=0D + continue;=0D + }=0D + if ((p->AttributesSetting & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) !=3D IMAG= E_ATTRIBUTE_IMAGE_UPDATABLE) {=0D + continue;=0D + }=0D +=0D + ImageSize =3D p->Size;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageSize,=0D + (VOID **) &Image=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + BufferImage =3D Image;=0D +=0D + ImageSize =3D 1;=0D + FunctionTested++;=0D + Status =3D FirmwareManagement->GetImage (=0D + FirmwareManagement,=0D + p->ImageIndex,=0D + Image,=0D + &ImageSize=0D + );=0D + gtBS->FreePool (BufferImage);=0D + BufferImage =3D NULL;=0D + Image =3D NULL;=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D + if (Status !=3D EFI_BUFFER_TOO_SMALL) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_BUFFER_TOO_SMALL.";=0D + goto Exit;=0D + }=0D + if (ImageInfoSize <=3D 1) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to update *ImageSize.";=0D + goto Exit;=0D + }=0D + }=0D +=0D + if (FunctionTested =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"test skipped - test case does not apply.";=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"correctly returned EFI_BUFFER_TOO_SMALL.";=0D + }=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D + if (BufferImageInfo !=3D NULL) {=0D + gtBS->FreePool (BufferImageInfo);=0D + }=0D + if (BufferImage !=3D NULL) {=0D + gtBS->FreePool (BufferImage);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: GetImage, 2=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - Calls function with valid parameters, except Image =3D NULL.=0D + The function should return EFI_INVALID_PARAMETER.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestGetImageConformanceTestCheckpoint2 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *BufferImageInfo;=0D +=0D + UINTN ImageInfoSize;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo;=0D + UINT32 DescriptorVersion;=0D + UINT8 DescriptorCount;=0D + UINTN DescriptorSize;=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D +=0D + VOID *Image;=0D + UINTN ImageSize;=0D +=0D + UINTN i;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *p;=0D + UINTN FunctionTested;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceAssertionGuid004;=0D + ResultMessageLabel =3D L"GetImage, conformance checkpoint #2";=0D +=0D + BufferImageInfo =3D NULL;=0D + ImageInfo =3D NULL;=0D + Image =3D NULL;=0D + PackageVersionName =3D NULL;=0D + FunctionTested =3D 0;=0D +=0D + // Use a sufficiently large buffer to obtain EFI_SUCCESS,=0D + // since some implementation does NOT correctly return EFI_BUFFER_TOO_SM= ALL.=0D + // Check for EFI_BUFFER_TOO_SMALL in another conformance test.=0D +=0D + ImageInfoSize =3D (sizeof (EFI_FIRMWARE_IMAGE_DESCRIPTOR)) * 20;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D +=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) {=0D + gtBS->FreePool (ImageInfo);=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status !=3D EFI_SUCCESS) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + BufferImageInfo =3D ImageInfo;=0D + goto Exit;=0D + }=0D + }=0D + BufferImageInfo =3D ImageInfo;=0D +=0D + if (DescriptorSize =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"*DescriptorSize is 0.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D + if ((DescriptorCount * DescriptorSize) > ImageInfoSize) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"((*DescriptorCount) * (*DescriptorSize)) > *Im= ageInfoSize.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + for (i =3D 0; i < DescriptorCount; i++) {=0D + p =3D (EFI_FIRMWARE_IMAGE_DESCRIPTOR *) (((UINT8 *) ImageInfo) + (i * = DescriptorSize));=0D +=0D + if (((p->AttributesSupported & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED= ) =3D=3D=0D + IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) &&=0D + ((p->AttributesSetting & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) = =3D=3D=0D + IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED)) {=0D + continue;=0D + }=0D + if (p->Size =3D=3D 0) {=0D + continue;=0D + }=0D + if ((p->AttributesSupported & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) !=3D IM= AGE_ATTRIBUTE_IMAGE_UPDATABLE) {=0D + continue;=0D + }=0D + if ((p->AttributesSetting & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) !=3D IMAG= E_ATTRIBUTE_IMAGE_UPDATABLE) {=0D + continue;=0D + }=0D +=0D + // Use a sufficiently large buffer size to avoid EFI_BUFFER_TOO_SMALL.= =0D + ImageSize =3D p->Size * 2;=0D + Image =3D NULL;=0D + FunctionTested++;=0D + Status =3D FirmwareManagement->GetImage (=0D + FirmwareManagement,=0D + p->ImageIndex,=0D + Image,=0D + &ImageSize=0D + );=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D + if (Status !=3D EFI_INVALID_PARAMETER) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_INVALID_PARAMETER.";=0D + goto Exit;=0D + }=0D + }=0D +=0D + if (FunctionTested =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"test skipped - test case does not apply.";=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"correctly returned EFI_INVALID_PARAMETER.";=0D + }=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D + if (BufferImageInfo !=3D NULL) {=0D + gtBS->FreePool (BufferImageInfo);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: GetImage, 3=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - Calls function with valid parameters, except ImageIndex =3D 0 or=0D + ImageIndex =3D DescriptorCount + 1.=0D + The function should return EFI_INVALID_PARAMETER or EFI_NOT_FOUND.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestGetImageConformanceTestCheckpoint3 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *BufferImageInfo;=0D + VOID *BufferImage;=0D +=0D + UINTN ImageInfoSize;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo;=0D + UINT32 DescriptorVersion;=0D + UINT8 DescriptorCount;=0D + UINTN DescriptorSize;=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D +=0D + VOID *Image;=0D + UINTN ImageSize;=0D + UINT8 ImageIndex;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceAssertionGuid005;=0D + ResultMessageLabel =3D L"GetImage, conformance checkpoint #3";=0D +=0D + BufferImageInfo =3D NULL;=0D + BufferImage =3D NULL;=0D + ImageInfo =3D NULL;=0D + Image =3D NULL;=0D + PackageVersionName =3D NULL;=0D +=0D + // Use a sufficiently large buffer to obtain EFI_SUCCESS,=0D + // since some implementation does NOT correctly return EFI_BUFFER_TOO_SM= ALL.=0D + // Check for EFI_BUFFER_TOO_SMALL in another conformance test.=0D +=0D + ImageInfoSize =3D (sizeof (EFI_FIRMWARE_IMAGE_DESCRIPTOR)) * 20;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D +=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) {=0D + gtBS->FreePool (ImageInfo);=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status !=3D EFI_SUCCESS) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + BufferImageInfo =3D ImageInfo;=0D + goto Exit;=0D + }=0D + }=0D + BufferImageInfo =3D ImageInfo;=0D +=0D + if (DescriptorSize =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"*DescriptorSize is 0.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D + if ((DescriptorCount * DescriptorSize) > ImageInfoSize) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"((*DescriptorCount) * (*DescriptorSize)) > *Im= ageInfoSize.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + // Dummy image so as to fail on Image =3D NULL=0D + // Any size since the function should check for index before size=0D + ImageSize =3D 64;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageSize,=0D + (VOID **) &Image=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + BufferImage =3D Image;=0D +=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_INVALID_PARAMETER or EFI_NO= T_FOUND.";=0D +=0D + ImageIndex =3D 0;=0D + Status =3D FirmwareManagement->GetImage (=0D + FirmwareManagement,=0D + ImageIndex,=0D + Image,=0D + &ImageSize=0D + );=0D + if ((Status !=3D EFI_INVALID_PARAMETER) && (Status !=3D EFI_NOT_FOUND)) = {=0D + goto Exit;=0D + }=0D +=0D + if ((DescriptorCount + 1) !=3D 0) {=0D + ImageIndex =3D DescriptorCount + 1;=0D + Status =3D FirmwareManagement->GetImage (=0D + FirmwareManagement,=0D + ImageIndex,=0D + Image,=0D + &ImageSize=0D + );=0D + if ((Status !=3D EFI_INVALID_PARAMETER) && (Status !=3D EFI_NOT_FOUND)= ) {=0D + goto Exit;=0D + }=0D + }=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"correctly returned EFI_INVALID_PARAMETER or EFI_= NOT_FOUND.";=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D + if (BufferImageInfo !=3D NULL) {=0D + gtBS->FreePool (BufferImageInfo);=0D + }=0D + if (BufferImage !=3D NULL) {=0D + gtBS->FreePool (BufferImage);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: GetImage, 4=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - The function requires authentication.=0D + - Calls function with valid parameters, except Image has dummy=0D + authentication data.=0D + The function should return EFI_SECURITY_VIOLATION.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestGetImageConformanceTestCheckpoint4 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *BufferImageInfo;=0D + VOID *BufferImage;=0D +=0D + UINTN ImageInfoSize;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo;=0D + UINT32 DescriptorVersion;=0D + UINT8 DescriptorCount;=0D + UINTN DescriptorSize;=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D +=0D + VOID *Image;=0D + UINTN ImageSize;=0D +=0D + UINTN i;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *p;=0D + UINTN FunctionTested;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceAssertionGuid006;=0D + ResultMessageLabel =3D L"GetImage, conformance checkpoint #4";=0D +=0D + BufferImageInfo =3D NULL;=0D + BufferImage =3D NULL;=0D + ImageInfo =3D NULL;=0D + Image =3D NULL;=0D + PackageVersionName =3D NULL;=0D + FunctionTested =3D 0;=0D +=0D + // Use a sufficiently large buffer to obtain EFI_SUCCESS,=0D + // since some implementation does NOT correctly return EFI_BUFFER_TOO_SM= ALL.=0D + // Check for EFI_BUFFER_TOO_SMALL in another conformance test.=0D +=0D + ImageInfoSize =3D (sizeof (EFI_FIRMWARE_IMAGE_DESCRIPTOR)) * 20;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D +=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) {=0D + gtBS->FreePool (ImageInfo);=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status !=3D EFI_SUCCESS) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + BufferImageInfo =3D ImageInfo;=0D + goto Exit;=0D + }=0D + }=0D + BufferImageInfo =3D ImageInfo;=0D +=0D + if (DescriptorSize =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"*DescriptorSize is 0.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D + if ((DescriptorCount * DescriptorSize) > ImageInfoSize) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"((*DescriptorCount) * (*DescriptorSize)) > *Im= ageInfoSize.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + for (i =3D 0; i < DescriptorCount; i++) {=0D + p =3D (EFI_FIRMWARE_IMAGE_DESCRIPTOR *) (((UINT8 *) ImageInfo) + (i * = DescriptorSize));=0D +=0D + if ((p->AttributesSupported & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED)= !=3D IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) {=0D + continue;=0D + }=0D + if ((p->AttributesSetting & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) != =3D IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) {=0D + continue;=0D + }=0D + if (p->Size =3D=3D 0) {=0D + continue;=0D + }=0D + if ((p->AttributesSupported & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) !=3D IM= AGE_ATTRIBUTE_IMAGE_UPDATABLE) {=0D + continue;=0D + }=0D + if ((p->AttributesSetting & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) !=3D IMAG= E_ATTRIBUTE_IMAGE_UPDATABLE) {=0D + continue;=0D + }=0D +=0D + // Use a sufficiently large buffer size to avoid EFI_BUFFER_TOO_SMALL.= =0D + ImageSize =3D p->Size * 2;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageSize,=0D + (VOID **) &Image=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + BufferImage =3D Image;=0D +=0D + FunctionTested++;=0D +=0D + Status =3D FirmwareManagement->GetImage (=0D + FirmwareManagement,=0D + p->ImageIndex,=0D + Image,=0D + &ImageSize=0D + );=0D + gtBS->FreePool (BufferImage);=0D + BufferImage =3D NULL;=0D + Image =3D NULL;=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D + if (Status !=3D EFI_SECURITY_VIOLATION) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_SECURITY_VIOLATION.";=0D + goto Exit;=0D + }=0D + }=0D +=0D + if (FunctionTested =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"test skipped - test case does not apply.";=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"correctly returned EFI_SECURITY_VIOLATION";=0D + }=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D + if (BufferImageInfo !=3D NULL) {=0D + gtBS->FreePool (BufferImageInfo);=0D + }=0D + if (BufferImage !=3D NULL) {=0D + gtBS->FreePool (BufferImage);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: SetImage, 1=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - Calls function with valid parameters, except Image =3D NULL.=0D + The function should return EFI_INVALID_PARAMETER.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestSetImageConformanceTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *BufferImageInfo;=0D +=0D + UINTN ImageInfoSize;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo;=0D + UINT32 DescriptorVersion;=0D + UINT8 DescriptorCount;=0D + UINTN DescriptorSize;=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D +=0D + CHAR16 *AbortReason;=0D +=0D + VOID *Image;=0D + UINTN ImageSize;=0D +=0D + UINTN i;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *p;=0D + UINTN FunctionTested;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceAssertionGuid007;=0D + ResultMessageLabel =3D L"SetImage, conformance checkpoint #1";=0D +=0D + BufferImageInfo =3D NULL;=0D + ImageInfo =3D NULL;=0D + Image =3D NULL;=0D + PackageVersionName =3D NULL;=0D + AbortReason =3D NULL;=0D + FunctionTested =3D 0;=0D +=0D + // Use a sufficiently large buffer to obtain EFI_SUCCESS,=0D + // since some implementation does NOT correctly return EFI_BUFFER_TOO_SM= ALL.=0D + // Check for EFI_BUFFER_TOO_SMALL in another conformance test.=0D +=0D + ImageInfoSize =3D (sizeof (EFI_FIRMWARE_IMAGE_DESCRIPTOR)) * 20;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D +=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) {=0D + gtBS->FreePool (ImageInfo);=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status !=3D EFI_SUCCESS) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + BufferImageInfo =3D ImageInfo;=0D + goto Exit;=0D + }=0D + }=0D + BufferImageInfo =3D ImageInfo;=0D +=0D + if (DescriptorSize =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"*DescriptorSize is 0.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D + if ((DescriptorCount * DescriptorSize) > ImageInfoSize) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"((*DescriptorCount) * (*DescriptorSize)) > *Im= ageInfoSize.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + for (i =3D 0; i < DescriptorCount; i++) {=0D + p =3D (EFI_FIRMWARE_IMAGE_DESCRIPTOR *) (((UINT8 *) ImageInfo) + (i * = DescriptorSize));=0D +=0D + if (((p->AttributesSupported & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED= ) =3D=3D=0D + IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) &&=0D + ((p->AttributesSetting & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) = =3D=3D=0D + IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED)) {=0D + continue;=0D + }=0D + if (p->Size =3D=3D 0) {=0D + continue;=0D + }=0D + if ((p->AttributesSupported & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) !=3D IM= AGE_ATTRIBUTE_IMAGE_UPDATABLE) {=0D + continue;=0D + }=0D + if ((p->AttributesSetting & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) !=3D IMAG= E_ATTRIBUTE_IMAGE_UPDATABLE) {=0D + continue;=0D + }=0D +=0D + ImageSize =3D p->Size;=0D + Image =3D NULL;=0D + FunctionTested++;=0D + Status =3D FirmwareManagement->SetImage (=0D + FirmwareManagement,=0D + p->ImageIndex,=0D + Image,=0D + ImageSize,=0D + NULL, // VendorCode=0D + Progress,=0D + &AbortReason=0D + );=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D + if (Status !=3D EFI_INVALID_PARAMETER) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_INVALID_PARAMETER.";=0D + goto Exit;=0D + }=0D + }=0D +=0D + if (FunctionTested =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"test skipped - test case does not apply.";=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"correctly returned EFI_INVALID_PARAMETER.";=0D + }=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D + if (BufferImageInfo !=3D NULL) {=0D + gtBS->FreePool (BufferImageInfo);=0D + }=0D + if (AbortReason !=3D NULL) {=0D + gtBS->FreePool (AbortReason);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: SetImage, 2=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - Calls function with valid parameters, except Image is a dummy image.= =0D + The function should return EFI_INVALID_PARAMETER or EFI_ABORTED.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestSetImageConformanceTestCheckpoint2 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *BufferImageInfo;=0D + VOID *BufferImage;=0D +=0D + UINTN ImageInfoSize;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo;=0D + UINT32 DescriptorVersion;=0D + UINT8 DescriptorCount;=0D + UINTN DescriptorSize;=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D +=0D + CHAR16 *AbortReason;=0D +=0D + VOID *Image;=0D + UINTN ImageSize;=0D +=0D + UINTN i;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *p;=0D + UINTN FunctionTested;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceAssertionGuid008;=0D + ResultMessageLabel =3D L"SetImage, conformance checkpoint #2";=0D +=0D + BufferImageInfo =3D NULL;=0D + BufferImage =3D NULL;=0D + ImageInfo =3D NULL;=0D + Image =3D NULL;=0D + PackageVersionName =3D NULL;=0D + AbortReason =3D NULL;=0D + FunctionTested =3D 0;=0D +=0D + // Use a sufficiently large buffer to obtain EFI_SUCCESS,=0D + // since some implementation does NOT correctly return EFI_BUFFER_TOO_SM= ALL.=0D + // Check for EFI_BUFFER_TOO_SMALL in another conformance test.=0D +=0D + ImageInfoSize =3D (sizeof (EFI_FIRMWARE_IMAGE_DESCRIPTOR)) * 20;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D +=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) {=0D + gtBS->FreePool (ImageInfo);=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status !=3D EFI_SUCCESS) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + BufferImageInfo =3D ImageInfo;=0D + goto Exit;=0D + }=0D + }=0D + BufferImageInfo =3D ImageInfo;=0D +=0D + if (DescriptorSize =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"*DescriptorSize is 0.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D + if ((DescriptorCount * DescriptorSize) > ImageInfoSize) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"((*DescriptorCount) * (*DescriptorSize)) > *Im= ageInfoSize.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + for (i =3D 0; i < DescriptorCount; i++) {=0D + p =3D (EFI_FIRMWARE_IMAGE_DESCRIPTOR *) (((UINT8 *) ImageInfo) + (i * = DescriptorSize));=0D +=0D + if (((p->AttributesSupported & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED= ) =3D=3D=0D + IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) &&=0D + ((p->AttributesSetting & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) = =3D=3D=0D + IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED)) {=0D + continue;=0D + }=0D + if (p->Size =3D=3D 0) {=0D + continue;=0D + }=0D + if ((p->AttributesSupported & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) !=3D IM= AGE_ATTRIBUTE_IMAGE_UPDATABLE) {=0D + continue;=0D + }=0D + if ((p->AttributesSetting & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) !=3D IMAG= E_ATTRIBUTE_IMAGE_UPDATABLE) {=0D + continue;=0D + }=0D +=0D + ImageSize =3D p->Size;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageSize,=0D + (VOID **) &Image=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + BufferImage =3D Image;=0D + FunctionTested++;=0D + Status =3D FirmwareManagement->SetImage (=0D + FirmwareManagement,=0D + p->ImageIndex,=0D + Image,=0D + ImageSize,=0D + NULL, // VendorCode=0D + Progress,=0D + &AbortReason=0D + );=0D + gtBS->FreePool (BufferImage);=0D + BufferImage =3D NULL;=0D + Image =3D NULL;=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D + if ((Status !=3D EFI_INVALID_PARAMETER) && (Status !=3D EFI_ABORTED)) = {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_INVALID_PARAMETER or EF= I_ABORTED.";=0D + goto Exit;=0D + }=0D + }=0D +=0D + if (FunctionTested =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"test skipped - test case does not apply.";=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"correctly returned EFI_INVALID_PARAMETER or EF= I_ABORTED.";=0D + }=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D + if (BufferImageInfo !=3D NULL) {=0D + gtBS->FreePool (BufferImageInfo);=0D + }=0D + if (BufferImage !=3D NULL) {=0D + gtBS->FreePool (BufferImage);=0D + }=0D + if (AbortReason !=3D NULL) {=0D + gtBS->FreePool (AbortReason);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: SetImage, 3=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - Calls function with valid parameters, except ImageIndex =3D 0 or=0D + ImageIndex =3D DescriptorCount + 1.=0D + The function should return EFI_INVALID_PARAMETER or EFI_ABORTED.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestSetImageConformanceTestCheckpoint3 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *BufferImageInfo;=0D + VOID *BufferImage;=0D +=0D + UINTN ImageInfoSize;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo;=0D + UINT32 DescriptorVersion;=0D + UINT8 DescriptorCount;=0D + UINTN DescriptorSize;=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D +=0D + CHAR16 *AbortReason;=0D +=0D + VOID *Image;=0D + UINTN ImageSize;=0D + UINT8 ImageIndex;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceAssertionGuid009;=0D + ResultMessageLabel =3D L"SetImage, conformance checkpoint #3";=0D +=0D + BufferImageInfo =3D NULL;=0D + BufferImage=3DNULL;=0D + ImageInfo =3D NULL;=0D + Image =3D NULL;=0D + PackageVersionName =3D NULL;=0D + AbortReason =3D NULL;=0D +=0D + // Use a sufficiently large buffer to obtain EFI_SUCCESS,=0D + // since some implementation does NOT correctly return EFI_BUFFER_TOO_SM= ALL.=0D + // Check for EFI_BUFFER_TOO_SMALL in another conformance test.=0D +=0D + ImageInfoSize =3D (sizeof (EFI_FIRMWARE_IMAGE_DESCRIPTOR)) * 20;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D +=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) {=0D + gtBS->FreePool (ImageInfo);=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status !=3D EFI_SUCCESS) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + BufferImageInfo =3D ImageInfo;=0D + goto Exit;=0D + }=0D + }=0D + BufferImageInfo =3D ImageInfo;=0D +=0D + if (DescriptorSize =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"*DescriptorSize is 0.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D + if ((DescriptorCount * DescriptorSize) > ImageInfoSize) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"((*DescriptorCount) * (*DescriptorSize)) > *Im= ageInfoSize.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + // Dummy image so as to fail on Image =3D NULL=0D + // Any size since the function should check for index before size=0D + ImageSize =3D 64;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageSize,=0D + (VOID **) &Image=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + BufferImage =3D Image;=0D +=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_INVALID_PARAMETER or EFI_AB= ORTED.";=0D +=0D + ImageIndex =3D 0;=0D + Status =3D FirmwareManagement->SetImage (=0D + FirmwareManagement,=0D + ImageIndex,=0D + Image,=0D + ImageSize,=0D + NULL, // VendorCode=0D + Progress,=0D + &AbortReason=0D + );=0D + if ((Status !=3D EFI_INVALID_PARAMETER) && (Status !=3D EFI_ABORTED)) {= =0D + goto Exit;=0D + }=0D +=0D + if ((DescriptorCount + 1) !=3D 0) {=0D + ImageIndex =3D DescriptorCount + 1;=0D + Status =3D FirmwareManagement->SetImage (=0D + FirmwareManagement,=0D + ImageIndex,=0D + Image,=0D + ImageSize,=0D + NULL, // Vendorcode=0D + Progress,=0D + &AbortReason=0D + );=0D + if ((Status !=3D EFI_INVALID_PARAMETER) && (Status !=3D EFI_ABORTED)) = {=0D + goto Exit;=0D + }=0D + }=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"correctly returned EFI_INVALID_PARAMETER or EFI_= ABORTED.";=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D + if (BufferImageInfo !=3D NULL) {=0D + gtBS->FreePool (BufferImageInfo);=0D + }=0D + if (BufferImage !=3D NULL) {=0D + gtBS->FreePool (BufferImage);=0D + }=0D + if (AbortReason !=3D NULL) {=0D + gtBS->FreePool (AbortReason);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: SetImage, 4=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - The function requires authentication.=0D + - Calls function with valid parameters, except Image has dummy=0D + authentication data.=0D + The function should return EFI_SECURITY_VIOLATION.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestSetImageConformanceTestCheckpoint4 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *BufferImageInfo;=0D + VOID *BufferImage;=0D +=0D + UINTN ImageInfoSize;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo;=0D + UINT32 DescriptorVersion;=0D + UINT8 DescriptorCount;=0D + UINTN DescriptorSize;=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D +=0D + CHAR16 *AbortReason;=0D +=0D + VOID *Image;=0D + UINTN ImageSize;=0D +=0D + UINTN i;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *p;=0D + UINTN FunctionTested;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceAssertionGuid010;=0D + ResultMessageLabel =3D L"SetImage, conformance checkpoint #4";=0D +=0D + BufferImageInfo =3D NULL;=0D + BufferImage =3D NULL;=0D + ImageInfo =3D NULL;=0D + Image =3D NULL;=0D + PackageVersionName =3D NULL;=0D + AbortReason =3D NULL;=0D + FunctionTested =3D 0;=0D +=0D + // Use a sufficiently large buffer to obtain EFI_SUCCESS,=0D + // since some implementation does NOT correctly return EFI_BUFFER_TOO_SM= ALL.=0D + // Check for EFI_BUFFER_TOO_SMALL in another conformance test.=0D +=0D + ImageInfoSize =3D (sizeof (EFI_FIRMWARE_IMAGE_DESCRIPTOR)) * 20;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D +=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) {=0D + gtBS->FreePool (ImageInfo);=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status !=3D EFI_SUCCESS) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + BufferImageInfo =3D ImageInfo;=0D + goto Exit;=0D + }=0D + }=0D + BufferImageInfo =3D ImageInfo;=0D +=0D + if (DescriptorSize =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"*DescriptorSize is 0.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D + if ((DescriptorCount * DescriptorSize) > ImageInfoSize) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"((*DescriptorCount) * (*DescriptorSize)) > *Im= ageInfoSize.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + for (i =3D 0; i < DescriptorCount; i++) {=0D + p =3D (EFI_FIRMWARE_IMAGE_DESCRIPTOR *) (((UINT8 *) ImageInfo) + (i * = DescriptorSize));=0D +=0D + if ((p->AttributesSupported & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED)= !=3D IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) {=0D + continue;=0D + }=0D + if ((p->AttributesSetting & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) != =3D IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) {=0D + continue;=0D + }=0D + if (p->Size =3D=3D 0) {=0D + continue;=0D + }=0D + if ((p->AttributesSupported & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) !=3D IM= AGE_ATTRIBUTE_IMAGE_UPDATABLE) {=0D + continue;=0D + }=0D + if ((p->AttributesSetting & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) !=3D IMAG= E_ATTRIBUTE_IMAGE_UPDATABLE) {=0D + continue;=0D + }=0D +=0D + ImageSize =3D p->Size;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageSize,=0D + (VOID **) &Image=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + BufferImage =3D Image;=0D + FunctionTested++;=0D + Status =3D FirmwareManagement->SetImage (=0D + FirmwareManagement,=0D + p->ImageIndex,=0D + Image,=0D + ImageSize,=0D + NULL, // VendorCode=0D + Progress,=0D + &AbortReason=0D + );=0D + gtBS->FreePool (BufferImage);=0D + BufferImage =3D NULL;=0D + Image =3D NULL;=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D + if (Status !=3D EFI_SECURITY_VIOLATION) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_SECURITY_VIOLATION.";=0D + goto Exit;=0D + }=0D + }=0D +=0D + if (FunctionTested =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"test skipped - test case does not apply.";=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"correctly returned EFI_SECURITY_VIOLATION";=0D + }=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D + if (BufferImageInfo !=3D NULL) {=0D + gtBS->FreePool (BufferImageInfo);=0D + }=0D + if (BufferImage !=3D NULL) {=0D + gtBS->FreePool (BufferImage);=0D + }=0D + if (AbortReason !=3D NULL) {=0D + gtBS->FreePool (AbortReason);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: CheckImage, 1=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - Calls function with valid parameters, except Image =3D NULL.=0D + The function should return EFI_INVALID_PARAMETER.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestCheckImageConformanceTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *BufferImageInfo;=0D +=0D + UINTN ImageInfoSize;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo;=0D + UINT32 DescriptorVersion;=0D + UINT8 DescriptorCount;=0D + UINTN DescriptorSize;=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D +=0D + UINT32 ImageUpdatable;=0D +=0D + VOID *Image;=0D + UINTN ImageSize;=0D +=0D + UINTN i;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *p;=0D + UINTN FunctionTested;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceAssertionGuid011;=0D + ResultMessageLabel =3D L"CheckImage, conformance checkpoint #1";=0D +=0D + BufferImageInfo =3D NULL;=0D + ImageInfo =3D NULL;=0D + Image =3D NULL;=0D + PackageVersionName =3D NULL;=0D + FunctionTested =3D 0;=0D +=0D + // Use a sufficiently large buffer to obtain EFI_SUCCESS,=0D + // since some implementation does NOT correctly return EFI_BUFFER_TOO_SM= ALL.=0D + // Check for EFI_BUFFER_TOO_SMALL in another conformance test.=0D +=0D + ImageInfoSize =3D (sizeof (EFI_FIRMWARE_IMAGE_DESCRIPTOR)) * 20;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D +=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) {=0D + gtBS->FreePool (ImageInfo);=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status !=3D EFI_SUCCESS) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + BufferImageInfo =3D ImageInfo;=0D + goto Exit;=0D + }=0D + }=0D + BufferImageInfo =3D ImageInfo;=0D +=0D + if (DescriptorSize =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"*DescriptorSize is 0.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D + if ((DescriptorCount * DescriptorSize) > ImageInfoSize) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"((*DescriptorCount) * (*DescriptorSize)) > *Im= ageInfoSize.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + for (i =3D 0; i < DescriptorCount; i++) {=0D + p =3D (EFI_FIRMWARE_IMAGE_DESCRIPTOR *) (((UINT8 *) ImageInfo) + (i * = DescriptorSize));=0D +=0D + if (((p->AttributesSupported & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED= ) =3D=3D=0D + IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) &&=0D + ((p->AttributesSetting & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) = =3D=3D=0D + IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED)) {=0D + continue;=0D + }=0D + if (p->Size =3D=3D 0) {=0D + continue;=0D + }=0D + if ((p->AttributesSupported & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) !=3D IM= AGE_ATTRIBUTE_IMAGE_UPDATABLE) {=0D + continue;=0D + }=0D + if ((p->AttributesSetting & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) !=3D IMAG= E_ATTRIBUTE_IMAGE_UPDATABLE) {=0D + continue;=0D + }=0D +=0D + ImageSize =3D p->Size;=0D + Image =3D NULL;=0D + FunctionTested++;=0D + Status =3D FirmwareManagement->CheckImage (=0D + FirmwareManagement,=0D + p->ImageIndex,=0D + Image,=0D + ImageSize,=0D + &ImageUpdatable=0D + );=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D + if (Status !=3D EFI_INVALID_PARAMETER) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_INVALID_PARAMETER.";=0D + goto Exit;=0D + }=0D + }=0D +=0D + if (FunctionTested =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"test skipped - test case does not apply.";=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"correctly returned EFI_INVALID_PARAMETER.";=0D + }=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D + if (BufferImageInfo !=3D NULL) {=0D + gtBS->FreePool (BufferImageInfo);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: CheckImage, 2=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - The function requires authentication.=0D + - Calls function with valid parameters, except Image has dummy=0D + authentication data.=0D + The function should return EFI_SECURITY_VIOLATION.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestCheckImageConformanceTestCheckpoint2 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *BufferImageInfo;=0D + VOID *BufferImage;=0D +=0D + UINTN ImageInfoSize;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo;=0D + UINT32 DescriptorVersion;=0D + UINT8 DescriptorCount;=0D + UINTN DescriptorSize;=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D +=0D + UINT32 ImageUpdatable;=0D +=0D + VOID *Image;=0D + UINTN ImageSize;=0D +=0D + UINTN i;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *p;=0D + UINTN FunctionTested;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceAssertionGuid012;=0D + ResultMessageLabel =3D L"CheckImage, conformance checkpoint #2";=0D +=0D + BufferImageInfo =3D NULL;=0D + BufferImage =3D NULL;=0D + ImageInfo =3D NULL;=0D + Image =3D NULL;=0D + PackageVersionName =3D NULL;=0D + FunctionTested =3D 0;=0D +=0D + // Use a sufficiently large buffer to obtain EFI_SUCCESS,=0D + // since some implementation does NOT correctly return EFI_BUFFER_TOO_SM= ALL.=0D + // Check for EFI_BUFFER_TOO_SMALL in another conformance test.=0D +=0D + ImageInfoSize =3D (sizeof (EFI_FIRMWARE_IMAGE_DESCRIPTOR)) * 20;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D +=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) {=0D + gtBS->FreePool (ImageInfo);=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status !=3D EFI_SUCCESS) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + BufferImageInfo =3D ImageInfo;=0D + goto Exit;=0D + }=0D + }=0D + BufferImageInfo =3D ImageInfo;=0D +=0D + if (DescriptorSize =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"*DescriptorSize is 0.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D + if ((DescriptorCount * DescriptorSize) > ImageInfoSize) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"((*DescriptorCount) * (*DescriptorSize)) > *Im= ageInfoSize.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + for (i =3D 0; i < DescriptorCount; i++) {=0D + p =3D (EFI_FIRMWARE_IMAGE_DESCRIPTOR *) (((UINT8 *) ImageInfo) + (i * = DescriptorSize));=0D +=0D + if ((p->AttributesSupported & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED)= !=3D IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) {=0D + continue;=0D + }=0D + if ((p->AttributesSetting & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) != =3D IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) {=0D + continue;=0D + }=0D + if (p->Size =3D=3D 0) {=0D + continue;=0D + }=0D + if ((p->AttributesSupported & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) !=3D IM= AGE_ATTRIBUTE_IMAGE_UPDATABLE) {=0D + continue;=0D + }=0D + if ((p->AttributesSetting & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) !=3D IMAG= E_ATTRIBUTE_IMAGE_UPDATABLE) {=0D + continue;=0D + }=0D +=0D + ImageSize =3D p->Size;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageSize,=0D + (VOID **) &Image=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + BufferImage =3D Image;=0D + FunctionTested++;=0D + Status =3D FirmwareManagement->CheckImage (=0D + FirmwareManagement,=0D + p->ImageIndex,=0D + Image,=0D + ImageSize,=0D + &ImageUpdatable=0D + );=0D + gtBS->FreePool (BufferImage);=0D + BufferImage =3D NULL;=0D + Image =3D NULL;=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D + if (Status !=3D EFI_SECURITY_VIOLATION) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_SECURITY_VIOLATION.";=0D + goto Exit;=0D + }=0D + }=0D +=0D + if (FunctionTested =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"test skipped - test case does not apply.";=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"correctly returned EFI_SECURITY_VIOLATION";=0D + }=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D + if (BufferImageInfo !=3D NULL) {=0D + gtBS->FreePool (BufferImageInfo);=0D + }=0D + if (BufferImage !=3D NULL) {=0D + gtBS->FreePool (BufferImage);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: SetPackageInfo, 1=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - Gets PackageVersionNameMaxLen.=0D + - Calls function with valid parameters, except PackageVersionName is l= onger=0D + than the value returned in PackageVersionNameLen.=0D + The function should return EFI_INVALID_PARAMETER.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestSetPackageInfoConformanceTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D +=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D + UINT32 PackageVersionNameMaxLen;= =0D + UINT64 AttributesSupported;=0D + UINT64 AttributesSetting;=0D +=0D + CHAR16 *TestName;=0D + UINT32 TestNameLength;=0D +=0D + UINTN i;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceAssertionGuid013;=0D + ResultMessageLabel =3D L"SetPackageInfo, function checkpoint #1";=0D +=0D + PackageVersionName =3D NULL;=0D + TestName =3D NULL;=0D +=0D + //=0D + // Get PackageVersionNameMaxLen=0D + //=0D +=0D + Status =3D FirmwareManagement->GetPackageInfo (=0D + FirmwareManagement,=0D + &PackageVersion,=0D + &PackageVersionName,=0D + &PackageVersionNameMaxLen,=0D + &AttributesSupported,=0D + &AttributesSetting=0D + );=0D + if (Status !=3D EFI_SUCCESS) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D +=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"test skipped - test case does not apply.";=0D + if (PackageVersionNameMaxLen =3D=3D 0) {=0D + goto Exit;=0D + }=0D + if (((AttributesSupported & PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) = =3D=3D=0D + PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) &&=0D + ((AttributesSetting & PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) =3D= =3D=0D + PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED)) {=0D + goto Exit;=0D + }=0D + if ((AttributesSupported & PACKAGE_ATTRIBUTE_VERSION_UPDATABLE) !=3D=0D + PACKAGE_ATTRIBUTE_VERSION_UPDATABLE) {=0D + goto Exit;=0D + }=0D + if ((AttributesSetting & PACKAGE_ATTRIBUTE_VERSION_UPDATABLE) !=3D=0D + PACKAGE_ATTRIBUTE_VERSION_UPDATABLE) {=0D + goto Exit;=0D + }=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + gtBS->FreePool (PackageVersionName);=0D + PackageVersionName =3D NULL;=0D + TestNameLength =3D PackageVersionNameMaxLen + 1;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + TestNameLength * 2, // Unicode=0D + (VOID **) &TestName=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + for (i =3D 0; i < (TestNameLength - 1); i++) {=0D + TestName[i] =3D L' ';=0D + }=0D + TestName[i] =3D L'\0';=0D + Status =3D FirmwareManagement->SetPackageInfo (=0D + FirmwareManagement,=0D + NULL, // Image=0D + 0, // ImageSize=0D + NULL, // VendorCode=0D + 0x01010101, // Dummy PackageVersion=0D + TestName=0D + );=0D +=0D + if (Status =3D=3D EFI_INVALID_PARAMETER) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"correctly returned EFI_INVALID_PARAMETER.";=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_INVALID_PARAMETER.";=0D + }=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D + if (TestName !=3D NULL) {=0D + gtBS->FreePool (TestName);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: SetPackageInfo, 2=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - The function requires authentication.=0D + - Calls function with valid parameters, except Image is NULL.=0D + The function should return EFI_SECURITY_VIOLATION.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestSetPackageInfoConformanceTestCheckpoint2 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D +=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D + UINT32 PackageVersionNameMaxLen;= =0D + UINT64 AttributesSupported;=0D + UINT64 AttributesSetting;=0D +=0D + VOID *Image;=0D + UINTN ImageSize;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceAssertionGuid014;=0D + ResultMessageLabel =3D L"SetPackageInfo, function checkpoint #2";=0D +=0D + PackageVersionName =3D NULL;=0D +=0D + //=0D + // Get PackageVersionNameMaxLen=0D + //=0D +=0D + Status =3D FirmwareManagement->GetPackageInfo (=0D + FirmwareManagement,=0D + &PackageVersion,=0D + &PackageVersionName,=0D + &PackageVersionNameMaxLen,=0D + &AttributesSupported,=0D + &AttributesSetting=0D + );=0D + if (Status !=3D EFI_SUCCESS) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D +=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"test skipped - test case does not apply.";=0D + if ((AttributesSupported & PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) != =3D PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) {=0D + goto Exit;=0D + }=0D + if ((AttributesSetting & PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) !=3D= PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) {=0D + goto Exit;=0D + }=0D + if ((AttributesSupported & PACKAGE_ATTRIBUTE_VERSION_UPDATABLE) !=3D=0D + PACKAGE_ATTRIBUTE_VERSION_UPDATABLE) {=0D + goto Exit;=0D + }=0D + if ((AttributesSetting & PACKAGE_ATTRIBUTE_VERSION_UPDATABLE) !=3D=0D + PACKAGE_ATTRIBUTE_VERSION_UPDATABLE) {=0D + goto Exit;=0D + }=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + Image =3D NULL;=0D + ImageSize =3D 64; // Dummy=0D + Status =3D FirmwareManagement->SetPackageInfo (=0D + FirmwareManagement,=0D + Image,=0D + ImageSize,=0D + NULL, // VendorCode=0D + PackageVersion,=0D + PackageVersionName=0D + );=0D +=0D + if (Status =3D=3D EFI_SECURITY_VIOLATION) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"correctly returned EFI_SECURITY_VIOLATION.";=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_SECURITY_VIOLATION.";=0D + }=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: SetPackageInfo, 3=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - The function requires authentication.=0D + - Calls function with valid parameters, except ImageSize is 0.=0D + The function should return EFI_SECURITY_VIOLATION.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestSetPackageInfoConformanceTestCheckpoint3 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D +=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D + UINT32 PackageVersionNameMaxLen;= =0D + UINT64 AttributesSupported;=0D + UINT64 AttributesSetting;=0D +=0D + VOID *Image;=0D + UINTN ImageSize;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceAssertionGuid015;=0D + ResultMessageLabel =3D L"SetPackageInfo, function checkpoint #3";=0D +=0D + PackageVersionName =3D NULL;=0D + Image =3D NULL;=0D +=0D + //=0D + // Get PackageVersionNameMaxLen=0D + //=0D +=0D + Status =3D FirmwareManagement->GetPackageInfo (=0D + FirmwareManagement,=0D + &PackageVersion,=0D + &PackageVersionName,=0D + &PackageVersionNameMaxLen,=0D + &AttributesSupported,=0D + &AttributesSetting=0D + );=0D + if (Status !=3D EFI_SUCCESS) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D +=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"test skipped - test case does not apply.";=0D + if ((AttributesSupported & PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) != =3D PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) {=0D + goto Exit;=0D + }=0D + if ((AttributesSetting & PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) !=3D= PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) {=0D + goto Exit;=0D + }=0D + if ((AttributesSupported & PACKAGE_ATTRIBUTE_VERSION_UPDATABLE) !=3D=0D + PACKAGE_ATTRIBUTE_VERSION_UPDATABLE) {=0D + goto Exit;=0D + }=0D + if ((AttributesSetting & PACKAGE_ATTRIBUTE_VERSION_UPDATABLE) !=3D=0D + PACKAGE_ATTRIBUTE_VERSION_UPDATABLE) {=0D + goto Exit;=0D + }=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + 64, // Dummy=0D + (VOID **) &Image=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + ImageSize =3D 0;=0D + Status =3D FirmwareManagement->SetPackageInfo (=0D + FirmwareManagement,=0D + Image,=0D + ImageSize,=0D + NULL, // VendorCode=0D + PackageVersion,=0D + PackageVersionName=0D + );=0D +=0D + if (Status =3D=3D EFI_SECURITY_VIOLATION) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"correctly returned EFI_SECURITY_VIOLATION.";=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_SECURITY_VIOLATION.";=0D + }=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D + if (Image !=3D NULL) {=0D + gtBS->FreePool (Image);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: SetPackageInfo, 4=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - The function requires authentication.=0D + - Calls function with valid parameters, except Image has a dummy=0D + authentication data.=0D + The function should return EFI_SECURITY_VIOLATION.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestSetPackageInfoConformanceTestCheckpoint4 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D +=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D + UINT32 PackageVersionNameMaxLen;= =0D + UINT64 AttributesSupported;=0D + UINT64 AttributesSetting;=0D +=0D + VOID *Image;=0D + UINTN ImageSize;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestConformanceAssertionGuid016;=0D + ResultMessageLabel =3D L"SetPackageInfo, function checkpoint #4";=0D +=0D + PackageVersionName =3D NULL;=0D + Image =3D NULL;=0D + ImageSize =3D 64;=0D +=0D + //=0D + // Get PackageVersionNameMaxLen=0D + //=0D +=0D + Status =3D FirmwareManagement->GetPackageInfo (=0D + FirmwareManagement,=0D + &PackageVersion,=0D + &PackageVersionName,=0D + &PackageVersionNameMaxLen,=0D + &AttributesSupported,=0D + &AttributesSetting=0D + );=0D + if (Status !=3D EFI_SUCCESS) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D +=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"test skipped - test case does not apply.";=0D + if ((AttributesSupported & PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) != =3D PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) {=0D + goto Exit;=0D + }=0D + if ((AttributesSetting & PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) !=3D= PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) {=0D + goto Exit;=0D + }=0D + if ((AttributesSupported & PACKAGE_ATTRIBUTE_VERSION_UPDATABLE) !=3D=0D + PACKAGE_ATTRIBUTE_VERSION_UPDATABLE) {=0D + goto Exit;=0D + }=0D + if ((AttributesSetting & PACKAGE_ATTRIBUTE_VERSION_UPDATABLE) !=3D=0D + PACKAGE_ATTRIBUTE_VERSION_UPDATABLE) {=0D + goto Exit;=0D + }=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageSize,=0D + (VOID **) &Image=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + Status =3D FirmwareManagement->SetPackageInfo (=0D + FirmwareManagement,=0D + Image,=0D + ImageSize,=0D + NULL, // VendorCode=0D + PackageVersion,=0D + PackageVersionName=0D + );=0D +=0D + if (Status =3D=3D EFI_SECURITY_VIOLATION) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"correctly returned EFI_SECURITY_VIOLATION.";=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_SECURITY_VIOLATION.";=0D + }=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D + if (Image !=3D NULL) {=0D + gtBS->FreePool (Image);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/FirmwareManagement/= BlackBoxTest/FirmwareManagementBBTestFunction.c b/uefi-sct/SctPkg/TestCase/= UEFI/IHV/Protocol/FirmwareManagement/BlackBoxTest/FirmwareManagementBBTestF= unction.c=0D new file mode 100644=0D index 00000000..5b739c95=0D --- /dev/null=0D +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/FirmwareManagement/BlackBo= xTest/FirmwareManagementBBTestFunction.c=0D @@ -0,0 +1,872 @@=0D +/** @file=0D +=0D + Copyright 2006 - 2016 Unified EFI, Inc.
=0D + Copyright (c) 2010 - 2016, Dell Inc. All rights reserved.
=0D + Copyright (c) 2019,Microchip Technology Inc.
=0D + This program and the accompanying materials=0D + are licensed and made available under the terms and conditions of the BS= D License=0D + which accompanies this distribution. The full text of the license may b= e found at=0D + http://opensource.org/licenses/bsd-license.php=0D +=0D + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=0D + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED.=0D +=0D +**/=0D +/*++=0D +=0D +Module Name:=0D + FirmwareManagementBBTestFunction.c=0D +=0D +Abstract:=0D + Firmware Management Protocol's function tests.=0D +=0D +--*/=0D +=0D +#define DEBUG_ALL 0=0D +#define DEBUG_GET_IMAGE_INFO 1=0D +#define DEBUG_GET_IMAGE 0=0D +#define DEBUG_GET_PACKAGE_INFO 1=0D +=0D +=0D +#include "SctLib.h"=0D +#include "FirmwareManagementBBTestMain.h"=0D +=0D +// ***********************************************************************= *****=0D +// Check Points=0D +// ***********************************************************************= *****=0D +=0D +EFI_STATUS=0D +BBTestGetImageInfoFunctionTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +BBTestGetImageFunctionTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +EFI_STATUS=0D +BBTestGetPackageInfoFunctionTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + );=0D +=0D +// ***********************************************************************= *****=0D +// Test Case: GetImageInfo=0D +// ***********************************************************************= *****=0D +=0D +EFI_STATUS=0D +BBTestGetImageInfoFunctionTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + )=0D +{=0D + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;=0D + EFI_STATUS Status;=0D + EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + FirmwareManagement =3D (EFI_FIRMWARE_MANAGEMENT_PROTOCOL*)ClientInterfac= e;=0D +=0D + Status =3D gtBS->HandleProtocol (=0D + SupportHandle,=0D + &gEfiStandardTestLibraryGuid,=0D + (VOID **) &StandardLib=0D + );=0D + if (EFI_ERROR(Status)) {=0D + return Status;=0D + }=0D +=0D + //=0D + // Call check point(s)=0D + //=0D +=0D + BBTestGetImageInfoFunctionTestCheckpoint1 (StandardLib, FirmwareManageme= nt);=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Test Case: GetImage=0D +// ***********************************************************************= *****=0D +=0D +EFI_STATUS=0D +BBTestGetImageFunctionTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + )=0D +{=0D + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;=0D + EFI_STATUS Status;=0D + EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + FirmwareManagement =3D (EFI_FIRMWARE_MANAGEMENT_PROTOCOL*)ClientInterfac= e;=0D +=0D + Status =3D gtBS->HandleProtocol (=0D + SupportHandle,=0D + &gEfiStandardTestLibraryGuid,=0D + (VOID **) &StandardLib=0D + );=0D + if (EFI_ERROR(Status)) {=0D + return Status;=0D + }=0D +=0D + //=0D + // Call check point(s)=0D + //=0D +=0D + BBTestGetImageFunctionTestCheckpoint1 (StandardLib, FirmwareManagement);= =0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Test Case: GetPackageInfo=0D +// ***********************************************************************= *****=0D +=0D +EFI_STATUS=0D +BBTestGetPackageInfoFunctionTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + )=0D +{=0D + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;=0D + EFI_STATUS Status;=0D + EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + FirmwareManagement =3D (EFI_FIRMWARE_MANAGEMENT_PROTOCOL*)ClientInterfac= e;=0D +=0D + Status =3D gtBS->HandleProtocol (=0D + SupportHandle,=0D + &gEfiStandardTestLibraryGuid,=0D + (VOID **) &StandardLib=0D + );=0D + if (EFI_ERROR(Status)) {=0D + return Status;=0D + }=0D +=0D + //=0D + // Call check point(s)=0D + //=0D +=0D + BBTestGetPackageInfoFunctionTestCheckpoint1 (StandardLib, FirmwareManage= ment);=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Check Points=0D +//=0D +//=0D +// ***********************************************************************= *****=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: GetImageInfo, 1=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - Calls function with all valid parameters.=0D + The function should return EFI_SUCCESS.=0D + - Checks DescriptorSize is 0.=0D + - Checks (DescriptorCount * DescriptorSize) is <=3D ImageInfoSize.=0D + - Checks DescriptorVersion is =3D=3D 1.=0D + - Checks ImageIndex is between 1 and DescriptorCount.=0D + - Checks AttributesSupported has no bits set beyond bit3.=0D + - Checks AttribtuesSetting has no bits set beyond bit3.=0D + - Checks Compatibilities bit1 thru bit15 are 0s.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestGetImageInfoFunctionTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *BufferImageInfo;=0D +=0D + UINTN ImageInfoSize;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo;=0D + UINT32 DescriptorVersion;=0D + UINT8 DescriptorCount;=0D + UINTN DescriptorSize;=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D +=0D + CHAR16* Attribute[4];=0D +=0D + UINTN i;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *p;=0D +=0D +#if (DEBUG_ALL || DEBUG_GET_IMAGE_INFO)=0D +=0D + CHAR16 *BitField;=0D + CHAR16 *BitSetting;=0D +=0D + UINT64 j;=0D + UINTN k;=0D +=0D +#endif=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestFunctionAssertionGuid001;=0D + ResultMessageLabel =3D L"GetImageInfo, function checkpoint #1";=0D +=0D + BufferImageInfo =3D NULL;=0D + ImageInfo =3D NULL;=0D + PackageVersionName =3D NULL;=0D +=0D + Attribute[0] =3D L"Image Updatable";=0D + Attribute[1] =3D L"Reset Required";=0D + Attribute[2] =3D L"Authentication Required";=0D + Attribute[3] =3D L"In Use";=0D +=0D + // Use a sufficiently large buffer to obtain EFI_SUCCESS,=0D + // since some implementation does NOT correctly return EFI_BUFFER_TOO_SM= ALL.=0D + // Check for EFI_BUFFER_TOO_SMALL in another conformance test.=0D +=0D + ImageInfoSize =3D (sizeof (EFI_FIRMWARE_IMAGE_DESCRIPTOR)) * 20;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D +=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) {=0D + gtBS->FreePool (ImageInfo);=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + }=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + BufferImageInfo =3D ImageInfo;=0D +=0D + if (Status =3D=3D EFI_SUCCESS) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"correctly returned EFI_SUCCESS.";=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_SUCCESS.";=0D + goto Exit;=0D + }=0D +=0D + if (DescriptorSize =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"*DescriptorSize is 0.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D +=0D + if ((DescriptorCount * DescriptorSize) > ImageInfoSize) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"((*DescriptorCount) * (*DescriptorSize)) > *Im= ageInfoSize.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D +=0D + if (DescriptorVersion !=3D 1) {=0D + AssertionType =3D EFI_TEST_ASSERTION_WARNING;=0D + ResultMessageData =3D L"*DescriptorVersion !=3D 1.";=0D + goto Exit;=0D + }=0D +=0D + for (i =3D 0; i < DescriptorCount; i++) {=0D + p =3D (EFI_FIRMWARE_IMAGE_DESCRIPTOR *) (((UINT8 *) ImageInfo) + (i * = DescriptorSize));=0D +=0D + if (p->ImageIndex > DescriptorCount) {=0D + AssertionType =3D EFI_TEST_ASSERTION_WARNING;=0D + ResultMessageData =3D L"ImageIndex is beyond DescriptorCount.";=0D + goto Exit;=0D + }=0D +=0D + if ((p->AttributesSupported & 0xFFFFFFFFFFFFFFF0) !=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_WARNING;=0D + ResultMessageData =3D L"AttributesSupported has bit(s) set beyond bi= t3.";=0D + goto Exit;=0D + }=0D +=0D + if ((p->AttributesSetting & 0xFFFFFFFFFFFFFFF0) !=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_WARNING;=0D + ResultMessageData =3D L"AttributesSetting has bit(s) set beyond bit3= .";=0D + goto Exit;=0D + }=0D +=0D + if ((p->Compatibilities & 0x000000000000FFFE) !=3D0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_WARNING;=0D + ResultMessageData =3D L"Compatibilities have bit(s) set between bit1= and bit15.";=0D + goto Exit;=0D + }=0D + }=0D +=0D +#if (DEBUG_ALL || DEBUG_GET_IMAGE_INFO)=0D +=0D + StandardLib->RecordMessage (=0D + StandardLib,=0D + EFI_VERBOSE_LEVEL_QUIET,=0D + L"Firmware Image Info Header: \n"=0D + L" - *ImageInfoSize =3D %x\n"=0D + L" - *DescriptorVersion =3D %x\n"=0D + L" - *DescriptorCount =3D %x\n"=0D + L" - *DescriptorSzie =3D %x\n"=0D + L" - *PackageVersion =3D %08x\n"=0D + L" - **PackageVersionName =3D %s\n",=0D + ImageInfoSize,=0D + DescriptorVersion,=0D + DescriptorCount,=0D + DescriptorSize,=0D + PackageVersion,=0D + PackageVersionName=0D + );=0D +=0D + for (i =3D 0; i < DescriptorCount; i++) {=0D + p =3D (EFI_FIRMWARE_IMAGE_DESCRIPTOR *) (((UINT8 *) ImageInfo) + (i * = DescriptorSize));=0D + StandardLib->RecordMessage (=0D + StandardLib,=0D + EFI_VERBOSE_LEVEL_QUIET,=0D + L"Descriptor Index =3D %x:\n"=0D + L" - ImageTypeId =3D %08x-%04x-%04x-%02x%02x%02x%02x%0= 2x%02x%02x%02x",=0D + p->ImageIndex,=0D + p->ImageTypeId.Data1,=0D + p->ImageTypeId.Data2,=0D + p->ImageTypeId.Data3,=0D + p->ImageTypeId.Data4[0],=0D + p->ImageTypeId.Data4[1],=0D + p->ImageTypeId.Data4[2],=0D + p->ImageTypeId.Data4[3],=0D + p->ImageTypeId.Data4[4],=0D + p->ImageTypeId.Data4[5],=0D + p->ImageTypeId.Data4[6],=0D + p->ImageTypeId.Data4[7]=0D + );=0D + StandardLib->RecordMessage (=0D + StandardLib,=0D + EFI_VERBOSE_LEVEL_QUIET,=0D + L" - ImageId =3D %016X\n"=0D + L" - *ImageIdName =3D %s\n"=0D + L" - Version =3D %08x\n"=0D + L" - *VersionName =3D %s\n"=0D + L" - Size =3D %x",=0D + p->ImageId,=0D + p->ImageIdName,=0D + p->Version,=0D + p->VersionName,=0D + p->Size=0D + );=0D + StandardLib->RecordMessage (=0D + StandardLib,=0D + EFI_VERBOSE_LEVEL_QUIET,=0D + L" - AttributesSupported =3D %016x\n"=0D + L" - AttributesSetting =3D %016x",=0D + p->AttributesSupported,=0D + p->AttributesSetting=0D + );=0D + for (j =3D 1, k =3D 0; j <=3D IMAGE_ATTRIBUTE_IN_USE; j =3D SctLShiftU= 64(j, 1), k++) {=0D + BitField =3D Attribute[k];=0D + if ((p->AttributesSupported & j) !=3D j) {=0D + BitSetting =3D L"Not Supported";=0D + } else if ((p->AttributesSetting & j) =3D=3D j) {=0D + BitSetting =3D L"Yes";=0D + } else {=0D + BitSetting =3D L"No";=0D + }=0D + StandardLib->RecordMessage (=0D + StandardLib,=0D + EFI_VERBOSE_LEVEL_QUIET,=0D + L" - %s =3D %s",=0D + BitField,=0D + BitSetting=0D + );=0D + }=0D + StandardLib->RecordMessage (=0D + StandardLib,=0D + EFI_VERBOSE_LEVEL_QUIET,=0D + L" - Compatibilities =3D %016x\n",=0D + p->Compatibilities=0D + );=0D + }=0D +=0D +#endif=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D + if (BufferImageInfo !=3D NULL) {=0D + gtBS->FreePool (BufferImageInfo);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: GetImage, 1=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - Calls function with all valid parameters.=0D + The function should return EFI_SUCCESS or EFI_UNSUPPORTED.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestGetImageFunctionTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *BufferImageInfo;=0D + VOID *BufferImage;=0D +=0D + UINTN ImageInfoSize;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo;=0D + UINT32 DescriptorVersion;=0D + UINT8 DescriptorCount;=0D + UINTN DescriptorSize;=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D +=0D + VOID *Image;=0D + UINTN ImageSize;=0D +=0D + UINTN i;=0D + EFI_FIRMWARE_IMAGE_DESCRIPTOR *p;=0D + UINTN FunctionTested;=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestFunctionAssertionGuid002;=0D + ResultMessageLabel =3D L"GetImage, function checkpoint #1";=0D +=0D + BufferImageInfo =3D NULL;=0D + BufferImage =3D NULL;=0D + ImageInfo =3D NULL;=0D + Image =3D NULL;=0D + PackageVersionName =3D NULL;=0D + FunctionTested =3D 0;=0D +=0D + // Use a sufficiently large buffer to obtain EFI_SUCCESS,=0D + // since some implementation does NOT correctly return EFI_BUFFER_TOO_SM= ALL.=0D + // Check for EFI_BUFFER_TOO_SMALL in another conformance test.=0D +=0D + ImageInfoSize =3D (sizeof (EFI_FIRMWARE_IMAGE_DESCRIPTOR)) * 20;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D +=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) {=0D + gtBS->FreePool (ImageInfo);=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageInfoSize,=0D + (VOID **) &ImageInfo=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + Status =3D FirmwareManagement->GetImageInfo (=0D + FirmwareManagement,=0D + &ImageInfoSize,=0D + ImageInfo,=0D + &DescriptorVersion,=0D + &DescriptorCount,=0D + &DescriptorSize,=0D + &PackageVersion,=0D + &PackageVersionName=0D + );=0D + if (Status !=3D EFI_SUCCESS) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + BufferImageInfo =3D ImageInfo;=0D + goto Exit;=0D + }=0D + }=0D + BufferImageInfo =3D ImageInfo;=0D +=0D + if (DescriptorSize =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"*DescriptorSize is 0.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D + if ((DescriptorCount * DescriptorSize) > ImageInfoSize) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"((*DescriptorCount) * (*DescriptorSize)) > *Im= ageInfoSize.";=0D + goto Exit; // Note the Status =3D EFI_SUCCESS=0D + }=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + for (i =3D 0; i < DescriptorCount; i++) {=0D + p =3D (EFI_FIRMWARE_IMAGE_DESCRIPTOR *) (((UINT8 *) ImageInfo) + (i * = DescriptorSize));=0D +=0D + if (((p->AttributesSupported & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED= ) =3D=3D=0D + IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) &&=0D + ((p->AttributesSetting & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) = =3D=3D=0D + IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED)) {=0D + continue;=0D + }=0D + if (p->Size =3D=3D 0) {=0D + continue;=0D + }=0D + if ((p->AttributesSupported & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) !=3D IM= AGE_ATTRIBUTE_IMAGE_UPDATABLE) {=0D + continue;=0D + }=0D + if ((p->AttributesSetting & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) !=3D IMAG= E_ATTRIBUTE_IMAGE_UPDATABLE) {=0D + continue;=0D + }=0D +=0D + ImageSize =3D p->Size;=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageSize,=0D + (VOID **) &Image=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + BufferImage =3D Image;=0D +=0D + FunctionTested++;=0D + Status =3D FirmwareManagement->GetImage (=0D + FirmwareManagement,=0D + p->ImageIndex,=0D + Image,=0D + &ImageSize=0D + );=0D +=0D + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) {=0D + gtBS->FreePool (Image);=0D + Status =3D gtBS->AllocatePool (=0D + EfiBootServicesData,=0D + ImageSize,=0D + (VOID **) &Image=0D + );=0D + if (EFI_ERROR (Status)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"test case initialization failure.";=0D + goto Exit;=0D + }=0D + }=0D + BufferImage =3D Image;=0D +=0D + Status =3D FirmwareManagement->GetImage (=0D + FirmwareManagement,=0D + p->ImageIndex,=0D + Image,=0D + &ImageSize=0D + );=0D + gtBS->FreePool (BufferImage);=0D + BufferImage =3D NULL;=0D + Image =3D NULL;=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D + if ((Status !=3D EFI_SUCCESS) && (Status !=3D EFI_UNSUPPORTED)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_SUCCESS or EFI_UNSUPPOR= TED.";=0D + goto Exit;=0D + }=0D + }=0D +=0D + if (FunctionTested =3D=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"test skipped - test case does not apply.";=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"correctly returned EFI_SUCCESS or EFI_UNSUPPOR= TED.";=0D + }=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D + if (BufferImageInfo !=3D NULL) {=0D + gtBS->FreePool (BufferImageInfo);=0D + }=0D + if (BufferImage !=3D NULL) {=0D + gtBS->FreePool (BufferImage);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +// ***********************************************************************= *****=0D +// Checkpoint: GetPackageInfo, 1=0D +// ***********************************************************************= *****=0D +=0D +/**=0D + This routine:=0D + - Calls function with all valid parameters.=0D + The function should return EFI_SUCCESS or EFI_UNSUPPORTED.=0D + - Checks AttributesSupported has no bits set beyond bit2.=0D + - Checks AttributesSetting has no bits set beyond bit2.=0D +**/=0D +=0D +EFI_STATUS=0D +BBTestGetPackageInfoFunctionTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *FirmwareManagement=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D + EFI_GUID TestGuid;=0D + CHAR16 *ResultMessageLabel;=0D + CHAR16 *ResultMessageData;=0D +=0D + UINT32 PackageVersion;=0D + CHAR16 *PackageVersionName;=0D + UINT32 PackageVersionNameMaxLen;= =0D + UINT64 AttributesSupported;=0D + UINT64 AttributesSetting;=0D +=0D + CHAR16* Attribute[3];=0D +=0D +#if (DEBUG_ALL || DEBUG_GET_PACKAGE_INFO)=0D +=0D + CHAR16 *BitField;=0D + CHAR16 *BitSetting;=0D +=0D + UINT64 j;=0D + UINTN k;=0D +=0D +#endif=0D +=0D + //=0D + // Init=0D + //=0D +=0D + Status =3D EFI_SUCCESS;=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + TestGuid =3D gFirmwareManagementBBTestFunctionAssertionGuid003;=0D + ResultMessageLabel =3D L"GetPackageInfo, function checkpoint #1";=0D +=0D + PackageVersionName =3D NULL;=0D +=0D + Attribute[0] =3D L"Version Updatable";=0D + Attribute[1] =3D L"Reset Required";=0D + Attribute[2] =3D L"Authentication Required";=0D +=0D + //=0D + // Check the data returned by the function=0D + //=0D +=0D + Status =3D FirmwareManagement->GetPackageInfo (=0D + FirmwareManagement,=0D + &PackageVersion,=0D + &PackageVersionName,=0D + &PackageVersionNameMaxLen,=0D + &AttributesSupported,=0D + &AttributesSetting=0D + );=0D +=0D + if ((Status =3D=3D EFI_SUCCESS) || (Status =3D=3D EFI_UNSUPPORTED)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + ResultMessageData =3D L"correctly returned EFI_SUCCESS or EFI_UNSUPPOR= TED.";=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + ResultMessageData =3D L"failed to return EFI_SUCCESS or EFI_UNSUPPORTE= D.";=0D + goto Exit;=0D + }=0D +=0D +#if (DEBUG_ALL || DEBUG_GET_PACKAGE_INFO)=0D +=0D + StandardLib->RecordMessage (=0D + StandardLib,=0D + EFI_VERBOSE_LEVEL_QUIET,=0D + L"Firmware Package Info: \n"=0D + L" - *PackageVersion =3D %08x\n"=0D + L" - **PackageVersionName =3D %s\n"=0D + L" - *PackageVersionNameMaxLen =3D %08x",=0D + PackageVersion,=0D + PackageVersionName,=0D + PackageVersionNameMaxLen=0D + );=0D + StandardLib->RecordMessage (=0D + StandardLib,=0D + EFI_VERBOSE_LEVEL_QUIET,=0D + L" - *AttributesSupported =3D %016x\n"=0D + L" - *AttributesSetting =3D %016x",=0D + AttributesSupported,=0D + AttributesSetting=0D + );=0D + for (j =3D 1, k =3D 0; j <=3D PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED;= j =3D SctLShiftU64(j, 1), k++) {=0D + BitField =3D Attribute[k];=0D + if ((AttributesSupported & j) !=3D j) {=0D + BitSetting =3D L"Not Supported";=0D + } else if ((AttributesSetting & j) =3D=3D j) {=0D + BitSetting =3D L"Yes";=0D + } else {=0D + BitSetting =3D L"No";=0D + }=0D + StandardLib->RecordMessage (=0D + StandardLib,=0D + EFI_VERBOSE_LEVEL_QUIET,=0D + L" - %s =3D %s",=0D + BitField,=0D + BitSetting=0D + );=0D + }=0D +=0D +#endif=0D +=0D + if ((AttributesSupported & 0xFFFFFFFFFFFFFFF8) !=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_WARNING;=0D + ResultMessageData =3D L"*AttributesSupported has bit(s) set beyond bit= 2.";=0D + goto Exit;=0D + }=0D +=0D + if ((AttributesSetting & 0xFFFFFFFFFFFFFFF8) !=3D 0) {=0D + AssertionType =3D EFI_TEST_ASSERTION_WARNING;=0D + ResultMessageData =3D L"*AttributesSetting has bit(s) set beyond bit2.= ";=0D + goto Exit;=0D + }=0D +=0D + //=0D + // Report the checkpoint result=0D + //=0D +=0D +Exit:=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + TestGuid,=0D + ResultMessageLabel,=0D + L"Result - %s\n%a:%d: Status - %r",=0D + ResultMessageData,=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + if (PackageVersionName !=3D NULL) {=0D + gtBS->FreePool (PackageVersionName);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/FirmwareManagement/= BlackBoxTest/FirmwareManagementBBTestMain.c b/uefi-sct/SctPkg/TestCase/UEFI= /IHV/Protocol/FirmwareManagement/BlackBoxTest/FirmwareManagementBBTestMain.= c=0D new file mode 100644=0D index 00000000..3ec928be=0D --- /dev/null=0D +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/FirmwareManagement/BlackBo= xTest/FirmwareManagementBBTestMain.c=0D @@ -0,0 +1,168 @@=0D +/** @file=0D +=0D + Copyright 2006 - 2017 Unified EFI, Inc.
=0D + Copyright (c) 2010 - 2017, Dell Inc. All rights reserved.
=0D + Copyright (c) 2019,Microchip Technology Inc.
=0D + This program and the accompanying materials=0D + are licensed and made available under the terms and conditions of the BS= D License=0D + which accompanies this distribution. The full text of the license may b= e found at=0D + http://opensource.org/licenses/bsd-license.php=0D +=0D + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=0D + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED.=0D +=0D +**/=0D +/*++=0D +=0D +Module Name:=0D +=0D + FirmwareManagementBBTestMain.c=0D +=0D +Abstract:=0D +=0D + Firmware Management Protocol test driver.=0D +=0D +--*/=0D +=0D +#include "SctLib.h"=0D +#include "FirmwareManagementBBTestMain.h"=0D +=0D +// ***********************************************************************= *****=0D +// Variables=0D +// ***********************************************************************= *****=0D +=0D +EFI_HANDLE mImageHandle;=0D +=0D +EFI_BB_TEST_PROTOCOL *gBBTestProtocolInterface;=0D +=0D +EFI_BB_TEST_PROTOCOL_FIELD gBBTestProtocolField =3D {=0D + EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_REVISION,=0D + IHV_EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GUID,=0D + L"Firmware Management Protocol Test",=0D + L"UEFI 2.3 Firmware Management Protocol Black-Box Test"=0D +};=0D +=0D +EFI_GUID gSupportProtocolGuid[] =3D {=0D + EFI_STANDARD_TEST_LIBRARY_GUID,=0D + EFI_NULL_GUID=0D +};=0D +=0D +EFI_BB_TEST_ENTRY_FIELD gBBTestEntryField[] =3D {=0D + {=0D + EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0101,=0D + L"Function_Test-GetImageInfo",=0D + L"Function auto test for Firmware Management Protocol GetImageInfo()."= ,=0D + EFI_TEST_LEVEL_MINIMAL,=0D + gSupportProtocolGuid,=0D + EFI_TEST_CASE_AUTO,=0D + BBTestGetImageInfoFunctionTest=0D + },=0D + {=0D + EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0102,=0D + L"Function_Test-GetImage",=0D + L"Function auto test for Firmware Management Protocol GetImage().",=0D + EFI_TEST_LEVEL_MINIMAL,=0D + gSupportProtocolGuid,=0D + EFI_TEST_CASE_AUTO,=0D + BBTestGetImageFunctionTest=0D + },=0D + {=0D + EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0105,=0D + L"Function_Test-GetPackageInfo",=0D + L"Function auto test for Firmware Management Protocol GetPackageInfo()= .",=0D + EFI_TEST_LEVEL_MINIMAL,=0D + gSupportProtocolGuid,=0D + EFI_TEST_CASE_AUTO,=0D + BBTestGetPackageInfoFunctionTest=0D + },=0D + {=0D + EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0201,=0D + L"Conformance_Test-GetImageInfo",=0D + L"Conformance auto test for Firmware Management Protocol GetImageInfo(= ).",=0D + EFI_TEST_LEVEL_MINIMAL,=0D + gSupportProtocolGuid,=0D + EFI_TEST_CASE_AUTO,=0D + BBTestGetImageInfoConformanceTest=0D + },=0D + {=0D + EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0202,=0D + L"Conformance_Test-GetImage",=0D + L"Conformance auto test for Firmware Management Protocol GetImage().",= =0D + EFI_TEST_LEVEL_MINIMAL,=0D + gSupportProtocolGuid,=0D + EFI_TEST_CASE_AUTO,=0D + BBTestGetImageConformanceTest=0D + },=0D + {=0D + EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0203,=0D + L"Conformance_Test-SetImage",=0D + L"Conformance auto test for Firmware Management Protocol SetImage().",= =0D + EFI_TEST_LEVEL_MINIMAL,=0D + gSupportProtocolGuid,=0D + EFI_TEST_CASE_AUTO,=0D + BBTestSetImageConformanceTest=0D + },=0D + {=0D + EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0204,=0D + L"Conformance_Test-CheckImage",=0D + L"Conformance auto test for Firmware Management Protocol CheckImage().= ",=0D + EFI_TEST_LEVEL_MINIMAL,=0D + gSupportProtocolGuid,=0D + EFI_TEST_CASE_AUTO,=0D + BBTestCheckImageConformanceTest=0D + },=0D + {=0D + EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0206,=0D + L"Conformance_Test-SetPackageInfo",=0D + L"Conformance auto test for Firmware Management Protocol SetPackageInf= o().",=0D + EFI_TEST_LEVEL_MINIMAL,=0D + gSupportProtocolGuid,=0D + EFI_TEST_CASE_AUTO,=0D + BBTestSetPackageInfoConformanceTest=0D + },=0D + 0=0D +};=0D +=0D +// ***********************************************************************= *****=0D +// Initialization and Unload functions=0D +// ***********************************************************************= *****=0D +=0D +=0D +EFI_STATUS=0D +EFIAPI=0D +InitializeFirmwareManagementBBTest (=0D + IN EFI_HANDLE ImageHandle,=0D + IN EFI_SYSTEM_TABLE *SystemTable=0D + )=0D +{=0D + EfiInitializeTestLib (ImageHandle, SystemTable);=0D +=0D + //=0D + // initialize test utility lib=0D + //=0D +=0D + SctInitializeLib (ImageHandle, SystemTable);=0D +=0D + mImageHandle =3D ImageHandle;=0D +=0D + return EfiInitAndInstallIHVBBTestInterface (=0D + &ImageHandle,=0D + &gBBTestProtocolField,=0D + gBBTestEntryField,=0D + UnloadFirmwareManagementBBTest,=0D + &gBBTestProtocolInterface=0D + );=0D +}=0D +=0D +EFI_STATUS=0D +EFIAPI=0D +UnloadFirmwareManagementBBTest (=0D + IN EFI_HANDLE ImageHandle=0D + )=0D +{=0D + return EfiUninstallAndFreeIHVBBTestInterface (=0D + ImageHandle,=0D + gBBTestProtocolInterface=0D + );=0D +}=0D +=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/FirmwareManagement/= BlackBoxTest/FirmwareManagementBBTestMain.h b/uefi-sct/SctPkg/TestCase/UEFI= /IHV/Protocol/FirmwareManagement/BlackBoxTest/FirmwareManagementBBTestMain.= h=0D new file mode 100644=0D index 00000000..d21a5f9f=0D --- /dev/null=0D +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/FirmwareManagement/BlackBo= xTest/FirmwareManagementBBTestMain.h=0D @@ -0,0 +1,205 @@=0D +/** @file=0D +=0D + Copyright 2006 - 2017 Unified EFI, Inc.
=0D + Copyright (c) 2010 - 2017, Dell Inc. All rights reserved.
=0D + Copyright (c) 2019,Microchip Technology Inc.
=0D + This program and the accompanying materials=0D + are licensed and made available under the terms and conditions of the BS= D License=0D + which accompanies this distribution. The full text of the license may b= e found at=0D + http://opensource.org/licenses/bsd-license.php=0D +=0D + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=0D + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED.=0D +=0D +**/=0D +/*++=0D +=0D +Module Name:=0D +=0D + FirmwareManagementBBTestMain.h=0D +=0D +Abstract:=0D +=0D + Header file for Firmware Management Protocol test driver.=0D +=0D +--*/=0D +=0D +#ifndef _FIRMWARE_MANAGEMENT_BB_TEST_MAIN=0D +#define _FIRMWARE_MANAGEMENT_BB_TEST_MAIN=0D +=0D +#include "Efi.h"=0D +#include "Guid.h"=0D +#include =0D +=0D +#include =0D +=0D +#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_REVISION 0x00010000=0D +=0D +#define IHV_EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GUID \=0D +{ 0x941d02a8, 0x49ad, 0x4bda, { 0x9f, 0xae, 0x0a, 0x69, 0x24, 0x54, 0x1c, = 0x88 } }=0D +// ***********************************************************************= *****=0D +// Entry GUIDs for Function Test=0D +// ***********************************************************************= *****=0D +=0D +#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0101 \=0D +{ 0x7ddddd57, 0x68ff, 0x460e, { 0x90, 0xad, 0xa9, 0xd5, 0xf1, 0xf0, 0xa0, = 0x87 } }=0D +=0D +#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0102 \=0D +{ 0x5b4c24b2, 0x852d, 0x418a, { 0x82, 0x34, 0xc2, 0xc8, 0x63, 0x5e, 0x9a, = 0x2a } }=0D +=0D +#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0103 \=0D +{ 0x84062e44, 0xdaee, 0x41a5, { 0x94, 0xf8, 0x6d, 0xe0, 0x72, 0x9b, 0xfa, = 0xb4 } }=0D +=0D +#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0104 \=0D +{ 0xdeb26021, 0xca4e, 0x4876, { 0x90, 0x99, 0xca, 0x7d, 0x77, 0x2c, 0x90, = 0x1d } }=0D +=0D +#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0105 \=0D +{ 0xaa160ecc, 0xfc2f, 0x4f05, { 0xac, 0x20, 0x4c, 0xed, 0x45, 0xde, 0xda, = 0xab } }=0D +=0D +#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0106 \=0D +{ 0x7a9a2714, 0xf32b, 0x4083, { 0x90, 0xf2, 0x12, 0x51, 0x1a, 0x87, 0x48, = 0x1a } }=0D +=0D +// ***********************************************************************= *****=0D +// Entry GUIDs for Conformance Test=0D +// ***********************************************************************= *****=0D +=0D +#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0201 \=0D +{ 0x54ee347c, 0x10a3, 0x4311, { 0x94, 0x27, 0xa8, 0x97, 0xbf, 0xdc, 0x98, = 0x8 } }=0D +=0D +#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0202 \=0D +{ 0x68aba93c, 0x1d0c, 0x412f, { 0xb1, 0xe, 0xe3, 0xa4, 0x6, 0xbc, 0x42, 0x= cf } }=0D +=0D +#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0203 \=0D +{ 0x12834a23, 0x6cef, 0x478e, { 0xaf, 0x48, 0x44, 0xe5, 0x93, 0x40, 0xab, = 0xe8 } }=0D +=0D +#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0204 \=0D +{ 0xc6dc94b1, 0xb81b, 0x4b85, { 0x8b, 0x7d, 0x8f, 0xbf, 0xa6, 0x8e, 0xf3, = 0xe5 } }=0D +=0D +#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0205 \=0D +{ 0x3d13f23d, 0x8306, 0x49d4, { 0xa0, 0xe0, 0x9a, 0x9b, 0xf6, 0x89, 0x40, = 0x3c } }=0D +=0D +#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_TEST_ENTRY_GUID0206 \=0D +{ 0x24cf9ac2, 0x9abc, 0x4f5c, { 0x9c, 0x7a, 0xbc, 0x22, 0x29, 0xc3, 0x2, 0= x7f } }=0D +=0D +// ***********************************************************************= *****=0D +// Initializaiton and Unload functions=0D +// ***********************************************************************= *****=0D +=0D +EFI_STATUS=0D +EFIAPI=0D +InitializeFirmwareManagementBBTest (=0D + IN EFI_HANDLE ImageHandle,=0D + IN EFI_SYSTEM_TABLE *SystemTable=0D + );=0D +=0D +EFI_STATUS=0D +EFIAPI=0D +UnloadFirmwareManagementBBTest (=0D + IN EFI_HANDLE ImageHandle=0D + );=0D +=0D +//=0D +// Test Cases - Function=0D +//=0D +=0D +EFI_STATUS=0D +BBTestGetImageInfoFunctionTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + );=0D +=0D +EFI_STATUS=0D +BBTestGetImageFunctionTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + );=0D +=0D +EFI_STATUS=0D +BBTestSetImageFunctionTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + );=0D +=0D +EFI_STATUS=0D +BBTestCheckImageFunctionTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + );=0D +=0D +EFI_STATUS=0D +BBTestGetPackageInfoFunctionTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + );=0D +=0D +EFI_STATUS=0D +BBTestSetPackageInfoFunctionTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + );=0D +=0D +//=0D +// Test Cases - Conformance=0D +//=0D +=0D +EFI_STATUS=0D +BBTestGetImageInfoConformanceTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + );=0D +=0D +EFI_STATUS=0D +BBTestGetImageConformanceTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + );=0D +=0D +EFI_STATUS=0D +BBTestSetImageConformanceTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + );=0D +=0D +EFI_STATUS=0D +BBTestCheckImageConformanceTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + );=0D +=0D +EFI_STATUS=0D +BBTestGetPackageInfoConformanceTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + );=0D +=0D +EFI_STATUS=0D +BBTestSetPackageInfoConformanceTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + );=0D +=0D +#endif=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/FirmwareManagement/= BlackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/FirmwareMa= nagement/BlackBoxTest/Guid.c=0D new file mode 100644=0D index 00000000..ce045f23=0D --- /dev/null=0D +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/FirmwareManagement/BlackBo= xTest/Guid.c=0D @@ -0,0 +1,83 @@=0D +/** @file=0D +=0D + Copyright 2006 - 2012 Unified EFI, Inc.
=0D + Copyright (c) 2010 - 2012, Dell Inc. All rights reserved.
=0D + Copyright (c) 2019,Microchip Technology Inc.
=0D + This program and the accompanying materials=0D + are licensed and made available under the terms and conditions of the BS= D License=0D + which accompanies this distribution. The full text of the license may b= e found at=0D + http://opensource.org/licenses/bsd-license.php=0D +=0D + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=0D + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED.=0D +=0D +**/=0D +/*++=0D +=0D + Module Name:=0D +=0D + Guid.c=0D +=0D + Abstract:=0D +=0D + GUIDs auto-generated for EFI test assertion.=0D +=0D +--*/=0D +=0D +#include "Efi.h"=0D +#include "Guid.h"=0D +=0D +// ***********************************************************************= *****=0D +// Function=0D +// ***********************************************************************= *****=0D +=0D +EFI_GUID gFirmwareManagementBBTestFunctionAssertionGuid001=3DEFI_TEST_FIRM= WAREMANAGEMENTBBTESTFUNCTION_ASSERTION_001_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestFunctionAssertionGuid002=3DEFI_TEST_FIRM= WAREMANAGEMENTBBTESTFUNCTION_ASSERTION_002_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestFunctionAssertionGuid003=3DEFI_TEST_FIRM= WAREMANAGEMENTBBTESTFUNCTION_ASSERTION_003_GUID;=0D +=0D +// ***********************************************************************= *****=0D +// Conformance=0D +// ***********************************************************************= *****=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceSupportGuid001=3DEFI_TEST_FIR= MWAREMANAGEMENTBBTESTCONFORMANCE_SUPPORT_001_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceSupportGuid002=3DEFI_TEST_FIR= MWAREMANAGEMENTBBTESTCONFORMANCE_SUPPORT_002_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceSupportGuid003=3DEFI_TEST_FIR= MWAREMANAGEMENTBBTESTCONFORMANCE_SUPPORT_003_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceSupportGuid004=3DEFI_TEST_FIR= MWAREMANAGEMENTBBTESTCONFORMANCE_SUPPORT_004_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid001=3DEFI_TEST_F= IRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_001_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid002=3DEFI_TEST_F= IRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_002_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid003=3DEFI_TEST_F= IRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_003_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid004=3DEFI_TEST_F= IRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_004_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid005=3DEFI_TEST_F= IRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_005_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid006=3DEFI_TEST_F= IRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_006_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid007=3DEFI_TEST_F= IRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_007_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid008=3DEFI_TEST_F= IRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_008_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid009=3DEFI_TEST_F= IRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_009_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid010=3DEFI_TEST_F= IRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_010_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid011=3DEFI_TEST_F= IRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_011_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid012=3DEFI_TEST_F= IRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_012_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid013=3DEFI_TEST_F= IRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_013_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid014=3DEFI_TEST_F= IRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_014_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid015=3DEFI_TEST_F= IRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_015_GUID;=0D +=0D +EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid016=3DEFI_TEST_F= IRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_016_GUID;=0D +=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/FirmwareManagement/= BlackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/FirmwareMa= nagement/BlackBoxTest/Guid.h=0D new file mode 100644=0D index 00000000..e26cf7dd=0D --- /dev/null=0D +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/FirmwareManagement/BlackBo= xTest/Guid.h=0D @@ -0,0 +1,153 @@=0D +/** @file=0D +=0D + Copyright 2006 - 2010 Unified EFI, Inc.
=0D + Copyright (c) 2010, Dell Inc. All rights reserved.
=0D + Copyright (c) 2019,Microchip Technology Inc.
=0D + This program and the accompanying materials=0D + are licensed and made available under the terms and conditions of the BS= D License=0D + which accompanies this distribution. The full text of the license may b= e found at=0D + http://opensource.org/licenses/bsd-license.php=0D +=0D + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=0D + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED.=0D +=0D +**/=0D +/*++=0D +=0D + Module Name:=0D +=0D + Guid.h=0D +=0D + Abstract:=0D +=0D + GUIDs auto-generated for EFI test assertion.=0D +=0D +--*/=0D +=0D +// ***********************************************************************= *****=0D +// Function=0D +// ***********************************************************************= *****=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTFUNCTION_ASSERTION_001_GUID \=0D +{ 0xd02b40ae, 0x62f, 0x4155, { 0xbb, 0xdd, 0x4, 0x29, 0x18, 0x94, 0xea, 0x= 31 } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestFunctionAssertionGuid001;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTFUNCTION_ASSERTION_002_GUID \=0D +{ 0xff704c46, 0x3999, 0x4a28, { 0xa3, 0x6e, 0x76, 0x8a, 0xb6, 0xad, 0x89, = 0xd8 } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestFunctionAssertionGuid002;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTFUNCTION_ASSERTION_003_GUID \=0D +{ 0x70884539, 0x9a34, 0x4146, { 0x83, 0x3a, 0x4d, 0x89, 0x8b, 0x9c, 0x7e, = 0xa4 } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestFunctionAssertionGuid003;=0D +=0D +// ***********************************************************************= *****=0D +// Conformance - Function Support Check=0D +// ***********************************************************************= *****=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_SUPPORT_001_GUID \=0D +{ 0xd9c7d018, 0x60ba, 0x448d, { 0xb1, 0x3b, 0x88, 0x8b, 0x41, 0xd9, 0xdc, = 0x9 } };=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceSupportGuid001;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_SUPPORT_002_GUID \=0D +{ 0x28310f16, 0x690e, 0x44a5, { 0x93, 0x98, 0xe1, 0xcd, 0x6a, 0xb3, 0xe1, = 0x61 } };=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceSupportGuid002;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_SUPPORT_003_GUID \=0D +{ 0x92cc940a, 0xdcf8, 0x42a0, { 0x81, 0xa1, 0xd7, 0xdd, 0x43, 0x87, 0xbf, = 0x6d } };=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceSupportGuid003;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_SUPPORT_004_GUID \=0D +{ 0x3f910041, 0xcd4d, 0x4b36, { 0xb2, 0x23, 0xfb, 0x16, 0x4e, 0x7e, 0x6a, = 0x8c } };=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceSupportGuid004;=0D +=0D +// ***********************************************************************= *****=0D +// Conformance - Assertion=0D +// ***********************************************************************= *****=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_001_GUID \= =0D +{ 0x3789b80e, 0xab70, 0x4dc9, { 0xbb, 0xbd, 0x70, 0x63, 0x76, 0x36, 0xab, = 0x52 } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid001;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_002_GUID \= =0D +{ 0xca1d7706, 0x256b, 0x464e, { 0xb6, 0xee, 0x50, 0x34, 0x1e, 0xec, 0x3c, = 0x83 } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid002;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_003_GUID \= =0D +{ 0x3c8d87b2, 0x6a89, 0x4a6c, { 0xbc, 0x75, 0xe6, 0x86, 0xa1, 0x49, 0x13, = 0xf0 } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid003;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_004_GUID \= =0D +{ 0x88031c96, 0x99bf, 0x4d2c, { 0x9f, 0x57, 0xa7, 0x2, 0x6a, 0xbc, 0xd3, 0= x51 } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid004;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_005_GUID \= =0D +{ 0x7a386361, 0x3a5d, 0x4e58, { 0x8a, 0x51, 0x4d, 0x93, 0xb6, 0x55, 0x95, = 0xf4 } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid005;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_006_GUID \= =0D +{ 0xd6a77629, 0x5afd, 0x4854, { 0x87, 0xc8, 0xee, 0x9f, 0xc5, 0x3d, 0xbe, = 0x3d } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid006;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_007_GUID \= =0D +{ 0x4ea24764, 0xa6b1, 0x43b5, { 0xb8, 0xa0, 0xd3, 0x3f, 0xdc, 0x8b, 0xc6, = 0xe4 } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid007;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_008_GUID \= =0D +{ 0x712ce1e9, 0x80d1, 0x4168, { 0xb8, 0xd0, 0x74, 0xd1, 0x72, 0x7a, 0x2f, = 0x25 } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid008;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_009_GUID \= =0D +{ 0xc82d1373, 0x1f87, 0x45f4, { 0xaf, 0xfc, 0x10, 0xa7, 0xf7, 0xb0, 0x9c, = 0xb0 } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid009;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_010_GUID \= =0D +{ 0x2410a859, 0xdf6f, 0x4857, { 0x92, 0x4a, 0x26, 0x37, 0x7, 0x11, 0xf, 0x= 1c } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid010;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_011_GUID \= =0D +{ 0x3987172c, 0xe6a0, 0x4099, { 0xb1, 0x2b, 0xd8, 0xef, 0xf2, 0x62, 0x75, = 0x93 } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid011;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_012_GUID \= =0D +{ 0xd6dad28e, 0x7f0f, 0x4f56, { 0x9a, 0x93, 0x14, 0x7d, 0xb3, 0x74, 0x0, 0= xc9 } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid012;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_013_GUID \= =0D +{ 0xb5288fc3, 0xe906, 0x4468, { 0x83, 0x3d, 0xd4, 0xa6, 0x58, 0xa5, 0x4f, = 0xbd } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid013;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_014_GUID \= =0D +{ 0x57355301, 0x1343, 0x497f, { 0xbe, 0xe0, 0x8e, 0x5c, 0x27, 0xd2, 0x40, = 0x25 } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid014;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_015_GUID \= =0D +{ 0xadeab82d, 0x7592, 0x40fe, { 0x87, 0xa8, 0x93, 0x2b, 0xad, 0x97, 0xff, = 0x5e } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid015;=0D +=0D +#define EFI_TEST_FIRMWAREMANAGEMENTBBTESTCONFORMANCE_ASSERTION_016_GUID \= =0D +{ 0x9be658d2, 0x1312, 0x4254, { 0x91, 0x10, 0x59, 0x0, 0xd5, 0xfd, 0x6c, 0= x6c } }=0D +=0D +extern EFI_GUID gFirmwareManagementBBTestConformanceAssertionGuid016;=0D +=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/FirmwareManagement/= BlackBoxTest/IhvFirmwareManagementBBTest.inf b/uefi-sct/SctPkg/TestCase/UEF= I/IHV/Protocol/FirmwareManagement/BlackBoxTest/IhvFirmwareManagementBBTest.= inf=0D new file mode 100644=0D index 00000000..f2de4cea=0D --- /dev/null=0D +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/FirmwareManagement/BlackBo= xTest/IhvFirmwareManagementBBTest.inf=0D @@ -0,0 +1,52 @@=0D +## @file=0D +#=0D +# Copyright 2006 - 2012 Unified EFI, Inc.
=0D +# Copyright (c) 2010 - 2012, Dell Inc. All rights reserved.
=0D +# Copyright (c) 2019,Microchip Technology Inc.
=0D +# This program and the accompanying materials=0D +# are licensed and made available under the terms and conditions of the B= SD License=0D +# which accompanies this distribution. The full text of the license may = be found at=0D +# http://opensource.org/licenses/bsd-license.php=0D +#=0D +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=0D +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED.=0D +#=0D +##=0D +#/*++=0D +#=0D +# Module Name:=0D +#=0D +# FirmwareManagementBBTest.inf=0D +#=0D +# Abstract:=0D +#=0D +# Component description file for IHV Firmware Management Protocol Black-= Box Test.=0D +#=0D +#--*/=0D +=0D +[defines]=0D + INF_VERSION =3D 0x00010005=0D + BASE_NAME =3D IhvFirmwareManagementBBTest=0D + FILE_GUID =3D DB0E842F-201B-4D47-BA74-88602A41C9D2=0D + MODULE_TYPE =3D UEFI_DRIVER=0D + COMPONENT_TYPE =3D BS_DRIVER=0D + VERSION_STRING =3D 1.0=0D + ENTRY_POINT =3D InitializeFirmwareManagementBBTest=0D +=0D +[sources.common]=0D + FirmwareManagementBBTestConformance.c=0D + FirmwareManagementBBTestFunction.c=0D + FirmwareManagementBBTestMain.c=0D + Guid.c=0D +=0D +[Packages]=0D + MdePkg/MdePkg.dec=0D + SctPkg/SctPkg.dec=0D + SctPkg/UEFI/UEFI.dec=0D +=0D +[LibraryClasses]=0D + UefiDriverEntryPoint=0D + SctLib=0D + EfiTestLib=0D +=0D +[Protocols]=0D --=0D 2.22.0.windows.1=0D =0D