From nobody Mon Feb 9 02:28:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+102731+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+102731+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1680906064; cv=none; d=zohomail.com; s=zohoarc; b=PCQbICpTLKkDjiUk2hxupvfoP+ue/nCSqtohqaBTZaBG0KDOyodYoGm6dF7ukc1R4dY+aO7jC4hFvDpTJ+yt6bm58h03nIfR9bvoeMIHKF8/tIk39nJ88H5reSvyWJ3Kgzs/WoeCBjq/vCBGyUtpVFiNdDwIods7PqoWAFx6lq4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680906064; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=vVNQrCByaOWw7Wa8Wet9Ho709Yd0idOoSRVREWjimoY=; b=T4zicH1KvEFXuErg/lmML3Ny2w6iP4TOycjlaVOJ9wn4GvEU4Vpo5VlGNrLCwP3XemG/wki4xwf++C8seVv5MdgRiKT5WLszmocNw7Upq1YunTr0WyPCvNpdUvWfPgIuWhQK5U88I1jmjE3lAf7aYVYn/+trNj5we5zxOQj6hiQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+102731+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1680906064586945.4072207912301; Fri, 7 Apr 2023 15:21:04 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id hSnZYY1788612xbRLIuJJ7Z3; Fri, 07 Apr 2023 15:21:04 -0700 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web10.2854.1680906059556530823 for ; Fri, 07 Apr 2023 15:21:03 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10673"; a="343085663" X-IronPort-AV: E=Sophos;i="5.98,328,1673942400"; d="scan'208";a="343085663" X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2023 15:21:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10673"; a="690177477" X-IronPort-AV: E=Sophos;i="5.98,328,1673942400"; d="scan'208";a="690177477" X-Received: from mdkinney-mobl2.amr.corp.intel.com ([10.209.18.108]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2023 15:21:02 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Chris Johnson , Jiewen Yao , Jian J Wang , Oliver Smith-Denny Subject: [edk2-devel] [Patch v3 07/12] SecurityPkg: Add gmock example Date: Fri, 7 Apr 2023 15:20:45 -0700 Message-Id: <20230407222051.1095-8-michael.d.kinney@intel.com> In-Reply-To: <20230407222051.1095-1-michael.d.kinney@intel.com> References: <20230407222051.1095-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com X-Gm-Message-State: 9w2b8wZFjMFOz1vf3dMII7T8x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1680906064; bh=LK9tu6zb2NKJPLdnWAa1srtp9e8qjgzvUtvGqmumcrc=; h=Cc:Date:From:Reply-To:Subject:To; b=BHpo2VSRAG6dFW82ZJu/NzlMBAi4tP5uNTJlAgN1J53YvprjQ7JFQP3F0MdAv+NU3Sz hTXBP/UQF1t8qZUbXbPe86j0oGN0vL4o9ZWJijDy/fm8pHYfzSsmronEBL4jemHgvCyJT OWR0WVoGJZlUtX0euiR0n0ziKkyMHXTrQaw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1680906066115100035 Content-Type: text/plain; charset="utf-8" From: Chris Johnson REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4389 Cc: Jiewen Yao Cc: Jian J Wang Signed-off-by: Chris Johnson Acked-by: Jiewen Yao Reviewed-by: Oliver Smith-Denny Reviewed-by: Michael D Kinney --- .../SecureBootVariableLibGoogleTest.cpp | 174 ++++++++++++++++++ .../SecureBootVariableLibGoogleTest.inf | 32 ++++ .../UnitTest/MockPlatformPKProtectionLib.inf | 4 +- .../UnitTest/MockUefiLib.inf | 4 +- .../MockUefiRuntimeServicesTableLib.inf | 4 +- .../UnitTest/SecureBootVariableLibUnitTest.c | 2 +- SecurityPkg/SecurityPkg.dec | 1 + .../Library/MockPlatformPKProtectionLib.h | 28 +++ .../MockPlatformPKProtectionLib.cpp | 11 ++ .../MockPlatformPKProtectionLib.inf | 34 ++++ SecurityPkg/Test/SecurityPkgHostTest.dsc | 8 + 11 files changed, 295 insertions(+), 7 deletions(-) create mode 100644 SecurityPkg/Library/SecureBootVariableLib/GoogleTest/Se= cureBootVariableLibGoogleTest.cpp create mode 100644 SecurityPkg/Library/SecureBootVariableLib/GoogleTest/Se= cureBootVariableLibGoogleTest.inf create mode 100644 SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPl= atformPKProtectionLib.h create mode 100644 SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPK= ProtectionLib/MockPlatformPKProtectionLib.cpp create mode 100644 SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPK= ProtectionLib/MockPlatformPKProtectionLib.inf diff --git a/SecurityPkg/Library/SecureBootVariableLib/GoogleTest/SecureBoo= tVariableLibGoogleTest.cpp b/SecurityPkg/Library/SecureBootVariableLib/Goog= leTest/SecureBootVariableLibGoogleTest.cpp new file mode 100644 index 000000000000..c9190c8ffd61 --- /dev/null +++ b/SecurityPkg/Library/SecureBootVariableLib/GoogleTest/SecureBootVariab= leLibGoogleTest.cpp @@ -0,0 +1,174 @@ +/** @file + Unit tests for the implementation of SecureBootVariableLib. + + Copyright (c) 2022, Intel Corporation. All rights reserved. + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#include +#include +#include + +extern "C" { + #include + #include + #include + #include + #include + #include +} + +using namespace testing; + +//////////////////////////////////////////////////////////////////////////= //// +class SetSecureBootModeTest : public Test { + protected: + MockUefiRuntimeServicesTableLib RtServicesMock; + UINT8 SecureBootMode; + EFI_STATUS Status; + + void SetUp() override { + // Any random magic number can be used for these tests + SecureBootMode =3D 0xAB; + } +}; + +// Test SetSecureBootMode() API from SecureBootVariableLib to verify the +// expected error is returned when the call to gRT->SetVariable() fails. +TEST_F(SetSecureBootModeTest, SetVarError) { + EXPECT_CALL(RtServicesMock, gRT_SetVariable) + .WillOnce(Return(EFI_INVALID_PARAMETER)); + + Status =3D SetSecureBootMode(SecureBootMode); + EXPECT_EQ(Status, EFI_INVALID_PARAMETER); +} + +// Test SetSecureBootMode() API from SecureBootVariableLib to verify the +// expected secure boot mode is written to the correct variable in the call +// to gRT->SetVariable(). +TEST_F(SetSecureBootModeTest, PropogateModeToSetVar) { + EXPECT_CALL(RtServicesMock, + gRT_SetVariable( + Char16StrEq(EFI_CUSTOM_MODE_NAME), + BufferEq(&gEfiCustomModeEnableGuid, sizeof(EFI_GUID)), + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS, + sizeof(SecureBootMode), + BufferEq(&SecureBootMode, sizeof(SecureBootMode)))) + .WillOnce(Return(EFI_SUCCESS)); + + Status =3D SetSecureBootMode(SecureBootMode); + EXPECT_EQ(Status, EFI_SUCCESS); +} + +//////////////////////////////////////////////////////////////////////////= //// +class GetSetupModeTest : public Test { + protected: + MockUefiRuntimeServicesTableLib RtServicesMock; + UINT8 SetupMode; + EFI_STATUS Status; + UINT8 ExpSetupMode; + + void SetUp() override { + // Any random magic number can be used for these tests + ExpSetupMode =3D 0xAB; + } +}; + +// Test GetSetupMode() API from SecureBootVariableLib to verify the expect= ed +// error is returned when the call to gRT->GetVariable() fails. +TEST_F(GetSetupModeTest, GetVarError) { + EXPECT_CALL(RtServicesMock, gRT_GetVariable) + .WillOnce(Return(EFI_INVALID_PARAMETER)); + + Status =3D GetSetupMode (&SetupMode); + EXPECT_EQ(Status, EFI_INVALID_PARAMETER); +} + +// Test GetSetupMode() API from SecureBootVariableLib to verify the expect= ed +// setup mode is returned (and with a success return code) when the mode is +// successfully read from the call to gRT->GetVariable(). +TEST_F(GetSetupModeTest, FetchModeFromGetVar) { + EXPECT_CALL(RtServicesMock, + gRT_GetVariable( + Char16StrEq(EFI_SETUP_MODE_NAME), + BufferEq(&gEfiGlobalVariableGuid, sizeof(EFI_GUID)), + _, + Pointee(Eq(sizeof(SetupMode))), + NotNull())) + .WillOnce(DoAll( + SetArgPointee<3>(sizeof(ExpSetupMode)), + SetArgBuffer<4>(&ExpSetupMode, sizeof(ExpSetupMode)), + Return(EFI_SUCCESS))); + + Status =3D GetSetupMode (&SetupMode); + ASSERT_EQ(Status, EFI_SUCCESS); + EXPECT_EQ(SetupMode, ExpSetupMode); +} + +//////////////////////////////////////////////////////////////////////////= //// +class IsSecureBootEnabledTest : public Test { + protected: + MockUefiLib UefiLibMock; + BOOLEAN Enabled; +}; + +// Test IsSecureBootEnabled() API from SecureBootVariableLib to verify FAL= SE +// is returned when the call to GetEfiGlobalVariable2() fails. +TEST_F(IsSecureBootEnabledTest, GetVarError) { + EXPECT_CALL(UefiLibMock, GetEfiGlobalVariable2) + .WillOnce(Return(EFI_ABORTED)); + + Enabled =3D IsSecureBootEnabled (); + EXPECT_EQ(Enabled, FALSE); +} + +//////////////////////////////////////////////////////////////////////////= //// +class IsSecureBootEnabledAllocTest : public IsSecureBootEnabledTest { + protected: + UINT8 *BootEnabledBuffer; + + void SetUp() override { + BootEnabledBuffer =3D (UINT8*) AllocatePool(1); + ASSERT_NE(BootEnabledBuffer, nullptr); + } +}; + +// Test IsSecureBootEnabled() API from SecureBootVariableLib to verify TRUE +// is returned when the call to GetEfiGlobalVariable2() is successful and +// returns SECURE_BOOT_MODE_ENABLE. +TEST_F(IsSecureBootEnabledAllocTest, IsEnabled) { + *BootEnabledBuffer =3D SECURE_BOOT_MODE_ENABLE; + EXPECT_CALL(UefiLibMock, + GetEfiGlobalVariable2( + Char16StrEq(EFI_SECURE_BOOT_MODE_NAME), + NotNull(), + _)) + .WillOnce(DoAll( + SetArgBuffer<1>(&BootEnabledBuffer, sizeof(VOID*)), + Return(EFI_SUCCESS))); + + Enabled =3D IsSecureBootEnabled (); + EXPECT_EQ(Enabled, TRUE); +} + +// Test IsSecureBootEnabled() API from SecureBootVariableLib to verify FAL= SE +// is returned when the call to GetEfiGlobalVariable2() is successful and +// returns SECURE_BOOT_MODE_DISABLE. +TEST_F(IsSecureBootEnabledAllocTest, IsDisabled) { + *BootEnabledBuffer =3D SECURE_BOOT_MODE_DISABLE; + EXPECT_CALL(UefiLibMock, + GetEfiGlobalVariable2( + Char16StrEq(EFI_SECURE_BOOT_MODE_NAME), + NotNull(), + _)) + .WillOnce(DoAll( + SetArgBuffer<1>(&BootEnabledBuffer, sizeof(VOID*)), + Return(EFI_SUCCESS))); + + Enabled =3D IsSecureBootEnabled (); + EXPECT_EQ(Enabled, FALSE); +} + +int main(int argc, char* argv[]) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/SecurityPkg/Library/SecureBootVariableLib/GoogleTest/SecureBoo= tVariableLibGoogleTest.inf b/SecurityPkg/Library/SecureBootVariableLib/Goog= leTest/SecureBootVariableLibGoogleTest.inf new file mode 100644 index 000000000000..5503dcfa32d1 --- /dev/null +++ b/SecurityPkg/Library/SecureBootVariableLib/GoogleTest/SecureBootVariab= leLibGoogleTest.inf @@ -0,0 +1,32 @@ +## @file +# Unit test suite for the SecureBootVariableLib using Google Test +# +# Copyright (c) 2022, Intel Corporation. All rights reserved. +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + INF_VERSION =3D 0x00010017 + BASE_NAME =3D SecureBootVariableLibGoogleTest + FILE_GUID =3D C88372AB-726B-4344-A250-6C7F826C874E + VERSION_STRING =3D 1.0 + MODULE_TYPE =3D HOST_APPLICATION + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 +# + +[Sources] + SecureBootVariableLibGoogleTest.cpp + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + SecurityPkg/SecurityPkg.dec + UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec + +[LibraryClasses] + GoogleTestLib + SecureBootVariableLib diff --git a/SecurityPkg/Library/SecureBootVariableLib/UnitTest/MockPlatfor= mPKProtectionLib.inf b/SecurityPkg/Library/SecureBootVariableLib/UnitTest/M= ockPlatformPKProtectionLib.inf index 1e19033c5a91..c927ef709958 100644 --- a/SecurityPkg/Library/SecureBootVariableLib/UnitTest/MockPlatformPKProt= ectionLib.inf +++ b/SecurityPkg/Library/SecureBootVariableLib/UnitTest/MockPlatformPKProt= ectionLib.inf @@ -10,9 +10,9 @@ [Defines] INF_VERSION =3D 0x00010005 BASE_NAME =3D MockPlatformPKProtectionLib FILE_GUID =3D 5FCD74D3-3965-4D56-AB83-000B9B4806A0 - MODULE_TYPE =3D DXE_DRIVER + MODULE_TYPE =3D HOST_APPLICATION VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D PlatformPKProtectionLib|HOST_APPLICAT= ION + LIBRARY_CLASS =3D PlatformPKProtectionLib =20 # # The following information is for reference only and not required by the = build tools. diff --git a/SecurityPkg/Library/SecureBootVariableLib/UnitTest/MockUefiLib= .inf b/SecurityPkg/Library/SecureBootVariableLib/UnitTest/MockUefiLib.inf index a84242ac7205..fecf46841131 100644 --- a/SecurityPkg/Library/SecureBootVariableLib/UnitTest/MockUefiLib.inf +++ b/SecurityPkg/Library/SecureBootVariableLib/UnitTest/MockUefiLib.inf @@ -18,9 +18,9 @@ [Defines] INF_VERSION =3D 0x00010005 BASE_NAME =3D MockUefiLib FILE_GUID =3D E3B7AEF9-4E55-49AF-B035-ED776C928EC6 - MODULE_TYPE =3D UEFI_DRIVER + MODULE_TYPE =3D HOST_APPLICATION VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D UefiLib|HOST_APPLICATION + LIBRARY_CLASS =3D UefiLib =20 # # VALID_ARCHITECTURES =3D IA32 X64 EBC diff --git a/SecurityPkg/Library/SecureBootVariableLib/UnitTest/MockUefiRun= timeServicesTableLib.inf b/SecurityPkg/Library/SecureBootVariableLib/UnitTe= st/MockUefiRuntimeServicesTableLib.inf index f832a93e2254..6fe04189606e 100644 --- a/SecurityPkg/Library/SecureBootVariableLib/UnitTest/MockUefiRuntimeSer= vicesTableLib.inf +++ b/SecurityPkg/Library/SecureBootVariableLib/UnitTest/MockUefiRuntimeSer= vicesTableLib.inf @@ -10,9 +10,9 @@ [Defines] INF_VERSION =3D 0x00010005 BASE_NAME =3D MockUefiRuntimeServicesTableLib FILE_GUID =3D 84CE0021-ABEE-403C-9A1B-763CCF2D40F1 - MODULE_TYPE =3D UEFI_DRIVER + MODULE_TYPE =3D HOST_APPLICATION VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D UefiRuntimeServicesTableLib|HOST_APPL= ICATION + LIBRARY_CLASS =3D UefiRuntimeServicesTableLib =20 # # VALID_ARCHITECTURES =3D IA32 X64 EBC diff --git a/SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootV= ariableLibUnitTest.c b/SecurityPkg/Library/SecureBootVariableLib/UnitTest/S= ecureBootVariableLibUnitTest.c index a23135dfb016..3a92d5d83457 100644 --- a/SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariable= LibUnitTest.c +++ b/SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariable= LibUnitTest.c @@ -163,7 +163,7 @@ MockGetVariable ( return EFI_BUFFER_TOO_SMALL; } else { assert_non_null (Data); - CopyMem (Data, (VOID *)mock (), TargetSize); + CopyMem (Data, (VOID *)(UINTN)mock (), TargetSize); } =20 return EFI_SUCCESS; diff --git a/SecurityPkg/SecurityPkg.dec b/SecurityPkg/SecurityPkg.dec index 0382090f4e75..0a8042d63fe1 100644 --- a/SecurityPkg/SecurityPkg.dec +++ b/SecurityPkg/SecurityPkg.dec @@ -21,6 +21,7 @@ [Defines] =20 [Includes] Include + Test/Mock/Include =20 [LibraryClasses] ## @libraryclass Provides hash interfaces from different implementatio= ns. diff --git a/SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPlatformP= KProtectionLib.h b/SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPla= tformPKProtectionLib.h new file mode 100644 index 000000000000..8024f4be2975 --- /dev/null +++ b/SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPlatformPKProtec= tionLib.h @@ -0,0 +1,28 @@ +/** @file + Google Test mocks for PlatformPKProtectionLib + + Copyright (c) 2022, Intel Corporation. All rights reserved. + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef MOCK_PLATFORM_PK_PROTECTION_LIB_H_ +#define MOCK_PLATFORM_PK_PROTECTION_LIB_H_ + +#include +#include +extern "C" { +#include +#include +} + +struct MockPlatformPKProtectionLib { + MOCK_INTERFACE_DECLARATION (MockPlatformPKProtectionLib); + + MOCK_FUNCTION_DECLARATION ( + EFI_STATUS, + DisablePKProtection, + () + ); +}; + +#endif diff --git a/SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtect= ionLib/MockPlatformPKProtectionLib.cpp b/SecurityPkg/Test/Mock/Library/Goog= leTest/MockPlatformPKProtectionLib/MockPlatformPKProtectionLib.cpp new file mode 100644 index 000000000000..5ea030f6dfcf --- /dev/null +++ b/SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/= MockPlatformPKProtectionLib.cpp @@ -0,0 +1,11 @@ +/** @file + Google Test mocks for PlatformPKProtectionLib + + Copyright (c) 2022, Intel Corporation. All rights reserved. + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#include + +MOCK_INTERFACE_DEFINITION(MockPlatformPKProtectionLib); + +MOCK_FUNCTION_DEFINITION(MockPlatformPKProtectionLib, DisablePKProtection,= 0, EFIAPI); diff --git a/SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtect= ionLib/MockPlatformPKProtectionLib.inf b/SecurityPkg/Test/Mock/Library/Goog= leTest/MockPlatformPKProtectionLib/MockPlatformPKProtectionLib.inf new file mode 100644 index 000000000000..3ed638eaf74c --- /dev/null +++ b/SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/= MockPlatformPKProtectionLib.inf @@ -0,0 +1,34 @@ +## @file +# Google Test mocks for PlatformPKProtectionLib +# +# Copyright (c) 2022, Intel Corporation. All rights reserved. +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D MockPlatformPKProtectionLib + FILE_GUID =3D C1383D85-E0ED-44E0-A0A6-125F1D78B6E9 + MODULE_TYPE =3D HOST_APPLICATION + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D PlatformPKProtectionLib + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 +# + +[Sources] + MockPlatformPKProtectionLib.cpp + +[Packages] + MdePkg/MdePkg.dec + SecurityPkg/SecurityPkg.dec + UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec + +[LibraryClasses] + GoogleTestLib + +[BuildOptions] + MSFT:*_*_*_CC_FLAGS =3D /EHsc diff --git a/SecurityPkg/Test/SecurityPkgHostTest.dsc b/SecurityPkg/Test/Se= curityPkgHostTest.dsc index c4df01fe1b73..ad5b4fc350ea 100644 --- a/SecurityPkg/Test/SecurityPkgHostTest.dsc +++ b/SecurityPkg/Test/SecurityPkgHostTest.dsc @@ -25,6 +25,7 @@ [Components] SecurityPkg/Library/SecureBootVariableLib/UnitTest/MockUefiRuntimeServic= esTableLib.inf SecurityPkg/Library/SecureBootVariableLib/UnitTest/MockPlatformPKProtect= ionLib.inf SecurityPkg/Library/SecureBootVariableLib/UnitTest/MockUefiLib.inf + SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/Moc= kPlatformPKProtectionLib.inf =20 # # Build SecurityPkg HOST_APPLICATION Tests @@ -36,3 +37,10 @@ [Components] PlatformPKProtectionLib|SecurityPkg/Library/SecureBootVariableLib/Un= itTest/MockPlatformPKProtectionLib.inf UefiLib|SecurityPkg/Library/SecureBootVariableLib/UnitTest/MockUefiL= ib.inf } + SecurityPkg/Library/SecureBootVariableLib/GoogleTest/SecureBootVariableL= ibGoogleTest.inf { + + SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/Secu= reBootVariableLib.inf + UefiRuntimeServicesTableLib|MdePkg/Test/Mock/Library/GoogleTest/Mock= UefiRuntimeServicesTableLib/MockUefiRuntimeServicesTableLib.inf + PlatformPKProtectionLib|SecurityPkg/Test/Mock/Library/GoogleTest/Moc= kPlatformPKProtectionLib/MockPlatformPKProtectionLib.inf + UefiLib|MdePkg/Test/Mock/Library/GoogleTest/MockUefiLib/MockUefiLib.= inf + } --=20 2.39.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#102731): https://edk2.groups.io/g/devel/message/102731 Mute This Topic: https://groups.io/mt/98134499/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076= /xyzzy [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-