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.100, mailfrom: eric.jin@intel.com) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by groups.io with SMTP; Tue, 16 Jul 2019 19:52:32 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jul 2019 19:52:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,272,1559545200"; d="scan'208";a="169439489" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga007.fm.intel.com with ESMTP; 16 Jul 2019 19:52:30 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 16 Jul 2019 19:52:30 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 16 Jul 2019 19:52:29 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.109]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.174]) with mapi id 14.03.0439.000; Wed, 17 Jul 2019 10:52:28 +0800 From: "Eric Jin" To: shrishail , "devel@edk2.groups.io" CC: "Jin, Eric" , "supreeth.venkatesh@arm.com" , "Jeff.Booher-Kaeding@arm.com" Subject: FW:[edk2-test][PATCH] Adding HII to IHVSCT Thread-Topic: [edk2-test][PATCH] Adding HII to IHVSCT Thread-Index: AdU8ScmNN6Oe2KlMSOWD7xWkKjbI1Q== Date: Wed, 17 Jul 2019 02:52:27 +0000 Message-ID: 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 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/HIIConfigAcc= ess/BlackBoxTest/Guid.c create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAcc= ess/BlackBoxTest/Guid.h create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAcc= ess/BlackBoxTest/HIIConfigAccessBBTestConformance.c create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAcc= ess/BlackBoxTest/HIIConfigAccessBBTestFunction.c create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAcc= ess/BlackBoxTest/HIIConfigAccessBBTestMain.c create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAcc= ess/BlackBoxTest/HIIConfigAccessBBTestMain.h create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAcc= ess/BlackBoxTest/IhvHIIConfigAccessBBTest.inf diff --git a/uefi-sct/SctPkg/CommonGenFramework.bat b/uefi-sct/SctPkg/Commo= nGenFramework.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 %Framework= %\Test\ > NUL copy %ProcessorType%\IhviScsiInitiatorNameBBTest.efi %Framework= %\Test\ > NUL copy %ProcessorType%\IhvStorageSecurityCommandBBTest.efi %Framework= %\Test\ > NUL - =20 + copy %ProcessorType%\IhvHIIConfigAccessBBTest.efi %Framework= %\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/Common= GenFramework.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/Te= st/ > NUL cp $ProcessorType/IhviScsiInitiatorNameBBTest.efi $Framework/Te= st/ > NUL cp $ProcessorType/IhvStorageSecurityCommandBBTest.efi $Framework/Te= st/ > NUL - + cp $ProcessorType/IhvHIIConfigAccessBBTest.efi $Framework/Te= st/ > NUL # ********************************************* # Copy the UEFI 2.1 Test Cases for IHV # ********************************************* diff --git a/uefi-sct/SctPkg/Config/Data/Category.ini b/uefi-sct/SctPkg/Con= fig/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-B66FA8D54385 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/Bla= ckBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAcce= ss/BlackBoxTest/Guid.c new file mode 100644 index 00000000..6a6d4e60 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxTe= st/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 BS= D License + which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. +=20 +**/ +/*++ + + Module Name: + + Guid.c + + Abstract: + + GUIDs auto-generated for EFI test assertion. + +--*/ + +#include "HIIConfigAccessBBTestMain.h" + +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid001=3DEFI_TEST_HIIC= ONFIGACCESSBBTESTCONFORMANCE_ASSERTION_001_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid002=3DEFI_TEST_HIIC= ONFIGACCESSBBTESTCONFORMANCE_ASSERTION_002_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid003=3DEFI_TEST_HIIC= ONFIGACCESSBBTESTCONFORMANCE_ASSERTION_003_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid004=3DEFI_TEST_HIIC= ONFIGACCESSBBTESTCONFORMANCE_ASSERTION_004_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid005=3DEFI_TEST_HIIC= ONFIGACCESSBBTESTCONFORMANCE_ASSERTION_005_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid006=3DEFI_TEST_HIIC= ONFIGACCESSBBTESTCONFORMANCE_ASSERTION_006_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid007=3DEFI_TEST_HIIC= ONFIGACCESSBBTESTCONFORMANCE_ASSERTION_007_GUID; +/* +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid008=3DEFI_TEST_HIIC= ONFIGACCESSBBTESTCONFORMANCE_ASSERTION_008_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid009=3DEFI_TEST_HIIC= ONFIGACCESSBBTESTCONFORMANCE_ASSERTION_009_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid0010=3DEFI_TEST_HII= CONFIGACCESSBBTESTCONFORMANCE_ASSERTION_0010_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid0011=3DEFI_TEST_HII= CONFIGACCESSBBTESTCONFORMANCE_ASSERTION_0011_GUID; +EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid0012=3DEFI_TEST_HII= CONFIGACCESSBBTESTCONFORMANCE_ASSERTION_0012_GUID; +*/ +EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid001=3DEFI_TEST_HIICONF= IGACCESSBBTESTFUNCTION_ASSERTION_001_GUID; +EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid002=3DEFI_TEST_HIICONF= IGACCESSBBTESTFUNCTION_ASSERTION_002_GUID; +EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid003=3DEFI_TEST_HIICONF= IGACCESSBBTESTFUNCTION_ASSERTION_003_GUID; +EFI_GUID gHIIConfigAccessBBTestFunctionAssertionGuid004=3DEFI_TEST_HIICONF= IGACCESSBBTESTFUNCTION_ASSERTION_004_GUID; 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 new file mode 100644 index 00000000..b7003028 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxTe= st/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 BS= D License + which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. +=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, 0= xc1 } } + +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid001; + +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_002_GUID \ +{ 0xfa5973e2, 0xd05, 0x44c2, { 0xaf, 0x2d, 0x1b, 0x68, 0x33, 0x42, 0x6d, 0= x76 } } + +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid002; + +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_003_GUID \ +{ 0x6f6d1dd, 0x49b8, 0x488a, { 0xa7, 0x75, 0xde, 0xbc, 0xc7, 0x60, 0xfd, 0= x28 } } + +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, 0= x29 } } + +extern EFI_GUID gHIIConfigAccessBBTestConformanceAssertionGuid007; +/* +#define EFI_TEST_HIICONFIGACCESSBBTESTCONFORMANCE_ASSERTION_008_GUID \ +{ 0xbdec5b08, 0x423, 0x482b, { 0xb7, 0xdf, 0xde, 0xac, 0xab, 0xf7, 0x13, 0= x11 } } + +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, 0= xe7 } } + +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, 0= x8 } } + +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/Bla= ckBoxTest/HIIConfigAccessBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEF= I/IHV/Protocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestConformanc= e.c new file mode 100644 index 00000000..c8b35003 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxTe= st/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 BS= D License + which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. +=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 + ); + =20 +EFI_STATUS +BBTestRouteConfigConformanceTestCheckpoint1 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ); + =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 + ); + =20 +EFI_STATUS +BBTestRouteConfigConformanceTestCheckpoint3 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ); +/* =20 +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 + ); + =20 +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; + =20 + // + // 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; + } + =20 + // + //Call check points + // + BBTestExtractConfigConformanceTestCheckpoint1( StandardLib, HIIConfigAcc= ess ); + BBTestExtractConfigConformanceTestCheckpoint2( StandardLib, HIIConfigRou= ting, HIIConfigAccess ); + BBTestExtractConfigConformanceTestCheckpoint3( StandardLib, HIIConfigRou= ting, HIIConfigAccess ); + BBTestExtractConfigConformanceTestCheckpoint4( StandardLib, HIIConfigAcc= ess ); + =20 + 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; + =20 + // + // 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; + } + =20 + // + //Call check points + // + BBTestRouteConfigConformanceTestCheckpoint1( StandardLib, HIIConfigAcces= s ); + BBTestRouteConfigConformanceTestCheckpoint2( StandardLib, HIIConfigRouti= ng, HIIConfigAccess ); + BBTestRouteConfigConformanceTestCheckpoint3( StandardLib, HIIConfigAcces= s ); + =20 + 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; + =20 + // + // 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; + } + =20 + // + //Call check points + // + BBTestCallBackConformanceTestCheckpoint1( StandardLib, HIIConfigAccess )= ; + BBTestCallBackConformanceTestCheckpoint2( StandardLib, HIIConfigAccess )= ; + BBTestCallBackConformanceTestCheckpoint3( StandardLib, HIIConfigAccess )= ; + BBTestCallBackConformanceTestCheckpoint4( StandardLib, HIIConfigAccess )= ; + =20 + 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; + =20 + 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; + } + =20 + if ( IfMulti =3D=3D 0 ) { + SctStrCat ( Request, L"&GUID=3D970eb94aa0d449f7b980bdaa47d42527&NAME= =3D006a0069006e0039&PATH=3D000acf&grag&star"); + } + + Status =3D HIIConfigAccess->ExtractConfig ( + HIIConfigAccess, + Request, + &Progress, + &Results + ); + =20 + if ( (EFI_INVALID_PARAMETER !=3D Status) || (SctStrnCmp (Progress, L"&GU= ID=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 - ExtractConfi= g() 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; + =20 + EFI_STRING Request =3D NULL; + EFI_STRING Results =3D NULL; + EFI_STRING MultiConfigAltResp =3D NULL; + EFI_STRING DevicePath =3D NULL; + =20 + //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 (MultiConfi= gAltResp) + 2 ); + if (Request =3D=3D NULL) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + return EFI_OUT_OF_RESOURCES; + } + =20 + Status =3D GetCorrespondingRequest (MultiConfigAltResp, DevicePath, Requ= est); + if (EFI_ERROR(Status)) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + gtBS->FreePool (Request); + return Status; + } + =20 + // + // Call ExtractConfig with Progress been NULL + // + Status =3D HIIConfigAccess->ExtractConfig ( + HIIConfigAccess, + Request, + NULL, + &Results + ); + =20 + 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 - ExtractConfi= g() 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; + =20 + EFI_STRING Request =3D NULL; + EFI_STRING Progress =3D NULL; + EFI_STRING MultiConfigAltResp =3D NULL; + EFI_STRING DevicePath =3D NULL; + =20 + //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 (MultiConfi= gAltResp) + 2 ); + if (Request =3D=3D NULL) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + return EFI_OUT_OF_RESOURCES; + } + =20 + Status =3D GetCorrespondingRequest (MultiConfigAltResp, DevicePath, Requ= est); + 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 + ); + =20 + 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 - ExtractConfi= g() 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; + =20 + EFI_STRING Request; + EFI_STRING Progress =3D NULL; + EFI_STRING Results =3D NULL; + =20 + //init the Request + Request =3D L"GUID=3D71e430fb2e8849779d7a33ef1139e7ed&NAME=3D006a0069006= e0039&PATH=3D000acf&Jack&Rons&Nash&Mary"; =20 + =20 + // + // Call ExtractConfig with unknown name=20 + // + Status =3D HIIConfigAccess->ExtractConfig ( + HIIConfigAccess, + Request, + &Progress, + &Results + ); + =20 + 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() re= turns 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; + =20 + EFI_STRING Progress =3D NULL; + + =20 + // + // Call RouteConfig with Configuration been NULL + // + Status =3D HIIConfigAccess->RouteConfig ( + HIIConfigAccess, + NULL, + &Progress + ); + =20 + 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() return= s 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; + =20 + EFI_STRING Config =3D NULL; + EFI_STRING MultiConfigAltResp =3D NULL; + EFI_STRING DevicePath =3D NULL; + =20 + //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 (MultiConfig= AltResp) + 2 ); + if (Config =3D=3D NULL) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + return EFI_OUT_OF_RESOURCES; + } + =20 + Status =3D GetCorrespondingResp (MultiConfigAltResp, DevicePath, Config)= ; + if (EFI_ERROR(Status)) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + gtBS->FreePool (Config); + return Status; + } + =20 + // + // Call RouteConfig with Progress been NULL + // + Status =3D HIIConfigAccess->RouteConfig ( + HIIConfigAccess, + Config, + NULL + ); + =20 + 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; + =20 + EFI_STRING Configuration; + EFI_STRING Progress =3D NULL; + =20 + //init the Configuration + Configuration=3DL"GUID=3D71e430fb2e8849779d7a33ef1139e7ed&NAME=3D006a006= 9006e0039&PATH=3D0acf&OFFSET=3D2&WIDTH=3D3VALUE=3D45AF"; + =20 + // + // Call RouteConfig with no found target for the routing data + // + Status =3D HIIConfigAccess->RouteConfig ( + HIIConfigAccess, + Configuration, + &Progress + ); + =20 + 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() return= s 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; + =20 + EFI_QUESTION_ID QuestionId; + UINT8 Type; + EFI_IFR_TYPE_VALUE Value; + EFI_BROWSER_ACTION_REQUEST ActionRequest; + =20 + //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, + Type, + &Value, + &ActionRequest + ); + =20 + 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_RESET= || 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; + =20 +} + +EFI_STATUS +BBTestCallBackConformanceTestCheckpoint2 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ) +{ + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + =20 + EFI_BROWSER_ACTION *Action; + EFI_QUESTION_ID QuestionId; + UINT8 Type; + EFI_IFR_TYPE_VALUE Value; + + =20 + //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, + Type, + &Value, + NULL + ); + =20 + 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; + =20 +} + +EFI_STATUS +BBTestCallBackConformanceTestCheckpoint3( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ) +{ + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + =20 + EFI_BROWSER_ACTION *Action; + EFI_QUESTION_ID QuestionId; + UINT8 Type; + EFI_BROWSER_ACTION_REQUEST ActionRequest; + =20 + //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, + Type, + NULL, + &ActionRequest + ); + =20 + 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_RESET= || 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; + =20 +} + +EFI_STATUS +BBTestCallBackConformanceTestCheckpoint4 ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess + ) +{ + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + =20 + EFI_BROWSER_ACTION *Action; + EFI_QUESTION_ID QuestionId; + UINT8 Type; + EFI_IFR_TYPE_VALUE Value; + EFI_BROWSER_ACTION_REQUEST ActionRequest; + =20 + //init the parameter + Action=3D&EFI_BROWSER_ACTION_UNSUPPORTED; + QuestionId=3D0x1234; + Type=3DEFI_IFR_TYPE_NUM_SIZE_8; + + =20 + // + // Call CallBack with the specified action not supported by the callbac= k + // + Status =3D HIIConfigAccess->CallBack ( + HIIConfigAccess, + Action, + QuestionId, + Type, + &Value, + &ActionRequest + ); + =20 + 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_RESET= || 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; + =20 +} +*/ 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 new file mode 100644 index 00000000..14cc5684 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxTe= st/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 BS= D License + which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. +=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=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";; + + // + // init + // + HIIConfigAccess =3D (EFI_HII_CONFIG_ACCESS_PROTOCOL*)ClientInterface; + + Request =3D (EFI_STRING) SctAllocateZeroPool (2 * SctStrLen (MultiConfig= AltResp) + 2); + if (Request =3D=3D NULL) + return EFI_OUT_OF_RESOURCES; + + Resp =3D (EFI_STRING) SctAllocateZeroPool (2 * SctStrLen (MultiConfigAlt= Resp) + 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); =20 + gtBS->FreePool (Request); + return Status; + } + =20 + Status =3D GetCorrespondingRequest (MultiConfigAltResp, DevicePath, Requ= est); + + 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; + =20 + // + // 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, HIIConfigRoutin= g, HIIConfigAccess ); + BBTestExtractConfigFunctionTestCheckpoint2( StandardLib, HIIConfigRoutin= g, HIIConfigAccess ); + =20 + return EFI_SUCCESS; +} + =20 + +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; + } + =20 + // + // Get the Config Routing Protocol Interface + // + Status =3D GetHIIConfigRoutingInterface( &HIIConfigRouting ); + if ( EFI_ERROR(Status) ) { + return Status; + } + =20 + // + //Call check points + // + BBTestRouteConfigFunctionTestCheckpoint1( StandardLib, HIIConfigRouting,= HIIConfigAccess ); + =20 + 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; + =20 + // + // 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; + } + =20 + // + //Call check points + // + BBTestCallBackFunctionTestCheckpoint1( StandardLib, HIIConfigAccess ); + =20 + 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; + =20 + 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; + + =20 + //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 (MultiConfi= gAltResp) + 2 ); + if (Request =3D=3D NULL) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + return EFI_OUT_OF_RESOURCES; + } + =20 + Status =3D GetCorrespondingRequest (MultiConfigAltResp, DevicePath, Requ= est); + if (EFI_ERROR(Status)) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + gtBS->FreePool (Request); + return Status; + } + =20 + // + // Call ExtractConfig with valid parameters + // + Status =3D HIIConfigAccess->ExtractConfig( + HIIConfigAccess, + Request, + &Progress, + &Results + ); + + if ( (EFI_SUCCESS =3D=3D Status) && (Progress =3D=3D (Request + SctStrLe= n (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; =20 + }else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestFunctionAssertionGuid001, + L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig- ExtractConfig= () 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; + =20 + // + // 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 + SctStrLe= n (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; =20 + }else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestFunctionAssertionGuid002, + L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig- ExtractConfig= () 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; + + =20 + //init the Request=20 + Status =3D HIIConfigRouting->ExportConfig( + HIIConfigRouting, + &MultiConfigAltResp + ); + if (EFI_ERROR(Status)) { + return Status; + } + =20 + // + // 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) && (R= esults =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- ExtractConfig= () 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); =20 + } + =20 + 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; + =20 + EFI_STRING Resp =3D NULL; + EFI_STRING Progress =3D NULL; + EFI_STRING MultiConfigAltResp =3D NULL; + EFI_STRING DevicePath =3D NULL; + =20 + //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 (MultiConfigAl= tResp) + 2 ); + if (Resp =3D=3D NULL) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + return EFI_OUT_OF_RESOURCES; + } + =20 + Status =3D GetCorrespondingResp (MultiConfigAltResp, DevicePath, Resp); + if (EFI_ERROR(Status)) { + gtBS->FreePool (MultiConfigAltResp); + gtBS->FreePool (DevicePath); + gtBS->FreePool (Resp); + return Status; + } + =20 + // + // Call RouteConfig with valid parameters + // + Status =3D HIIConfigAccess->RouteConfig( + HIIConfigAccess, + Resp, + &Progress + ); + if ( (EFI_SUCCESS =3D=3D Status) && (Progress =3D=3D Resp + SctStrLen (R= esp)) ) { + 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() returns= EFI_SUCCESS with valid parameters .", + L"%a:%d: Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + =20 + 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; + =20 + EFI_BROWSER_ACTION *Action; + EFI_QUESTION_ID QuestionId; + UINT8 Type; + EFI_IFR_TYPE_VALUE Value; + EFI_BROWSER_ACTION_REQUEST ActionRequest; + =20 + //init the paremeters + Action=3DEFI_BROWSER_ACTION_REQUEST_CHANGING; + QuestionId=3D0x1234; + Type=3DEFI_IFR_TYPE_NUM_SIZE_8; + =20 + =20 + // + // Call CallBack with valid parameters + // + Status =3D HIIConfigAccess->CallBack( + HIIConfigAccess, + Action, + QuestionId, + Type, + &Value, + &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_RESET= || EFI_BROWSER_ACTION_REQUEST_SUBMIT || EFI_BROWSER_ACTION_REQUEST_EXIT) != =3D ActionRequest) + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + =20 + } + =20 +=20 + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gHIIConfigAccessBBTestFunctionAssertionGuid003, + L"HII_CONFIG_ACCESS_PROTOCOL.CallBack- CallBack() returns EFI_S= UCCESS 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/Bla= ckBoxTest/HIIConfigAccessBBTestMain.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/P= rotocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestMain.c new file mode 100644 index 00000000..29c793e2 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxTe= st/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 BS= D License + which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. +=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, 0x= b0, 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 ExtractConf= ig().", + EFI_TEST_LEVEL_MINIMAL, + gSupportProtocolGuid, + EFI_TEST_CASE_AUTO, + BBTestExtractConfigFunctionTest + }, + =20 + { + EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0102, + L"RouteConfigFunction", + L"Function auto test for HII Configuration Access Protocol RouteConfig= ().", + 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 ExtractC= onfig().", + 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 RouteCon= fig().", + 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 CallBack= ().", + 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 stru= cture + // + return ((UINTN) DevicePath - (UINTN) Start) + sizeof (EFI_DEVICE_PATH_PR= OTOCOL); +} + + +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 stri= ng. Includes tailing '\0' character. + If routine return with EFI_SUCCESS, containing= length of hex string buffer. + If routine return with EFI_BUFFER_TOO_SMALL, c= ontaing 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 reve= rse 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 bi= nary 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); + =20 + // + // 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 Pr= otocol 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; + =20 + ReqPtr =3D Request; + RespPtr =3D MultiConfigAltResp; + + Len =3D SctStrLen (MultiConfigAltResp); + =20 + if (SctStrnCmp (MultiConfigAltResp, L"GUID=3D", 5) !=3D 0) { + return EFI_INVALID_PARAMETER; + } + =20 + if (SctStrStr (MultiConfigAltResp, DevicePath) =3D=3D NULL) { + return EFI_NOT_FOUND; + } + + SingleResp =3D (EFI_STRING) SctAllocateZeroPool ( 2 * SctStrLen (MultiCo= nfigAltResp) + 2 ); + if (SingleResp =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; + } + SingleRespPtr =3D SingleResp; + + while (*MultiConfigAltResp !=3D 0) { + while ((*MultiConfigAltResp !=3D 0) && (SctStrnCmp (MultiConfigAltResp= , 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++); + } 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; + =20 + ReqPtr =3D Resp; + RespPtr =3D MultiConfigAltResp; + + Len =3D SctStrLen (MultiConfigAltResp); + =20 + if (SctStrnCmp (MultiConfigAltResp, L"GUID=3D", 5) !=3D 0) { + return EFI_INVALID_PARAMETER; + } + =20 + if (SctStrStr (MultiConfigAltResp, DevicePath) =3D=3D NULL) { + return EFI_NOT_FOUND; + } + + while (*MultiConfigAltResp !=3D 0) { + while ((*MultiConfigAltResp !=3D 0) && (SctStrnCmp (MultiConfigAltResp= , 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; + =20 + return EFI_SUCCESS; +} + + + +EFI_STATUS +GetHIIConfigRoutingInterface ( + OUT EFI_HII_CONFIG_ROUTING_PROTOCOL **HIIConfigRouting + ) +{ + UINTN NoHandles; + EFI_HANDLE *HandleBuffer; + EFI_STATUS Status; + =20 + // + // Get the HII Database Protocol interface + // + Status =3D gtBS->LocateHandleBuffer ( + ByProtocol, + &gBlackBoxEfiHIIConfigRoutingProtocolGuid, + NULL, + &NoHandles, + &HandleBuffer + ); + if ( EFI_ERROR(Status) ) { + return Status; + } + =20 + if ( NoHandles <=3D 0 ) { + return EFI_DEVICE_ERROR; + } + =20 + Status =3D gtBS->HandleProtocol ( + HandleBuffer[0], + &gBlackBoxEfiHIIConfigRoutingProtocolGuid, + (VOID **) HIIConfigRouting + ); + if ( EFI_ERROR(Status) ) { + gtBS->FreePool ( HandleBuffer ); + return Status; + } + =20 + gtBS->FreePool ( HandleBuffer ); + =20 + return EFI_SUCCESS; +} + +EFI_STATUS +MultiAltRespToMultiReq ( + IN EFI_STRING Resp, + IN OUT EFI_STRING Req + ) +{ + EFI_STRING Pointer1 =3D Resp; =20 + 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) { =20 + 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; + =20 + 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)){ + if (*Req =3D=3D L'G') + *(Pointer3++) =3D L'&'; + SctStrCat (Req, CfgHdr); + Pointer3 +=3D SctStrLen (CfgHdr); + Flag =3D 1; + } else { + Flag =3D 0; + } =20 + } + 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 + (SctStrnCmp (Pointer1, L"&OFFSET=3D", 8) !=3D 0) && (SctStrnCmp (Point= er1, 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); + =20 + return EFI_SUCCESS; +} 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 new file mode 100644 index 00000000..c81a00ca --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxTe= st/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 BS= D License + which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. +=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, 0= x4 } } + +#define EFI_HII_CONFIG_ACCESS_PROTOCOL_TEST_ENTRY_GUID0202 \ +{ 0x495c99f3, 0x231, 0x45a5, { 0xaf, 0xfa, 0xd2, 0x5c, 0x6f, 0x9a, 0x19, 0= x1c } } + + + +EFI_STATUS +InitializeHIIConfigAccessBBTest ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ); + =20 + =20 +EFI_STATUS +UnloadHIIConfigAccessBBTest ( + IN EFI_HANDLE ImageHandle + ); + =20 + =20 +// +//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 + ); + =20 +EFI_STATUS +BBTestRouteConfigConformanceTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ); +/* =20 +EFI_STATUS +BBTestCallBackConformanceTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ); +*/ =20 +EFI_STATUS +BBTestExtractConfigFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ); + =20 +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/Bla= ckBoxTest/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/BlackBoxTe= st/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 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: +# +# HIIConfigAccessBBTest.inf +# +# Abstract: +# +# Component description file for IHV HII Config Access Protocol Black-Bo= x 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_SC= T.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/Ih= vUsbIoTest.inf SctPkg/TestCase/UEFI/IHV/Protocol/GraphicsOutput/BlackBoxTest/IhvGraphicsO= utputBBTest.inf SctPkg/TestCase/UEFI/IHV/Protocol/ExtScsiPassThru/BlackBoxTest/IhvExtScsiP= assThruBBTest.inf SctPkg/TestCase/UEFI/IHV/Protocol/ScsiIo/BlackBoxTest/IhvScsiIoBBTest.inf +SctPkg/TestCase/UEFI/IHV/Protocol/HIIConfigAccess/BlackBoxTest/IhvHIIConfi= gAccessBBTest.inf SctPkg/TestCase/UEFI/IHV/Protocol/iScsiInitiatorName/BlackBoxTest/IhviScsi= InitiatorNameBBTest.inf =20 SctPkg/TestCase/UEFI/IHV/Protocol/AbsolutePointer/BlackBoxTest/IhvAbsolute= PointerBBTest.inf --=20 2.22.0.windows.1