public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-test][Patch v2] uefi-sct/SctPkg: Sync SNP Statistics change to IHV
@ 2019-10-10  2:24 xianhui liu
  2019-10-10  2:32 ` Eric Jin
       [not found] ` <15CC285E18CC0426.26504@groups.io>
  0 siblings, 2 replies; 3+ messages in thread
From: xianhui liu @ 2019-10-10  2:24 UTC (permalink / raw)
  To: devel; +Cc: Heinrich Schuchardt, Supreeth Venkatesh, Eric Jin, xianhui liu

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2160
sync commit 269f8a35e44f2093625b3671f372f68e2983c49d
on file EFI/Protocol/SimpleNetwork/BlackBoxTest
/SimpleNetworkBBTestConformance.c to IHV

Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Cc: Eric Jin <eric.jin@intel.com>

Signed-off-by: xianhui liu <xianhuix.liu@intel.com>
---
 .../BlackBoxTest/SimpleNetworkBBTestConformance.c  | 125 ++++++++++++---------
 1 file changed, 73 insertions(+), 52 deletions(-)

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c
index 9d5bec18..c758f560 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2016 Unified EFI, Inc.<BR>
-  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2019, 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
@@ -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 = 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] = SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &StatisticsTable);
-  if ((StatusBuf[0] == EFI_NOT_STARTED) && (SnpInterface->Mode->State == EfiSimpleNetworkStopped)) {
-    AssertionType[0] = EFI_TEST_ASSERTION_PASSED;
+  Status = SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &StatisticsTable);
+  if (Status == EFI_UNSUPPORTED) {
+    StandardLib->RecordMessage(
+                   StandardLib,
+                   EFI_VERBOSE_LEVEL_QUIET,
+                   L"Statistics isn't supported, Status - %r\n",
+                   Status
+                   );
   } else {
-    AssertionType[0] = EFI_TEST_ASSERTION_FAILED;
+    if ((Status == EFI_NOT_STARTED) && (SnpInterface->Mode->State == EfiSimpleNetworkStopped)) {
+      AssertionType = EFI_TEST_ASSERTION_PASSED;
+    } else {
+      AssertionType = EFI_TEST_ASSERTION_FAILED;
+    }
+    StandardLib->RecordAssertion (
+                   StandardLib,
+                   AssertionType,
+                   gSimpleNetworkBBTestConformanceAssertionGuid014,
+                   L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Statistics() while network interface not started.",
+                   L"%a:%d:Status - %r",
+                   __FILE__,
+                   (UINTN)__LINE__,
+                   Status
+                   );
   }
 
   //
   // Assertion Point 5.8.2.2
-  // Call Statistics() function if network interface not initialized.
+  // Call Statistics() function while network interface is not initialized.
   //
   Status = SnpInterface->Start (SnpInterface);
   if (EFI_ERROR(Status)) {
     return Status;
   }
 
-  StatusBuf[1] = SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &StatisticsTable);
-  if (StatusBuf[1] == EFI_DEVICE_ERROR) {
-    AssertionType[1] = EFI_TEST_ASSERTION_PASSED;
+  Status = SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &StatisticsTable);
+  if (Status == EFI_UNSUPPORTED) {
+    StandardLib->RecordMessage(
+                   StandardLib,
+                   EFI_VERBOSE_LEVEL_QUIET,
+                   L"Statistics isn't supported, Status - %r\n",
+                   Status
+                   );
   } else {
-    AssertionType[1] = EFI_TEST_ASSERTION_FAILED;
+    if (Status == EFI_DEVICE_ERROR) {
+      AssertionType = EFI_TEST_ASSERTION_PASSED;
+    } else {
+      AssertionType = EFI_TEST_ASSERTION_FAILED;
+    }
+    StandardLib->RecordAssertion (
+                   StandardLib,
+                   AssertionType,
+                   gSimpleNetworkBBTestConformanceAssertionGuid015,
+                   L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Statistics() while network interface is not initialized.",
+                   L"%a:%d:Status - %r",
+                   __FILE__,
+                   (UINTN)__LINE__,
+                   Status
+                   );
   }
- 
 
   //
   // Assertion Point 5.8.2.3
@@ -1053,47 +1089,32 @@ BBTestStatisticsConformanceTest (
   //
   StatisticsSize = 0;
 
-  StatusBuf[2] = SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &StatisticsTable);
-  if (StatusBuf[2] == EFI_BUFFER_TOO_SMALL || Status == EFI_UNSUPPORTED) {
-    AssertionType[2] = EFI_TEST_ASSERTION_PASSED;
+  Status = SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &StatisticsTable);
+  if (Status == EFI_UNSUPPORTED) {
+    StandardLib->RecordMessage(
+                   StandardLib,
+                   EFI_VERBOSE_LEVEL_QUIET,
+                   L"Statistics isn't supported, Status - %r\n",
+                   Status
+                   );
   } else {
-    AssertionType[2] = EFI_TEST_ASSERTION_FAILED;
+    if (Status == EFI_BUFFER_TOO_SMALL) {
+      AssertionType = EFI_TEST_ASSERTION_PASSED;
+    } else {
+      AssertionType = EFI_TEST_ASSERTION_FAILED;
+    }
+    StandardLib->RecordAssertion (
+                   StandardLib,
+                   AssertionType,
+                   gSimpleNetworkBBTestConformanceAssertionGuid017,
+                   L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Statistics() with small buffer.",
+                   L"%a:%d:Status - %r",
+                   __FILE__,
+                   (UINTN)__LINE__,
+                   Status
+                   );
   }
 
-  
-  StandardLib->RecordAssertion (
-                 StandardLib,
-                 AssertionType[0],
-                 gSimpleNetworkBBTestConformanceAssertionGuid014,
-                 L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Statistics() 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 Statistics() 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 Statistics() with small buffer.",
-                 L"%a:%d:Status - %r",
-                 __FILE__,
-                 (UINTN)__LINE__,
-                 StatusBuf[2]
-                 );
-
   //
   // Restore SNP State
   //
-- 
2.14.1.windows.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [edk2-test][Patch v2] uefi-sct/SctPkg: Sync SNP Statistics change to IHV
  2019-10-10  2:24 [edk2-test][Patch v2] uefi-sct/SctPkg: Sync SNP Statistics change to IHV xianhui liu
@ 2019-10-10  2:32 ` Eric Jin
       [not found] ` <15CC285E18CC0426.26504@groups.io>
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Jin @ 2019-10-10  2:32 UTC (permalink / raw)
  To: Liu, XianhuiX, devel@edk2.groups.io
  Cc: Heinrich Schuchardt, Supreeth Venkatesh

Reviewed-by: Eric Jin <eric.jin@intel.com>

> -----Original Message-----
> From: Liu, XianhuiX <xianhuix.liu@intel.com>
> Sent: Thursday, October 10, 2019 10:24 AM
> To: devel@edk2.groups.io
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>; Supreeth Venkatesh
> <supreeth.venkatesh@arm.com>; Jin, Eric <eric.jin@intel.com>; Liu,
> XianhuiX <xianhuix.liu@intel.com>
> Subject: [edk2-test][Patch v2] uefi-sct/SctPkg: Sync SNP Statistics change to
> IHV
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2160
> sync commit 269f8a35e44f2093625b3671f372f68e2983c49d
> on file EFI/Protocol/SimpleNetwork/BlackBoxTest
> /SimpleNetworkBBTestConformance.c to IHV
> 
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> Cc: Eric Jin <eric.jin@intel.com>
> 
> Signed-off-by: xianhui liu <xianhuix.liu@intel.com>
> ---
>  .../BlackBoxTest/SimpleNetworkBBTestConformance.c  | 125
> ++++++++++++---------
>  1 file changed, 73 insertions(+), 52 deletions(-)
> 
> 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
> 
>    Copyright 2006 - 2016 Unified EFI, Inc.<BR>
> -  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2010 - 2019, 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 @@ -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 = 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] = SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize,
> &StatisticsTable);
> -  if ((StatusBuf[0] == EFI_NOT_STARTED) && (SnpInterface->Mode->State
> == EfiSimpleNetworkStopped)) {
> -    AssertionType[0] = EFI_TEST_ASSERTION_PASSED;
> +  Status = SnpInterface->Statistics (SnpInterface, FALSE,
> + &StatisticsSize, &StatisticsTable);  if (Status == EFI_UNSUPPORTED) {
> +    StandardLib->RecordMessage(
> +                   StandardLib,
> +                   EFI_VERBOSE_LEVEL_QUIET,
> +                   L"Statistics isn't supported, Status - %r\n",
> +                   Status
> +                   );
>    } else {
> -    AssertionType[0] = EFI_TEST_ASSERTION_FAILED;
> +    if ((Status == EFI_NOT_STARTED) && (SnpInterface->Mode->State ==
> EfiSimpleNetworkStopped)) {
> +      AssertionType = EFI_TEST_ASSERTION_PASSED;
> +    } else {
> +      AssertionType = EFI_TEST_ASSERTION_FAILED;
> +    }
> +    StandardLib->RecordAssertion (
> +                   StandardLib,
> +                   AssertionType,
> +                   gSimpleNetworkBBTestConformanceAssertionGuid014,
> +                   L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Statistics()
> while network interface not started.",
> +                   L"%a:%d:Status - %r",
> +                   __FILE__,
> +                   (UINTN)__LINE__,
> +                   Status
> +                   );
>    }
> 
>    //
>    // Assertion Point 5.8.2.2
> -  // Call Statistics() function if network interface not initialized.
> +  // Call Statistics() function while network interface is not initialized.
>    //
>    Status = SnpInterface->Start (SnpInterface);
>    if (EFI_ERROR(Status)) {
>      return Status;
>    }
> 
> -  StatusBuf[1] = SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize,
> &StatisticsTable);
> -  if (StatusBuf[1] == EFI_DEVICE_ERROR) {
> -    AssertionType[1] = EFI_TEST_ASSERTION_PASSED;
> +  Status = SnpInterface->Statistics (SnpInterface, FALSE,
> + &StatisticsSize, &StatisticsTable);  if (Status == EFI_UNSUPPORTED) {
> +    StandardLib->RecordMessage(
> +                   StandardLib,
> +                   EFI_VERBOSE_LEVEL_QUIET,
> +                   L"Statistics isn't supported, Status - %r\n",
> +                   Status
> +                   );
>    } else {
> -    AssertionType[1] = EFI_TEST_ASSERTION_FAILED;
> +    if (Status == EFI_DEVICE_ERROR) {
> +      AssertionType = EFI_TEST_ASSERTION_PASSED;
> +    } else {
> +      AssertionType = EFI_TEST_ASSERTION_FAILED;
> +    }
> +    StandardLib->RecordAssertion (
> +                   StandardLib,
> +                   AssertionType,
> +                   gSimpleNetworkBBTestConformanceAssertionGuid015,
> +                   L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Statistics()
> while network interface is not initialized.",
> +                   L"%a:%d:Status - %r",
> +                   __FILE__,
> +                   (UINTN)__LINE__,
> +                   Status
> +                   );
>    }
> -
> 
>    //
>    // Assertion Point 5.8.2.3
> @@ -1053,47 +1089,32 @@ BBTestStatisticsConformanceTest (
>    //
>    StatisticsSize = 0;
> 
> -  StatusBuf[2] = SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize,
> &StatisticsTable);
> -  if (StatusBuf[2] == EFI_BUFFER_TOO_SMALL || Status ==
> EFI_UNSUPPORTED) {
> -    AssertionType[2] = EFI_TEST_ASSERTION_PASSED;
> +  Status = SnpInterface->Statistics (SnpInterface, FALSE,
> + &StatisticsSize, &StatisticsTable);  if (Status == EFI_UNSUPPORTED) {
> +    StandardLib->RecordMessage(
> +                   StandardLib,
> +                   EFI_VERBOSE_LEVEL_QUIET,
> +                   L"Statistics isn't supported, Status - %r\n",
> +                   Status
> +                   );
>    } else {
> -    AssertionType[2] = EFI_TEST_ASSERTION_FAILED;
> +    if (Status == EFI_BUFFER_TOO_SMALL) {
> +      AssertionType = EFI_TEST_ASSERTION_PASSED;
> +    } else {
> +      AssertionType = EFI_TEST_ASSERTION_FAILED;
> +    }
> +    StandardLib->RecordAssertion (
> +                   StandardLib,
> +                   AssertionType,
> +                   gSimpleNetworkBBTestConformanceAssertionGuid017,
> +                   L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Statistics()
> with small buffer.",
> +                   L"%a:%d:Status - %r",
> +                   __FILE__,
> +                   (UINTN)__LINE__,
> +                   Status
> +                   );
>    }
> 
> -
> -  StandardLib->RecordAssertion (
> -                 StandardLib,
> -                 AssertionType[0],
> -                 gSimpleNetworkBBTestConformanceAssertionGuid014,
> -                 L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Statistics()
> 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 Statistics()
> 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 Statistics()
> with small buffer.",
> -                 L"%a:%d:Status - %r",
> -                 __FILE__,
> -                 (UINTN)__LINE__,
> -                 StatusBuf[2]
> -                 );
> -
>    //
>    // Restore SNP State
>    //
> --
> 2.14.1.windows.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [edk2-test][Patch v2] uefi-sct/SctPkg: Sync SNP Statistics change to IHV
       [not found] ` <15CC285E18CC0426.26504@groups.io>
@ 2019-10-11  1:52   ` Eric Jin
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Jin @ 2019-10-11  1:52 UTC (permalink / raw)
  To: devel@edk2.groups.io, Jin, Eric, Liu, XianhuiX
  Cc: Heinrich Schuchardt, Supreeth Venkatesh

Push at 4a3165b8afa563eca1fc0ca93c1a849207a38c8b

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Eric Jin
Sent: Thursday, October 10, 2019 10:33 AM
To: Liu, XianhuiX <xianhuix.liu@intel.com>; devel@edk2.groups.io
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>; Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Subject: Re: [edk2-devel] [edk2-test][Patch v2] uefi-sct/SctPkg: Sync SNP Statistics change to IHV

Reviewed-by: Eric Jin <eric.jin@intel.com>

> -----Original Message-----
> From: Liu, XianhuiX <xianhuix.liu@intel.com>
> Sent: Thursday, October 10, 2019 10:24 AM
> To: devel@edk2.groups.io
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>; Supreeth Venkatesh 
> <supreeth.venkatesh@arm.com>; Jin, Eric <eric.jin@intel.com>; Liu, 
> XianhuiX <xianhuix.liu@intel.com>
> Subject: [edk2-test][Patch v2] uefi-sct/SctPkg: Sync SNP Statistics 
> change to IHV
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2160
> sync commit 269f8a35e44f2093625b3671f372f68e2983c49d
> on file EFI/Protocol/SimpleNetwork/BlackBoxTest
> /SimpleNetworkBBTestConformance.c to IHV
> 
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> Cc: Eric Jin <eric.jin@intel.com>
> 
> Signed-off-by: xianhui liu <xianhuix.liu@intel.com>
> ---
>  .../BlackBoxTest/SimpleNetworkBBTestConformance.c  | 125
> ++++++++++++---------
>  1 file changed, 73 insertions(+), 52 deletions(-)
> 
> 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
> 
>    Copyright 2006 - 2016 Unified EFI, Inc.<BR>
> -  Copyright (c) 2010 - 2018, Intel Corporation. All rights 
> reserved.<BR>
> +  Copyright (c) 2010 - 2019, 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 @@ -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 = 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] = SnpInterface->Statistics (SnpInterface, FALSE, 
> &StatisticsSize, &StatisticsTable);
> -  if ((StatusBuf[0] == EFI_NOT_STARTED) && (SnpInterface->Mode->State 
> == EfiSimpleNetworkStopped)) {
> -    AssertionType[0] = EFI_TEST_ASSERTION_PASSED;
> +  Status = SnpInterface->Statistics (SnpInterface, FALSE, 
> + &StatisticsSize, &StatisticsTable);  if (Status == EFI_UNSUPPORTED) {
> +    StandardLib->RecordMessage(
> +                   StandardLib,
> +                   EFI_VERBOSE_LEVEL_QUIET,
> +                   L"Statistics isn't supported, Status - %r\n",
> +                   Status
> +                   );
>    } else {
> -    AssertionType[0] = EFI_TEST_ASSERTION_FAILED;
> +    if ((Status == EFI_NOT_STARTED) && (SnpInterface->Mode->State ==
> EfiSimpleNetworkStopped)) {
> +      AssertionType = EFI_TEST_ASSERTION_PASSED;
> +    } else {
> +      AssertionType = EFI_TEST_ASSERTION_FAILED;
> +    }
> +    StandardLib->RecordAssertion (
> +                   StandardLib,
> +                   AssertionType,
> +                   gSimpleNetworkBBTestConformanceAssertionGuid014,
> +                   L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke 
> + Statistics()
> while network interface not started.",
> +                   L"%a:%d:Status - %r",
> +                   __FILE__,
> +                   (UINTN)__LINE__,
> +                   Status
> +                   );
>    }
> 
>    //
>    // Assertion Point 5.8.2.2
> -  // Call Statistics() function if network interface not initialized.
> +  // Call Statistics() function while network interface is not initialized.
>    //
>    Status = SnpInterface->Start (SnpInterface);
>    if (EFI_ERROR(Status)) {
>      return Status;
>    }
> 
> -  StatusBuf[1] = SnpInterface->Statistics (SnpInterface, FALSE, 
> &StatisticsSize, &StatisticsTable);
> -  if (StatusBuf[1] == EFI_DEVICE_ERROR) {
> -    AssertionType[1] = EFI_TEST_ASSERTION_PASSED;
> +  Status = SnpInterface->Statistics (SnpInterface, FALSE, 
> + &StatisticsSize, &StatisticsTable);  if (Status == EFI_UNSUPPORTED) {
> +    StandardLib->RecordMessage(
> +                   StandardLib,
> +                   EFI_VERBOSE_LEVEL_QUIET,
> +                   L"Statistics isn't supported, Status - %r\n",
> +                   Status
> +                   );
>    } else {
> -    AssertionType[1] = EFI_TEST_ASSERTION_FAILED;
> +    if (Status == EFI_DEVICE_ERROR) {
> +      AssertionType = EFI_TEST_ASSERTION_PASSED;
> +    } else {
> +      AssertionType = EFI_TEST_ASSERTION_FAILED;
> +    }
> +    StandardLib->RecordAssertion (
> +                   StandardLib,
> +                   AssertionType,
> +                   gSimpleNetworkBBTestConformanceAssertionGuid015,
> +                   L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke 
> + Statistics()
> while network interface is not initialized.",
> +                   L"%a:%d:Status - %r",
> +                   __FILE__,
> +                   (UINTN)__LINE__,
> +                   Status
> +                   );
>    }
> -
> 
>    //
>    // Assertion Point 5.8.2.3
> @@ -1053,47 +1089,32 @@ BBTestStatisticsConformanceTest (
>    //
>    StatisticsSize = 0;
> 
> -  StatusBuf[2] = SnpInterface->Statistics (SnpInterface, FALSE, 
> &StatisticsSize, &StatisticsTable);
> -  if (StatusBuf[2] == EFI_BUFFER_TOO_SMALL || Status ==
> EFI_UNSUPPORTED) {
> -    AssertionType[2] = EFI_TEST_ASSERTION_PASSED;
> +  Status = SnpInterface->Statistics (SnpInterface, FALSE, 
> + &StatisticsSize, &StatisticsTable);  if (Status == EFI_UNSUPPORTED) {
> +    StandardLib->RecordMessage(
> +                   StandardLib,
> +                   EFI_VERBOSE_LEVEL_QUIET,
> +                   L"Statistics isn't supported, Status - %r\n",
> +                   Status
> +                   );
>    } else {
> -    AssertionType[2] = EFI_TEST_ASSERTION_FAILED;
> +    if (Status == EFI_BUFFER_TOO_SMALL) {
> +      AssertionType = EFI_TEST_ASSERTION_PASSED;
> +    } else {
> +      AssertionType = EFI_TEST_ASSERTION_FAILED;
> +    }
> +    StandardLib->RecordAssertion (
> +                   StandardLib,
> +                   AssertionType,
> +                   gSimpleNetworkBBTestConformanceAssertionGuid017,
> +                   L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke 
> + Statistics()
> with small buffer.",
> +                   L"%a:%d:Status - %r",
> +                   __FILE__,
> +                   (UINTN)__LINE__,
> +                   Status
> +                   );
>    }
> 
> -
> -  StandardLib->RecordAssertion (
> -                 StandardLib,
> -                 AssertionType[0],
> -                 gSimpleNetworkBBTestConformanceAssertionGuid014,
> -                 L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Statistics()
> 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 Statistics()
> 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 Statistics()
> with small buffer.",
> -                 L"%a:%d:Status - %r",
> -                 __FILE__,
> -                 (UINTN)__LINE__,
> -                 StatusBuf[2]
> -                 );
> -
>    //
>    // Restore SNP State
>    //
> --
> 2.14.1.windows.1





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-11  1:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-10  2:24 [edk2-test][Patch v2] uefi-sct/SctPkg: Sync SNP Statistics change to IHV xianhui liu
2019-10-10  2:32 ` Eric Jin
     [not found] ` <15CC285E18CC0426.26504@groups.io>
2019-10-11  1:52   ` [edk2-devel] " Eric Jin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox