From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web12.1504.1570674754171493729 for ; Wed, 09 Oct 2019 19:32:34 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: eric.jin@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2019 19:32:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,278,1566889200"; d="scan'208";a="187814155" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga008.jf.intel.com with ESMTP; 09 Oct 2019 19:32:33 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 9 Oct 2019 19:32:32 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 9 Oct 2019 19:32:32 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.165]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.166]) with mapi id 14.03.0439.000; Thu, 10 Oct 2019 10:32:30 +0800 From: "Eric Jin" To: "Liu, XianhuiX" , "devel@edk2.groups.io" CC: Heinrich Schuchardt , Supreeth Venkatesh Subject: Re: [edk2-test][Patch v2] uefi-sct/SctPkg: Sync SNP Statistics change to IHV Thread-Topic: [edk2-test][Patch v2] uefi-sct/SctPkg: Sync SNP Statistics change to IHV Thread-Index: AQHVfxHT4lj/yfUWK0WBRs2TODFgsadTJ6DQ Date: Thu, 10 Oct 2019 02:32:30 +0000 Message-ID: References: <20191010022409.6540-1-xianhuix.liu@intel.com> In-Reply-To: <20191010022409.6540-1-xianhuix.liu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDgxOWM3YzItNThiMi00OThkLTk3MWQtZGE1Yjk0ZGYyMzA4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiU3Vybmd0VEJcLzVPS1lrVlVQb0hGaUE2SVNXeVBJWVV2bndncXRVSFZWSlF0cnppUlVPcDJHaDA4VENLVDkxcHIifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action 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 Reviewed-by: Eric Jin > -----Original Message----- > From: Liu, XianhuiX > Sent: Thursday, October 10, 2019 10:24 AM > To: devel@edk2.groups.io > Cc: Heinrich Schuchardt ; Supreeth Venkatesh > ; Jin, Eric ; Liu, > XianhuiX > Subject: [edk2-test][Patch v2] uefi-sct/SctPkg: Sync SNP Statistics chang= e to > IHV >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2160 > sync commit 269f8a35e44f2093625b3671f372f68e2983c49d > on file EFI/Protocol/SimpleNetwork/BlackBoxTest > /SimpleNetworkBBTestConformance.c to IHV >=20 > Cc: Heinrich Schuchardt > Cc: Supreeth Venkatesh > Cc: Eric Jin >=20 > Signed-off-by: xianhui liu > --- > .../BlackBoxTest/SimpleNetworkBBTestConformance.c | 125 > ++++++++++++--------- > 1 file changed, 73 insertions(+), 52 deletions(-) >=20 > diff --git a/uefi- > sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Simpl > eNetworkBBTestConformance.c b/uefi- > sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Simpl > eNetworkBBTestConformance.c > index 9d5bec18..c758f560 100644 > --- a/uefi- > sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Simpl > eNetworkBBTestConformance.c > +++ b/uefi- > sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxT > +++ est/SimpleNetworkBBTestConformance.c > @@ -1,7 +1,7 @@ > /** @file >=20 > Copyright 2006 - 2016 Unified EFI, Inc.
> - Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
> + Copyright (c) 2010 - 2019, Intel Corporation. All rights > + reserved.
>=20 > This program and the accompanying materials > are licensed and made available under the terms and conditions of the = BSD > License @@ -964,8 +964,7 @@ BBTestStatisticsConformanceTest ( { > EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; > EFI_STATUS Status; > - EFI_STATUS StatusBuf[3]; > - EFI_TEST_ASSERTION AssertionType[3]; > + EFI_TEST_ASSERTION AssertionType; > EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; > EFI_SIMPLE_NETWORK_STATE State1, State2; > EFI_NETWORK_STATISTICS StatisticsTable; > @@ -1012,31 +1011,68 @@ BBTestStatisticsConformanceTest ( > StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); > // > // Assertion Point 5.8.2.1 > - // Call Statistics() function if network interface not start. > + // Call Statistics() function while network interface is not started. > // > - StatusBuf[0] =3D SnpInterface->Statistics (SnpInterface, FALSE, &Stati= sticsSize, > &StatisticsTable); > - if ((StatusBuf[0] =3D=3D EFI_NOT_STARTED) && (SnpInterface->Mode->Stat= e > =3D=3D EfiSimpleNetworkStopped)) { > - AssertionType[0] =3D EFI_TEST_ASSERTION_PASSED; > + Status =3D SnpInterface->Statistics (SnpInterface, FALSE, > + &StatisticsSize, &StatisticsTable); if (Status =3D=3D EFI_UNSUPPORTED)= { > + StandardLib->RecordMessage( > + StandardLib, > + EFI_VERBOSE_LEVEL_QUIET, > + L"Statistics isn't supported, Status - %r\n", > + Status > + ); > } else { > - AssertionType[0] =3D EFI_TEST_ASSERTION_FAILED; > + if ((Status =3D=3D EFI_NOT_STARTED) && (SnpInterface->Mode->State = =3D=3D > EfiSimpleNetworkStopped)) { > + AssertionType =3D EFI_TEST_ASSERTION_PASSED; > + } else { > + AssertionType =3D EFI_TEST_ASSERTION_FAILED; > + } > + StandardLib->RecordAssertion ( > + StandardLib, > + AssertionType, > + gSimpleNetworkBBTestConformanceAssertionGuid014, > + L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Sta= tistics() > while network interface not started.", > + L"%a:%d:Status - %r", > + __FILE__, > + (UINTN)__LINE__, > + Status > + ); > } >=20 > // > // Assertion Point 5.8.2.2 > - // Call Statistics() function if network interface not initialized. > + // Call Statistics() function while network interface is not initializ= ed. > // > Status =3D SnpInterface->Start (SnpInterface); > if (EFI_ERROR(Status)) { > return Status; > } >=20 > - StatusBuf[1] =3D SnpInterface->Statistics (SnpInterface, FALSE, &Stati= sticsSize, > &StatisticsTable); > - if (StatusBuf[1] =3D=3D EFI_DEVICE_ERROR) { > - AssertionType[1] =3D EFI_TEST_ASSERTION_PASSED; > + Status =3D SnpInterface->Statistics (SnpInterface, FALSE, > + &StatisticsSize, &StatisticsTable); if (Status =3D=3D EFI_UNSUPPORTED)= { > + StandardLib->RecordMessage( > + StandardLib, > + EFI_VERBOSE_LEVEL_QUIET, > + L"Statistics isn't supported, Status - %r\n", > + Status > + ); > } else { > - AssertionType[1] =3D EFI_TEST_ASSERTION_FAILED; > + if (Status =3D=3D EFI_DEVICE_ERROR) { > + AssertionType =3D EFI_TEST_ASSERTION_PASSED; > + } else { > + AssertionType =3D EFI_TEST_ASSERTION_FAILED; > + } > + StandardLib->RecordAssertion ( > + StandardLib, > + AssertionType, > + gSimpleNetworkBBTestConformanceAssertionGuid015, > + L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Sta= tistics() > while network interface is not initialized.", > + L"%a:%d:Status - %r", > + __FILE__, > + (UINTN)__LINE__, > + Status > + ); > } > - >=20 > // > // Assertion Point 5.8.2.3 > @@ -1053,47 +1089,32 @@ BBTestStatisticsConformanceTest ( > // > StatisticsSize =3D 0; >=20 > - StatusBuf[2] =3D SnpInterface->Statistics (SnpInterface, FALSE, &Stati= sticsSize, > &StatisticsTable); > - if (StatusBuf[2] =3D=3D EFI_BUFFER_TOO_SMALL || Status =3D=3D > EFI_UNSUPPORTED) { > - AssertionType[2] =3D EFI_TEST_ASSERTION_PASSED; > + Status =3D SnpInterface->Statistics (SnpInterface, FALSE, > + &StatisticsSize, &StatisticsTable); if (Status =3D=3D EFI_UNSUPPORTED)= { > + StandardLib->RecordMessage( > + StandardLib, > + EFI_VERBOSE_LEVEL_QUIET, > + L"Statistics isn't supported, Status - %r\n", > + Status > + ); > } else { > - AssertionType[2] =3D EFI_TEST_ASSERTION_FAILED; > + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { > + AssertionType =3D EFI_TEST_ASSERTION_PASSED; > + } else { > + AssertionType =3D EFI_TEST_ASSERTION_FAILED; > + } > + StandardLib->RecordAssertion ( > + StandardLib, > + AssertionType, > + gSimpleNetworkBBTestConformanceAssertionGuid017, > + L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Sta= tistics() > with small buffer.", > + L"%a:%d:Status - %r", > + __FILE__, > + (UINTN)__LINE__, > + Status > + ); > } >=20 > - > - StandardLib->RecordAssertion ( > - StandardLib, > - AssertionType[0], > - gSimpleNetworkBBTestConformanceAssertionGuid014, > - L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Stati= stics() > when network interface not start.", > - L"%a:%d:Status - %r", > - __FILE__, > - (UINTN)__LINE__, > - StatusBuf[0] > - ); > - > - StandardLib->RecordAssertion ( > - StandardLib, > - AssertionType[1], > - gSimpleNetworkBBTestConformanceAssertionGuid015, > - L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Stati= stics() > when network interface not initialized.", > - L"%a:%d:Status - %r", > - __FILE__, > - (UINTN)__LINE__, > - StatusBuf[1] > - ); > - > - StandardLib->RecordAssertion ( > - StandardLib, > - AssertionType[2], > - gSimpleNetworkBBTestConformanceAssertionGuid017, > - L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Stati= stics() > with small buffer.", > - L"%a:%d:Status - %r", > - __FILE__, > - (UINTN)__LINE__, > - StatusBuf[2] > - ); > - > // > // Restore SNP State > // > -- > 2.14.1.windows.1