From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: microchip.com, ip: 216.71.154.253, mailfrom: shrishail.patil@microchip.com) Received: from esa6.microchip.iphmx.com (esa6.microchip.iphmx.com [216.71.154.253]) by groups.io with SMTP; Thu, 01 Aug 2019 00:04:52 -0700 Received-SPF: Pass (esa6.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=esa6.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 (esa6.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Shrishail.Patil@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa6.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: d15cof39RicF0BVZaV+Rw2728PVGbDvWRyovjIftlwTrPuApKFu4zz9KvJYkQmGNBJPNHzlpmI dsyTZA8i9Eh6cpUYAqG2FiaVEcXEEIR6FvyiqEcnRwuPCSTtY9puULtFfVCpo9AJHLrCl45jna VD4jQxqmpBK1hefQkehB6GUcu5B7cQU+MuPZEBgpm/m/D/Btj8qSKFUY/A+GVLeU4Cu3e4PT8g CuISduQkdaATsJNzMmunWwWuqJL4EMa7jig+u8h6Q2/kdNIv4+6+NeEtmv7T62zBnF/ggpsRHA gSg= X-IronPort-AV: E=Sophos;i="5.64,333,1559545200"; d="scan'208";a="40555315" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 01 Aug 2019 00:04:51 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 1 Aug 2019 00:04:50 -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; Thu, 1 Aug 2019 00:04:43 -0700 From: "shrishail" To: CC: , , , Shrishail Patil , shrishail patil Subject: [edk2-test][PATCH V2 1/3] Adding HII Config Access Protocol Date: Thu, 1 Aug 2019 12:33:22 +0530 Message-ID: <20190801070326.1852-2-shrishail.patil@microchip.com> X-Mailer: git-send-email 2.22.0.windows.1 In-Reply-To: <20190801070326.1852-1-shrishail.patil@microchip.com> References: <20190801070326.1852-1-shrishail.patil@microchip.com> MIME-Version: 1.0 Return-Path: shrishail.patil@microchip.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Shrishail Patil =0D Adding HII Config Access Protocol to IHVSCT=0D This patch contains source code which is copied from =0D UEFISCT and added into IHVSCT.=0D Contributed-under: TianoCore Contribution Agreement 1.1=0D Signed-off-by: shrishail patil =0D ---=0D .../HIIConfigAccess/BlackBoxTest/Guid.c | 46 +=0D .../HIIConfigAccess/BlackBoxTest/Guid.h | 109 +++=0D .../HIIConfigAccessBBTestConformance.c | 908 ++++++++++++++++++=0D .../HIIConfigAccessBBTestFunction.c | 606 ++++++++++++=0D .../BlackBoxTest/HIIConfigAccessBBTestMain.c | 655 +++++++++++++=0D .../BlackBoxTest/HIIConfigAccessBBTestMain.h | 168 ++++=0D .../BlackBoxTest/IhvHIIConfigAccessBBTest.inf | 55 ++=0D 7 files changed, 2547 insertions(+)=0D create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/=0D HIIConfigAccess/BlackBoxTest/Guid.c=0D create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/=0D HIIConfigAccess/BlackBoxTest/Guid.h=0D create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/=0D HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestConformance.c=0D create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/=0D HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestFunction.c=0D create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/=0D HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestMain.c=0D create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/=0D HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestMain.h=0D create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/=0D HIIConfigAccess/BlackBoxTest/IhvHIIConfigAccessBBTest.inf=0D =0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/Bla= ckBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAcce= ss/BlackBoxTest/Guid.c=0D new file mode 100644=0D index 00000000..6a6d4e60=0D --- /dev/null=0D +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxTe= st/Guid.c=0D @@ -0,0 +1,46 @@=0D +/** @file=0D +=0D + Copyright 2006 - 2012 Unified EFI, Inc.
=0D + Copyright (c) 2010 - 2012, Intel Corporation. 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 "HIIConfigAccessBBTestMain.h"=0D +=0D +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid001=3DEFI_TEST_HIIC= ONFIGACCESSBBTESTCONFORMANCE_ASSERTION_001_GUID;=0D +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid002=3DEFI_TEST_HIIC= ONFIGACCESSBBTESTCONFORMANCE_ASSERTION_002_GUID;=0D +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid003=3DEFI_TEST_HIIC= ONFIGACCESSBBTESTCONFORMANCE_ASSERTION_003_GUID;=0D +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid004=3DEFI_TEST_HIIC= ONFIGACCESSBBTESTCONFORMANCE_ASSERTION_004_GUID;=0D +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid005=3DEFI_TEST_HIIC= ONFIGACCESSBBTESTCONFORMANCE_ASSERTION_005_GUID;=0D +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid006=3DEFI_TEST_HIIC= ONFIGACCESSBBTESTCONFORMANCE_ASSERTION_006_GUID;=0D +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid007=3DEFI_TEST_HIIC= ONFIGACCESSBBTESTCONFORMANCE_ASSERTION_007_GUID;=0D +/*=0D +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid008=3DEFI_TEST_HIIC= ONFIGACCESSBBTESTCONFORMANCE_ASSERTION_008_GUID;=0D +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid009=3DEFI_TEST_HIIC= ONFIGACCESSBBTESTCONFORMANCE_ASSERTION_009_GUID;=0D +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid0010=3DEFI_TEST_HII= CONFIGACCESSBBTESTCONFORMANCE_ASSERTION_0010_GUID;=0D +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid0011=3DEFI_TEST_HII= CONFIGACCESSBBTESTCONFORMANCE_ASSERTION_0011_GUID;=0D +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid0012=3DEFI_TEST_HII= CONFIGACCESSBBTESTCONFORMANCE_ASSERTION_0012_GUID;=0D +*/=0D +EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid001=3DEFI_TEST_HIICONF= IGACCESSBBTESTFUNCTION_ASSERTION_001_GUID;=0D +EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid002=3DEFI_TEST_HIICONF= IGACCESSBBTESTFUNCTION_ASSERTION_002_GUID;=0D +EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid003=3DEFI_TEST_HIICONF= IGACCESSBBTESTFUNCTION_ASSERTION_003_GUID;=0D +EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid004=3DEFI_TEST_HIICONF= IGACCESSBBTESTFUNCTION_ASSERTION_004_GUID;=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/Bla= ckBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAcce= ss/BlackBoxTest/Guid.h=0D new file mode 100644=0D index 00000000..b7003028=0D --- /dev/null=0D +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxTe= st/Guid.h=0D @@ -0,0 +1,109 @@=0D +/** @file=0D +=0D + Copyright 2006 - 2011 Unified EFI, Inc.
=0D + Copyright (c) 2010 - 2011, Intel Corporation. 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 +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_001_GUID \=0D +{ 0xa7173eb5, 0xf76a, 0x4ea1, { 0x95, 0xd, 0x14, 0x91, 0x1e, 0x49, 0x86, 0= xc1 } }=0D +=0D +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid001;=0D +=0D +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_002_GUID \=0D +{ 0xfa5973e2, 0xd05, 0x44c2, { 0xaf, 0x2d, 0x1b, 0x68, 0x33, 0x42, 0x6d, 0= x76 } }=0D +=0D +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid002;=0D +=0D +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_003_GUID \=0D +{ 0x6f6d1dd, 0x49b8, 0x488a, { 0xa7, 0x75, 0xde, 0xbc, 0xc7, 0x60, 0xfd, 0= x28 } }=0D +=0D +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid003;=0D +=0D +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_004_GUID \=0D +{ 0x28652613, 0x6bf4, 0x4f42, { 0xab, 0xe2, 0x84, 0x4f, 0x2f, 0x77, 0xec, = 0x2f } }=0D +=0D +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid004;=0D +=0D +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_005_GUID \=0D +{ 0xebba197a, 0x467f, 0x4736, { 0x92, 0xf2, 0x11, 0xb1, 0x91, 0x2e, 0xe9, = 0x90 } }=0D +=0D +=0D +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid005;=0D +=0D +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_006_GUID \=0D +{ 0x341fe3e0, 0xf688, 0x45f2, { 0x91, 0x56, 0xc7, 0xae, 0x9f, 0x2c, 0xcb, = 0xb0 } }=0D +=0D +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid006;=0D +=0D +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_007_GUID \=0D +{ 0x1f99ebc8, 0x253, 0x455f, { 0x88, 0xac, 0x9e, 0x2b, 0xa6, 0xdc, 0xd7, 0= x29 } }=0D +=0D +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid007;=0D +/*=0D +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_008_GUID \=0D +{ 0xbdec5b08, 0x423, 0x482b, { 0xb7, 0xdf, 0xde, 0xac, 0xab, 0xf7, 0x13, 0= x11 } }=0D +=0D +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid008;=0D +=0D +=0D +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_009_GUID \=0D +{ 0x5fed024d, 0x85f3, 0x45bf, { 0xbe, 0xb1, 0xe4, 0xf4, 0xcc, 0x86, 0xe5, = 0x61 } }=0D +=0D +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid009;=0D +=0D +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_0010_GUID \=0D +{ 0x22ee938e, 0xa9ad, 0x4cb9, { 0x8d, 0x6d, 0x6, 0xe4, 0xfa, 0xb3, 0x72, 0= xe7 } }=0D +=0D +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid0010;=0D +=0D +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_0011_GUID \=0D +{ 0x2053d3e0, 0xeebe, 0x4391, { 0x84, 0x7d, 0xf4, 0x60, 0x1b, 0x30, 0x4e, = 0x3 } }=0D +=0D +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid0011;=0D +=0D +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_0012_GUID \=0D +{ 0x81c5d7b7, 0x7ebe, 0x44e1, { 0x8a, 0x1f, 0xcc, 0x47, 0x9c, 0x2d, 0xfe, = 0x4f } }=0D +=0D +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid0012;=0D +*/=0D +=0D +#define EFI_TEST_HIICONFIGACCESSBBTESTFUNCTION_ASSERTION_001_GUID \=0D +{ 0x24dcf8bf, 0xbfbf, 0x4588, { 0xba, 0xf, 0x77, 0x1e, 0x24, 0x4e, 0x3e, 0= x8 } }=0D +=0D +extern EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid001;=0D +=0D +#define EFI_TEST_HIICONFIGACCESSBBTESTFUNCTION_ASSERTION_002_GUID \=0D +{ 0x961a5268, 0x1998, 0x4a7e, { 0x9d, 0x9d, 0xce, 0xdc, 0x67, 0xfb, 0xcc, = 0x77 } }=0D +=0D +extern EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid002;=0D +=0D +#define EFI_TEST_HIICONFIGACCESSBBTESTFUNCTION_ASSERTION_003_GUID \=0D +{ 0x603e52f0, 0x2ce3, 0x4e7a, { 0xa7, 0x2e, 0xdf, 0x8c, 0xa3, 0xfd, 0xb2, = 0xd } }=0D +=0D +extern EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid003;=0D +=0D +#define EFI_TEST_HIICONFIGACCESSBBTESTFUNCTION_ASSERTION_004_GUID \=0D +{ 0xab163674, 0x6c27, 0x4169, { 0xa6, 0xa9, 0xe1, 0x9c, 0x88, 0x14, 0x94, = 0x96 } }=0D +=0D +extern EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid004;=0D +=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/Bla= ckBoxTest/HIIConfigAccessBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEF= I/IHV/Protocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestConformanc= e.c=0D new file mode 100644=0D index 00000000..c8b35003=0D --- /dev/null=0D +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestConformance.c=0D @@ -0,0 +1,908 @@=0D +/** @file=0D +=0D + Copyright 2006 - 2016 Unified EFI, Inc.
=0D + Copyright (c) 2010 - 2016, Intel Corporation. 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 + HIIConfigAccessBBTestConformance.c=0D +=0D +Abstract:=0D + for EFI Driver HII Configuration Access Protocol's conformance Test=0D +=0D +--*/=0D +=0D +#include "HIIConfigAccessBBTestMain.h"=0D +=0D +EFI_BROWSER_ACTION EFI_BROWSER_ACTION_UNSUPPORTED =3D 2;=0D +=0D +EFI_STATUS=0D +BBTestExtractConfigConformanceTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + );=0D +=0D +EFI_STATUS=0D +BBTestExtractConfigConformanceTestCheckpoint2 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + );=0D +=0D +EFI_STATUS=0D +BBTestExtractConfigConformanceTestCheckpoint3 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + );=0D +=0D +EFI_STATUS=0D +BBTestExtractConfigConformanceTestCheckpoint4 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + );=0D +=0D +EFI_STATUS=0D +BBTestRouteConfigConformanceTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + );=0D +=0D +EFI_STATUS=0D +BBTestRouteConfigConformanceTestCheckpoint2 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + );=0D +=0D +EFI_STATUS=0D +BBTestRouteConfigConformanceTestCheckpoint3 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + );=0D +/*=0D +EFI_STATUS=0D +BBTestCallBackConformanceTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + );=0D +=0D +EFI_STATUS=0D +BBTestCallBackConformanceTestCheckpoint2 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + );=0D +=0D +EFI_STATUS=0D +BBTestCallBackConformanceTestCheckpoint3 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + );=0D +=0D +EFI_STATUS=0D +BBTestCallBackConformanceTestCheckpoint4 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + );=0D +*/=0D +=0D +EFI_STATUS=0D +BBTestExtractConfigConformanceTest (=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_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess;=0D + EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting;=0D +=0D + //=0D + // init=0D + //=0D + HIIConfigAccess =3D (EFI_HII_CONFIG_ACCESS_PROTOCOL*)ClientInterface;=0D +=0D + //=0D + // Get the Standard Library Interface=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 + // Get the Config Routing Protocol Interface=0D + //=0D + Status =3D GetHIIConfigRoutingInterface( &HIIConfigRouting );=0D + if ( EFI_ERROR(Status) ) {=0D + return Status;=0D + }=0D +=0D + //=0D + //Call check points=0D + //=0D + BBTestExtractConfigConformanceTestCheckpoint1( StandardLib, HIIConfigAcc= ess );=0D + BBTestExtractConfigConformanceTestCheckpoint2( StandardLib, HIIConfigRou= ting, HIIConfigAccess );=0D + BBTestExtractConfigConformanceTestCheckpoint3( StandardLib, HIIConfigRou= ting, HIIConfigAccess );=0D + BBTestExtractConfigConformanceTestCheckpoint4( StandardLib, HIIConfigAcc= ess );=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +EFI_STATUS=0D +BBTestRouteConfigConformanceTest (=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_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess;=0D + EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting;=0D +=0D + //=0D + // init=0D + //=0D + HIIConfigAccess =3D (EFI_HII_CONFIG_ACCESS_PROTOCOL*)ClientInterface;=0D +=0D + //=0D + // Get the Standard Library Interface=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 + // Get the Config Routing Protocol Interface=0D + //=0D + Status =3D GetHIIConfigRoutingInterface( &HIIConfigRouting );=0D + if ( EFI_ERROR(Status) ) {=0D + return Status;=0D + }=0D +=0D + //=0D + //Call check points=0D + //=0D + BBTestRouteConfigConformanceTestCheckpoint1( StandardLib, HIIConfigAcces= s );=0D + BBTestRouteConfigConformanceTestCheckpoint2( StandardLib, HIIConfigRouti= ng, HIIConfigAccess );=0D + BBTestRouteConfigConformanceTestCheckpoint3( StandardLib, HIIConfigAcces= s );=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +/*=0D +EFI_STATUS=0D +BBTestCallBackConformanceTest (=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_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess;=0D +=0D + //=0D + // init=0D + //=0D + HIIConfigAccess =3D (EFI_HII_CONFIG_ACCESS_PROTOCOL*)ClientInterface;=0D +=0D + //=0D + // Get the Standard Library Interface=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 points=0D + //=0D + BBTestCallBackConformanceTestCheckpoint1( StandardLib, HIIConfigAccess )= ;=0D + BBTestCallBackConformanceTestCheckpoint2( StandardLib, HIIConfigAccess )= ;=0D + BBTestCallBackConformanceTestCheckpoint3( StandardLib, HIIConfigAccess )= ;=0D + BBTestCallBackConformanceTestCheckpoint4( StandardLib, HIIConfigAccess )= ;=0D +=0D + return EFI_SUCCESS;=0D +}=0D +*/=0D +=0D +//=0D +//Check Points=0D +//=0D +=0D +EFI_STATUS=0D +BBTestExtractConfigConformanceTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D +=0D + EFI_STRING Progress =3D NULL;=0D + EFI_STRING Results =3D NULL;=0D + EFI_STRING ResultsPtr =3D NULL;=0D + UINTN Len =3D 0;=0D + CHAR16* Pointer =3D NULL;=0D + UINT8 IfMulti =3D 0;=0D +=0D + EFI_STRING Request =3D NULL;=0D + //=0D + // Call ExtractConfig with Request been =0D + //=0D + Status =3D HIIConfigAccess->ExtractConfig (=0D + HIIConfigAccess,=0D + NULL,=0D + &Progress,=0D + &Results=0D + );=0D +=0D + if ( Status =3D=3D EFI_SUCCESS ) {=0D + Len =3D SctStrLen (Results);=0D + //=0D + // Make sure the size of Request is enough to hold =0D + // if original Results is not Multi=0D + //=0D + Request =3D (EFI_STRING) SctAllocateZeroPool ( 2 * Len + 2 + 256);=0D + if (Request =3D=3D NULL) {=0D + SctFreePool (Results);=0D + return EFI_OUT_OF_RESOURCES;=0D + }=0D + } else {=0D + return Status;=0D + }=0D +=0D + Status =3D MultiAltRespToMultiReq (Results, Request);=0D + ResultsPtr =3D Request;=0D +=0D + SctFreePool (Results);=0D + Results =3D NULL;=0D +=0D + if ( SctStrStr (Request, L"GUID=3D") !=3D NULL ) {=0D + Pointer =3D SctStrStr (Request, L"GUID=3D");=0D + Pointer++;=0D + if ( SctStrStr (Pointer, L"GUID=3D") !=3D NULL )=0D + IfMulti =3D 1;=0D + }=0D +=0D + if ( IfMulti =3D=3D 0 ) {=0D + SctStrCat ( Request, L"&GUID=3D970eb94aa0d449f7b980bdaa47d42527&NAME= =3D006a0069006e0039&PATH=3D000acf&grag&star");=0D + }=0D +=0D + Status =3D HIIConfigAccess->ExtractConfig (=0D + HIIConfigAccess,=0D + Request,=0D + &Progress,=0D + &Results=0D + );=0D +=0D + if ( (EFI_INVALID_PARAMETER !=3D Status) || (SctStrnCmp (Progress, L"&GU= ID=3D", 6) !=3D 0) ) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + }=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + gHIIConfigAccessBBTestConformanceAssertionGuid001,=0D + L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig - ExtractConfi= g() returns EFI_INVALID_PARAMETER with Request been .",= =0D + L"%a:%d: Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D + SctFreePool (Request);=0D + return EFI_SUCCESS;=0D +}=0D +=0D +EFI_STATUS=0D +BBTestExtractConfigConformanceTestCheckpoint2 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D +=0D + EFI_STRING Request =3D NULL;=0D + EFI_STRING Results =3D NULL;=0D + EFI_STRING MultiConfigAltResp =3D NULL;=0D + EFI_STRING DevicePath =3D NULL;=0D +=0D + //init the Request=0D + Status =3D HIIConfigRouting->ExportConfig(=0D + HIIConfigRouting,=0D + &MultiConfigAltResp=0D + );=0D + if (EFI_ERROR(Status)) {=0D + return Status;=0D + }=0D +=0D + Status =3D GetDevicePath ( HIIConfigAccess, &DevicePath );=0D + if (EFI_ERROR(Status)) {=0D + gtBS->FreePool (MultiConfigAltResp);=0D + return Status;=0D + }=0D +=0D + Request =3D (EFI_STRING) SctAllocateZeroPool ( 2 * SctStrLen (MultiConfi= gAltResp) + 2 );=0D + if (Request =3D=3D NULL) {=0D + gtBS->FreePool (MultiConfigAltResp);=0D + gtBS->FreePool (DevicePath);=0D + return EFI_OUT_OF_RESOURCES;=0D + }=0D +=0D + Status =3D GetCorrespondingRequest (MultiConfigAltResp, DevicePath, Requ= est);=0D + if (EFI_ERROR(Status)) {=0D + gtBS->FreePool (MultiConfigAltResp);=0D + gtBS->FreePool (DevicePath);=0D + gtBS->FreePool (Request);=0D + return Status;=0D + }=0D +=0D + //=0D + // Call ExtractConfig with Progress been NULL=0D + //=0D + Status =3D HIIConfigAccess->ExtractConfig (=0D + HIIConfigAccess,=0D + Request,=0D + NULL,=0D + &Results=0D + );=0D +=0D + if ( EFI_INVALID_PARAMETER !=3D Status ) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + }=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + gHIIConfigAccessBBTestConformanceAssertionGuid002,=0D + L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig - ExtractConfi= g() returns EFI_INVALID_PARAMETER with Progress been NULL.",=0D + L"%a:%d: Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + gtBS->FreePool (MultiConfigAltResp);=0D + gtBS->FreePool (DevicePath);=0D + gtBS->FreePool (Request);=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +EFI_STATUS=0D +BBTestExtractConfigConformanceTestCheckpoint3 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D +=0D + EFI_STRING Request =3D NULL;=0D + EFI_STRING Progress =3D NULL;=0D + EFI_STRING MultiConfigAltResp =3D NULL;=0D + EFI_STRING DevicePath =3D NULL;=0D +=0D + //init the Request=0D + Status =3D HIIConfigRouting->ExportConfig(=0D + HIIConfigRouting,=0D + &MultiConfigAltResp=0D + );=0D + if (EFI_ERROR(Status)) {=0D + return Status;=0D + }=0D +=0D + Status =3D GetDevicePath ( HIIConfigAccess, &DevicePath );=0D + if (EFI_ERROR(Status)) {=0D + gtBS->FreePool (MultiConfigAltResp);=0D + return Status;=0D + }=0D +=0D + Request =3D (EFI_STRING) SctAllocateZeroPool ( 2 * SctStrLen (MultiConfi= gAltResp) + 2 );=0D + if (Request =3D=3D NULL) {=0D + gtBS->FreePool (MultiConfigAltResp);=0D + gtBS->FreePool (DevicePath);=0D + return EFI_OUT_OF_RESOURCES;=0D + }=0D +=0D + Status =3D GetCorrespondingRequest (MultiConfigAltResp, DevicePath, Requ= est);=0D + if (EFI_ERROR(Status)) {=0D + gtBS->FreePool (MultiConfigAltResp);=0D + gtBS->FreePool (DevicePath);=0D + gtBS->FreePool (Request);=0D + return Status;=0D + }=0D + //=0D + // Call ExtractConfig with Results been NULL=0D + //=0D + Status =3D HIIConfigAccess->ExtractConfig (=0D + HIIConfigAccess,=0D + Request,=0D + &Progress,=0D + NULL=0D + );=0D +=0D + if ( EFI_INVALID_PARAMETER !=3D Status ) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + }=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + gHIIConfigAccessBBTestConformanceAssertionGuid003,=0D + L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig - ExtractConfi= g() returns EFI_INVALID_PARAMETER with Results been NULL.",=0D + L"%a:%d: Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + gtBS->FreePool (MultiConfigAltResp);=0D + gtBS->FreePool (DevicePath);=0D + gtBS->FreePool (Request);=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +=0D +EFI_STATUS=0D +BBTestExtractConfigConformanceTestCheckpoint4 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D +=0D + EFI_STRING Request;=0D + EFI_STRING Progress =3D NULL;=0D + EFI_STRING Results =3D NULL;=0D +=0D + //init the Request=0D + Request =3D L"GUID=3D71e430fb2e8849779d7a33ef1139e7ed&NAME=3D006a0069006= e0039&PATH=3D000acf&Jack&Rons&Nash&Mary";=0D +=0D + //=0D + // Call ExtractConfig with unknown name=0D + //=0D + Status =3D HIIConfigAccess->ExtractConfig (=0D + HIIConfigAccess,=0D + Request,=0D + &Progress,=0D + &Results=0D + );=0D +=0D + if ( ((EFI_INVALID_PARAMETER =3D=3D Status) && (SctStrnCmp (Progress, L"= &Jack&Rons&Nash&Mary", 20) =3D=3D 0)) ||=0D + ((EFI_NOT_FOUND =3D=3D Status) && (Progress =3D=3D Request)) ) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + }=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + gHIIConfigAccessBBTestConformanceAssertionGuid004,=0D + L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig - ExtractConfig() re= turns EFI_INVALID_PARAMETER/EFI_NOT_FOUND with invalid input.",=0D + L"%a:%d: Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D + return EFI_SUCCESS;=0D + }=0D +=0D +=0D +EFI_STATUS=0D +BBTestRouteConfigConformanceTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D +=0D + EFI_STRING Progress =3D NULL;=0D +=0D +=0D + //=0D + // Call RouteConfig with Configuration been NULL=0D + //=0D + Status =3D HIIConfigAccess->RouteConfig (=0D + HIIConfigAccess,=0D + NULL,=0D + &Progress=0D + );=0D +=0D + if ( EFI_INVALID_PARAMETER !=3D Status ) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + }=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + gHIIConfigAccessBBTestConformanceAssertionGuid005,=0D + L"HII_CONFIG_ACCESS_PROTOCOL.RouteConfig - RouteConfig() return= s EFI_INVALID_PARAMETER with Configuration been NULL.",=0D + L"%a:%d: Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D + return EFI_SUCCESS;=0D + }=0D +=0D +EFI_STATUS=0D +BBTestRouteConfigConformanceTestCheckpoint2 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D +=0D + EFI_STRING Config =3D NULL;=0D + EFI_STRING MultiConfigAltResp =3D NULL;=0D + EFI_STRING DevicePath =3D NULL;=0D +=0D + //init the Request=0D + Status =3D HIIConfigRouting->ExportConfig(=0D + HIIConfigRouting,=0D + &MultiConfigAltResp=0D + );=0D + if (EFI_ERROR(Status)) {=0D + return Status;=0D + }=0D +=0D + Status =3D GetDevicePath ( HIIConfigAccess, &DevicePath );=0D + if (EFI_ERROR(Status)) {=0D + gtBS->FreePool (MultiConfigAltResp);=0D + return Status;=0D + }=0D +=0D + Config =3D (EFI_STRING) SctAllocateZeroPool ( 2 * SctStrLen (MultiConfig= AltResp) + 2 );=0D + if (Config =3D=3D NULL) {=0D + gtBS->FreePool (MultiConfigAltResp);=0D + gtBS->FreePool (DevicePath);=0D + return EFI_OUT_OF_RESOURCES;=0D + }=0D +=0D + Status =3D GetCorrespondingResp (MultiConfigAltResp, DevicePath, Config)= ;=0D + if (EFI_ERROR(Status)) {=0D + gtBS->FreePool (MultiConfigAltResp);=0D + gtBS->FreePool (DevicePath);=0D + gtBS->FreePool (Config);=0D + return Status;=0D + }=0D +=0D + //=0D + // Call RouteConfig with Progress been NULL=0D + //=0D + Status =3D HIIConfigAccess->RouteConfig (=0D + HIIConfigAccess,=0D + Config,=0D + NULL=0D + );=0D +=0D + if ( EFI_INVALID_PARAMETER !=3D Status ) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + }=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + gHIIConfigAccessBBTestConformanceAssertionGuid006,=0D + L"HII_CONFIG_ACCESS_PROTOCOL.RouteConfig - RouteConfig() = returns EFI_INVALID_PARAMETER with Progress been NULL.",=0D + L"%a:%d: Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + gtBS->FreePool (MultiConfigAltResp);=0D + gtBS->FreePool (DevicePath);=0D + gtBS->FreePool (Config);=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +EFI_STATUS=0D +BBTestRouteConfigConformanceTestCheckpoint3 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D +=0D + EFI_STRING Configuration;=0D + EFI_STRING Progress =3D NULL;=0D +=0D + //init the Configuration=0D + Configuration=3DL"GUID=3D71e430fb2e8849779d7a33ef1139e7ed&NAME=3D006a006= 9006e0039&PATH=3D0acf&OFFSET=3D2&WIDTH=3D3VALUE=3D45AF";=0D +=0D + //=0D + // Call RouteConfig with no found target for the routing data=0D + //=0D + Status =3D HIIConfigAccess->RouteConfig (=0D + HIIConfigAccess,=0D + Configuration,=0D + &Progress=0D + );=0D +=0D + if ( EFI_NOT_FOUND !=3D Status ) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + }=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + gHIIConfigAccessBBTestConformanceAssertionGuid007,=0D + L"HII_CONFIG_ACCESS_PROTOCOL.RouteConfig - RouteConfig() return= s EFI_NOT_FOUND with no found target for the routing data.",=0D + L"%a:%d: Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +/*=0D +EFI_STATUS=0D +BBTestCallBackConformanceTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D +=0D + EFI_QUESTION_ID QuestionId;=0D + UINT8 Type;=0D + EFI_IFR_TYPE_VALUE Value;=0D + EFI_BROWSER_ACTION_REQUEST ActionRequest;=0D +=0D + //init the parameter=0D + QuestionId=3D0x1234;=0D + Type=3DEFI_IFR_TYPE_NUM_SIZE_8;=0D +=0D +=0D + //=0D + // Call CallBack with the Action been NULL=0D + //=0D + Status =3D HIIConfigAccess->CallBack (=0D + HIIConfigAccess,=0D + NULL,=0D + QuestionId,=0D + Type,=0D + &Value,=0D + &ActionRequest=0D + );=0D +=0D + if ( EFI_INVALID_PARAMETER !=3D Status ) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D +=0D + //check the output ActionRequest=0D + if ((EFI_BROWSER_ACTION_REQUEST_NONE || EFI_BROWSER_ACTION_REQUEST_RESET= || EFI_BROWSER_ACTION_REQUEST_SUBMIT || EFI_BROWSER_ACTION_REQUEST_EXIT) != =3D ActionRequest)=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D +=0D + }=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + gHIIConfigAccessBBTestConformanceAssertionGuid009,=0D + L"HII_CONFIG_ACCESS_PROTOCOL.CallBack - CallBack() returns EFI_= INVALID_PARAMETER with Action been NULL .",=0D + L"%a:%d: Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D + return EFI_SUCCESS;=0D +=0D +}=0D +=0D +EFI_STATUS=0D +BBTestCallBackConformanceTestCheckpoint2 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D +=0D + EFI_BROWSER_ACTION *Action;=0D + EFI_QUESTION_ID QuestionId;=0D + UINT8 Type;=0D + EFI_IFR_TYPE_VALUE Value;=0D +=0D +=0D + //init the parameter=0D + Action=3DEFI_BROWSER_ACTION_REQUEST_CHANGING;=0D + QuestionId=3D0x1234;=0D + Type=3DEFI_IFR_TYPE_NUM_SIZE_8;=0D +=0D +=0D + //=0D + // Call CallBack with the ActionRequest been NULL=0D + //=0D + Status =3D HIIConfigAccess->CallBack (=0D + HIIConfigAccess,=0D + Action,=0D + QuestionId,=0D + Type,=0D + &Value,=0D + NULL=0D + );=0D +=0D + if ( EFI_INVALID_PARAMETER !=3D Status ) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D +=0D + }=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + gHIIConfigAccessBBTestConformanceAssertionGuid0010,=0D + L"HII_CONFIG_ACCESS_PROTOCOL.CallBack - CallBack() returns EFI_= INVALID_PARAMETER with QuestionId been NULL.",=0D + L"%a:%d: Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D + return EFI_SUCCESS;=0D +=0D +}=0D +=0D +EFI_STATUS=0D +BBTestCallBackConformanceTestCheckpoint3(=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D +=0D + EFI_BROWSER_ACTION *Action;=0D + EFI_QUESTION_ID QuestionId;=0D + UINT8 Type;=0D + EFI_BROWSER_ACTION_REQUEST ActionRequest;=0D +=0D + //init the parameter=0D + Action =3D EFI_BROWSER_ACTION_REQUEST_CHANGING;=0D + QuestionId =3D 0x1234;=0D + Type =3D EFI_IFR_TYPE_NUM_SIZE_8;=0D +=0D +=0D + //=0D + // Call CallBack with the Value been NULL=0D + //=0D + Status =3D HIIConfigAccess->CallBack (=0D + HIIConfigAccess,=0D + Action,=0D + QuestionId,=0D + Type,=0D + NULL,=0D + &ActionRequest=0D + );=0D +=0D + if ( EFI_INVALID_PARAMETER !=3D Status ) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D +=0D + //check the output ActionRequest=0D + if ((EFI_BROWSER_ACTION_REQUEST_NONE || EFI_BROWSER_ACTION_REQUEST_RESET= || EFI_BROWSER_ACTION_REQUEST_SUBMIT || EFI_BROWSER_ACTION_REQUEST_EXIT) != =3D ActionRequest)=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D +=0D + }=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + gHIIConfigAccessBBTestConformanceAssertionGuid0011,=0D + L"HII_CONFIG_ACCESS_PROTOCOL.CallBack - CallBack() returns EFI_= INVALID_PARAMETER with Value been NULL.",=0D + L"%a:%d: Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D + return EFI_SUCCESS;=0D +=0D +}=0D +=0D +EFI_STATUS=0D +BBTestCallBackConformanceTestCheckpoint4 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D +=0D + EFI_BROWSER_ACTION *Action;=0D + EFI_QUESTION_ID QuestionId;=0D + UINT8 Type;=0D + EFI_IFR_TYPE_VALUE Value;=0D + EFI_BROWSER_ACTION_REQUEST ActionRequest;=0D +=0D + //init the parameter=0D + Action=3D&EFI_BROWSER_ACTION_UNSUPPORTED;=0D + QuestionId=3D0x1234;=0D + Type=3DEFI_IFR_TYPE_NUM_SIZE_8;=0D +=0D +=0D + //=0D + // Call CallBack with the specified action not supported by the callbac= k=0D + //=0D + Status =3D HIIConfigAccess->CallBack (=0D + HIIConfigAccess,=0D + Action,=0D + QuestionId,=0D + Type,=0D + &Value,=0D + &ActionRequest=0D + );=0D +=0D + if ( EFI_UNSUPPORTED !=3D Status ) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D +=0D + //check the output ActionRequest=0D + if ((EFI_BROWSER_ACTION_REQUEST_NONE || EFI_BROWSER_ACTION_REQUEST_RESET= || EFI_BROWSER_ACTION_REQUEST_SUBMIT || EFI_BROWSER_ACTION_REQUEST_EXIT) != =3D ActionRequest)=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D +=0D + }=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + gHIIConfigAccessBBTestConformanceAssertionGuid0012,=0D + L"HII_CONFIG_ACCESS_PROTOCOL.CallBack - CallBack() returns EFI_= UNSUPPORTED with the specified action not supported by the callback .",=0D + L"%a:%d: Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D + return EFI_SUCCESS;=0D +=0D +}=0D +*/=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/Bla= ckBoxTest/HIIConfigAccessBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/I= HV/Protocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestFunction.c=0D new file mode 100644=0D index 00000000..14cc5684=0D --- /dev/null=0D +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestFunction.c=0D @@ -0,0 +1,606 @@=0D +/** @file=0D +=0D + Copyright 2006 - 2017 Unified EFI, Inc.
=0D + Copyright (c) 2010 - 2018, Intel Corporation. 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 + HIIConfigAccessBBTestFunction.c=0D +=0D +Abstract:=0D + for EFI Driver HII Configuration Access Protocol's function Test=0D +=0D +--*/=0D +=0D +#include "HIIConfigAccessBBTestMain.h"=0D +=0D +=0D +EFI_STATUS=0D +BBTestExtractConfigFunctionTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + );=0D +=0D +EFI_STATUS=0D +BBTestExtractConfigFunctionTestCheckpoint2 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + );=0D +=0D +EFI_STATUS=0D +BBTestRouteConfigFunctionTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + );=0D +/*=0D +EFI_STATUS=0D +BBTestCallBackFunctionTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + );=0D +*/=0D +=0D +//=0D +//Test Cases=0D +//=0D +/*=0D +EFI_STATUS=0D +BBTestUnitTest (=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 Status;=0D + EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess;=0D + EFI_STRING DevicePath =3D NULL;=0D + EFI_STRING Request =3D NULL;=0D + EFI_STRING Resp =3D NULL;=0D + EFI_STRING MultiConfigAltResp =3D L"GUID=3D970eb94aa0d449f7b980bdaa47= d42527&NAME=3Dft894&PATH=3D000acf&OFFSET=3D3&WIDTH=3D4&VALUE=3Daabbccdd&OFF= SET=3D1&WIDTH=3D2&VALUE=3Deeff&GUID=3D970eb94aa0d449f7b980bdaa47d42527&NAME= =3Dft894&PATH=3D000acf&ALTCFG=3D0037&A000=3Dabcd&B000=3Defef&GUID=3D970eb94= aa0d449f7b980bdaa47d42528&NAME=3Dft894&PATH=3D0104180035170b0fa0879341b2665= 38c38af48ce000000007fff0400&A000=3Dabcd&B000=3Defef&GUID=3D970eb94aa0d449f7= b980bdaa47d42528&NAME=3Dft894&PATH=3D0104180035170b0fa0879341b266538c38af48= ce000000007fff0400&ALTCFG=3D0037&OFFSET=3D3&WIDTH=3D4&VALUE=3Daabbccdd&OFFS= ET=3D1&WIDTH=3D2&VALUE=3Deeff";;=0D +=0D + //=0D + // init=0D + //=0D + HIIConfigAccess =3D (EFI_HII_CONFIG_ACCESS_PROTOCOL*)ClientInterface;=0D +=0D + Request =3D (EFI_STRING) SctAllocateZeroPool (2 * SctStrLen (MultiConfig= AltResp) + 2);=0D + if (Request =3D=3D NULL)=0D + return EFI_OUT_OF_RESOURCES;=0D +=0D + Resp =3D (EFI_STRING) SctAllocateZeroPool (2 * SctStrLen (MultiConfigAlt= Resp) + 2);=0D + if (Resp =3D=3D NULL) {=0D + gtBS->FreePool (Request);=0D + return EFI_OUT_OF_RESOURCES;=0D + }=0D +=0D + Status =3D GetDevicePath ( HIIConfigAccess, &DevicePath );=0D + if (EFI_ERROR(Status)) {=0D + gtBS->FreePool (Resp);=0D + gtBS->FreePool (Request);=0D + return Status;=0D + }=0D +=0D + Status =3D GetCorrespondingRequest (MultiConfigAltResp, DevicePath, Requ= est);=0D +=0D + Status =3D GetCorrespondingResp (MultiConfigAltResp, DevicePath, Resp);= =0D +=0D + gtBS->FreePool (Request);=0D + gtBS->FreePool (Resp);=0D + gtBS->FreePool (DevicePath);=0D +=0D + return EFI_SUCCESS;=0D +}=0D +*/=0D +=0D +EFI_STATUS=0D +BBTestExtractConfigFunctionTest (=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_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess;=0D + EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting;=0D +=0D + //=0D + // init=0D + //=0D + HIIConfigAccess =3D (EFI_HII_CONFIG_ACCESS_PROTOCOL*)ClientInterface;=0D +=0D + //=0D + // Get the Standard Library Interface=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 + // Get the Config Routing Protocol Interface=0D + //=0D + Status =3D GetHIIConfigRoutingInterface( &HIIConfigRouting );=0D + if ( EFI_ERROR(Status) ) {=0D + return Status;=0D + }=0D +=0D + //=0D + //Call check points=0D + //=0D + BBTestExtractConfigFunctionTestCheckpoint1( StandardLib, HIIConfigRoutin= g, HIIConfigAccess );=0D + BBTestExtractConfigFunctionTestCheckpoint2( StandardLib, HIIConfigRoutin= g, HIIConfigAccess );=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +=0D +EFI_STATUS=0D +BBTestRouteConfigFunctionTest (=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_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess;=0D + EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting;=0D +=0D + //=0D + // init=0D + //=0D + HIIConfigAccess =3D (EFI_HII_CONFIG_ACCESS_PROTOCOL*)ClientInterface;=0D +=0D + //=0D + // Get the Standard Library Interface=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 + // Get the Config Routing Protocol Interface=0D + //=0D + Status =3D GetHIIConfigRoutingInterface( &HIIConfigRouting );=0D + if ( EFI_ERROR(Status) ) {=0D + return Status;=0D + }=0D +=0D + //=0D + //Call check points=0D + //=0D + BBTestRouteConfigFunctionTestCheckpoint1( StandardLib, HIIConfigRouting,= HIIConfigAccess );=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +/*=0D +EFI_STATUS=0D +BBTestCallBackFunctionTest (=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_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess;=0D +=0D + //=0D + // init=0D + //=0D + HIIConfigAccess =3D (EFI_HII_CONFIG_ACCESS_PROTOCOL*)ClientInterface;=0D +=0D + //=0D + // Get the Standard Library Interface=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 points=0D + //=0D + BBTestCallBackFunctionTestCheckpoint1( StandardLib, HIIConfigAccess );=0D +=0D + return EFI_SUCCESS;=0D +}=0D +*/=0D +=0D +//=0D +//Check Points=0D +//=0D +EFI_STATUS=0D +BBTestExtractConfigFunctionTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D +=0D + EFI_STRING Request =3D NULL;=0D + EFI_STRING ConfigHdr =3D NULL;=0D + EFI_STRING Progress =3D NULL;=0D + EFI_STRING Results =3D NULL;=0D + EFI_STRING MultiConfigAltResp =3D NULL;=0D + EFI_STRING DevicePath =3D NULL;=0D +=0D +=0D + //init the Request=0D + Status =3D HIIConfigRouting->ExportConfig(=0D + HIIConfigRouting,=0D + &MultiConfigAltResp=0D + );=0D + if (EFI_ERROR(Status)) {=0D + return Status;=0D + }=0D +=0D + Status =3D GetDevicePath ( HIIConfigAccess, &DevicePath );=0D + if (EFI_ERROR(Status)) {=0D + gtBS->FreePool (MultiConfigAltResp);=0D + return Status;=0D + }=0D +=0D + Request =3D (EFI_STRING) SctAllocateZeroPool ( 2 * SctStrLen (MultiConfi= gAltResp) + 2 );=0D + if (Request =3D=3D NULL) {=0D + gtBS->FreePool (MultiConfigAltResp);=0D + gtBS->FreePool (DevicePath);=0D + return EFI_OUT_OF_RESOURCES;=0D + }=0D +=0D + Status =3D GetCorrespondingRequest (MultiConfigAltResp, DevicePath, Requ= est);=0D + if (EFI_ERROR(Status)) {=0D + gtBS->FreePool (MultiConfigAltResp);=0D + gtBS->FreePool (DevicePath);=0D + gtBS->FreePool (Request);=0D + return Status;=0D + }=0D +=0D + //=0D + // Call ExtractConfig with valid parameters=0D + //=0D + Status =3D HIIConfigAccess->ExtractConfig(=0D + HIIConfigAccess,=0D + Request,=0D + &Progress,=0D + &Results=0D + );=0D +=0D + if ( (EFI_SUCCESS =3D=3D Status) && (Progress =3D=3D (Request + SctStrLe= n (Request))) ) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + if (Results =3D=3D NULL) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + } else {=0D + gtBS->FreePool (Results);=0D + }=0D + } else if (EFI_OUT_OF_RESOURCES =3D=3D Status) {=0D + AssertionType =3D EFI_TEST_ASSERTION_WARNING;=0D + }else {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + }=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + gHIIConfigAccessBBTestFunctionAssertionGuid001,=0D + L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig- ExtractConfig= () returns EFI_SUCCESS and vaild Results with valid parameters .",=0D + L"%a:%d: Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + //=0D + // Change the Request to ConfigHdr=0D + //=0D + ConfigHdr =3D Request;=0D + while (*Request) {=0D + if (*Request =3D=3D L'&') {=0D + if (SctStrnCmp (Request, L"&NAME=3D", 6) =3D=3D 0) {=0D + Request =3D Request + 6;=0D + } else if (SctStrnCmp (Request, L"&PATH=3D", 6) =3D=3D 0) {=0D + Request =3D Request + 6;=0D + } else {=0D + *Request =3D 0;=0D + }=0D + } else {=0D + Request++;=0D + }=0D + }=0D + Request =3D ConfigHdr;=0D +=0D + //=0D + // Call ExtractConfig when Request is ConfigHdr=0D + //=0D + Progress =3D NULL;=0D + Results =3D NULL;=0D + Status =3D HIIConfigAccess->ExtractConfig(=0D + HIIConfigAccess,=0D + Request,=0D + &Progress,=0D + &Results=0D + );=0D +=0D + if ( (EFI_SUCCESS =3D=3D Status) && (Progress =3D=3D (Request + SctStrLe= n (Request))) ) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + if (Results =3D=3D NULL) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + } else {=0D + if (NULL =3D=3D SctStrStr (Results, Request)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + }=0D + gtBS->FreePool (Results);=0D + }=0D + } else if (EFI_OUT_OF_RESOURCES =3D=3D Status) {=0D + AssertionType =3D EFI_TEST_ASSERTION_WARNING;=0D + }else {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + }=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + gHIIConfigAccessBBTestFunctionAssertionGuid002,=0D + L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig- ExtractConfig= () returns EFI_SUCCESS and vaild Results with valid parameters .",=0D + L"%a:%d: Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + gtBS->FreePool (MultiConfigAltResp);=0D + gtBS->FreePool (DevicePath);=0D + gtBS->FreePool (Request);=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +=0D +EFI_STATUS=0D +BBTestExtractConfigFunctionTestCheckpoint2 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D +=0D + EFI_STRING Request =3D NULL;=0D + EFI_STRING Progress =3D NULL;=0D + EFI_STRING Results =3D NULL;=0D + EFI_STRING MultiConfigAltResp =3D NULL;=0D +=0D +=0D + //init the Request=0D + Status =3D HIIConfigRouting->ExportConfig(=0D + HIIConfigRouting,=0D + &MultiConfigAltResp=0D + );=0D + if (EFI_ERROR(Status)) {=0D + return Status;=0D + }=0D +=0D + //=0D + // Call ExtractConfig with valid parameters=0D + //=0D + Status =3D HIIConfigAccess->ExtractConfig(=0D + HIIConfigAccess,=0D + NULL,=0D + &Progress,=0D + &Results=0D + );=0D +=0D + if (EFI_OUT_OF_RESOURCES =3D=3D Status) {=0D + AssertionType =3D EFI_TEST_ASSERTION_WARNING;=0D + } else if ((EFI_NOT_FOUND =3D=3D Status) && (Progress =3D=3D NULL) && (R= esults =3D=3D NULL)) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + } else if ( EFI_SUCCESS !=3D Status ) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + if (Results !=3D NULL) {=0D + gtBS->FreePool (Results);=0D + }=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + if (Results =3D=3D NULL) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + }=0D + }=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + gHIIConfigAccessBBTestFunctionAssertionGuid003,=0D + L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig- ExtractConfig= () returns EFI_SUCCESS or EFI_NOT_FOUND with Request been NULL .",=0D + L"%a:%d: Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D +=0D + if ( NULL !=3D MultiConfigAltResp ){=0D + gtBS->FreePool (MultiConfigAltResp);=0D + }=0D +=0D + if ( NULL !=3DResults ) {=0D + gtBS->FreePool (Results);=0D + }=0D +=0D + if (NULL !=3D Request) {=0D + gtBS->FreePool (Request);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +=0D +EFI_STATUS=0D +BBTestRouteConfigFunctionTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D +=0D + EFI_STRING Resp =3D NULL;=0D + EFI_STRING Progress =3D NULL;=0D + EFI_STRING MultiConfigAltResp =3D NULL;=0D + EFI_STRING DevicePath =3D NULL;=0D +=0D + //init the Request=0D + Status =3D HIIConfigRouting->ExportConfig(=0D + HIIConfigRouting,=0D + &MultiConfigAltResp=0D + );=0D + if (EFI_ERROR(Status)) {=0D + return Status;=0D + }=0D +=0D + Status =3D GetDevicePath ( HIIConfigAccess, &DevicePath );=0D + if (EFI_ERROR(Status)) {=0D + gtBS->FreePool (MultiConfigAltResp);=0D + return Status;=0D + }=0D +=0D + Resp =3D (EFI_STRING) SctAllocateZeroPool ( 2 * SctStrLen (MultiConfigAl= tResp) + 2 );=0D + if (Resp =3D=3D NULL) {=0D + gtBS->FreePool (MultiConfigAltResp);=0D + gtBS->FreePool (DevicePath);=0D + return EFI_OUT_OF_RESOURCES;=0D + }=0D +=0D + Status =3D GetCorrespondingResp (MultiConfigAltResp, DevicePath, Resp);= =0D + if (EFI_ERROR(Status)) {=0D + gtBS->FreePool (MultiConfigAltResp);=0D + gtBS->FreePool (DevicePath);=0D + gtBS->FreePool (Resp);=0D + return Status;=0D + }=0D +=0D + //=0D + // Call RouteConfig with valid parameters=0D + //=0D + Status =3D HIIConfigAccess->RouteConfig(=0D + HIIConfigAccess,=0D + Resp,=0D + &Progress=0D + );=0D + if ( (EFI_SUCCESS =3D=3D Status) && (Progress =3D=3D Resp + SctStrLen (R= esp)) ) {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D + } else if ( EFI_OUT_OF_RESOURCES =3D=3D Status ) {=0D + AssertionType =3D EFI_TEST_ASSERTION_WARNING;=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + }=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + gHIIConfigAccessBBTestFunctionAssertionGuid003,=0D + L"HII_CONFIG_ACCESS_PROTOCOL.RouteConfig- RouteConfig() returns= EFI_SUCCESS with valid parameters .",=0D + L"%a:%d: Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D +=0D + gtBS->FreePool (MultiConfigAltResp);=0D + gtBS->FreePool (DevicePath);=0D + gtBS->FreePool (Resp);=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +/*=0D +EFI_STATUS=0D +BBTestCallBackFunctionTestCheckpoint1 (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION AssertionType;=0D +=0D + EFI_BROWSER_ACTION *Action;=0D + EFI_QUESTION_ID QuestionId;=0D + UINT8 Type;=0D + EFI_IFR_TYPE_VALUE Value;=0D + EFI_BROWSER_ACTION_REQUEST ActionRequest;=0D +=0D + //init the paremeters=0D + Action=3DEFI_BROWSER_ACTION_REQUEST_CHANGING;=0D + QuestionId=3D0x1234;=0D + Type=3DEFI_IFR_TYPE_NUM_SIZE_8;=0D +=0D +=0D + //=0D + // Call CallBack with valid parameters=0D + //=0D + Status =3D HIIConfigAccess->CallBack(=0D + HIIConfigAccess,=0D + Action,=0D + QuestionId,=0D + Type,=0D + &Value,=0D + &ActionRequest=0D + );=0D + if ( EFI_SUCCESS !=3D Status ) {=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D + } else {=0D + AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D +=0D + //check the output ActionRequest=0D + if ((EFI_BROWSER_ACTION_REQUEST_NONE || EFI_BROWSER_ACTION_REQUEST_RESET= || EFI_BROWSER_ACTION_REQUEST_SUBMIT || EFI_BROWSER_ACTION_REQUEST_EXIT) != =3D ActionRequest)=0D + AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D +=0D + }=0D +=0D +=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType,=0D + gHIIConfigAccessBBTestFunctionAssertionGuid003,=0D + L"HII_CONFIG_ACCESS_PROTOCOL.CallBack- CallBack() returns EFI_S= UCCESS with valid parameters .",=0D + L"%a:%d: Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D + return EFI_SUCCESS;=0D +}=0D +*/=0D +=0D +=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/Bla= ckBoxTest/HIIConfigAccessBBTestMain.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/P= rotocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestMain.c=0D new file mode 100644=0D index 00000000..29c793e2=0D --- /dev/null=0D +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestMain.c=0D @@ -0,0 +1,655 @@=0D +/** @file=0D +=0D + Copyright 2006 - 2016 Unified EFI, Inc.
=0D + Copyright (c) 2010 - 2016, Intel Corporation. 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 + HIIConfigAccessBBTestMain.c=0D +=0D +Abstract:=0D +=0D + Test Driver of HII Configuration Access Protocol=0D +=0D +--*/=0D +=0D +#include "HIIConfigAccessBBTestMain.h"=0D +=0D +//=0D +// Global variables=0D +//=0D +EFI_HANDLE mImageHandle;=0D +=0D +EFI_BB_TEST_PROTOCOL *gBBTestProtocolInterface;=0D +=0D +EFI_BB_TEST_PROTOCOL_FIELD gBBTestProtocolField =3D {=0D + EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_REVISION,=0D + IHV_EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID,=0D + L"HII Configuration Access Protocol Test",=0D + L"UEFI HII Configuration Access 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 + //Use for unit test only=0D + {=0D + { 0x8cdda816, 0x3f97, 0x4155, { 0xa6, 0x73, 0x86, 0x93, 0x79, 0x8f, 0x= b0, 0x6d } },=0D + L"Unit Test Only",=0D + L"Verify the Assistant Function",=0D + EFI_TEST_LEVEL_DEFAULT,=0D + gSupportProtocolGuid,=0D + EFI_TEST_CASE_AUTO,=0D + BBTestUnitTest=0D + },=0D + */=0D + {=0D + EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0101,=0D + L"ExtractConfigFunction",=0D + L"Function auto test for HII Configuration Access Protocol ExtractConf= ig().",=0D + EFI_TEST_LEVEL_MINIMAL,=0D + gSupportProtocolGuid,=0D + EFI_TEST_CASE_AUTO,=0D + BBTestExtractConfigFunctionTest=0D + },=0D +=0D + {=0D + EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0102,=0D + L"RouteConfigFunction",=0D + L"Function auto test for HII Configuration Access Protocol RouteConfig= ().",=0D + EFI_TEST_LEVEL_MINIMAL,=0D + gSupportProtocolGuid,=0D + EFI_TEST_CASE_AUTO,=0D + BBTestRouteConfigFunctionTest=0D + },=0D + /*=0D + {=0D + EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0103,=0D + L"CallBackFunction",=0D + L"Function auto test for HII Configuration Access Protocol CallBack().= ",=0D + EFI_TEST_LEVEL_MINIMAL,=0D + gSupportProtocolGuid,=0D + EFI_TEST_CASE_AUTO,=0D + BBTestCallBackFunctionTest=0D + },=0D + */=0D + {=0D + EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0201,=0D + L"ExtractConfigConformance",=0D + L"Conformance auto test for HII Configuration Access Protocol ExtractC= onfig().",=0D + EFI_TEST_LEVEL_MINIMAL,=0D + gSupportProtocolGuid,=0D + EFI_TEST_CASE_AUTO,=0D + BBTestExtractConfigConformanceTest=0D + },=0D + {=0D + EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0202,=0D + L"RouteConfigConformance",=0D + L"Conformance auto test for HII Configuration Access Protocol RouteCon= fig().",=0D + EFI_TEST_LEVEL_MINIMAL,=0D + gSupportProtocolGuid,=0D + EFI_TEST_CASE_AUTO,=0D + BBTestRouteConfigConformanceTest=0D + },=0D + /*=0D + {=0D + EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0203,=0D + L"CallBackConformance",=0D + L"Conformance auto test for HII Configuration Access Protocol CallBack= ().",=0D + EFI_TEST_LEVEL_MINIMAL,=0D + gSupportProtocolGuid,=0D + EFI_TEST_CASE_AUTO,=0D + BBTestCallBackConformanceTest=0D + },=0D + */=0D + 0=0D +};=0D +=0D +=0D +=0D +=0D +EFI_STATUS=0D +InitializeHIIConfigAccessBBTest (=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 + UnloadHIIConfigAccessBBTest,=0D + &gBBTestProtocolInterface=0D + );=0D +}=0D +=0D +=0D +EFI_STATUS=0D +UnloadHIIConfigAccessBBTest (=0D + IN EFI_HANDLE ImageHandle=0D + )=0D +{=0D + return EfiUninstallAndFreeIHVBBTestInterface (=0D + ImageHandle,=0D + gBBTestProtocolInterface=0D + );=0D +}=0D +=0D +=0D +// Assistance Function=0D +UINTN=0D +EfiDevicePathSize (=0D + IN EFI_DEVICE_PATH_PROTOCOL *DevicePath=0D + )=0D +/*++=0D +=0D +Routine Description:=0D +=0D + Calculate the space size of a device path.=0D +=0D +Arguments:=0D +=0D + DevicePath - A specified device path=0D +=0D +Returns:=0D +=0D + The size.=0D +=0D +--*/=0D +{=0D + EFI_DEVICE_PATH_PROTOCOL *Start;=0D +=0D + if (DevicePath =3D=3D NULL) {=0D + return 0;=0D + }=0D +=0D + //=0D + // Search for the end of the device path structure=0D + //=0D + Start =3D DevicePath;=0D + while (!SctIsDevicePathEnd (DevicePath)) {=0D + DevicePath =3D SctNextDevicePathNode (DevicePath);=0D + }=0D +=0D + //=0D + // Compute the size and add back in the size of the end device path stru= cture=0D + //=0D + return ((UINTN) DevicePath - (UINTN) Start) + sizeof (EFI_DEVICE_PATH_PR= OTOCOL);=0D +}=0D +=0D +=0D +STATIC=0D +CHAR16=0D +NibbleToHexCharPrivate (=0D + IN UINT8 Nibble=0D + )=0D +/*++=0D +=0D + Routine Description:=0D + Converts the low nibble of a byte to hex unicode character.=0D +=0D + Arguments:=0D + Nibble - lower nibble of a byte.=0D +=0D + Returns:=0D + Hex unicode character between L'0' to L'f'.=0D +=0D +--*/=0D +{=0D + Nibble &=3D 0x0F;=0D +=0D + if (Nibble <=3D 0x9) {=0D + return (CHAR16)(Nibble + L'0');=0D + }=0D +=0D + return (CHAR16)(Nibble - 0xA + L'a');=0D +}=0D +=0D +=0D +STATIC=0D +EFI_STATUS=0D +BufToHexStringPrivate (=0D + IN OUT CHAR16 *Str,=0D + IN OUT UINTN *HexStringBufferLength,=0D + IN UINT8 *Buf,=0D + IN UINTN Len,=0D + IN BOOLEAN Flag=0D + )=0D +/*++=0D +=0D + Routine Description:=0D + Converts binary buffer to Unicode string.=0D + At a minimum, any blob of data could be represented as a hex string.=0D +=0D + Arguments:=0D + Str - Pointer to the string.=0D + HexStringBufferLength - Length in bytes of buffer to hold the hex stri= ng. Includes tailing '\0' character.=0D + If routine return with EFI_SUCCESS, containing= length of hex string buffer.=0D + If routine return with EFI_BUFFER_TOO_SMALL, c= ontaing length of hex string buffer desired.=0D + Buf - Buffer to be converted from.=0D + Len - Length in bytes of the buffer to be converted.= =0D + Flag - If TRUE, encode the data in the same order as = the it=0D + resides in the Buf. Else encode it in the reve= rse direction.=0D +=0D + Returns:=0D + EFI_SUCCESS - Routine success.=0D + EFI_BUFFER_TOO_SMALL - The hex string buffer is too small.=0D +=0D +--*/=0D +{=0D + UINTN Idx;=0D + UINT8 Byte;=0D + UINTN StrLen;=0D +=0D + //=0D + // Make sure string is either passed or allocate enough.=0D + // It takes 2 Unicode characters (4 bytes) to represent 1 byte of the bi= nary buffer.=0D + // Plus the Unicode termination character.=0D + //=0D + StrLen =3D Len * 2;=0D + if ((*HexStringBufferLength) < (StrLen + 1) * sizeof (CHAR16)) {=0D + *HexStringBufferLength =3D (StrLen + 1) * sizeof (CHAR16);=0D + return EFI_BUFFER_TOO_SMALL;=0D + }=0D +=0D + *HexStringBufferLength =3D (StrLen + 1) * sizeof (CHAR16);=0D +=0D + //=0D + // Ends the string.=0D + //=0D + Str[StrLen] =3D 0;=0D +=0D + for (Idx =3D 0; Idx < Len; Idx++) {=0D +=0D + Byte =3D Buf[Idx];=0D + if (Flag) {=0D + Str[Idx * 2] =3D NibbleToHexCharPrivate ((UINT8)(Byte >> 4));=0D + Str[Idx * 2 + 1] =3D NibbleToHexCharPrivate (Byte);=0D + } else {=0D + Str[StrLen - 1 - Idx * 2] =3D NibbleToHexCharPrivate (Byte);=0D + Str[StrLen - 2 - Idx * 2] =3D NibbleToHexCharPrivate ((UINT8)(Byte >= > 4));=0D + }=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +EFI_STATUS=0D +GetDevicePath (=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess,=0D + OUT EFI_STRING *DevicePathStr=0D + )=0D +{=0D + EFI_STATUS Status;=0D + UINTN Index;=0D + UINTN NoHandles;=0D + EFI_HANDLE *HandleBuffer;=0D + EFI_HANDLE ConfigAccessHandle =3D NULL;=0D + EFI_HII_CONFIG_ACCESS_PROTOCOL *TestedConfigAccess;=0D + EFI_DEVICE_PATH_PROTOCOL *DevicePath;=0D + UINTN Length;=0D + UINTN PathHdrSize;=0D +=0D + //=0D + // locate all Hii Configuration Access Protocol Instances=0D + //=0D + Status =3D gtBS->LocateHandleBuffer (=0D + ByProtocol,=0D + &gBlackBoxEfiHIIConfigAccessProtocolGuid,=0D + NULL,=0D + &NoHandles,=0D + &HandleBuffer=0D + );=0D + if (EFI_ERROR(Status) || (NoHandles =3D=3D 0)) {=0D + return EFI_NOT_FOUND;=0D + }=0D +=0D + //=0D + // scan for the handle that matched with the Hii Configuration Access Pr= otocol that=0D + // passed in by the test framework=0D + //=0D + for (Index =3D 0; Index < NoHandles; Index++) {=0D + Status =3D gtBS->HandleProtocol (=0D + HandleBuffer[Index],=0D + &gBlackBoxEfiHIIConfigAccessProtocolGuid,=0D + (VOID **) &TestedConfigAccess=0D + );=0D + if (EFI_ERROR(Status)) {=0D + continue;=0D + }=0D +=0D + if (TestedConfigAccess =3D=3D ConfigAccess) {=0D + ConfigAccessHandle =3D HandleBuffer[Index];=0D + break;=0D + }=0D + }=0D +=0D + gtBS->FreePool (HandleBuffer);=0D +=0D + if (ConfigAccessHandle =3D=3D NULL) {=0D + return EFI_NOT_FOUND;=0D + }=0D +=0D + //=0D + // find controller handles managed by the component name handle.=0D + //=0D + Status =3D gtBS->HandleProtocol (=0D + ConfigAccessHandle,=0D + &gBlackBoxEfiDevicePathProtocolGuid,=0D + (void **)&DevicePath=0D + );=0D +=0D + //=0D + // Convert the device path binary to hex UNICODE %02x bytes in the same = order=0D + // as the device path resides in RAM memory.=0D + //=0D + Length =3D EfiDevicePathSize (DevicePath);=0D + PathHdrSize =3D (Length * 2 + 1) * sizeof (CHAR16);=0D + *DevicePathStr =3D (EFI_STRING) SctAllocateZeroPool (PathHdrSize);=0D + if (*DevicePathStr =3D=3D NULL) {=0D + return EFI_OUT_OF_RESOURCES;=0D + }=0D + Status =3D BufToHexStringPrivate (*DevicePathStr, &PathHdrSize, (UINT8 *= ) DevicePath, Length, TRUE);=0D +=0D + return Status;=0D +}=0D +=0D +=0D +EFI_STATUS=0D +GetCorrespondingRequest (=0D + IN EFI_STRING MultiConfigAltResp,=0D + IN EFI_STRING DevicePath,=0D + IN OUT EFI_STRING Request=0D + )=0D +{=0D + EFI_STRING RespPtr;=0D + EFI_STRING ReqPtr;=0D + EFI_STRING SingleResp;=0D + EFI_STRING SingleRespPtr;=0D + UINTN Len;=0D +=0D + ReqPtr =3D Request;=0D + RespPtr =3D MultiConfigAltResp;=0D +=0D + Len =3D SctStrLen (MultiConfigAltResp);=0D +=0D + if (SctStrnCmp (MultiConfigAltResp, L"GUID=3D", 5) !=3D 0) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + if (SctStrStr (MultiConfigAltResp, DevicePath) =3D=3D NULL) {=0D + return EFI_NOT_FOUND;=0D + }=0D +=0D + SingleResp =3D (EFI_STRING) SctAllocateZeroPool ( 2 * SctStrLen (MultiCo= nfigAltResp) + 2 );=0D + if (SingleResp =3D=3D NULL) {=0D + return EFI_OUT_OF_RESOURCES;=0D + }=0D + SingleRespPtr =3D SingleResp;=0D +=0D + while (*MultiConfigAltResp !=3D 0) {=0D + while ((*MultiConfigAltResp !=3D 0) && (SctStrnCmp (MultiConfigAltResp= , L"&GUID=3D", 6) !=3D 0)) {=0D + *(SingleResp++) =3D *(MultiConfigAltResp++);=0D + }=0D + SingleResp =3D SingleRespPtr;=0D + if (SctStrStr (SingleResp, DevicePath) !=3D NULL)=0D + break;=0D + SctZeroMem (SingleRespPtr, 2 * Len + 2);=0D + if (*MultiConfigAltResp !=3D 0)=0D + MultiConfigAltResp++;=0D + }=0D +=0D + if (SctStrStr (SingleResp, DevicePath) =3D=3D NULL)=0D + return EFI_NOT_FOUND;=0D +=0D + if (SctStrStr (SingleResp, L"VALUE=3D") =3D=3D NULL){=0D + while (*SingleResp !=3D 0) {=0D + while ((*SingleResp !=3D 0) && (SctStrnCmp (SingleResp, L"&PATH=3D",= 6) !=3D 0)) {=0D + *(Request++) =3D *(SingleResp++);=0D + }=0D + *(Request++) =3D *(SingleResp++);=0D + while ((*SingleResp !=3D 0) && (*SingleResp !=3D L'&')) {=0D + *(Request++) =3D *(SingleResp++);=0D + }=0D + while (*SingleResp !=3D 0){=0D + if (*SingleResp !=3D L'=3D') {=0D + *(Request++) =3D *(SingleResp++);=0D + } else {=0D + while ((*SingleResp !=3D 0) && (*SingleResp !=3D L'&')) {=0D + SingleResp++;=0D + }=0D + }=0D + }=0D + }=0D + } else {=0D + while (*SingleResp !=3D 0) {=0D + while ((*SingleResp !=3D 0) && (SctStrnCmp (SingleResp, L"&VALUE=3D"= , 7)) !=3D 0) {=0D + *(Request++) =3D *(SingleResp++);=0D + }=0D + SingleResp++;=0D + while ((*SingleResp !=3D 0) && (*SingleResp !=3D L'&'))=0D + SingleResp++;=0D + }=0D +=0D + }=0D +=0D + *Request =3D 0;=0D +=0D + gtBS->FreePool (SingleRespPtr);=0D + return EFI_SUCCESS;=0D +}=0D +=0D +=0D +EFI_STATUS=0D +GetCorrespondingResp (=0D + IN EFI_STRING MultiConfigAltResp,=0D + IN EFI_STRING DevicePath,=0D + IN OUT EFI_STRING Resp=0D + )=0D +{=0D + EFI_STRING RespPtr;=0D + EFI_STRING ReqPtr;=0D + UINTN Len;=0D +=0D + ReqPtr =3D Resp;=0D + RespPtr =3D MultiConfigAltResp;=0D +=0D + Len =3D SctStrLen (MultiConfigAltResp);=0D +=0D + if (SctStrnCmp (MultiConfigAltResp, L"GUID=3D", 5) !=3D 0) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + if (SctStrStr (MultiConfigAltResp, DevicePath) =3D=3D NULL) {=0D + return EFI_NOT_FOUND;=0D + }=0D +=0D + while (*MultiConfigAltResp !=3D 0) {=0D + while ((*MultiConfigAltResp !=3D 0) && (SctStrnCmp (MultiConfigAltResp= , L"&GUID=3D", 6) !=3D 0)) {=0D + *(Resp++) =3D *(MultiConfigAltResp++);=0D + }=0D + Resp =3D ReqPtr;=0D + if (SctStrStr (Resp, DevicePath) !=3D NULL)=0D + break;=0D + SctZeroMem (ReqPtr, 2 * Len + 2);=0D + if (*MultiConfigAltResp !=3D 0)=0D + MultiConfigAltResp++;=0D + }=0D +=0D + if (SctStrStr (Resp, DevicePath) =3D=3D NULL)=0D + return EFI_NOT_FOUND;=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +=0D +=0D +EFI_STATUS=0D +GetHIIConfigRoutingInterface (=0D + OUT EFI_HII_CONFIG_ROUTING_PROTOCOL **HIIConfigRouting=0D + )=0D +{=0D + UINTN NoHandles;=0D + EFI_HANDLE *HandleBuffer;=0D + EFI_STATUS Status;=0D +=0D + //=0D + // Get the HII Database Protocol interface=0D + //=0D + Status =3D gtBS->LocateHandleBuffer (=0D + ByProtocol,=0D + &gBlackBoxEfiHIIConfigRoutingProtocolGuid,=0D + NULL,=0D + &NoHandles,=0D + &HandleBuffer=0D + );=0D + if ( EFI_ERROR(Status) ) {=0D + return Status;=0D + }=0D +=0D + if ( NoHandles <=3D 0 ) {=0D + return EFI_DEVICE_ERROR;=0D + }=0D +=0D + Status =3D gtBS->HandleProtocol (=0D + HandleBuffer[0],=0D + &gBlackBoxEfiHIIConfigRoutingProtocolGuid,=0D + (VOID **) HIIConfigRouting=0D + );=0D + if ( EFI_ERROR(Status) ) {=0D + gtBS->FreePool ( HandleBuffer );=0D + return Status;=0D + }=0D +=0D + gtBS->FreePool ( HandleBuffer );=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +EFI_STATUS=0D +MultiAltRespToMultiReq (=0D + IN EFI_STRING Resp,=0D + IN OUT EFI_STRING Req=0D + )=0D +{=0D + EFI_STRING Pointer1 =3D Resp;=0D + EFI_STRING Pointer2 =3D NULL;=0D + EFI_STRING Pointer3 =3D Req;=0D + EFI_STRING CfgHdr =3D NULL;=0D + EFI_STRING FreePtr =3D NULL;=0D + CHAR8 Flag =3D 0;=0D +=0D + if (SctStrnCmp (Pointer1, L"GUID=3D", 5) !=3D 0) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + Pointer2 =3D (EFI_STRING) SctAllocateZeroPool (2 * SctStrLen (Resp) + 2)= ;=0D + if (Pointer2 =3D=3D NULL) {=0D + return EFI_OUT_OF_RESOURCES;=0D + }=0D + FreePtr =3D Pointer2;=0D +=0D + while (*Pointer1) {=0D + if (SctStrnCmp (Pointer1, L"GUID=3D", 5) =3D=3D 0) {=0D + CfgHdr =3D Pointer2;=0D + *(Pointer2++) =3D *(Pointer1++);=0D + while (*Pointer1 !=3D L'&') {=0D + *(Pointer2++) =3D *(Pointer1++);=0D + }=0D + }=0D + if (SctStrnCmp (Pointer1, L"&GUID=3D", 6) =3D=3D 0) {=0D + *(Pointer2++) =3D *(Pointer1++);=0D + CfgHdr =3D Pointer2;=0D + while (*Pointer1 !=3D L'&') {=0D + *(Pointer2++) =3D *(Pointer1++);=0D + }=0D + }=0D + if (SctStrnCmp (Pointer1, L"&NAME=3D", 6) =3D=3D 0) {=0D + *(Pointer2++) =3D *(Pointer1++);=0D + while (*Pointer1 !=3D L'&') {=0D + *(Pointer2++) =3D *(Pointer1++);=0D + }=0D + }=0D + if (SctStrnCmp (Pointer1, L"&PATH=3D", 6) =3D=3D 0) {=0D + *(Pointer2++) =3D *(Pointer1++);=0D + while (*Pointer1 !=3D L'&') {=0D + *(Pointer2++) =3D *(Pointer1++);=0D + }=0D + if (NULL =3D=3D SctStrStr (Req, CfgHdr)){=0D + if (*Req =3D=3D L'G')=0D + *(Pointer3++) =3D L'&';=0D + SctStrCat (Req, CfgHdr);=0D + Pointer3 +=3D SctStrLen (CfgHdr);=0D + Flag =3D 1;=0D + } else {=0D + Flag =3D 0;=0D + }=0D + }=0D + while ((Flag =3D=3D 1) && (SctStrnCmp (Pointer1, L"&GUID=3D", 6) !=3D = 0) && *Pointer1) {=0D + if (SctStrnCmp (Pointer1, L"&OFFSET=3D", 8) =3D=3D 0) {=0D + *(Pointer3++) =3D *(Pointer1++);=0D + while (*Pointer1 !=3D L'&') {=0D + *(Pointer3++) =3D *(Pointer1++);=0D + }=0D + }=0D + if (SctStrnCmp (Pointer1, L"&WIDTH=3D", 7) =3D=3D 0) {=0D + *(Pointer3++) =3D *(Pointer1++);=0D + while (*Pointer1 !=3D L'&') {=0D + *(Pointer3++) =3D *(Pointer1++);=0D + }=0D + }=0D + if (SctStrnCmp (Pointer1, L"&VALUE=3D", 7) =3D=3D 0) {=0D + Pointer1 +=3D 7;=0D + while (*Pointer1 !=3D L'&' && *Pointer1) {=0D + Pointer1++;=0D + }=0D + }=0D + if (SctStrnCmp (Pointer1, L"&ALTCFG=3D", 8) =3D=3D 0) {=0D + Pointer1 +=3D 8;=0D + while (*Pointer1 !=3D L'&' && *Pointer1) {=0D + Pointer1++;=0D + }=0D + }=0D + if ((*Pointer1 =3D=3D L'&') && (SctStrnCmp (Pointer1, L"&GUID=3D", 6)= !=3D 0) &&=0D + (SctStrnCmp (Pointer1, L"&OFFSET=3D", 8) !=3D 0) && (SctStrnCmp (= Pointer1, L"&WIDTH=3D", 7) !=3D 0)) {=0D + *(Pointer3++) =3D *(Pointer1++);=0D + while (*Pointer1 !=3D L'=3D') {=0D + *(Pointer3++) =3D *(Pointer1++);=0D + }=0D + while (*Pointer1 !=3D L'&' && *Pointer1) {=0D + Pointer1++;=0D + }=0D + }=0D + }=0D + Pointer1++;=0D + }=0D +=0D + SctFreePool (FreePtr);=0D +=0D + return EFI_SUCCESS;=0D +}=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/Bla= ckBoxTest/HIIConfigAccessBBTestMain.h b/uefi-sct/SctPkg/TestCase/UEFI/IHV/P= rotocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestMain.h=0D new file mode 100644=0D index 00000000..c81a00ca=0D --- /dev/null=0D +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestMain.h=0D @@ -0,0 +1,168 @@=0D +/** @file=0D +=0D + Copyright 2006 - 2013 Unified EFI, Inc.
=0D + Copyright (c) 2010 - 2013, Intel Corporation. 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 + HIIConfigAccessBBTestMain.h=0D +=0D +Abstract:=0D +=0D + Test Driver of HII Configuration Access Protocol header file=0D +=0D +--*/=0D +=0D +#ifndef _HII_CONFIG_ACCESS_BB_TEST_MAIN=0D +#define _HII_CONFIG_ACCESS_BB_TEST_MAIN=0D +=0D +#define __UEFI_INTERNAL_FORMREPRESENTATION_H__=0D +#include =0D +#include "SctLib.h"=0D +#include "Guid.h"=0D +#include =0D +#include =0D +#include =0D +#include =0D +=0D +=0D +#define EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_REVISION 0x00010000=0D +#define IHV_EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID \=0D +{ 0x68820884, 0x4be3, 0x4ca9, { 0x83, 0x81, 0x9e, 0x98, 0xf3, 0xf4, 0x8d, = 0xaf } }=0D +//=0D +// Entry GUIDs for Func Test=0D +//=0D +#define EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0101 \=0D +{ 0x2a85387e, 0xdcf9, 0x45e9, { 0xb3, 0x8f, 0x5d, 0xa1, 0x75, 0x41, 0xcf, = 0x1a } }=0D +=0D +#define EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0102 \=0D +{ 0x1a15df85, 0x6cc1, 0x43f2, { 0x9b, 0x86, 0x21, 0x8b, 0xd5, 0xfd, 0xf4, = 0xa0 } }=0D +=0D +=0D +//=0D +// Entry GUIDs for Conf Test=0D +//=0D +#define EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0201 \=0D +{ 0xe2c3b0fe, 0xfbe9, 0x46a9, { 0xa3, 0x1b, 0xa3, 0xf3, 0x82, 0xd, 0xcf, 0= x4 } }=0D +=0D +#define EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0202 \=0D +{ 0x495c99f3, 0x231, 0x45a5, { 0xaf, 0xfa, 0xd2, 0x5c, 0x6f, 0x9a, 0x19, 0= x1c } }=0D +=0D +=0D +=0D +EFI_STATUS=0D +InitializeHIIConfigAccessBBTest (=0D + IN EFI_HANDLE ImageHandle,=0D + IN EFI_SYSTEM_TABLE *SystemTable=0D + );=0D +=0D +=0D +EFI_STATUS=0D +UnloadHIIConfigAccessBBTest (=0D + IN EFI_HANDLE ImageHandle=0D + );=0D +=0D +=0D +//=0D +//Test Cases=0D +//=0D +/*=0D +EFI_STATUS=0D +BBTestUnitTest (=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 +BBTestExtractConfigConformanceTest (=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 +BBTestRouteConfigConformanceTest (=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 +BBTestCallBackConformanceTest (=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 +BBTestExtractConfigFunctionTest (=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 +BBTestRouteConfigFunctionTest (=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 +BBTestCallBackFunctionTest (=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 +GetDevicePath (=0D + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess,=0D + OUT EFI_STRING *DevicePathStr=0D + );=0D +=0D +EFI_STATUS=0D +GetCorrespondingRequest (=0D + IN EFI_STRING MultiConfigAltResp,=0D + IN EFI_STRING DevicePath,=0D + IN OUT EFI_STRING Request=0D + );=0D +=0D +EFI_STATUS=0D +GetCorrespondingResp (=0D + IN EFI_STRING MultiConfigAltResp,=0D + IN EFI_STRING DevicePath,=0D + IN OUT EFI_STRING Resp=0D + );=0D +=0D +EFI_STATUS=0D +GetHIIConfigRoutingInterface (=0D + OUT EFI_HII_CONFIG_ROUTING_PROTOCOL **HIIConfigRouting=0D + );=0D +=0D +EFI_STATUS=0D +MultiAltRespToMultiReq (=0D + IN EFI_STRING Resp,=0D + IN OUT EFI_STRING Req=0D + );=0D +=0D +#endif=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/Bla= ckBoxTest/IhvHIIConfigAccessBBTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/IHV/= Protocol/HIIConfigAccess/BlackBoxTest/IhvHIIConfigAccessBBTest.inf=0D new file mode 100644=0D index 00000000..1168986b=0D --- /dev/null=0D +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxTe= st/IhvHIIConfigAccessBBTest.inf=0D @@ -0,0 +1,55 @@=0D +## @file=0D +#=0D +# Copyright 2006 - 2012 Unified EFI, Inc.
=0D +# Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
= =0D +# Copyright (c) 2019, ARM Ltd. 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 +# HIIConfigAccessBBTest.inf=0D +#=0D +# Abstract:=0D +#=0D +# Component description file for IHV HII Config Access Protocol Black-Bo= x Test.=0D +#=0D +#--*/=0D +=0D +[defines]=0D +INF_VERSION =3D 0x00010005=0D +BASE_NAME =3D IhvHIIConfigAccessBBTest=0D +FILE_GUID =3D D39F2A3B-72BF-40F5-86BF-2E1E96D15EA3=0D +MODULE_TYPE =3D UEFI_DRIVER=0D +VERSION_STRING =3D 1.0=0D +ENTRY_POINT =3D InitializeHIIConfigAccessBBTest=0D +=0D +[sources.common]=0D + HIIConfigAccessBBTestConformance.c=0D + HIIConfigAccessBBTestFunction.c=0D + HIIConfigAccessBBTestMain.c=0D + Guid.c=0D +=0D +[Packages]=0D + SctPkg/SctPkg.dec=0D + SctPkg/UEFI/UEFI.dec=0D + MdePkg/MdePkg.dec=0D +=0D +[LibraryClasses]=0D + UefiDriverEntryPoint=0D + SctLib=0D + EfiTestLib=0D +=0D +[Protocols]=0D + gBlackBoxEfiHIIConfigAccessProtocolGuid=0D + gBlackBoxEfiHIIConfigRoutingProtocolGuid=0D + gBlackBoxEfiDevicePathProtocolGuid=0D --=0D 2.22.0.windows.1=0D =0D