From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web11.1383.1570673619040143106 for ; Wed, 09 Oct 2019 19:13:39 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, 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 fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2019 19:13:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,278,1566889200"; d="scan'208";a="187810374" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga008.jf.intel.com with ESMTP; 09 Oct 2019 19:13:38 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 9 Oct 2019 19:13:37 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.165]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.225]) with mapi id 14.03.0439.000; Thu, 10 Oct 2019 10:13:36 +0800 From: "Eric Jin" To: "devel@edk2.groups.io" , "Liu, XianhuiX" CC: Heinrich Schuchardt , Supreeth Venkatesh Subject: Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Sync SNP Statistics change to IHV Thread-Topic: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Sync SNP Statistics change to IHV Thread-Index: AQHVfoXczqsKi9qcXUmKeUBikM0dtqdTIxMA Date: Thu, 10 Oct 2019 02:13:35 +0000 Message-ID: References: <20191009094210.3380-1-xianhuix.liu@intel.com> In-Reply-To: <20191009094210.3380-1-xianhuix.liu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMGQxYTNmZDgtMmI0My00YjJkLTljZjEtNDM5MDBkZmE5YWY1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiSVZwYjlCMGgrdXBhSzhcLzdPa2hjQUpaUFIzbGtlRkwzeHFEa1JKdFlhUzMxbXRDSmlSclRpUm9McTg3TnJVV2MifQ== 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 Content is good to me. Please update the copyright with correct year info. Best Regards Eric > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of xianhui > liu > Sent: Wednesday, October 9, 2019 5:42 PM > To: devel@edk2.groups.io > Cc: Heinrich Schuchardt ; Supreeth Venkatesh > ; Jin, Eric ; Liu, > XianhuiX > Subject: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Sync SNP Stati= stics > change 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 | 123 > ++++++++++++--------- > 1 file changed, 72 insertions(+), 51 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..9bd21a76 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 > @@ -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, &Stat= isticsSize, > &StatisticsTable); > - if ((StatusBuf[0] =3D=3D EFI_NOT_STARTED) && (SnpInterface->Mode->Sta= te > =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 St= atistics() > 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 initiali= zed. > // > Status =3D SnpInterface->Start (SnpInterface); > if (EFI_ERROR(Status)) { > return Status; > } >=20 > - StatusBuf[1] =3D SnpInterface->Statistics (SnpInterface, FALSE, &Stat= isticsSize, > &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 St= atistics() > 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, &Stat= isticsSize, > &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 St= atistics() > 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 Stat= istics() > 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 Stat= istics() > 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 Stat= istics() > with small buffer.", > - L"%a:%d:Status - %r", > - __FILE__, > - (UINTN)__LINE__, > - StatusBuf[2] > - ); > - > // > // Restore SNP State > // > -- > 2.14.1.windows.1 >=20 >=20 >=20