From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=V8cVvhCn; spf=pass (domain: gmx.de, ip: 212.227.15.18, mailfrom: xypron.glpk@gmx.de) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by groups.io with SMTP; Tue, 24 Sep 2019 12:06:08 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1569351957; bh=ZFxXb457Q7kzoiXWpMDyqYKNSuT8FQ/MfYm/rNFXFAs=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=V8cVvhCnK9QiIunJEUYjXyuQFCYDZMOec+7oouPWOZz1xJ2b6ZfI9Cdety+LK4O6T PxXK6FT5jmYo+jFMksfHAM3Wc2WStCZP4aOjIMzT2PSjLj02J1qF9TTN1XthqBJab+ LR8MWFJXiTFxW9aSQeJKS5/3UjuyAxI3JJ/OIh1g= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.51] ([88.152.145.122]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MDQiS-1iMA4Z2vkk-00AYZu; Tue, 24 Sep 2019 21:05:57 +0200 Subject: Re: [edk2-test][Patch] uefi-sct/SctPkg: Add MediaPresentSupported check To: xianhui liu , devel@edk2.groups.io Cc: Supreeth Venkatesh , Eric Jin References: <20190924085052.8484-1-xianhuix.liu@intel.com> From: "Heinrich Schuchardt" Message-ID: <1ec6d2d9-561b-c04e-327e-20b82001929f@gmx.de> Date: Tue, 24 Sep 2019 21:05:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20190924085052.8484-1-xianhuix.liu@intel.com> X-Provags-ID: V03:K1:RjyOlF80wmE+NYA0UUZGH0AEDTFypjjnlcBJgxfoBjcD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wjVYKKZsVaMY3h+HL6zJmbHdg6yy16Wi2Ri91ZyXU0ILoACvH9aqNoIuT0Xm8Ox dlprrV+XozWK/VOeWPTsGVUQ7aF+drWJD4mg/2rZEP+emQEoK6yukSKPb7RZWAtLhaIsgVgw5 EV3u9bMwe5bfhejyJgaX8OTLkPHoJNRvs7y3xjh2gVQDSqmF5snXHhathokU5EOBl64sZrXNF bMdRhqjVesYz4OULAf8K6DqJiiA972lbI/dVvDjJBcqalXHK0Y4neQyD1S4Odnr5mwWflySJG ubfmmuwPEKt8cUhUvKR9GqEPYnd7X4rcqw/tnjfzF0OevrEB2a93GjIAJAn2ayPSdSzaZ0ZDF DJ2qPwSw6Q4DaFSGpRedP5RZD9AFV8mC8m3pVOAnvdioqtpBDVhDLdfCbiqdY9lyCsMzzWJwg pyuxO7/A2XVIECXFZhfPqJIzM/Os4pPh5PVEg3bRRMCqcYp6FljCEj6QNbk8= Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 9/24/19 10:50 AM, xianhui liu wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2061 > check MediaPresent while MediaPresentSupported is TRUE > sync change from EFI to IHV SimpleNetworkBBTestFunction Thanks for addressing this issue. > > Cc: Heinrich Schuchardt %s/Cc:/Reported-by:/ > Cc: Supreeth Venkatesh > Cc: Eric Jin > > Signed-off-by: xianhui liu > --- > .../BlackBoxTest/SimpleNetworkBBTestFunction.c | 64 +++++++++++---= -------- > 1 file changed, 33 insertions(+), 31 deletions(-) > > diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/Bl= ackBoxTest/SimpleNetworkBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/I= HV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c > index b4c7b5ee..8559e894 100644 > --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxT= est/SimpleNetworkBBTestFunction.c > +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxT= est/SimpleNetworkBBTestFunction.c > @@ -1888,38 +1888,40 @@ BBTestGetStatusFunctionTest ( > Status =3D SnpInterface->GetStatus (SnpInterface, &InterruptStatus, = &TxBuf); > Status1 =3D SnpInterface->GetStatus (SnpInterface, &InterruptStatus,= &TxBuf); > > - if (SnpInterface->Mode->MediaPresent =3D=3D FALSE) { > - if ((Status1 =3D=3D EFI_SUCCESS) && (Status =3D=3D EFI_SUCCESS) && = (InterruptStatus =3D=3D 0)) { > - AssertionType =3D EFI_TEST_ASSERTION_PASSED; > - } else { > - AssertionType =3D EFI_TEST_ASSERTION_FAILED; > - } > - } else { > - if ((Status1 =3D=3D EFI_SUCCESS) && (Status =3D=3D EFI_SUCCESS)) { > - AssertionType =3D EFI_TEST_ASSERTION_PASSED; > - if (InterruptStatus & > - ~( EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT | > - EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT | > - EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT | > - EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT)) { > - AssertionType =3D EFI_TEST_ASSERTION_FAILED; > - } > - } else { > - AssertionType =3D EFI_TEST_ASSERTION_FAILED; > - } > + if (SnpInterface->Mode-> MediaPresentSupported =3D=3D TRUE) { > + if (SnpInterface->Mode->MediaPresent =3D=3D FALSE) { If MediaPresentSupported =3D=3D FALSE shouldn't we assume that Media is pr= esent. So isn't a single 'if' enough: if (SnpInterface->Mode-> MediaPresentSupported =3D=3D TRUE && SnpInterface->Mode->MediaPresent =3D=3D FALSE) { Best regards Heinrich Schuchardt > + if ((Status1 =3D=3D EFI_SUCCESS) && (Status =3D=3D EFI_SUCCESS) = && (InterruptStatus =3D=3D 0)) { > + AssertionType =3D EFI_TEST_ASSERTION_PASSED; > + } else { > + AssertionType =3D EFI_TEST_ASSERTION_FAILED; > + } > + } else { > + if ((Status1 =3D=3D EFI_SUCCESS) && (Status =3D=3D EFI_SUCCESS))= { > + AssertionType =3D EFI_TEST_ASSERTION_PASSED; > + if (InterruptStatus & > + ~( EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT | > + EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT | > + EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT | > + EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT)) { > + AssertionType =3D EFI_TEST_ASSERTION_FAILED; > + } > + } else { > + AssertionType =3D EFI_TEST_ASSERTION_FAILED; > + } > + } > + StandardLib->RecordAssertion ( > + StandardLib, > + AssertionType, > + gSimpleNetworkBBTestFunctionAssertionGuid022, > + L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus - Invoke Ge= tStatus() and verify interface correctness within test case", > + L"%a:%d:Status - %r, Status1 - %r, InterruptStatus = - %d", > + __FILE__, > + (UINTN)__LINE__, > + Status, > + Status1, > + InterruptStatus > + ); > } > - StandardLib->RecordAssertion ( > - StandardLib, > - AssertionType, > - gSimpleNetworkBBTestFunctionAssertionGuid022, > - L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus - Invoke GetSt= atus() and verify interface correctness within test case", > - L"%a:%d:Status - %r, Status1 - %r, InterruptStatus - %= d", > - __FILE__, > - (UINTN)__LINE__, > - Status, > - Status1, > - InterruptStatus > - ); > > // > // Restore SNP State >