From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: eric.jin@intel.com) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by groups.io with SMTP; Tue, 16 Jul 2019 20:37:05 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jul 2019 20:37:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,272,1559545200"; d="scan'208";a="195104683" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 16 Jul 2019 20:37:03 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 16 Jul 2019 20:37:03 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.109]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.110]) with mapi id 14.03.0439.000; Wed, 17 Jul 2019 11:37:02 +0800 From: "Eric Jin" To: "devel@edk2.groups.io" , "Jin, Eric" , shrishail CC: "supreeth.venkatesh@arm.com" , "Jeff.Booher-Kaeding@arm.com" Subject: Re: [edk2-test][PATCH] Adding HII to IHVSCT Thread-Topic: [edk2-test][PATCH] Adding HII to IHVSCT Thread-Index: AdU8ScmNN6Oe2KlMSOWD7xWkKjbI1QAAfvdg Date: Wed, 17 Jul 2019 03:37:01 +0000 Message-ID: References: <15B21220C2BCC530.20638@groups.io> In-Reply-To: <15B21220C2BCC530.20638@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: eric.jin@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Shrishail, Thank you for the patch for adding HiiConfigAccess to IHV SCT. Two comments below are about the patch format. They can be caught by edk2\= BaseTools\Scripts\PatchCheck.py=20 1) The commit message format is not valid: * Missing Signed-off-by! (Note: this must be added by the code contributo= r!) https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-Forma= t 2) Code format is not valid: (I think the original code in EFI part also = has this issue, but please help to correct them in the IHV part at first) * Trailing whitespace found * Tab character used Another suggestion is to separate the patch to 2 or 3 in one series, eg, s= ource, script, and or description file, When you send the v2. Since the code comes from EFI part, and code exists serval years there, I = think the test logic is correct with your patch. Don't forget to add your c= ompany info in the file header. Thanks. Best Regards Eric -----Original Message----- From: devel@edk2.groups.io On Behalf Of Eric Jin Sent: Wednesday, July 17, 2019 10:52 AM To: shrishail ; devel@edk2.groups.io Cc: Jin, Eric ; supreeth.venkatesh@arm.com; Jeff.Boohe= r-Kaeding@arm.com Subject: [edk2-devel] FW:[edk2-test][PATCH] Adding HII to IHVSCT Forward to devel@edk2.groups.io with public review. -----Original Message----- From: shrishail =20 Sent: Friday, July 12, 2019 5:47 PM To: Jin, Eric Cc: shrishailp <50140165+shrishailp@users.noreply.github.com> Subject: [PATCH] Adding HII to IHVSCT From: shrishailp <50140165+shrishailp@users.noreply.github.com> Adding HII to IHVSCT --- uefi-sct/SctPkg/CommonGenFramework.bat | 2 +- uefi-sct/SctPkg/CommonGenFramework.sh | 2 +- uefi-sct/SctPkg/Config/Data/Category.ini | 7 + .../HIIConfigAccess/BlackBoxTest/Guid.c | 46 + .../HIIConfigAccess/BlackBoxTest/Guid.h | 109 +++ .../HIIConfigAccessBBTestConformance.c | 908 ++++++++++++++++++ .../HIIConfigAccessBBTestFunction.c | 606 ++++++++++++ .../BlackBoxTest/HIIConfigAccessBBTestMain.c | 655 +++++++++++++ .../BlackBoxTest/HIIConfigAccessBBTestMain.h | 168 ++++ .../BlackBoxTest/IhvHIIConfigAccessBBTest.inf | 55 ++ uefi-sct/SctPkg/UEFI/IHV_SCT.dsc | 1 + 11 files changed, 2557 insertions(+), 2 deletions(-) create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAc= cess/BlackBoxTest/Guid.c create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAc= cess/BlackBoxTest/Guid.h create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAc= cess/BlackBoxTest/HIIConfigAccessBBTestConformance.c create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAc= cess/BlackBoxTest/HIIConfigAccessBBTestFunction.c create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAc= cess/BlackBoxTest/HIIConfigAccessBBTestMain.c create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAc= cess/BlackBoxTest/HIIConfigAccessBBTestMain.h create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAc= cess/BlackBoxTest/IhvHIIConfigAccessBBTest.inf diff --git a/uefi-sct/SctPkg/CommonGenFramework.bat b/uefi-sct/SctPkg/Comm= onGenFramework.bat index 5c614eaa..8e75d8a8 100644 --- a/uefi-sct/SctPkg/CommonGenFramework.bat +++ b/uefi-sct/SctPkg/CommonGenFramework.bat @@ -279,7 +279,7 @@ rem copy %ProcessorType%\IhvUsbHcTest.efi = %Framework%\T copy %ProcessorType%\IhvUsb2HcTest.efi %Framewor= k%\Test\ > NUL copy %ProcessorType%\IhviScsiInitiatorNameBBTest.efi %Framewor= k%\Test\ > NUL copy %ProcessorType%\IhvStorageSecurityCommandBBTest.efi %Framewor= k%\Test\ > NUL - + copy %ProcessorType%\IhvHIIConfigAccessBBTest.efi %Framewor= k%\Test\ > NUL rem ********************************************* rem Copy the UEFI 2.1 Test Cases for IHV rem ********************************************* diff --git a/uefi-sct/SctPkg/CommonGenFramework.sh b/uefi-sct/SctPkg/Commo= nGenFramework.sh index c422034a..f0d1527b 100755 --- a/uefi-sct/SctPkg/CommonGenFramework.sh +++ b/uefi-sct/SctPkg/CommonGenFramework.sh @@ -312,7 +312,7 @@ then cp $ProcessorType/IhvUsb2HcTest.efi $Framework/T= est/ > NUL cp $ProcessorType/IhviScsiInitiatorNameBBTest.efi $Framework/T= est/ > NUL cp $ProcessorType/IhvStorageSecurityCommandBBTest.efi $Framework/T= est/ > NUL - + cp $ProcessorType/IhvHIIConfigAccessBBTest.efi $Framework/T= est/ > NUL # ********************************************* # Copy the UEFI 2.1 Test Cases for IHV # ********************************************* diff --git a/uefi-sct/SctPkg/Config/Data/Category.ini b/uefi-sct/SctPkg/Co= nfig/Data/Category.ini index 3e9f5e52..0bf8246e 100644 --- a/uefi-sct/SctPkg/Config/Data/Category.ini +++ b/uefi-sct/SctPkg/Config/Data/Category.ini @@ -479,6 +479,13 @@ InterfaceGuid =3D 330D4706-F2A0-4E4F-A369-B66FA8D5438= 5 Name =3D HIITest\HIIConfigAccessProtocolTest Description =3D =20 +[Category Data] +Revision =3D 0x00010000 +CategoryGuid =3D 68820884-4BE3-4CA9-8381-9E98F3F48DAF +InterfaceGuid =3D 330D4706-F2A0-4E4F-A369-B66FA8D54385 +Name =3D IHV\HIITest\HIIConfigAccessProtocolTest +Description =3D + [Category Data] Revision =3D 0x00010000 CategoryGuid =3D 587E72D7-CC50-4F79-8209-CA291FC1A10F diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/Bl= ackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAcc= ess/BlackBoxTest/Guid.c new file mode 100644 index 00000000..6a6d4e60 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxT= est/Guid.c @@ -0,0 +1,46 @@ +/** @file + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the B= SD License + which accompanies this distribution. The full text of the license may = be found at=20 + http://opensource.org/licenses/bsd-license.php +=20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +=20 +**/ +/*++ + + Module Name: + + Guid.c + + Abstract: + + GUIDs auto-generated for EFI test assertion. + +--*/ + +#include "HIIConfigAccessBBTestMain.h" + +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid001=3DEFI_TEST_HII= CONFIGACCESSBBTESTCONFORMANCE_ASSERTION_001_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid002=3DEFI_TEST_HII= CONFIGACCESSBBTESTCONFORMANCE_ASSERTION_002_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid003=3DEFI_TEST_HII= CONFIGACCESSBBTESTCONFORMANCE_ASSERTION_003_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid004=3DEFI_TEST_HII= CONFIGACCESSBBTESTCONFORMANCE_ASSERTION_004_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid005=3DEFI_TEST_HII= CONFIGACCESSBBTESTCONFORMANCE_ASSERTION_005_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid006=3DEFI_TEST_HII= CONFIGACCESSBBTESTCONFORMANCE_ASSERTION_006_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid007=3DEFI_TEST_HII= CONFIGACCESSBBTESTCONFORMANCE_ASSERTION_007_GUID; +/* +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid008=3DEFI_TEST_HII= CONFIGACCESSBBTESTCONFORMANCE_ASSERTION_008_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid009=3DEFI_TEST_HII= CONFIGACCESSBBTESTCONFORMANCE_ASSERTION_009_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid0010=3DEFI_TEST_HI= ICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_0010_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid0011=3DEFI_TEST_HI= ICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_0011_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid0012=3DEFI_TEST_HI= ICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_0012_GUID; +*/ +EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid001=3DEFI_TEST_HIICON= FIGACCESSBBTESTFUNCTION_ASSERTION_001_GUID; +EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid002=3DEFI_TEST_HIICON= FIGACCESSBBTESTFUNCTION_ASSERTION_002_GUID; +EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid003=3DEFI_TEST_HIICON= FIGACCESSBBTESTFUNCTION_ASSERTION_003_GUID; +EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid004=3DEFI_TEST_HIICON= FIGACCESSBBTESTFUNCTION_ASSERTION_004_GUID; diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/Bl= ackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAcc= ess/BlackBoxTest/Guid.h new file mode 100644 index 00000000..b7003028 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxT= est/Guid.h @@ -0,0 +1,109 @@ +/** @file + + Copyright 2006 - 2011 Unified EFI, Inc.
+ Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the B= SD License + which accompanies this distribution. The full text of the license may = be found at=20 + http://opensource.org/licenses/bsd-license.php +=20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +=20 +**/ +/*++ + + Module Name: + + Guid.h + + Abstract: + + GUIDs auto-generated for EFI test assertion. + +--*/ + +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_001_GUID \ +{ 0xa7173eb5, 0xf76a, 0x4ea1, { 0x95, 0xd, 0x14, 0x91, 0x1e, 0x49, 0x86, = 0xc1 } } + +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid001; + +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_002_GUID \ +{ 0xfa5973e2, 0xd05, 0x44c2, { 0xaf, 0x2d, 0x1b, 0x68, 0x33, 0x42, 0x6d, = 0x76 } } + +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid002; + +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_003_GUID \ +{ 0x6f6d1dd, 0x49b8, 0x488a, { 0xa7, 0x75, 0xde, 0xbc, 0xc7, 0x60, 0xfd, = 0x28 } } + +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid003; + +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_004_GUID \ +{ 0x28652613, 0x6bf4, 0x4f42, { 0xab, 0xe2, 0x84, 0x4f, 0x2f, 0x77, 0xec,= 0x2f } } + +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid004; + +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_005_GUID \ +{ 0xebba197a, 0x467f, 0x4736, { 0x92, 0xf2, 0x11, 0xb1, 0x91, 0x2e, 0xe9,= 0x90 } } + + +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid005; + +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_006_GUID \ +{ 0x341fe3e0, 0xf688, 0x45f2, { 0x91, 0x56, 0xc7, 0xae, 0x9f, 0x2c, 0xcb,= 0xb0 } } + +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid006; + +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_007_GUID \ +{ 0x1f99ebc8, 0x253, 0x455f, { 0x88, 0xac, 0x9e, 0x2b, 0xa6, 0xdc, 0xd7, = 0x29 } } + +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid007; +/* +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_008_GUID \ +{ 0xbdec5b08, 0x423, 0x482b, { 0xb7, 0xdf, 0xde, 0xac, 0xab, 0xf7, 0x13, = 0x11 } } + +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid008; + + +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_009_GUID \ +{ 0x5fed024d, 0x85f3, 0x45bf, { 0xbe, 0xb1, 0xe4, 0xf4, 0xcc, 0x86, 0xe5,= 0x61 } } + +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid009; + +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_0010_GUID \ +{ 0x22ee938e, 0xa9ad, 0x4cb9, { 0x8d, 0x6d, 0x6, 0xe4, 0xfa, 0xb3, 0x72, = 0xe7 } } + +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid0010; + +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_0011_GUID \ +{ 0x2053d3e0, 0xeebe, 0x4391, { 0x84, 0x7d, 0xf4, 0x60, 0x1b, 0x30, 0x4e,= 0x3 } } + +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid0011; + +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_0012_GUID \ +{ 0x81c5d7b7, 0x7ebe, 0x44e1, { 0x8a, 0x1f, 0xcc, 0x47, 0x9c, 0x2d, 0xfe,= 0x4f } } + +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid0012; +*/ + +#define EFI_TEST_HIICONFIGACCESSBBTESTFUNCTION_ASSERTION_001_GUID \ +{ 0x24dcf8bf, 0xbfbf, 0x4588, { 0xba, 0xf, 0x77, 0x1e, 0x24, 0x4e, 0x3e, = 0x8 } } + +extern EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid001; + +#define EFI_TEST_HIICONFIGACCESSBBTESTFUNCTION_ASSERTION_002_GUID \ +{ 0x961a5268, 0x1998, 0x4a7e, { 0x9d, 0x9d, 0xce, 0xdc, 0x67, 0xfb, 0xcc,= 0x77 } } + +extern EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid002; + +#define EFI_TEST_HIICONFIGACCESSBBTESTFUNCTION_ASSERTION_003_GUID \ +{ 0x603e52f0, 0x2ce3, 0x4e7a, { 0xa7, 0x2e, 0xdf, 0x8c, 0xa3, 0xfd, 0xb2,= 0xd } } + +extern EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid003; + +#define EFI_TEST_HIICONFIGACCESSBBTESTFUNCTION_ASSERTION_004_GUID \ +{ 0xab163674, 0x6c27, 0x4169, { 0xa6, 0xa9, 0xe1, 0x9c, 0x88, 0x14, 0x94,= 0x96 } } + +extern EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid004; + diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/Bl= ackBoxTest/HIIConfigAccessBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UE= FI/IHV/Protocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestConforman= ce.c new file mode 100644 index 00000000..c8b35003 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxT= est/HIIConfigAccessBBTestConformance.c @@ -0,0 +1,908 @@ +/** @file + + Copyright 2006 - 2016 Unified EFI, Inc.
+ Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the B= SD License + which accompanies this distribution. The full text of the license may = be found at=20 + http://opensource.org/licenses/bsd-license.php +=20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +=20 +**/ +/*++ + +Module Name: + HIIConfigAccessBBTestConformance.c + +Abstract: + for EFI Driver HII Configuration Access Protocol's conformance Test + +--*/ + +#include "HIIConfigAccessBBTestMain.h" + +EFI_BROWSER_ACTION EFI_BROWSER_ACTION_UNSUPPORTED =3D 2; + +EFI_STATUS +BBTestExtractConfigConformanceTestCheckpoint1 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ); + +EFI_STATUS +BBTestExtractConfigConformanceTestCheckpoint2 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ); + +EFI_STATUS +BBTestExtractConfigConformanceTestCheckpoint3 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ); + +EFI_STATUS +BBTestExtractConfigConformanceTestCheckpoint4 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ); + +EFI_STATUS +BBTestRouteConfigConformanceTestCheckpoint1 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ); + +EFI_STATUS +BBTestRouteConfigConformanceTestCheckpoint2 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ); + +EFI_STATUS +BBTestRouteConfigConformanceTestCheckpoint3 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ); +/* +EFI_STATUS +BBTestCallBackConformanceTestCheckpoint1 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ); + +EFI_STATUS +BBTestCallBackConformanceTestCheckpoint2 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ); + +EFI_STATUS +BBTestCallBackConformanceTestCheckpoint3 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ); + +EFI_STATUS +BBTestCallBackConformanceTestCheckpoint4 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ); +*/ + +EFI_STATUS +BBTestExtractConfigConformanceTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess; + EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting; + + // + // init + // + HIIConfigAccess =3D (EFI_HII_CONFIG_ACCESS_PROTOCOL*)ClientInterface; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the Config Routing Protocol Interface + // + Status =3D GetHIIConfigRoutingInterface( &HIIConfigRouting ); + if ( EFI_ERROR(Status) ) { + return Status; + } + + // + //Call check points + // + BBTestExtractConfigConformanceTestCheckpoint1( StandardLib, HIIConfigAc= cess ); + BBTestExtractConfigConformanceTestCheckpoint2( StandardLib, HIIConfigRo= uting, HIIConfigAccess ); + BBTestExtractConfigConformanceTestCheckpoint3( StandardLib, HIIConfigRo= uting, HIIConfigAccess ); + BBTestExtractConfigConformanceTestCheckpoint4( StandardLib, HIIConfigAc= cess ); + + return EFI_SUCCESS; +} + +EFI_STATUS +BBTestRouteConfigConformanceTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess; + EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting; + + // + // init + // + HIIConfigAccess =3D (EFI_HII_CONFIG_ACCESS_PROTOCOL*)ClientInterface; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the Config Routing Protocol Interface + // + Status =3D GetHIIConfigRoutingInterface( &HIIConfigRouting ); + if ( EFI_ERROR(Status) ) { + return Status; + } + + // + //Call check points + // + BBTestRouteConfigConformanceTestCheckpoint1( StandardLib, HIIConfigAcce= ss ); + BBTestRouteConfigConformanceTestCheckpoint2( StandardLib, HIIConfigRout= ing, HIIConfigAccess ); + BBTestRouteConfigConformanceTestCheckpoint3( StandardLib, HIIConfigAcce= ss ); + + return EFI_SUCCESS; +} + +/* +EFI_STATUS +BBTestCallBackConformanceTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess; + + // + // init + // + HIIConfigAccess =3D (EFI_HII_CONFIG_ACCESS_PROTOCOL*)ClientInterface; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + if (EFI_ERROR(Status)) { + return Status; + } + + // + //Call check points + // + BBTestCallBackConformanceTestCheckpoint1( StandardLib, HIIConfigAccess = ); + BBTestCallBackConformanceTestCheckpoint2( StandardLib, HIIConfigAccess = ); + BBTestCallBackConformanceTestCheckpoint3( StandardLib, HIIConfigAccess = ); + BBTestCallBackConformanceTestCheckpoint4( StandardLib, HIIConfigAccess = ); + + return EFI_SUCCESS; +} +*/ + +// +//Check Points +// + +EFI_STATUS +BBTestExtractConfigConformanceTestCheckpoint1 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ) +{ + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; +=20 + EFI_STRING Progress =3D NULL; + EFI_STRING Results =3D NULL; + EFI_STRING ResultsPtr =3D NULL; + UINTN Len =3D 0; + CHAR16* Pointer =3D NULL; + UINT8 IfMulti =3D 0; + + EFI_STRING Request =3D NULL; + // + // Call ExtractConfig with Request been + // + Status =3D HIIConfigAccess->ExtractConfig ( + HIIConfigAccess, + NULL, + &Progress, + &Results + ); + + if ( Status =3D=3D EFI_SUCCESS ) { + Len =3D SctStrLen (Results); + // + // Make sure the size of Request is enough to hold =20 + // if original Results is not Multi + // + Request =3D (EFI_STRING) SctAllocateZeroPool ( 2 * Len + 2 + 256); + if (Request =3D=3D NULL) { + SctFreePool (Results); + return EFI_OUT_OF_RESOURCES; + } + } else { + return Status; + } + + Status =3D MultiAltRespToMultiReq (Results, Request); + ResultsPtr =3D Request; + + SctFreePool (Results); + Results =3D NULL; + + if ( SctStrStr (Request, L"GUID=3D") !=3D NULL ) { + Pointer =3D SctStrStr (Request, L"GUID=3D"); + Pointer++; + if ( SctStrStr (Pointer, L"GUID=3D") !=3D NULL ) + IfMulti =3D 1; + } + + if ( IfMulti =3D=3D 0 ) { + SctStrCat ( Request, L"&GUID=3D970eb94aa0d449f7b980bdaa47d42527&NAME= =3D006a0069006e0039&PATH=3D000acf&grag&star"); + } + + Status =3D HIIConfigAccess->ExtractConfig ( + HIIConfigAccess, + Request, + &Progress, + &Results + ); + + if ( (EFI_INVALID_PARAMETER !=3D Status) || (SctStrnCmp (Progress, L"&G= UID=3D", 6) !=3D 0) ) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestConformanceAssertionGuid001, + L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig - ExtractConf= ig() returns EFI_INVALID_PARAMETER with Request been ."= , + L"%a:%d: Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + SctFreePool (Request); + return EFI_SUCCESS; +} +=20 +EFI_STATUS +BBTestExtractConfigConformanceTestCheckpoint2 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ) +{ + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + + EFI_STRING Request =3D NULL; + EFI_STRING Results =3D NULL; + EFI_STRING MultiConfigAltResp =3D NULL; + EFI_STRING DevicePath =3D NULL; + + //init the Request=20 + Status =3D HIIConfigRouting->ExportConfig( + HIIConfigRouting, + &MultiConfigAltResp + ); + if (EFI_ERROR(Status)) { + return Status; + } + + Status =3D GetDevicePath ( HIIConfigAccess, &DevicePath ); + if (EFI_ERROR(Status)) { + gtBS->FreePool (MultiConfigAltResp); + return Status; + } + + Request =3D (EFI_STRING) SctAllocateZeroPool ( 2 * SctStrLen (MultiConf= igAltResp) + 2 ); + if (Request =3D=3D NULL) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + return EFI_OUT_OF_RESOURCES; + } + + Status =3D GetCorrespondingRequest (MultiConfigAltResp, DevicePath, Req= uest); + if (EFI_ERROR(Status)) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + gtBS->FreePool (Request); + return Status; + } + + // + // Call ExtractConfig with Progress been NULL + // + Status =3D HIIConfigAccess->ExtractConfig ( + HIIConfigAccess, + Request, + NULL, + &Results + ); + + if ( EFI_INVALID_PARAMETER !=3D Status ) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestConformanceAssertionGuid002, + L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig - ExtractConf= ig() returns EFI_INVALID_PARAMETER with Progress been NULL.", + L"%a:%d: Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + gtBS->FreePool (Request); + + return EFI_SUCCESS; +} +=20 +EFI_STATUS +BBTestExtractConfigConformanceTestCheckpoint3 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ) +{ + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + + EFI_STRING Request =3D NULL; + EFI_STRING Progress =3D NULL; + EFI_STRING MultiConfigAltResp =3D NULL; + EFI_STRING DevicePath =3D NULL; + + //init the Request=20 + Status =3D HIIConfigRouting->ExportConfig( + HIIConfigRouting, + &MultiConfigAltResp + ); + if (EFI_ERROR(Status)) { + return Status; + } + + Status =3D GetDevicePath ( HIIConfigAccess, &DevicePath ); + if (EFI_ERROR(Status)) { + gtBS->FreePool (MultiConfigAltResp); + return Status; + } + + Request =3D (EFI_STRING) SctAllocateZeroPool ( 2 * SctStrLen (MultiConf= igAltResp) + 2 ); + if (Request =3D=3D NULL) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + return EFI_OUT_OF_RESOURCES; + } + + Status =3D GetCorrespondingRequest (MultiConfigAltResp, DevicePath, Req= uest); + if (EFI_ERROR(Status)) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + gtBS->FreePool (Request); + return Status; + } + // + // Call ExtractConfig with Results been NULL + // + Status =3D HIIConfigAccess->ExtractConfig ( + HIIConfigAccess, + Request, + &Progress, + NULL + ); + + if ( EFI_INVALID_PARAMETER !=3D Status ) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestConformanceAssertionGuid003, + L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig - ExtractConf= ig() returns EFI_INVALID_PARAMETER with Results been NULL.", + L"%a:%d: Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + gtBS->FreePool (Request); + + return EFI_SUCCESS; +} + +=20 +EFI_STATUS +BBTestExtractConfigConformanceTestCheckpoint4 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ) +{ + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + + EFI_STRING Request; + EFI_STRING Progress =3D NULL; + EFI_STRING Results =3D NULL; + + //init the Request + Request =3D L"GUID=3D71e430fb2e8849779d7a33ef1139e7ed&NAME=3D006a006900= 6e0039&PATH=3D000acf&Jack&Rons&Nash&Mary"; + + // + // Call ExtractConfig with unknown name=20 + // + Status =3D HIIConfigAccess->ExtractConfig ( + HIIConfigAccess, + Request, + &Progress, + &Results + ); + + if ( ((EFI_INVALID_PARAMETER =3D=3D Status) && (SctStrnCmp (Progress, L= "&Jack&Rons&Nash&Mary", 20) =3D=3D 0)) || + ((EFI_NOT_FOUND =3D=3D Status) && (Progress =3D=3D Request)) ) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestConformanceAssertionGuid004, + L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig - ExtractConfig() r= eturns EFI_INVALID_PARAMETER/EFI_NOT_FOUND with invalid input.", + L"%a:%d: Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return EFI_SUCCESS; + } + +=20 +EFI_STATUS +BBTestRouteConfigConformanceTestCheckpoint1 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ) +{ + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + + EFI_STRING Progress =3D NULL; + + + // + // Call RouteConfig with Configuration been NULL + // + Status =3D HIIConfigAccess->RouteConfig ( + HIIConfigAccess, + NULL, + &Progress + ); + + if ( EFI_INVALID_PARAMETER !=3D Status ) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestConformanceAssertionGuid005, + L"HII_CONFIG_ACCESS_PROTOCOL.RouteConfig - RouteConfig() retur= ns EFI_INVALID_PARAMETER with Configuration been NULL.", + L"%a:%d: Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return EFI_SUCCESS; + } +=20 +EFI_STATUS +BBTestRouteConfigConformanceTestCheckpoint2 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ) +{ + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + + EFI_STRING Config =3D NULL; + EFI_STRING MultiConfigAltResp =3D NULL; + EFI_STRING DevicePath =3D NULL; + + //init the Request=20 + Status =3D HIIConfigRouting->ExportConfig( + HIIConfigRouting, + &MultiConfigAltResp + ); + if (EFI_ERROR(Status)) { + return Status; + } + + Status =3D GetDevicePath ( HIIConfigAccess, &DevicePath ); + if (EFI_ERROR(Status)) { + gtBS->FreePool (MultiConfigAltResp); + return Status; + } + + Config =3D (EFI_STRING) SctAllocateZeroPool ( 2 * SctStrLen (MultiConfi= gAltResp) + 2 ); + if (Config =3D=3D NULL) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + return EFI_OUT_OF_RESOURCES; + } + + Status =3D GetCorrespondingResp (MultiConfigAltResp, DevicePath, Config= ); + if (EFI_ERROR(Status)) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + gtBS->FreePool (Config); + return Status; + } + + // + // Call RouteConfig with Progress been NULL + // + Status =3D HIIConfigAccess->RouteConfig ( + HIIConfigAccess, + Config, + NULL + ); + + if ( EFI_INVALID_PARAMETER !=3D Status ) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestConformanceAssertionGuid006, + L"HII_CONFIG_ACCESS_PROTOCOL.RouteConfig - RouteConfig()= returns EFI_INVALID_PARAMETER with Progress been NULL.", + L"%a:%d: Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + gtBS->FreePool (Config); + + return EFI_SUCCESS; +} +=20 +EFI_STATUS +BBTestRouteConfigConformanceTestCheckpoint3 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ) +{ + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + + EFI_STRING Configuration; + EFI_STRING Progress =3D NULL; + + //init the Configuration + Configuration=3DL"GUID=3D71e430fb2e8849779d7a33ef1139e7ed&NAME=3D006a00= 69006e0039&PATH=3D0acf&OFFSET=3D2&WIDTH=3D3VALUE=3D45AF"; + + // + // Call RouteConfig with no found target for the routing data + // + Status =3D HIIConfigAccess->RouteConfig ( + HIIConfigAccess, + Configuration, + &Progress + ); + + if ( EFI_NOT_FOUND !=3D Status ) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestConformanceAssertionGuid007, + L"HII_CONFIG_ACCESS_PROTOCOL.RouteConfig - RouteConfig() retur= ns EFI_NOT_FOUND with no found target for the routing data.", + L"%a:%d: Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + return EFI_SUCCESS; +} + +/* +EFI_STATUS +BBTestCallBackConformanceTestCheckpoint1 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ) +{ + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + + EFI_QUESTION_ID QuestionId; + UINT8 Type; + EFI_IFR_TYPE_VALUE Value; + EFI_BROWSER_ACTION_REQUEST ActionRequest; + + //init the parameter + QuestionId=3D0x1234; + Type=3DEFI_IFR_TYPE_NUM_SIZE_8; + +=20 + // + // Call CallBack with the Action been NULL + // + Status =3D HIIConfigAccess->CallBack ( + HIIConfigAccess, + NULL, + QuestionId, + =09 =09 Type, + =09 =09 &Value, + =09 =09 &ActionRequest + ); + + if ( EFI_INVALID_PARAMETER !=3D Status ) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + + //check the output ActionRequest + if ((EFI_BROWSER_ACTION_REQUEST_NONE || EFI_BROWSER_ACTION_REQUEST_RESE= T || EFI_BROWSER_ACTION_REQUEST_SUBMIT || EFI_BROWSER_ACTION_REQUEST_EXIT) = !=3D ActionRequest) + AssertionType =3D EFI_TEST_ASSERTION_FAILED; +=09 + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestConformanceAssertionGuid009, + L"HII_CONFIG_ACCESS_PROTOCOL.CallBack - CallBack() returns EFI= _INVALID_PARAMETER with Action been NULL .", + L"%a:%d: Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return EFI_SUCCESS; + +} + +EFI_STATUS +BBTestCallBackConformanceTestCheckpoint2 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ) +{ + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + + EFI_BROWSER_ACTION *Action; + EFI_QUESTION_ID QuestionId; + UINT8 Type; + EFI_IFR_TYPE_VALUE Value; + + + //init the parameter + Action=3DEFI_BROWSER_ACTION_REQUEST_CHANGING; + QuestionId=3D0x1234; + Type=3DEFI_IFR_TYPE_NUM_SIZE_8; + +=20 + // + // Call CallBack with the ActionRequest been NULL + // + Status =3D HIIConfigAccess->CallBack ( + HIIConfigAccess, + Action, + QuestionId, + =09 =09 Type, + =09 =09 &Value, + =09 =09 NULL + ); + + if ( EFI_INVALID_PARAMETER !=3D Status ) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; +=09 + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestConformanceAssertionGuid0010, + L"HII_CONFIG_ACCESS_PROTOCOL.CallBack - CallBack() returns EFI= _INVALID_PARAMETER with QuestionId been NULL.", + L"%a:%d: Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return EFI_SUCCESS; + +} + +EFI_STATUS +BBTestCallBackConformanceTestCheckpoint3( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ) +{ + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + + EFI_BROWSER_ACTION *Action; + EFI_QUESTION_ID QuestionId; + UINT8 Type; + EFI_BROWSER_ACTION_REQUEST ActionRequest; + + //init the parameter + Action =3D EFI_BROWSER_ACTION_REQUEST_CHANGING; + QuestionId =3D 0x1234; + Type =3D EFI_IFR_TYPE_NUM_SIZE_8; + +=20 + // + // Call CallBack with the Value been NULL + // + Status =3D HIIConfigAccess->CallBack ( + HIIConfigAccess, + Action, + QuestionId, + =09 =09 Type, + =09 =09 NULL, + =09 =09 &ActionRequest + ); + + if ( EFI_INVALID_PARAMETER !=3D Status ) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; +=09 + //check the output ActionRequest + if ((EFI_BROWSER_ACTION_REQUEST_NONE || EFI_BROWSER_ACTION_REQUEST_RESE= T || EFI_BROWSER_ACTION_REQUEST_SUBMIT || EFI_BROWSER_ACTION_REQUEST_EXIT) = !=3D ActionRequest) + AssertionType =3D EFI_TEST_ASSERTION_FAILED; +=09 + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestConformanceAssertionGuid0011, + L"HII_CONFIG_ACCESS_PROTOCOL.CallBack - CallBack() returns EFI= _INVALID_PARAMETER with Value been NULL.", + L"%a:%d: Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return EFI_SUCCESS; + +} + +EFI_STATUS +BBTestCallBackConformanceTestCheckpoint4 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ) +{ + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + + EFI_BROWSER_ACTION *Action; + EFI_QUESTION_ID QuestionId; + UINT8 Type; + EFI_IFR_TYPE_VALUE Value; + EFI_BROWSER_ACTION_REQUEST ActionRequest; + + //init the parameter + Action=3D&EFI_BROWSER_ACTION_UNSUPPORTED; + QuestionId=3D0x1234; + Type=3DEFI_IFR_TYPE_NUM_SIZE_8; + + + // + // Call CallBack with the specified action not supported by the callba= ck + // + Status =3D HIIConfigAccess->CallBack ( + HIIConfigAccess, + Action, + QuestionId, + =09 =09 Type, + =09 =09 &Value, + =09 =09 &ActionRequest + ); + + if ( EFI_UNSUPPORTED !=3D Status ) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; +=09 + //check the output ActionRequest + if ((EFI_BROWSER_ACTION_REQUEST_NONE || EFI_BROWSER_ACTION_REQUEST_RESE= T || EFI_BROWSER_ACTION_REQUEST_SUBMIT || EFI_BROWSER_ACTION_REQUEST_EXIT) = !=3D ActionRequest) + AssertionType =3D EFI_TEST_ASSERTION_FAILED; +=09 + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestConformanceAssertionGuid0012, + L"HII_CONFIG_ACCESS_PROTOCOL.CallBack - CallBack() returns EFI= _ UNSUPPORTED with the specified action not supported by the callback .", + L"%a:%d: Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return EFI_SUCCESS; + +} +*/ diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/Bl= ackBoxTest/HIIConfigAccessBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/= IHV/Protocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestFunction.c new file mode 100644 index 00000000..14cc5684 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxT= est/HIIConfigAccessBBTestFunction.c @@ -0,0 +1,606 @@ +/** @file + + Copyright 2006 - 2017 Unified EFI, Inc.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the B= SD License + which accompanies this distribution. The full text of the license may = be found at=20 + http://opensource.org/licenses/bsd-license.php +=20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +=20 +**/ +/*++ + +Module Name: + HIIConfigAccessBBTestFunction.c + +Abstract: + for EFI Driver HII Configuration Access Protocol's function Test + +--*/ + +#include "HIIConfigAccessBBTestMain.h" + + +EFI_STATUS +BBTestExtractConfigFunctionTestCheckpoint1 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ); + +EFI_STATUS +BBTestExtractConfigFunctionTestCheckpoint2 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ); + +EFI_STATUS +BBTestRouteConfigFunctionTestCheckpoint1 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ); +/* +EFI_STATUS +BBTestCallBackFunctionTestCheckpoint1 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ); +*/ + +// +//Test Cases +// +/* +EFI_STATUS +BBTestUnitTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STATUS Status; + EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess; + EFI_STRING DevicePath =3D NULL; + EFI_STRING Request =3D NULL; + EFI_STRING Resp =3D NULL; + EFI_STRING MultiConfigAltResp =3D L"GUID=3D970eb94aa0d449f7b980bdaa4= 7d42527&NAME=3Dft894&PATH=3D000acf&OFFSET=3D3&WIDTH=3D4&VALUE=3Daabbccdd&OF= FSET=3D1&WIDTH=3D2&VALUE=3Deeff&GUID=3D970eb94aa0d449f7b980bdaa47d42527&NAM= E=3Dft894&PATH=3D000acf&ALTCFG=3D0037&A000=3Dabcd&B000=3Defef&GUID=3D970eb9= 4aa0d449f7b980bdaa47d42528&NAME=3Dft894&PATH=3D0104180035170b0fa0879341b266= 538c38af48ce000000007fff0400&A000=3Dabcd&B000=3Defef&GUID=3D970eb94aa0d449f= 7b980bdaa47d42528&NAME=3Dft894&PATH=3D0104180035170b0fa0879341b266538c38af4= 8ce000000007fff0400&ALTCFG=3D0037&OFFSET=3D3&WIDTH=3D4&VALUE=3Daabbccdd&OFF= SET=3D1&WIDTH=3D2&VALUE=3Deeff";; + + // + // init + // + HIIConfigAccess =3D (EFI_HII_CONFIG_ACCESS_PROTOCOL*)ClientInterface; + + Request =3D (EFI_STRING) SctAllocateZeroPool (2 * SctStrLen (MultiConfi= gAltResp) + 2); + if (Request =3D=3D NULL) + return EFI_OUT_OF_RESOURCES; + + Resp =3D (EFI_STRING) SctAllocateZeroPool (2 * SctStrLen (MultiConfigAl= tResp) + 2); + if (Resp =3D=3D NULL) { + gtBS->FreePool (Request); + return EFI_OUT_OF_RESOURCES; + } + + Status =3D GetDevicePath ( HIIConfigAccess, &DevicePath ); + if (EFI_ERROR(Status)) { + gtBS->FreePool (Resp); + gtBS->FreePool (Request); + return Status; + } + + Status =3D GetCorrespondingRequest (MultiConfigAltResp, DevicePath, Req= uest); + + Status =3D GetCorrespondingResp (MultiConfigAltResp, DevicePath, Resp); + + gtBS->FreePool (Request); + gtBS->FreePool (Resp); + gtBS->FreePool (DevicePath); + + return EFI_SUCCESS; +} +*/ + +EFI_STATUS +BBTestExtractConfigFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess; + EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting; + + // + // init + // + HIIConfigAccess =3D (EFI_HII_CONFIG_ACCESS_PROTOCOL*)ClientInterface; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the Config Routing Protocol Interface + // + Status =3D GetHIIConfigRoutingInterface( &HIIConfigRouting ); + if ( EFI_ERROR(Status) ) { + return Status; + } + + // + //Call check points + // + BBTestExtractConfigFunctionTestCheckpoint1( StandardLib, HIIConfigRouti= ng, HIIConfigAccess ); + BBTestExtractConfigFunctionTestCheckpoint2( StandardLib, HIIConfigRouti= ng, HIIConfigAccess ); + + return EFI_SUCCESS; +} + + +EFI_STATUS +BBTestRouteConfigFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess; + EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting; + + // + // init + // + HIIConfigAccess =3D (EFI_HII_CONFIG_ACCESS_PROTOCOL*)ClientInterface; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the Config Routing Protocol Interface + // + Status =3D GetHIIConfigRoutingInterface( &HIIConfigRouting ); + if ( EFI_ERROR(Status) ) { + return Status; + } + + // + //Call check points + // + BBTestRouteConfigFunctionTestCheckpoint1( StandardLib, HIIConfigRouting= , HIIConfigAccess ); + + return EFI_SUCCESS; +} + +/* +EFI_STATUS +BBTestCallBackFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess; + + // + // init + // + HIIConfigAccess =3D (EFI_HII_CONFIG_ACCESS_PROTOCOL*)ClientInterface; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + if (EFI_ERROR(Status)) { + return Status; + } + + // + //Call check points + // + BBTestCallBackFunctionTestCheckpoint1( StandardLib, HIIConfigAccess ); + + return EFI_SUCCESS; +} +*/ + +// +//Check Points +// +EFI_STATUS +BBTestExtractConfigFunctionTestCheckpoint1 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ) +{ + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + + EFI_STRING Request =3D NULL; + EFI_STRING ConfigHdr =3D NULL; + EFI_STRING Progress =3D NULL; + EFI_STRING Results =3D NULL; + EFI_STRING MultiConfigAltResp =3D NULL; + EFI_STRING DevicePath =3D NULL; + + + //init the Request=20 + Status =3D HIIConfigRouting->ExportConfig( + HIIConfigRouting, + &MultiConfigAltResp + ); + if (EFI_ERROR(Status)) { + return Status; + } + + Status =3D GetDevicePath ( HIIConfigAccess, &DevicePath ); + if (EFI_ERROR(Status)) { + gtBS->FreePool (MultiConfigAltResp); + return Status; + } + + Request =3D (EFI_STRING) SctAllocateZeroPool ( 2 * SctStrLen (MultiConf= igAltResp) + 2 ); + if (Request =3D=3D NULL) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + return EFI_OUT_OF_RESOURCES; + } + + Status =3D GetCorrespondingRequest (MultiConfigAltResp, DevicePath, Req= uest); + if (EFI_ERROR(Status)) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + gtBS->FreePool (Request); + return Status; + } + + // + // Call ExtractConfig with valid parameters + // + Status =3D HIIConfigAccess->ExtractConfig( + HIIConfigAccess, + Request, + &Progress, + &Results + ); + + if ( (EFI_SUCCESS =3D=3D Status) && (Progress =3D=3D (Request + SctStrL= en (Request))) ) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + if (Results =3D=3D NULL) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + gtBS->FreePool (Results); + } + } else if (EFI_OUT_OF_RESOURCES =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_WARNING; + }else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestFunctionAssertionGuid001, + L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig- ExtractConfi= g() returns EFI_SUCCESS and vaild Results with valid parameters .", + L"%a:%d: Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + // + // Change the Request to ConfigHdr + // + ConfigHdr =3D Request; + while (*Request) { + if (*Request =3D=3D L'&') { + if (SctStrnCmp (Request, L"&NAME=3D", 6) =3D=3D 0) { + Request =3D Request + 6; + } else if (SctStrnCmp (Request, L"&PATH=3D", 6) =3D=3D 0) { + Request =3D Request + 6;=20 + } else { + *Request =3D 0; + } + } else { + Request++; + } + }=20 + Request =3D ConfigHdr; + + // + // Call ExtractConfig when Request is ConfigHdr + // + Progress =3D NULL; + Results =3D NULL; + Status =3D HIIConfigAccess->ExtractConfig( + HIIConfigAccess, + Request, + &Progress, + &Results + ); + + if ( (EFI_SUCCESS =3D=3D Status) && (Progress =3D=3D (Request + SctStrL= en (Request))) ) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + if (Results =3D=3D NULL) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + if (NULL =3D=3D SctStrStr (Results, Request)) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + gtBS->FreePool (Results); + } + } else if (EFI_OUT_OF_RESOURCES =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_WARNING; + }else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestFunctionAssertionGuid002, + L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig- ExtractConfi= g() returns EFI_SUCCESS and vaild Results with valid parameters .", + L"%a:%d: Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + gtBS->FreePool (Request); + + return EFI_SUCCESS; +}=20 + + +EFI_STATUS +BBTestExtractConfigFunctionTestCheckpoint2 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ) +{ + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + + EFI_STRING Request =3D NULL; + EFI_STRING Progress =3D NULL; + EFI_STRING Results =3D NULL; + EFI_STRING MultiConfigAltResp =3D NULL; + + + //init the Request=20 + Status =3D HIIConfigRouting->ExportConfig( + HIIConfigRouting, + &MultiConfigAltResp + ); + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Call ExtractConfig with valid parameters + // + Status =3D HIIConfigAccess->ExtractConfig( + HIIConfigAccess, + NULL, + &Progress, + &Results + ); + + if (EFI_OUT_OF_RESOURCES =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_WARNING; + } else if ((EFI_NOT_FOUND =3D=3D Status) && (Progress =3D=3D NULL) && (= Results =3D=3D NULL)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else if ( EFI_SUCCESS !=3D Status ) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (Results !=3D NULL) { + gtBS->FreePool (Results); + } + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + if (Results =3D=3D NULL) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestFunctionAssertionGuid003, + L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig- ExtractConfi= g() returns EFI_SUCCESS or EFI_NOT_FOUND with Request been NULL .", + L"%a:%d: Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + =20 + + if ( NULL !=3D MultiConfigAltResp ){ + gtBS->FreePool (MultiConfigAltResp); + } + + if ( NULL !=3DResults ) { + gtBS->FreePool (Results); + } + + if (NULL !=3D Request) { + gtBS->FreePool (Request); + } + + return EFI_SUCCESS; +}=20 + + +EFI_STATUS +BBTestRouteConfigFunctionTestCheckpoint1 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ) +{ + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + + EFI_STRING Resp =3D NULL; + EFI_STRING Progress =3D NULL; + EFI_STRING MultiConfigAltResp =3D NULL; + EFI_STRING DevicePath =3D NULL; + + //init the Request=20 + Status =3D HIIConfigRouting->ExportConfig( + HIIConfigRouting, + &MultiConfigAltResp + ); + if (EFI_ERROR(Status)) { + return Status; + } + + Status =3D GetDevicePath ( HIIConfigAccess, &DevicePath ); + if (EFI_ERROR(Status)) { + gtBS->FreePool (MultiConfigAltResp); + return Status; + } + + Resp =3D (EFI_STRING) SctAllocateZeroPool ( 2 * SctStrLen (MultiConfigA= ltResp) + 2 ); + if (Resp =3D=3D NULL) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + return EFI_OUT_OF_RESOURCES; + } + + Status =3D GetCorrespondingResp (MultiConfigAltResp, DevicePath, Resp); + if (EFI_ERROR(Status)) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + gtBS->FreePool (Resp); + return Status; + } + + // + // Call RouteConfig with valid parameters + // + Status =3D HIIConfigAccess->RouteConfig( + HIIConfigAccess, + Resp, + &Progress + ); + if ( (EFI_SUCCESS =3D=3D Status) && (Progress =3D=3D Resp + SctStrLen (= Resp)) ) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else if ( EFI_OUT_OF_RESOURCES =3D=3D Status ) { + AssertionType =3D EFI_TEST_ASSERTION_WARNING; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestFunctionAssertionGuid003, + L"HII_CONFIG_ACCESS_PROTOCOL.RouteConfig- RouteConfig() return= s EFI_SUCCESS with valid parameters .", + L"%a:%d: Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + gtBS->FreePool (Resp); + + return EFI_SUCCESS; +}=20 + +/* +EFI_STATUS +BBTestCallBackFunctionTestCheckpoint1 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ) +{ + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + + EFI_BROWSER_ACTION *Action; + EFI_QUESTION_ID QuestionId; + UINT8 Type; + EFI_IFR_TYPE_VALUE Value; + EFI_BROWSER_ACTION_REQUEST ActionRequest; + + //init the paremeters + Action=3DEFI_BROWSER_ACTION_REQUEST_CHANGING; + QuestionId=3D0x1234; + Type=3DEFI_IFR_TYPE_NUM_SIZE_8; + + + // + // Call CallBack with valid parameters + // + Status =3D HIIConfigAccess->CallBack( + HIIConfigAccess, + Action, + QuestionId, + =09 =09 Type, + =09 =09 &Value, + =09 =09 &ActionRequest + ); + if ( EFI_SUCCESS !=3D Status ) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; +=09 + //check the output ActionRequest + if ((EFI_BROWSER_ACTION_REQUEST_NONE || EFI_BROWSER_ACTION_REQUEST_RESE= T || EFI_BROWSER_ACTION_REQUEST_SUBMIT || EFI_BROWSER_ACTION_REQUEST_EXIT) = !=3D ActionRequest) + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + + } + +=20 + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestFunctionAssertionGuid003, + L"HII_CONFIG_ACCESS_PROTOCOL.CallBack- CallBack() returns EFI_= SUCCESS with valid parameters .", + L"%a:%d: Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return EFI_SUCCESS; +}=20 +*/ + + diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/Bl= ackBoxTest/HIIConfigAccessBBTestMain.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/= Protocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestMain.c new file mode 100644 index 00000000..29c793e2 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxT= est/HIIConfigAccessBBTestMain.c @@ -0,0 +1,655 @@ +/** @file + + Copyright 2006 - 2016 Unified EFI, Inc.
+ Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the B= SD License + which accompanies this distribution. The full text of the license may = be found at=20 + http://opensource.org/licenses/bsd-license.php +=20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +=20 +**/ +/*++ + +Module Name: + + HIIConfigAccessBBTestMain.c + +Abstract: + + Test Driver of HII Configuration Access Protocol + +--*/ + +#include "HIIConfigAccessBBTestMain.h" + +// +// Global variables +// +EFI_HANDLE mImageHandle; + +EFI_BB_TEST_PROTOCOL *gBBTestProtocolInterface; + +EFI_BB_TEST_PROTOCOL_FIELD gBBTestProtocolField =3D { + EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_REVISION, + IHV_EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID, + L"HII Configuration Access Protocol Test", + L"UEFI HII Configuration Access Protocol Black-Box Test" +}; + +EFI_GUID gSupportProtocolGuid[] =3D { + EFI_STANDARD_TEST_LIBRARY_GUID, + EFI_NULL_GUID +}; + +EFI_BB_TEST_ENTRY_FIELD gBBTestEntryField[] =3D { + /* + //Use for unit test only + { + { 0x8cdda816, 0x3f97, 0x4155, { 0xa6, 0x73, 0x86, 0x93, 0x79, 0x8f, 0= xb0, 0x6d } }, + L"Unit Test Only", + L"Verify the Assistant Function", + EFI_TEST_LEVEL_DEFAULT, + gSupportProtocolGuid, + EFI_TEST_CASE_AUTO, + BBTestUnitTest + }, + */ + { + EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0101, + L"ExtractConfigFunction", + L"Function auto test for HII Configuration Access Protocol ExtractCon= fig().", + EFI_TEST_LEVEL_MINIMAL, + gSupportProtocolGuid, + EFI_TEST_CASE_AUTO, + BBTestExtractConfigFunctionTest + }, + + { + EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0102, + L"RouteConfigFunction", + L"Function auto test for HII Configuration Access Protocol RouteConfi= g().", + EFI_TEST_LEVEL_MINIMAL, + gSupportProtocolGuid, + EFI_TEST_CASE_AUTO, + BBTestRouteConfigFunctionTest + }, + /* + { + EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0103, + L"CallBackFunction", + L"Function auto test for HII Configuration Access Protocol CallBack()= .", + EFI_TEST_LEVEL_MINIMAL, + gSupportProtocolGuid, + EFI_TEST_CASE_AUTO, + BBTestCallBackFunctionTest + }, + */ + { + EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0201, + L"ExtractConfigConformance", + L"Conformance auto test for HII Configuration Access Protocol Extract= Config().", + EFI_TEST_LEVEL_MINIMAL, + gSupportProtocolGuid, + EFI_TEST_CASE_AUTO, + BBTestExtractConfigConformanceTest + }, + { + EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0202, + L"RouteConfigConformance", + L"Conformance auto test for HII Configuration Access Protocol RouteCo= nfig().", + EFI_TEST_LEVEL_MINIMAL, + gSupportProtocolGuid, + EFI_TEST_CASE_AUTO, + BBTestRouteConfigConformanceTest + }, + /* + { + EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0203, + L"CallBackConformance", + L"Conformance auto test for HII Configuration Access Protocol CallBac= k().", + EFI_TEST_LEVEL_MINIMAL, + gSupportProtocolGuid, + EFI_TEST_CASE_AUTO, + BBTestCallBackConformanceTest + }, + */ + 0 +}; + + + + +EFI_STATUS +InitializeHIIConfigAccessBBTest ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EfiInitializeTestLib (ImageHandle, SystemTable); + + // + // initialize test utility lib + // + + SctInitializeLib (ImageHandle, SystemTable); + + mImageHandle =3D ImageHandle; + + return EfiInitAndInstallIHVBBTestInterface ( + &ImageHandle, + &gBBTestProtocolField, + gBBTestEntryField, + UnloadHIIConfigAccessBBTest, + &gBBTestProtocolInterface + ); +} + + +EFI_STATUS +UnloadHIIConfigAccessBBTest ( + IN EFI_HANDLE ImageHandle + ) +{ + return EfiUninstallAndFreeIHVBBTestInterface ( + ImageHandle, + gBBTestProtocolInterface + ); +} + + +// Assistance Function +UINTN +EfiDevicePathSize ( + IN EFI_DEVICE_PATH_PROTOCOL *DevicePath + ) +/*++ + +Routine Description: + + Calculate the space size of a device path. + +Arguments: + + DevicePath - A specified device path + +Returns: + + The size. + +--*/ +{ + EFI_DEVICE_PATH_PROTOCOL *Start; + + if (DevicePath =3D=3D NULL) { + return 0; + } + + // + // Search for the end of the device path structure + // + Start =3D DevicePath; + while (!SctIsDevicePathEnd (DevicePath)) { + DevicePath =3D SctNextDevicePathNode (DevicePath); + } + + // + // Compute the size and add back in the size of the end device path str= ucture + // + return ((UINTN) DevicePath - (UINTN) Start) + sizeof (EFI_DEVICE_PATH_P= ROTOCOL); +} + + +STATIC +CHAR16 +NibbleToHexCharPrivate ( + IN UINT8 Nibble + ) +/*++ + + Routine Description: + Converts the low nibble of a byte to hex unicode character. + + Arguments: + Nibble - lower nibble of a byte. + + Returns: + Hex unicode character between L'0' to L'f'. + +--*/ +{ + Nibble &=3D 0x0F; + + if (Nibble <=3D 0x9) { + return (CHAR16)(Nibble + L'0'); + } + + return (CHAR16)(Nibble - 0xA + L'a'); +} + + +STATIC +EFI_STATUS +BufToHexStringPrivate ( + IN OUT CHAR16 *Str, + IN OUT UINTN *HexStringBufferLength, + IN UINT8 *Buf, + IN UINTN Len, + IN BOOLEAN Flag + ) +/*++ + + Routine Description: + Converts binary buffer to Unicode string. + At a minimum, any blob of data could be represented as a hex string. + + Arguments: + Str - Pointer to the string. + HexStringBufferLength - Length in bytes of buffer to hold the hex str= ing. Includes tailing '\0' character. + If routine return with EFI_SUCCESS, containin= g length of hex string buffer. + If routine return with EFI_BUFFER_TOO_SMALL, = containg length of hex string buffer desired. + Buf - Buffer to be converted from. + Len - Length in bytes of the buffer to be converted= . + Flag - If TRUE, encode the data in the same order as= the it=20 + resides in the Buf. Else encode it in the rev= erse direction. + + Returns: + EFI_SUCCESS - Routine success. + EFI_BUFFER_TOO_SMALL - The hex string buffer is too small. + +--*/ +{ + UINTN Idx; + UINT8 Byte; + UINTN StrLen; + + // + // Make sure string is either passed or allocate enough. + // It takes 2 Unicode characters (4 bytes) to represent 1 byte of the b= inary buffer. + // Plus the Unicode termination character. + // + StrLen =3D Len * 2; + if ((*HexStringBufferLength) < (StrLen + 1) * sizeof (CHAR16)) { + *HexStringBufferLength =3D (StrLen + 1) * sizeof (CHAR16); + return EFI_BUFFER_TOO_SMALL; + } + + *HexStringBufferLength =3D (StrLen + 1) * sizeof (CHAR16); + + // + // Ends the string. + // + Str[StrLen] =3D 0; + + for (Idx =3D 0; Idx < Len; Idx++) { + + Byte =3D Buf[Idx]; + if (Flag) { + Str[Idx * 2] =3D NibbleToHexCharPrivate ((UINT8)(Byte >> 4)); + Str[Idx * 2 + 1] =3D NibbleToHexCharPrivate (Byte); + } else { + Str[StrLen - 1 - Idx * 2] =3D NibbleToHexCharPrivate (Byte); + Str[StrLen - 2 - Idx * 2] =3D NibbleToHexCharPrivate ((UINT8)(Byte = >> 4)); + } + } + + return EFI_SUCCESS; +} + +EFI_STATUS +GetDevicePath ( + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess, + OUT EFI_STRING *DevicePathStr + ) +{ + EFI_STATUS Status; + UINTN Index; + UINTN NoHandles; + EFI_HANDLE *HandleBuffer; + EFI_HANDLE ConfigAccessHandle =3D NULL; + EFI_HII_CONFIG_ACCESS_PROTOCOL *TestedConfigAccess; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + UINTN Length; + UINTN PathHdrSize; + + // + // locate all Hii Configuration Access Protocol Instances + // + Status =3D gtBS->LocateHandleBuffer ( + ByProtocol, + &gBlackBoxEfiHIIConfigAccessProtocolGuid, + NULL, + &NoHandles, + &HandleBuffer + ); + if (EFI_ERROR(Status) || (NoHandles =3D=3D 0)) { + return EFI_NOT_FOUND; + } + + // + // scan for the handle that matched with the Hii Configuration Access P= rotocol that + // passed in by the test framework + // + for (Index =3D 0; Index < NoHandles; Index++) { + Status =3D gtBS->HandleProtocol ( + HandleBuffer[Index], + &gBlackBoxEfiHIIConfigAccessProtocolGuid, + (VOID **) &TestedConfigAccess + ); + if (EFI_ERROR(Status)) { + continue; + } + + if (TestedConfigAccess =3D=3D ConfigAccess) { + ConfigAccessHandle =3D HandleBuffer[Index]; + break; + } + } + + gtBS->FreePool (HandleBuffer); + + if (ConfigAccessHandle =3D=3D NULL) { + return EFI_NOT_FOUND; + } + + // + // find controller handles managed by the component name handle. + // + Status =3D gtBS->HandleProtocol ( + ConfigAccessHandle, + &gBlackBoxEfiDevicePathProtocolGuid, + (void **)&DevicePath + ); + + // + // Convert the device path binary to hex UNICODE %02x bytes in the same= order + // as the device path resides in RAM memory. + // + Length =3D EfiDevicePathSize (DevicePath); + PathHdrSize =3D (Length * 2 + 1) * sizeof (CHAR16); + *DevicePathStr =3D (EFI_STRING) SctAllocateZeroPool (PathHdrSize); + if (*DevicePathStr =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; + } + Status =3D BufToHexStringPrivate (*DevicePathStr, &PathHdrSize, (UINT8 = *) DevicePath, Length, TRUE); + + return Status; +} + + +EFI_STATUS +GetCorrespondingRequest ( + IN EFI_STRING MultiConfigAltResp, + IN EFI_STRING DevicePath, + IN OUT EFI_STRING Request + ) +{ + EFI_STRING RespPtr; + EFI_STRING ReqPtr; + EFI_STRING SingleResp; + EFI_STRING SingleRespPtr; + UINTN Len; + + ReqPtr =3D Request; + RespPtr =3D MultiConfigAltResp; + + Len =3D SctStrLen (MultiConfigAltResp); + + if (SctStrnCmp (MultiConfigAltResp, L"GUID=3D", 5) !=3D 0) { + return EFI_INVALID_PARAMETER; + } + + if (SctStrStr (MultiConfigAltResp, DevicePath) =3D=3D NULL) { + return EFI_NOT_FOUND; + } + + SingleResp =3D (EFI_STRING) SctAllocateZeroPool ( 2 * SctStrLen (MultiC= onfigAltResp) + 2 ); + if (SingleResp =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; + } + SingleRespPtr =3D SingleResp; + + while (*MultiConfigAltResp !=3D 0) { + while ((*MultiConfigAltResp !=3D 0) && (SctStrnCmp (MultiConfigAltRes= p, L"&GUID=3D", 6) !=3D 0)) { + *(SingleResp++) =3D *(MultiConfigAltResp++); + } + SingleResp =3D SingleRespPtr; + if (SctStrStr (SingleResp, DevicePath) !=3D NULL) + break; + SctZeroMem (SingleRespPtr, 2 * Len + 2); + if (*MultiConfigAltResp !=3D 0) + MultiConfigAltResp++; + } + + if (SctStrStr (SingleResp, DevicePath) =3D=3D NULL) + return EFI_NOT_FOUND; + + if (SctStrStr (SingleResp, L"VALUE=3D") =3D=3D NULL){ + while (*SingleResp !=3D 0) { + while ((*SingleResp !=3D 0) && (SctStrnCmp (SingleResp, L"&PATH=3D"= , 6) !=3D 0)) { + *(Request++) =3D *(SingleResp++); + } + *(Request++) =3D *(SingleResp++); + while ((*SingleResp !=3D 0) && (*SingleResp !=3D L'&')) { + *(Request++) =3D *(SingleResp++); + } + while (*SingleResp !=3D 0){ + if (*SingleResp !=3D L'=3D') { + *(Request++) =3D *(SingleResp++); + =09} else { + while ((*SingleResp !=3D 0) && (*SingleResp !=3D L'&')) { + SingleResp++; + } + } + } + } + } else { + while (*SingleResp !=3D 0) { + while ((*SingleResp !=3D 0) && (SctStrnCmp (SingleResp, L"&VALUE=3D= ", 7)) !=3D 0) { + *(Request++) =3D *(SingleResp++); + } + SingleResp++; + while ((*SingleResp !=3D 0) && (*SingleResp !=3D L'&')) + SingleResp++; + } + + } + + *Request =3D 0; + + gtBS->FreePool (SingleRespPtr); + return EFI_SUCCESS; +} + + +EFI_STATUS +GetCorrespondingResp ( + IN EFI_STRING MultiConfigAltResp, + IN EFI_STRING DevicePath, + IN OUT EFI_STRING Resp + ) +{ + EFI_STRING RespPtr; + EFI_STRING ReqPtr; + UINTN Len; + + ReqPtr =3D Resp; + RespPtr =3D MultiConfigAltResp; + + Len =3D SctStrLen (MultiConfigAltResp); + + if (SctStrnCmp (MultiConfigAltResp, L"GUID=3D", 5) !=3D 0) { + return EFI_INVALID_PARAMETER; + } + + if (SctStrStr (MultiConfigAltResp, DevicePath) =3D=3D NULL) { + return EFI_NOT_FOUND; + } + + while (*MultiConfigAltResp !=3D 0) { + while ((*MultiConfigAltResp !=3D 0) && (SctStrnCmp (MultiConfigAltRes= p, L"&GUID=3D", 6) !=3D 0)) { + *(Resp++) =3D *(MultiConfigAltResp++); + } + Resp =3D ReqPtr; + if (SctStrStr (Resp, DevicePath) !=3D NULL) + break; + SctZeroMem (ReqPtr, 2 * Len + 2); + if (*MultiConfigAltResp !=3D 0) + MultiConfigAltResp++; + } + + if (SctStrStr (Resp, DevicePath) =3D=3D NULL) + return EFI_NOT_FOUND; + + return EFI_SUCCESS; +} + + + +EFI_STATUS +GetHIIConfigRoutingInterface ( + OUT EFI_HII_CONFIG_ROUTING_PROTOCOL **HIIConfigRouting + ) +{ + UINTN NoHandles; + EFI_HANDLE *HandleBuffer; + EFI_STATUS Status; + + // + // Get the HII Database Protocol interface + // + Status =3D gtBS->LocateHandleBuffer ( + ByProtocol, + &gBlackBoxEfiHIIConfigRoutingProtocolGuid, + NULL, + &NoHandles, + &HandleBuffer + ); + if ( EFI_ERROR(Status) ) { + return Status; + } + + if ( NoHandles <=3D 0 ) { + return EFI_DEVICE_ERROR; + } + + Status =3D gtBS->HandleProtocol ( + HandleBuffer[0], + &gBlackBoxEfiHIIConfigRoutingProtocolGuid, + (VOID **) HIIConfigRouting + ); + if ( EFI_ERROR(Status) ) { + gtBS->FreePool ( HandleBuffer ); + return Status; + } + + gtBS->FreePool ( HandleBuffer ); + + return EFI_SUCCESS; +} + +EFI_STATUS +MultiAltRespToMultiReq ( + IN EFI_STRING Resp, + IN OUT EFI_STRING Req + ) +{ + EFI_STRING Pointer1 =3D Resp; + EFI_STRING Pointer2 =3D NULL; + EFI_STRING Pointer3 =3D Req; + EFI_STRING CfgHdr =3D NULL; + EFI_STRING FreePtr =3D NULL; + CHAR8 Flag =3D 0; + + if (SctStrnCmp (Pointer1, L"GUID=3D", 5) !=3D 0) { + return EFI_INVALID_PARAMETER; + } + + Pointer2 =3D (EFI_STRING) SctAllocateZeroPool (2 * SctStrLen (Resp) + 2= ); + if (Pointer2 =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; + } + FreePtr =3D Pointer2; + + while (*Pointer1) { + if (SctStrnCmp (Pointer1, L"GUID=3D", 5) =3D=3D 0) { + CfgHdr =3D Pointer2; + *(Pointer2++) =3D *(Pointer1++); + while (*Pointer1 !=3D L'&') { + *(Pointer2++) =3D *(Pointer1++); + } + } + if (SctStrnCmp (Pointer1, L"&GUID=3D", 6) =3D=3D 0) { + *(Pointer2++) =3D *(Pointer1++); + CfgHdr =3D Pointer2; + while (*Pointer1 !=3D L'&') { + *(Pointer2++) =3D *(Pointer1++); + } + } + if (SctStrnCmp (Pointer1, L"&NAME=3D", 6) =3D=3D 0) { + *(Pointer2++) =3D *(Pointer1++); + while (*Pointer1 !=3D L'&') { + *(Pointer2++) =3D *(Pointer1++); + } + } + if (SctStrnCmp (Pointer1, L"&PATH=3D", 6) =3D=3D 0) { + *(Pointer2++) =3D *(Pointer1++); + while (*Pointer1 !=3D L'&') { + *(Pointer2++) =3D *(Pointer1++); + } + if (NULL =3D=3D SctStrStr (Req, CfgHdr)){ + =09if (*Req =3D=3D L'G') + *(Pointer3++) =3D L'&'; + SctStrCat (Req, CfgHdr); + Pointer3 +=3D SctStrLen (CfgHdr); + =09Flag =3D 1; + } else { + Flag =3D 0; + } + } + while ((Flag =3D=3D 1) && (SctStrnCmp (Pointer1, L"&GUID=3D", 6) !=3D= 0) && *Pointer1) { + if (SctStrnCmp (Pointer1, L"&OFFSET=3D", 8) =3D=3D 0) { + *(Pointer3++) =3D *(Pointer1++); + while (*Pointer1 !=3D L'&') { + *(Pointer3++) =3D *(Pointer1++); + } + } + if (SctStrnCmp (Pointer1, L"&WIDTH=3D", 7) =3D=3D 0) { + *(Pointer3++) =3D *(Pointer1++); + while (*Pointer1 !=3D L'&') { + *(Pointer3++) =3D *(Pointer1++); + } + } + if (SctStrnCmp (Pointer1, L"&VALUE=3D", 7) =3D=3D 0) { + Pointer1 +=3D 7; + while (*Pointer1 !=3D L'&' && *Pointer1) { + Pointer1++; + } + } + if (SctStrnCmp (Pointer1, L"&ALTCFG=3D", 8) =3D=3D 0) { + Pointer1 +=3D 8; + while (*Pointer1 !=3D L'&' && *Pointer1) { + Pointer1++; + } + } + if ((*Pointer1 =3D=3D L'&') && (SctStrnCmp (Pointer1, L"&GUID=3D", 6) = !=3D 0) &&=20 + =09 (SctStrnCmp (Pointer1, L"&OFFSET=3D", 8) !=3D 0) && (SctStrnCmp (Po= inter1, L"&WIDTH=3D", 7) !=3D 0)) { + *(Pointer3++) =3D *(Pointer1++); + while (*Pointer1 !=3D L'=3D') { + *(Pointer3++) =3D *(Pointer1++); + } + while (*Pointer1 !=3D L'&' && *Pointer1) { + Pointer1++; + } + } + } + Pointer1++; + } + + SctFreePool (FreePtr); + + return EFI_SUCCESS; +} diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/Bl= ackBoxTest/HIIConfigAccessBBTestMain.h b/uefi-sct/SctPkg/TestCase/UEFI/IHV/= Protocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestMain.h new file mode 100644 index 00000000..c81a00ca --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxT= est/HIIConfigAccessBBTestMain.h @@ -0,0 +1,168 @@ +/** @file + + Copyright 2006 - 2013 Unified EFI, Inc.
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the B= SD License + which accompanies this distribution. The full text of the license may = be found at=20 + http://opensource.org/licenses/bsd-license.php +=20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +=20 +**/ +/*++ + +Module Name: + + HIIConfigAccessBBTestMain.h + +Abstract: + + Test Driver of HII Configuration Access Protocol header file + +--*/ + +#ifndef _HII_CONFIG_ACCESS_BB_TEST_MAIN +#define _HII_CONFIG_ACCESS_BB_TEST_MAIN + +#define __UEFI_INTERNAL_FORMREPRESENTATION_H__ +#include +#include "SctLib.h" +#include "Guid.h" +#include +#include +#include +#include + + +#define EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_REVISION 0x00010000 +#define IHV_EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID \ +{ 0x68820884, 0x4be3, 0x4ca9, { 0x83, 0x81, 0x9e, 0x98, 0xf3, 0xf4, 0x8d,= 0xaf } } +// +// Entry GUIDs for Func Test +// +#define EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0101 \ +{ 0x2a85387e, 0xdcf9, 0x45e9, { 0xb3, 0x8f, 0x5d, 0xa1, 0x75, 0x41, 0xcf,= 0x1a } } + +#define EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0102 \ +{ 0x1a15df85, 0x6cc1, 0x43f2, { 0x9b, 0x86, 0x21, 0x8b, 0xd5, 0xfd, 0xf4,= 0xa0 } } + + +// +// Entry GUIDs for Conf Test +// +#define EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0201 \ +{ 0xe2c3b0fe, 0xfbe9, 0x46a9, { 0xa3, 0x1b, 0xa3, 0xf3, 0x82, 0xd, 0xcf, = 0x4 } } + +#define EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0202 \ +{ 0x495c99f3, 0x231, 0x45a5, { 0xaf, 0xfa, 0xd2, 0x5c, 0x6f, 0x9a, 0x19, = 0x1c } } + + + +EFI_STATUS +InitializeHIIConfigAccessBBTest ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ); + + +EFI_STATUS +UnloadHIIConfigAccessBBTest ( + IN EFI_HANDLE ImageHandle + ); + + +// +//Test Cases +// +/* +EFI_STATUS +BBTestUnitTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ); +*/ +EFI_STATUS +BBTestExtractConfigConformanceTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ); + +EFI_STATUS +BBTestRouteConfigConformanceTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ); +/* +EFI_STATUS +BBTestCallBackConformanceTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ); +*/ +EFI_STATUS +BBTestExtractConfigFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ); + +EFI_STATUS +BBTestRouteConfigFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ); +/* =20 +EFI_STATUS +BBTestCallBackFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + );=20 +*/ +EFI_STATUS +GetDevicePath ( + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess, + OUT EFI_STRING *DevicePathStr + ); + +EFI_STATUS +GetCorrespondingRequest ( + IN EFI_STRING MultiConfigAltResp, + IN EFI_STRING DevicePath, + IN OUT EFI_STRING Request + ); + +EFI_STATUS +GetCorrespondingResp ( + IN EFI_STRING MultiConfigAltResp, + IN EFI_STRING DevicePath, + IN OUT EFI_STRING Resp + ); + +EFI_STATUS +GetHIIConfigRoutingInterface ( + OUT EFI_HII_CONFIG_ROUTING_PROTOCOL **HIIConfigRouting + ); + +EFI_STATUS +MultiAltRespToMultiReq ( + IN EFI_STRING Resp, + IN OUT EFI_STRING Req + ); + +#endif diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/Bl= ackBoxTest/IhvHIIConfigAccessBBTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/IHV= /Protocol/HIIConfigAccess/BlackBoxTest/IhvHIIConfigAccessBBTest.inf new file mode 100644 index 00000000..1168986b --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxT= est/IhvHIIConfigAccessBBTest.inf @@ -0,0 +1,55 @@ +## @file +# +# Copyright 2006 - 2012 Unified EFI, Inc.
+# Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
+# Copyright (c) 2019, ARM Ltd. All rights reserved.
+# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the = BSD License +# which accompanies this distribution. The full text of the license may= be found at=20 +# http://opensource.org/licenses/bsd-license.php +#=20 +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. +#=20 +## +#/*++ +# +# Module Name: +# +# HIIConfigAccessBBTest.inf +# +# Abstract: +# +# Component description file for IHV HII Config Access Protocol Black-B= ox Test. +# +#--*/ + +[defines] +INF_VERSION =3D 0x00010005 +BASE_NAME =3D IhvHIIConfigAccessBBTest +FILE_GUID =3D D39F2A3B-72BF-40F5-86BF-2E1E96D15EA3 +MODULE_TYPE =3D UEFI_DRIVER +VERSION_STRING =3D 1.0 +ENTRY_POINT =3D InitializeHIIConfigAccessBBTest + +[sources.common] + HIIConfigAccessBBTestConformance.c + HIIConfigAccessBBTestFunction.c + HIIConfigAccessBBTestMain.c + Guid.c + +[Packages] + SctPkg/SctPkg.dec + SctPkg/UEFI/UEFI.dec + MdePkg/MdePkg.dec + +[LibraryClasses] + UefiDriverEntryPoint + SctLib + EfiTestLib + +[Protocols] + gBlackBoxEfiHIIConfigAccessProtocolGuid + gBlackBoxEfiHIIConfigRoutingProtocolGuid + gBlackBoxEfiDevicePathProtocolGuid diff --git a/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc b/uefi-sct/SctPkg/UEFI/IHV_S= CT.dsc index 83396f1a..2d929ba2 100644 --- a/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc +++ b/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc @@ -210,6 +210,7 @@ SctPkg/TestCase/UEFI/IHV/Protocol/UsbIo/BlackBoxTest/I= hvUsbIoTest.inf SctPkg/TestCase/UEFI/IHV/Protocol/GraphicsOutput/BlackBoxTest/IhvGraphics= OutputBBTest.inf SctPkg/TestCase/UEFI/IHV/Protocol/ExtScsiPassThru/BlackBoxTest/IhvExtScsi= PassThruBBTest.inf SctPkg/TestCase/UEFI/IHV/Protocol/ScsiIo/BlackBoxTest/IhvScsiIoBBTest.inf +SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxTest/IhvHIIConf= igAccessBBTest.inf SctPkg/TestCase/UEFI/IHV/Protocol/iScsiInitiatorName/BlackBoxTest/IhviScs= iInitiatorNameBBTest.inf =20 SctPkg/TestCase/UEFI/IHV/Protocol/AbsolutePointer/BlackBoxTest/IhvAbsolut= ePointerBBTest.inf --=20 2.22.0.windows.1