From: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
To: Eric Jin <eric.jin@intel.com>, edk2-devel@lists.01.org
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Subject: Re: [edk2-test][Patch] uefi-sct\SctPkg: Fix the corner case of ExtractConfig API
Date: Fri, 12 Oct 2018 09:38:01 +0100 [thread overview]
Message-ID: <934d2f72-2641-b74e-3ed8-ae6142e6a70d@arm.com> (raw)
In-Reply-To: <20181012021123.11904-1-eric.jin@intel.com>
migrating over from
https://github.com/UEFI/UEFI-SCT/commit/be1ddea30c03bf6c9f38ff826f7c4317b0653a4c
Reviewed-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
On 10/12/2018 03:11 AM, Eric Jin wrote:
> There may be no output with the ExtractConfig API
> The export data may be changed automatically
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Eric Jin <eric.jin@intel.com>
> Cc: Supreeth Venkatesh <Supreeth.Venkatesh@arm.com>
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
> ---
> .../BlackBoxTest/HIIConfigAccessBBTestFunction.c | 67 +++-------------------
> 1 file changed, 9 insertions(+), 58 deletions(-)
>
> diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestFunction.c
> index 07e6782..b327648 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestFunction.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestFunction.c
> @@ -1,7 +1,7 @@
> /** @file
>
> Copyright 2006 - 2017 Unified EFI, Inc.<BR>
> - Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
> + Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
>
> This program and the accompanying materials
> are licensed and made available under the terms and conditions of the BSD License
> @@ -305,9 +305,6 @@ BBTestExtractConfigFunctionTestCheckpoint1 (
> if (Results == NULL) {
> AssertionType = EFI_TEST_ASSERTION_FAILED;
> } else {
> - if (NULL == SctStrStr (MultiConfigAltResp, Results)) {
> - AssertionType = EFI_TEST_ASSERTION_FAILED;
> - }
> gtBS->FreePool (Results);
> }
> } else if (EFI_OUT_OF_RESOURCES == Status) {
> @@ -375,7 +372,7 @@ BBTestExtractConfigFunctionTestCheckpoint1 (
> StandardLib->RecordAssertion (
> StandardLib,
> AssertionType,
> - gHIIConfigAccessBBTestFunctionAssertionGuid001,
> + gHIIConfigAccessBBTestFunctionAssertionGuid002,
> L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig- ExtractConfig() returns EFI_SUCCESS and vaild Results with valid parameters .",
> L"%a:%d: Status - %r",
> __FILE__,
> @@ -401,7 +398,6 @@ BBTestExtractConfigFunctionTestCheckpoint2 (
> EFI_STATUS Status;
> EFI_TEST_ASSERTION AssertionType;
>
> - //UINTN Len = 0;
> EFI_STRING Request = NULL;
> EFI_STRING Progress = NULL;
> EFI_STRING Results = NULL;
> @@ -427,78 +423,33 @@ BBTestExtractConfigFunctionTestCheckpoint2 (
> &Results
> );
>
> - if ( EFI_OUT_OF_RESOURCES == Status) {
> - AssertionType = EFI_TEST_ASSERTION_WARNING;
> + if (EFI_OUT_OF_RESOURCES == Status) {
> + AssertionType = EFI_TEST_ASSERTION_WARNING;
> + } else if ((EFI_NOT_FOUND == Status) && (Progress == NULL) && (Results == NULL)) {
> + AssertionType = EFI_TEST_ASSERTION_PASSED;
> } else if ( EFI_SUCCESS != Status ) {
> AssertionType = EFI_TEST_ASSERTION_FAILED;
> if (Results != NULL) {
> gtBS->FreePool (Results);
> }
> - return Status;
> } else {
> AssertionType = EFI_TEST_ASSERTION_PASSED;
> - if ( (Results != NULL) && (NULL == SctStrStr (MultiConfigAltResp, Results)) ) {
> + if (Results == NULL) {
> AssertionType = EFI_TEST_ASSERTION_FAILED;
> }
> }
> StandardLib->RecordAssertion (
> StandardLib,
> AssertionType,
> - gHIIConfigAccessBBTestFunctionAssertionGuid002,
> - L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig- ExtractConfig() returns EFI_SUCCESS with Request been NULL .",
> + 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
> );
> -
> -
> -/*
> - //
> - // build <MultiConfigRequest> out of <MultiConfigAltResp>
> - //
> - Len = SctStrLen (MultiConfigAltResp);
> - Request = (EFI_STRING) SctAllocateZeroPool (2 * Len + 2);
> - if (Request == NULL) {
> - goto FUNC_EXIT;
> - }
> -
> -
> - Status = MultiAltRespToMultiReq (MultiConfigAltResp, Request);
> - if (Status != EFI_SUCCESS) {
> - goto FUNC_EXIT;
> - }
> -
> - Status = HIIConfigRouting->ExtractConfig(
> - HIIConfigRouting,
> - Request,
> - &Progress,
> - &Results
> - );
> - //
> - // Since ExtractConfig may not append <AltResp> at string tail.
> - // We check whether Results is a substring of MultiConfigAltResp from ExportConfig
> - //
> - if (Status == EFI_SUCCESS && SctStrStr (MultiConfigAltResp, Results) != NULL) {
> - AssertionType = EFI_TEST_ASSERTION_PASSED;
> - } else if (EFI_OUT_OF_RESOURCES == Status){
> - AssertionType = EFI_TEST_ASSERTION_WARNING;
> - } else {
> - AssertionType = EFI_TEST_ASSERTION_FAILED;
> - }
> - StandardLib->RecordAssertion (
> - StandardLib,
> - AssertionType,
> - gHIIConfigAccessBBTestFunctionAssertionGuid004,
> - L"HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig - ExtractConfig() Check if Results is in <MultiConfigAltResp> format.",
> - L"%a:%d:",
> - __FILE__,
> - (UINTN)__LINE__
> - );
>
>
> -FUNC_EXIT:
> -*/
> if ( NULL != MultiConfigAltResp ){
> gtBS->FreePool (MultiConfigAltResp);
> }
prev parent reply other threads:[~2018-10-12 8:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-12 2:11 [edk2-test][Patch] uefi-sct\SctPkg: Fix the corner case of ExtractConfig API Eric Jin
2018-10-12 8:38 ` Supreeth Venkatesh [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=934d2f72-2641-b74e-3ed8-ae6142e6a70d@arm.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox