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=PBFqdwsh; spf=pass (domain: gmx.de, ip: 212.227.17.21, mailfrom: xypron.glpk@gmx.de) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by groups.io with SMTP; Wed, 04 Sep 2019 02:26:15 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1567589163; bh=UcP9+kOR0AAT0Ew5b+1fpOVXELf+7fiMNFteqJrQxaQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=PBFqdwsh8MC48JXC9DSdPAH6Ez/d4nMlrA0dO2EnvfrkBuNkT/IDzuwICq70lsNxm uRJFgDh5fLJcDdVv0Ha0YBMxmlaeC2UqhBNOeREWWxlMeQ4PHiAEn8SSOeOqYrzXHL CpSmj65Tz6eT12TeoHjkFhKyzKsOoNejH0liGS+U= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([84.118.159.3]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MFKGP-1hycz40SaH-00FnsJ; Wed, 04 Sep 2019 11:26:03 +0200 From: "Heinrich Schuchardt" To: EDK II Development Cc: Eric Jin , Supreeth Venkatesh , Stephano Cetola , Heinrich Schuchardt Subject: [edk2-test] [PATCH 1/1] uefi-sct/SctPkg: SNP Statistics may be unsupported Date: Wed, 4 Sep 2019 11:25:54 +0200 Message-Id: <20190904092554.10090-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.23.0.rc1 MIME-Version: 1.0 X-Provags-ID: V03:K1:gE5PzjGqn5eG54ep2LPPDczZdGWcO0KfRPVCn25Wp0s9bsXflgp ztSMIP42IovYIwMzNfJyIULRdYK1Y9xXuzhxjpb9tz050r+xs+7APpIww21EWhWWr7+KrOI EfxIcSi4MHv1u2AS7erVKQE/qvF9sEw3WRY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OOrikrzUJkehKVmHN+CoZYS uHgr3WIJ3kBUkT3UCG+ZhIzj62KZyudqTka54dYGm2+iUkUUHXY5DJ9DJICmBc19w0hZKeAtA VXZppCYFsHg0lNrPvSFYB899jrWr8ZL1HetK+v5/X8Yx6+RQ1JTysZ/L4Y0NEKB2+RLwbp6Xt YWH7bJ8m20x+pDmQ92T3UsezCItcxwS9IFYFLyIM2v4imQGU9Ey+kRpV8SyjSfEnyGYMDuSPz C6Y2yClQW8SA9aI/+Tz1LRqlze0M0x9rtRX7Uxh7t5YcBuyg== Content-Transfer-Encoding: quoted-printable If EFI_SIMPLE_NETWORK.Statistics() is not supported, it will return EFI_UNSUPPORTED. In this case do not expect input parameters to be checked for conformance. Signed-off-by: Heinrich Schuchardt --- .../SimpleNetworkBBTestConformance.c | 112 +++++++++++------- 1 file changed, 72 insertions(+), 40 deletions(-) diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/Black= BoxTest/SimpleNetworkBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EF= I/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c index 9d5bec18..ea4a806b 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTestConformance.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTestConformance.c @@ -1015,10 +1015,19 @@ BBTestStatisticsConformanceTest ( // Call Statistics() function if network interface not start.=0D //=0D StatusBuf[0] =3D SnpInterface->Statistics (SnpInterface, FALSE, &Statist= icsSize, &StatisticsTable);=0D - if ((StatusBuf[0] =3D=3D EFI_NOT_STARTED) && (SnpInterface->Mode->State = =3D=3D EfiSimpleNetworkStopped)) {=0D - AssertionType[0] =3D EFI_TEST_ASSERTION_PASSED;=0D + if (StatusBuf[0] =3D=3D EFI_UNSUPPORTED) {=0D + StandardLib->RecordMessage(=0D + StandardLib,=0D + EFI_VERBOSE_LEVEL_QUIET,=0D + L"Statistics isn't supported, Status - %r\n",=0D + StatusBuf[0]=0D + );=0D } else {=0D - AssertionType[0] =3D EFI_TEST_ASSERTION_FAILED;=0D + if ((StatusBuf[0] =3D=3D EFI_NOT_STARTED) && (SnpInterface->Mode->Stat= e =3D=3D EfiSimpleNetworkStopped)) {=0D + AssertionType[0] =3D EFI_TEST_ASSERTION_PASSED;=0D + } else {=0D + AssertionType[0] =3D EFI_TEST_ASSERTION_FAILED;=0D + }=0D }=0D =0D //=0D @@ -1031,10 +1040,19 @@ BBTestStatisticsConformanceTest ( }=0D =0D StatusBuf[1] =3D SnpInterface->Statistics (SnpInterface, FALSE, &Statist= icsSize, &StatisticsTable);=0D - if (StatusBuf[1] =3D=3D EFI_DEVICE_ERROR) {=0D - AssertionType[1] =3D EFI_TEST_ASSERTION_PASSED;=0D + if (StatusBuf[1] =3D=3D EFI_UNSUPPORTED) {=0D + StandardLib->RecordMessage(=0D + StandardLib,=0D + EFI_VERBOSE_LEVEL_QUIET,=0D + L"Statistics isn't supported, Status - %r\n",=0D + StatusBuf[1]=0D + );=0D } else {=0D - AssertionType[1] =3D EFI_TEST_ASSERTION_FAILED;=0D + if (StatusBuf[1] =3D=3D EFI_DEVICE_ERROR) {=0D + AssertionType[1] =3D EFI_TEST_ASSERTION_PASSED;=0D + } else {=0D + AssertionType[1] =3D EFI_TEST_ASSERTION_FAILED;=0D + }=0D }=0D =0D =0D @@ -1054,45 +1072,59 @@ BBTestStatisticsConformanceTest ( StatisticsSize =3D 0;=0D =0D StatusBuf[2] =3D SnpInterface->Statistics (SnpInterface, FALSE, &Statist= icsSize, &StatisticsTable);=0D - if (StatusBuf[2] =3D=3D EFI_BUFFER_TOO_SMALL || Status =3D=3D EFI_UNSUPP= ORTED) {=0D - AssertionType[2] =3D EFI_TEST_ASSERTION_PASSED;=0D + if (StatusBuf[2] =3D=3D EFI_UNSUPPORTED) {=0D + StandardLib->RecordMessage(=0D + StandardLib,=0D + EFI_VERBOSE_LEVEL_QUIET,=0D + L"Statistics isn't supported, Status - %r\n",=0D + StatusBuf[2]=0D + );=0D } else {=0D - AssertionType[2] =3D EFI_TEST_ASSERTION_FAILED;=0D + if (StatusBuf[2] =3D=3D EFI_BUFFER_TOO_SMALL || Status =3D=3D EFI_UNSU= PPORTED) {=0D + AssertionType[2] =3D EFI_TEST_ASSERTION_PASSED;=0D + } else {=0D + AssertionType[2] =3D EFI_TEST_ASSERTION_FAILED;=0D + }=0D }=0D =0D + if (StatusBuf[0] !=3D EFI_UNSUPPORTED) {=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType[0],=0D + gSimpleNetworkBBTestConformanceAssertionGuid014,=0D + L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Stati= stics() when network interface not start.",=0D + L"%a:%d:Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + StatusBuf[0]=0D + );=0D + }=0D =0D - StandardLib->RecordAssertion (=0D - StandardLib,=0D - AssertionType[0],=0D - gSimpleNetworkBBTestConformanceAssertionGuid014,=0D - L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Statist= ics() when network interface not start.",=0D - L"%a:%d:Status - %r",=0D - __FILE__,=0D - (UINTN)__LINE__,=0D - StatusBuf[0]=0D - );=0D - =0D - StandardLib->RecordAssertion (=0D - StandardLib,=0D - AssertionType[1],=0D - gSimpleNetworkBBTestConformanceAssertionGuid015,=0D - L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Statist= ics() when network interface not initialized.",=0D - L"%a:%d:Status - %r",=0D - __FILE__,=0D - (UINTN)__LINE__,=0D - StatusBuf[1]=0D - );=0D + if (StatusBuf[1] !=3D EFI_UNSUPPORTED) {=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType[1],=0D + gSimpleNetworkBBTestConformanceAssertionGuid015,=0D + L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Stati= stics() when network interface not initialized.",=0D + L"%a:%d:Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + StatusBuf[1]=0D + );=0D + }=0D =0D - StandardLib->RecordAssertion (=0D - StandardLib,=0D - AssertionType[2],=0D - gSimpleNetworkBBTestConformanceAssertionGuid017,=0D - L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Statist= ics() with small buffer.",=0D - L"%a:%d:Status - %r",=0D - __FILE__,=0D - (UINTN)__LINE__,=0D - StatusBuf[2]=0D - );=0D + if (StatusBuf[2] !=3D EFI_UNSUPPORTED) {=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + AssertionType[2],=0D + gSimpleNetworkBBTestConformanceAssertionGuid017,=0D + L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Stati= stics() with small buffer.",=0D + L"%a:%d:Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + StatusBuf[2]=0D + );=0D + }=0D =0D //=0D // Restore SNP State=0D --=20 2.23.0.rc1