public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-test][Patch] uefi-sct/SctPkg: Add MediaPresentSupported check
@ 2019-09-23  1:42 xianhuix.liu
  0 siblings, 0 replies; 8+ messages in thread
From: xianhuix.liu @ 2019-09-23  1:42 UTC (permalink / raw)
  To: devel; +Cc: Heinrich Schuchardt, Supreeth Venkatesh, Eric Jin

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2061
check MediaPresent while MediaPresentSupported is TRUE

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/SimpleNetworkBBTestFunction.c     | 64 +++++++++++-----------
 1 file changed, 33 insertions(+), 31 deletions(-)

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
index 133ef8a9..563e5361 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
@@ -1888,38 +1888,40 @@ BBTestGetStatusFunctionTest (
   Status = SnpInterface->GetStatus (SnpInterface, &InterruptStatus, &TxBuf);
   Status1 = SnpInterface->GetStatus (SnpInterface, &InterruptStatus, &TxBuf);
 
-  if (SnpInterface->Mode->MediaPresent == FALSE) {
-    if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS) && (InterruptStatus == 0)) {
-      AssertionType = EFI_TEST_ASSERTION_PASSED;
-    } else {
-      AssertionType = EFI_TEST_ASSERTION_FAILED;
-    }
-  } else {
-    if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS)) {
-      AssertionType = 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 = EFI_TEST_ASSERTION_FAILED;
-      }
-    } else {
-      AssertionType = EFI_TEST_ASSERTION_FAILED;
-    }
+  if (SnpInterface->Mode-> MediaPresentSupported == TRUE) {
+     if (SnpInterface->Mode->MediaPresent == FALSE) {
+       if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS) && (InterruptStatus == 0)) {
+         AssertionType = EFI_TEST_ASSERTION_PASSED;
+       } else {
+         AssertionType = EFI_TEST_ASSERTION_FAILED;
+       }
+     } else {
+       if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS)) {
+         AssertionType = 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 = EFI_TEST_ASSERTION_FAILED;
+         }
+       } else {
+         AssertionType = EFI_TEST_ASSERTION_FAILED;
+       }
+     }
+     StandardLib->RecordAssertion (
+                    StandardLib,
+                    AssertionType,
+                    gSimpleNetworkBBTestFunctionAssertionGuid022,
+                    L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus - Invoke GetStatus() 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 GetStatus() 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
-- 
2.14.1.windows.1


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

* [edk2-test][Patch] uefi-sct/SctPkg: Add MediaPresentSupported check
@ 2019-09-24  8:50 xianhui liu
  2019-09-24 19:05 ` Heinrich Schuchardt
  0 siblings, 1 reply; 8+ messages in thread
From: xianhui liu @ 2019-09-24  8:50 UTC (permalink / raw)
  To: devel; +Cc: Heinrich Schuchardt, Supreeth Venkatesh, Eric Jin

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2061
check MediaPresent while MediaPresentSupported is TRUE
sync change from EFI to IHV SimpleNetworkBBTestFunction

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/SimpleNetworkBBTestFunction.c     | 64 +++++++++++-----------
 1 file changed, 33 insertions(+), 31 deletions(-)

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
index b4c7b5ee..8559e894 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
@@ -1888,38 +1888,40 @@ BBTestGetStatusFunctionTest (
   Status = SnpInterface->GetStatus (SnpInterface, &InterruptStatus, &TxBuf);
   Status1 = SnpInterface->GetStatus (SnpInterface, &InterruptStatus, &TxBuf);
 
-  if (SnpInterface->Mode->MediaPresent == FALSE) {
-    if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS) && (InterruptStatus == 0)) {
-      AssertionType = EFI_TEST_ASSERTION_PASSED;
-    } else {
-      AssertionType = EFI_TEST_ASSERTION_FAILED;
-    }
-  } else {
-    if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS)) {
-      AssertionType = 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 = EFI_TEST_ASSERTION_FAILED;
-      }
-    } else {
-      AssertionType = EFI_TEST_ASSERTION_FAILED;
-    }
+  if (SnpInterface->Mode-> MediaPresentSupported == TRUE) {
+     if (SnpInterface->Mode->MediaPresent == FALSE) {
+       if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS) && (InterruptStatus == 0)) {
+         AssertionType = EFI_TEST_ASSERTION_PASSED;
+       } else {
+         AssertionType = EFI_TEST_ASSERTION_FAILED;
+       }
+     } else {
+       if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS)) {
+         AssertionType = 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 = EFI_TEST_ASSERTION_FAILED;
+         }
+       } else {
+         AssertionType = EFI_TEST_ASSERTION_FAILED;
+       }
+     }
+     StandardLib->RecordAssertion (
+                    StandardLib,
+                    AssertionType,
+                    gSimpleNetworkBBTestFunctionAssertionGuid022,
+                    L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus - Invoke GetStatus() 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 GetStatus() 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
-- 
2.14.1.windows.1


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

* Re: [edk2-test][Patch] uefi-sct/SctPkg: Add MediaPresentSupported check
  2019-09-24  8:50 [edk2-test][Patch] uefi-sct/SctPkg: Add MediaPresentSupported check xianhui liu
@ 2019-09-24 19:05 ` Heinrich Schuchardt
  2019-09-25  2:18   ` [edk2-devel] " xianhui liu
       [not found]   ` <15C78CE54FBDEE07.4626@groups.io>
  0 siblings, 2 replies; 8+ messages in thread
From: Heinrich Schuchardt @ 2019-09-24 19:05 UTC (permalink / raw)
  To: xianhui liu, devel; +Cc: Supreeth Venkatesh, Eric Jin

On 9/24/19 10:50 AM, xianhui liu wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2061
> check MediaPresent while MediaPresentSupported is TRUE
> sync change from EFI to IHV SimpleNetworkBBTestFunction

Thanks for addressing this issue.

>
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>

%s/Cc:/Reported-by:/

> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> Cc: Eric Jin <eric.jin@intel.com>
>
> Signed-off-by: xianhui liu <xianhuix.liu@intel.com>
> ---
>   .../BlackBoxTest/SimpleNetworkBBTestFunction.c     | 64 +++++++++++-----------
>   1 file changed, 33 insertions(+), 31 deletions(-)
>
> diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
> index b4c7b5ee..8559e894 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
> @@ -1888,38 +1888,40 @@ BBTestGetStatusFunctionTest (
>     Status = SnpInterface->GetStatus (SnpInterface, &InterruptStatus, &TxBuf);
>     Status1 = SnpInterface->GetStatus (SnpInterface, &InterruptStatus, &TxBuf);
>
> -  if (SnpInterface->Mode->MediaPresent == FALSE) {
> -    if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS) && (InterruptStatus == 0)) {
> -      AssertionType = EFI_TEST_ASSERTION_PASSED;
> -    } else {
> -      AssertionType = EFI_TEST_ASSERTION_FAILED;
> -    }
> -  } else {
> -    if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS)) {
> -      AssertionType = 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 = EFI_TEST_ASSERTION_FAILED;
> -      }
> -    } else {
> -      AssertionType = EFI_TEST_ASSERTION_FAILED;
> -    }
> +  if (SnpInterface->Mode-> MediaPresentSupported == TRUE) {
> +     if (SnpInterface->Mode->MediaPresent == FALSE) {


If MediaPresentSupported == FALSE shouldn't we assume that Media is present.

So isn't a single 'if' enough:

if (SnpInterface->Mode-> MediaPresentSupported == TRUE &&
     SnpInterface->Mode->MediaPresent == FALSE) {

Best regards

Heinrich Schuchardt

> +       if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS) && (InterruptStatus == 0)) {
> +         AssertionType = EFI_TEST_ASSERTION_PASSED;
> +       } else {
> +         AssertionType = EFI_TEST_ASSERTION_FAILED;
> +       }
> +     } else {
> +       if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS)) {
> +         AssertionType = 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 = EFI_TEST_ASSERTION_FAILED;
> +         }
> +       } else {
> +         AssertionType = EFI_TEST_ASSERTION_FAILED;
> +       }
> +     }
> +     StandardLib->RecordAssertion (
> +                    StandardLib,
> +                    AssertionType,
> +                    gSimpleNetworkBBTestFunctionAssertionGuid022,
> +                    L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus - Invoke GetStatus() 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 GetStatus() 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
>


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

* Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Add MediaPresentSupported check
  2019-09-24 19:05 ` Heinrich Schuchardt
@ 2019-09-25  2:18   ` xianhui liu
       [not found]   ` <15C78CE54FBDEE07.4626@groups.io>
  1 sibling, 0 replies; 8+ messages in thread
From: xianhui liu @ 2019-09-25  2:18 UTC (permalink / raw)
  To: devel@edk2.groups.io, xypron.glpk@gmx.de; +Cc: Supreeth Venkatesh, Jin, Eric

Please refer to below comments.

> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Heinrich Schuchardt
> Sent: Wednesday, September 25, 2019 3:06 AM
> To: Liu, XianhuiX <xianhuix.liu@intel.com>; devel@edk2.groups.io
> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Jin, Eric
> <eric.jin@intel.com>
> Subject: Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Add
> MediaPresentSupported check
> 
> On 9/24/19 10:50 AM, xianhui liu wrote:
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2061
> > check MediaPresent while MediaPresentSupported is TRUE sync change
> > from EFI to IHV SimpleNetworkBBTestFunction
> 
> Thanks for addressing this issue.
> 
> >
> > Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> 
> %s/Cc:/Reported-by:/
> 
> > Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> > Cc: Eric Jin <eric.jin@intel.com>
> >
> > Signed-off-by: xianhui liu <xianhuix.liu@intel.com>
> > ---
> >   .../BlackBoxTest/SimpleNetworkBBTestFunction.c     | 64 +++++++++++---
> --------
> >   1 file changed, 33 insertions(+), 31 deletions(-)
> >
> > diff --git
> > a/uefi-
> sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTes
> > t/SimpleNetworkBBTestFunction.c
> > b/uefi-
> sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTes
> > t/SimpleNetworkBBTestFunction.c
> > index b4c7b5ee..8559e894 100644
> > ---
> > a/uefi-
> sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTes
> > t/SimpleNetworkBBTestFunction.c
> > +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBo
> > +++ xTest/SimpleNetworkBBTestFunction.c
> > @@ -1888,38 +1888,40 @@ BBTestGetStatusFunctionTest (
> >     Status = SnpInterface->GetStatus (SnpInterface, &InterruptStatus,
> &TxBuf);
> >     Status1 = SnpInterface->GetStatus (SnpInterface, &InterruptStatus,
> > &TxBuf);
> >
> > -  if (SnpInterface->Mode->MediaPresent == FALSE) {
> > -    if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS) &&
> (InterruptStatus == 0)) {
> > -      AssertionType = EFI_TEST_ASSERTION_PASSED;
> > -    } else {
> > -      AssertionType = EFI_TEST_ASSERTION_FAILED;
> > -    }
> > -  } else {
> > -    if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS)) {
> > -      AssertionType = 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 = EFI_TEST_ASSERTION_FAILED;
> > -      }
> > -    } else {
> > -      AssertionType = EFI_TEST_ASSERTION_FAILED;
> > -    }
> > +  if (SnpInterface->Mode-> MediaPresentSupported == TRUE) {
> > +     if (SnpInterface->Mode->MediaPresent == FALSE) {
> 
> 
> If MediaPresentSupported == FALSE shouldn't we assume that Media is
> present.
> 
> So isn't a single 'if' enough:
> 
> if (SnpInterface->Mode-> MediaPresentSupported == TRUE &&
>      SnpInterface->Mode->MediaPresent == FALSE) {
> 
> Best regards
> 
> Heinrich Schuchardt

Hi Heinrich,
We will skip the checkpoint if MediaPresentSupported == FALSE. Thanks.

Hi Eric,
Please help correct me if any mistake here. Thanks.

Best Regards
Xianhui Liu


> 
> > +       if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS) &&
> (InterruptStatus == 0)) {
> > +         AssertionType = EFI_TEST_ASSERTION_PASSED;
> > +       } else {
> > +         AssertionType = EFI_TEST_ASSERTION_FAILED;
> > +       }
> > +     } else {
> > +       if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS)) {
> > +         AssertionType = 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 = EFI_TEST_ASSERTION_FAILED;
> > +         }
> > +       } else {
> > +         AssertionType = EFI_TEST_ASSERTION_FAILED;
> > +       }
> > +     }
> > +     StandardLib->RecordAssertion (
> > +                    StandardLib,
> > +                    AssertionType,
> > +                    gSimpleNetworkBBTestFunctionAssertionGuid022,
> > +                    L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus - Invoke
> GetStatus() 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
> GetStatus() 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
> >
> 
> 
> 


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

* Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Add MediaPresentSupported check
       [not found]   ` <15C78CE54FBDEE07.4626@groups.io>
@ 2019-09-27  2:01     ` xianhui liu
  2019-09-27  6:00       ` Heinrich Schuchardt
  0 siblings, 1 reply; 8+ messages in thread
From: xianhui liu @ 2019-09-27  2:01 UTC (permalink / raw)
  To: devel@edk2.groups.io, Liu, XianhuiX, xypron.glpk@gmx.de
  Cc: Supreeth Venkatesh, Jin, Eric

Hi Heinrich,
Any concern about it? Thanks.

Best Regards
Xianhui Liu

> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> xianhui liu
> Sent: Wednesday, September 25, 2019 10:18 AM
> To: devel@edk2.groups.io; xypron.glpk@gmx.de
> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Jin, Eric
> <eric.jin@intel.com>
> Subject: Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Add
> MediaPresentSupported check
> 
> Please refer to below comments.
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > Heinrich Schuchardt
> > Sent: Wednesday, September 25, 2019 3:06 AM
> > To: Liu, XianhuiX <xianhuix.liu@intel.com>; devel@edk2.groups.io
> > Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Jin, Eric
> > <eric.jin@intel.com>
> > Subject: Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Add
> > MediaPresentSupported check
> >
> > On 9/24/19 10:50 AM, xianhui liu wrote:
> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2061
> > > check MediaPresent while MediaPresentSupported is TRUE sync change
> > > from EFI to IHV SimpleNetworkBBTestFunction
> >
> > Thanks for addressing this issue.
> >
> > >
> > > Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> >
> > %s/Cc:/Reported-by:/
> >
> > > Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> > > Cc: Eric Jin <eric.jin@intel.com>
> > >
> > > Signed-off-by: xianhui liu <xianhuix.liu@intel.com>
> > > ---
> > >   .../BlackBoxTest/SimpleNetworkBBTestFunction.c     | 64 +++++++++++-
> --
> > --------
> > >   1 file changed, 33 insertions(+), 31 deletions(-)
> > >
> > > diff --git
> > > a/uefi-
> > sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTes
> > > t/SimpleNetworkBBTestFunction.c
> > > b/uefi-
> > sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTes
> > > t/SimpleNetworkBBTestFunction.c
> > > index b4c7b5ee..8559e894 100644
> > > ---
> > > a/uefi-
> > sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTes
> > > t/SimpleNetworkBBTestFunction.c
> > > +++ b/uefi-
> > sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBo
> > > +++ xTest/SimpleNetworkBBTestFunction.c
> > > @@ -1888,38 +1888,40 @@ BBTestGetStatusFunctionTest (
> > >     Status = SnpInterface->GetStatus (SnpInterface,
> > > &InterruptStatus,
> > &TxBuf);
> > >     Status1 = SnpInterface->GetStatus (SnpInterface,
> > > &InterruptStatus, &TxBuf);
> > >
> > > -  if (SnpInterface->Mode->MediaPresent == FALSE) {
> > > -    if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS) &&
> > (InterruptStatus == 0)) {
> > > -      AssertionType = EFI_TEST_ASSERTION_PASSED;
> > > -    } else {
> > > -      AssertionType = EFI_TEST_ASSERTION_FAILED;
> > > -    }
> > > -  } else {
> > > -    if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS)) {
> > > -      AssertionType = 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 = EFI_TEST_ASSERTION_FAILED;
> > > -      }
> > > -    } else {
> > > -      AssertionType = EFI_TEST_ASSERTION_FAILED;
> > > -    }
> > > +  if (SnpInterface->Mode-> MediaPresentSupported == TRUE) {
> > > +     if (SnpInterface->Mode->MediaPresent == FALSE) {
> >
> >
> > If MediaPresentSupported == FALSE shouldn't we assume that Media is
> > present.
> >
> > So isn't a single 'if' enough:
> >
> > if (SnpInterface->Mode-> MediaPresentSupported == TRUE &&
> >      SnpInterface->Mode->MediaPresent == FALSE) {
> >
> > Best regards
> >
> > Heinrich Schuchardt
> 
> Hi Heinrich,
> We will skip the checkpoint if MediaPresentSupported == FALSE. Thanks.
> 
> Hi Eric,
> Please help correct me if any mistake here. Thanks.
> 
> Best Regards
> Xianhui Liu
> 
> 
> >
> > > +       if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS) &&
> > (InterruptStatus == 0)) {
> > > +         AssertionType = EFI_TEST_ASSERTION_PASSED;
> > > +       } else {
> > > +         AssertionType = EFI_TEST_ASSERTION_FAILED;
> > > +       }
> > > +     } else {
> > > +       if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS)) {
> > > +         AssertionType = 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 = EFI_TEST_ASSERTION_FAILED;
> > > +         }
> > > +       } else {
> > > +         AssertionType = EFI_TEST_ASSERTION_FAILED;
> > > +       }
> > > +     }
> > > +     StandardLib->RecordAssertion (
> > > +                    StandardLib,
> > > +                    AssertionType,
> > > +                    gSimpleNetworkBBTestFunctionAssertionGuid022,
> > > +                    L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus -
> > > + Invoke
> > GetStatus() 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
> > GetStatus() 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
> > >
> >
> >
> >
> 
> 
> 


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

* Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Add MediaPresentSupported check
  2019-09-27  2:01     ` xianhui liu
@ 2019-09-27  6:00       ` Heinrich Schuchardt
  2019-09-27  6:36         ` Eric Jin
       [not found]         ` <15C83824ED461154.3061@groups.io>
  0 siblings, 2 replies; 8+ messages in thread
From: Heinrich Schuchardt @ 2019-09-27  6:00 UTC (permalink / raw)
  To: Liu, XianhuiX, devel@edk2.groups.io; +Cc: Supreeth Venkatesh, Jin, Eric

On 9/27/19 4:01 AM, Liu, XianhuiX wrote:
> Hi Heinrich,
> Any concern about it? Thanks.

Your patch is correct. It is preceded by:

SctPrint (L"\nPlease disconnect the machine from the LAN, press any key
within 10 seconds\n");

If MediaPresentSupported is false you cannot detect if the user removed
the LAN cable or not.

Sorry for the noise.

Best regards

Heinrich

>
> Best Regards
> Xianhui Liu
>
>> -----Original Message-----
>> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
>> xianhui liu
>> Sent: Wednesday, September 25, 2019 10:18 AM
>> To: devel@edk2.groups.io; xypron.glpk@gmx.de
>> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Jin, Eric
>> <eric.jin@intel.com>
>> Subject: Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Add
>> MediaPresentSupported check
>>
>> Please refer to below comments.
>>
>>> -----Original Message-----
>>> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
>>> Heinrich Schuchardt
>>> Sent: Wednesday, September 25, 2019 3:06 AM
>>> To: Liu, XianhuiX <xianhuix.liu@intel.com>; devel@edk2.groups.io
>>> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Jin, Eric
>>> <eric.jin@intel.com>
>>> Subject: Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Add
>>> MediaPresentSupported check
>>>
>>> On 9/24/19 10:50 AM, xianhui liu wrote:
>>>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2061
>>>> check MediaPresent while MediaPresentSupported is TRUE sync change
>>>> from EFI to IHV SimpleNetworkBBTestFunction
>>>
>>> Thanks for addressing this issue.
>>>
>>>>
>>>> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
>>>
>>> %s/Cc:/Reported-by:/
>>>
>>>> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
>>>> Cc: Eric Jin <eric.jin@intel.com>
>>>>
>>>> Signed-off-by: xianhui liu <xianhuix.liu@intel.com>
>>>> ---
>>>>    .../BlackBoxTest/SimpleNetworkBBTestFunction.c     | 64 +++++++++++-
>> --
>>> --------
>>>>    1 file changed, 33 insertions(+), 31 deletions(-)
>>>>
>>>> diff --git
>>>> a/uefi-
>>> sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTes
>>>> t/SimpleNetworkBBTestFunction.c
>>>> b/uefi-
>>> sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTes
>>>> t/SimpleNetworkBBTestFunction.c
>>>> index b4c7b5ee..8559e894 100644
>>>> ---
>>>> a/uefi-
>>> sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTes
>>>> t/SimpleNetworkBBTestFunction.c
>>>> +++ b/uefi-
>>> sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBo
>>>> +++ xTest/SimpleNetworkBBTestFunction.c
>>>> @@ -1888,38 +1888,40 @@ BBTestGetStatusFunctionTest (
>>>>      Status = SnpInterface->GetStatus (SnpInterface,
>>>> &InterruptStatus,
>>> &TxBuf);
>>>>      Status1 = SnpInterface->GetStatus (SnpInterface,
>>>> &InterruptStatus, &TxBuf);
>>>>
>>>> -  if (SnpInterface->Mode->MediaPresent == FALSE) {
>>>> -    if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS) &&
>>> (InterruptStatus == 0)) {
>>>> -      AssertionType = EFI_TEST_ASSERTION_PASSED;
>>>> -    } else {
>>>> -      AssertionType = EFI_TEST_ASSERTION_FAILED;
>>>> -    }
>>>> -  } else {
>>>> -    if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS)) {
>>>> -      AssertionType = 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 = EFI_TEST_ASSERTION_FAILED;
>>>> -      }
>>>> -    } else {
>>>> -      AssertionType = EFI_TEST_ASSERTION_FAILED;
>>>> -    }
>>>> +  if (SnpInterface->Mode-> MediaPresentSupported == TRUE) {
>>>> +     if (SnpInterface->Mode->MediaPresent == FALSE) {
>>>
>>>
>>> If MediaPresentSupported == FALSE shouldn't we assume that Media is
>>> present.
>>>
>>> So isn't a single 'if' enough:
>>>
>>> if (SnpInterface->Mode-> MediaPresentSupported == TRUE &&
>>>       SnpInterface->Mode->MediaPresent == FALSE) {
>>>
>>> Best regards
>>>
>>> Heinrich Schuchardt
>>
>> Hi Heinrich,
>> We will skip the checkpoint if MediaPresentSupported == FALSE. Thanks.
>>
>> Hi Eric,
>> Please help correct me if any mistake here. Thanks.
>>
>> Best Regards
>> Xianhui Liu
>>
>>
>>>
>>>> +       if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS) &&
>>> (InterruptStatus == 0)) {
>>>> +         AssertionType = EFI_TEST_ASSERTION_PASSED;
>>>> +       } else {
>>>> +         AssertionType = EFI_TEST_ASSERTION_FAILED;
>>>> +       }
>>>> +     } else {
>>>> +       if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS)) {
>>>> +         AssertionType = 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 = EFI_TEST_ASSERTION_FAILED;
>>>> +         }
>>>> +       } else {
>>>> +         AssertionType = EFI_TEST_ASSERTION_FAILED;
>>>> +       }
>>>> +     }
>>>> +     StandardLib->RecordAssertion (
>>>> +                    StandardLib,
>>>> +                    AssertionType,
>>>> +                    gSimpleNetworkBBTestFunctionAssertionGuid022,
>>>> +                    L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus -
>>>> + Invoke
>>> GetStatus() 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
>>> GetStatus() 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
>>>>
>>>
>>>
>>>
>>
>>
>> 
>


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

* Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Add MediaPresentSupported check
  2019-09-27  6:00       ` Heinrich Schuchardt
@ 2019-09-27  6:36         ` Eric Jin
       [not found]         ` <15C83824ED461154.3061@groups.io>
  1 sibling, 0 replies; 8+ messages in thread
From: Eric Jin @ 2019-09-27  6:36 UTC (permalink / raw)
  To: Heinrich Schuchardt, Liu, XianhuiX, devel@edk2.groups.io
  Cc: Supreeth Venkatesh

Thank you for the confirmation, Heinrich.
If no objection, I will commit it 36 hours later.

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

-----Original Message-----
From: Heinrich Schuchardt <xypron.glpk@gmx.de> 
Sent: Friday, September 27, 2019 2:00 PM
To: Liu, XianhuiX <xianhuix.liu@intel.com>; devel@edk2.groups.io
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Jin, Eric <eric.jin@intel.com>
Subject: Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Add MediaPresentSupported check

On 9/27/19 4:01 AM, Liu, XianhuiX wrote:
> Hi Heinrich,
> Any concern about it? Thanks.

Your patch is correct. It is preceded by:

SctPrint (L"\nPlease disconnect the machine from the LAN, press any key within 10 seconds\n");

If MediaPresentSupported is false you cannot detect if the user removed the LAN cable or not.

Sorry for the noise.

Best regards

Heinrich

>
> Best Regards
> Xianhui Liu
>
>> -----Original Message-----
>> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of 
>> xianhui liu
>> Sent: Wednesday, September 25, 2019 10:18 AM
>> To: devel@edk2.groups.io; xypron.glpk@gmx.de
>> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Jin, Eric 
>> <eric.jin@intel.com>
>> Subject: Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Add 
>> MediaPresentSupported check
>>
>> Please refer to below comments.
>>
>>> -----Original Message-----
>>> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf 
>>> Of Heinrich Schuchardt
>>> Sent: Wednesday, September 25, 2019 3:06 AM
>>> To: Liu, XianhuiX <xianhuix.liu@intel.com>; devel@edk2.groups.io
>>> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Jin, Eric 
>>> <eric.jin@intel.com>
>>> Subject: Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Add 
>>> MediaPresentSupported check
>>>
>>> On 9/24/19 10:50 AM, xianhui liu wrote:
>>>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2061
>>>> check MediaPresent while MediaPresentSupported is TRUE sync change 
>>>> from EFI to IHV SimpleNetworkBBTestFunction
>>>
>>> Thanks for addressing this issue.
>>>
>>>>
>>>> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
>>>
>>> %s/Cc:/Reported-by:/
>>>
>>>> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
>>>> Cc: Eric Jin <eric.jin@intel.com>
>>>>
>>>> Signed-off-by: xianhui liu <xianhuix.liu@intel.com>
>>>> ---
>>>>    .../BlackBoxTest/SimpleNetworkBBTestFunction.c     | 64 +++++++++++-
>> --
>>> --------
>>>>    1 file changed, 33 insertions(+), 31 deletions(-)
>>>>
>>>> diff --git
>>>> a/uefi-
>>> sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTes
>>>> t/SimpleNetworkBBTestFunction.c
>>>> b/uefi-
>>> sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTes
>>>> t/SimpleNetworkBBTestFunction.c
>>>> index b4c7b5ee..8559e894 100644
>>>> ---
>>>> a/uefi-
>>> sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTes
>>>> t/SimpleNetworkBBTestFunction.c
>>>> +++ b/uefi-
>>> sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBo
>>>> +++ xTest/SimpleNetworkBBTestFunction.c
>>>> @@ -1888,38 +1888,40 @@ BBTestGetStatusFunctionTest (
>>>>      Status = SnpInterface->GetStatus (SnpInterface, 
>>>> &InterruptStatus,
>>> &TxBuf);
>>>>      Status1 = SnpInterface->GetStatus (SnpInterface, 
>>>> &InterruptStatus, &TxBuf);
>>>>
>>>> -  if (SnpInterface->Mode->MediaPresent == FALSE) {
>>>> -    if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS) &&
>>> (InterruptStatus == 0)) {
>>>> -      AssertionType = EFI_TEST_ASSERTION_PASSED;
>>>> -    } else {
>>>> -      AssertionType = EFI_TEST_ASSERTION_FAILED;
>>>> -    }
>>>> -  } else {
>>>> -    if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS)) {
>>>> -      AssertionType = 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 = EFI_TEST_ASSERTION_FAILED;
>>>> -      }
>>>> -    } else {
>>>> -      AssertionType = EFI_TEST_ASSERTION_FAILED;
>>>> -    }
>>>> +  if (SnpInterface->Mode-> MediaPresentSupported == TRUE) {
>>>> +     if (SnpInterface->Mode->MediaPresent == FALSE) {
>>>
>>>
>>> If MediaPresentSupported == FALSE shouldn't we assume that Media is 
>>> present.
>>>
>>> So isn't a single 'if' enough:
>>>
>>> if (SnpInterface->Mode-> MediaPresentSupported == TRUE &&
>>>       SnpInterface->Mode->MediaPresent == FALSE) {
>>>
>>> Best regards
>>>
>>> Heinrich Schuchardt
>>
>> Hi Heinrich,
>> We will skip the checkpoint if MediaPresentSupported == FALSE. Thanks.
>>
>> Hi Eric,
>> Please help correct me if any mistake here. Thanks.
>>
>> Best Regards
>> Xianhui Liu
>>
>>
>>>
>>>> +       if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS) &&
>>> (InterruptStatus == 0)) {
>>>> +         AssertionType = EFI_TEST_ASSERTION_PASSED;
>>>> +       } else {
>>>> +         AssertionType = EFI_TEST_ASSERTION_FAILED;
>>>> +       }
>>>> +     } else {
>>>> +       if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS)) {
>>>> +         AssertionType = 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 = EFI_TEST_ASSERTION_FAILED;
>>>> +         }
>>>> +       } else {
>>>> +         AssertionType = EFI_TEST_ASSERTION_FAILED;
>>>> +       }
>>>> +     }
>>>> +     StandardLib->RecordAssertion (
>>>> +                    StandardLib,
>>>> +                    AssertionType,
>>>> +                    gSimpleNetworkBBTestFunctionAssertionGuid022,
>>>> +                    L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus - 
>>>> + Invoke
>>> GetStatus() 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
>>> GetStatus() 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
>>>>
>>>
>>>
>>>
>>
>>
>> 
>


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

* Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Add MediaPresentSupported check
       [not found]         ` <15C83824ED461154.3061@groups.io>
@ 2019-09-29  3:37           ` Eric Jin
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Jin @ 2019-09-29  3:37 UTC (permalink / raw)
  To: devel@edk2.groups.io, Heinrich Schuchardt, Liu, XianhuiX
  Cc: Supreeth Venkatesh

Pushed at 9ca84f7ec62d04a43648858c8cd5fadaf2b5f1fa

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Eric Jin
Sent: Friday, September 27, 2019 2:37 PM
To: Heinrich Schuchardt <xypron.glpk@gmx.de>; Liu, XianhuiX <xianhuix.liu@intel.com>; devel@edk2.groups.io
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Subject: Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Add MediaPresentSupported check

Thank you for the confirmation, Heinrich.
If no objection, I will commit it 36 hours later.

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

-----Original Message-----
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
Sent: Friday, September 27, 2019 2:00 PM
To: Liu, XianhuiX <xianhuix.liu@intel.com>; devel@edk2.groups.io
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Jin, Eric <eric.jin@intel.com>
Subject: Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Add MediaPresentSupported check

On 9/27/19 4:01 AM, Liu, XianhuiX wrote:
> Hi Heinrich,
> Any concern about it? Thanks.

Your patch is correct. It is preceded by:

SctPrint (L"\nPlease disconnect the machine from the LAN, press any key within 10 seconds\n");

If MediaPresentSupported is false you cannot detect if the user removed the LAN cable or not.

Sorry for the noise.

Best regards

Heinrich

>
> Best Regards
> Xianhui Liu
>
>> -----Original Message-----
>> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of 
>> xianhui liu
>> Sent: Wednesday, September 25, 2019 10:18 AM
>> To: devel@edk2.groups.io; xypron.glpk@gmx.de
>> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Jin, Eric 
>> <eric.jin@intel.com>
>> Subject: Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Add 
>> MediaPresentSupported check
>>
>> Please refer to below comments.
>>
>>> -----Original Message-----
>>> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf 
>>> Of Heinrich Schuchardt
>>> Sent: Wednesday, September 25, 2019 3:06 AM
>>> To: Liu, XianhuiX <xianhuix.liu@intel.com>; devel@edk2.groups.io
>>> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Jin, Eric 
>>> <eric.jin@intel.com>
>>> Subject: Re: [edk2-devel] [edk2-test][Patch] uefi-sct/SctPkg: Add 
>>> MediaPresentSupported check
>>>
>>> On 9/24/19 10:50 AM, xianhui liu wrote:
>>>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2061
>>>> check MediaPresent while MediaPresentSupported is TRUE sync change 
>>>> from EFI to IHV SimpleNetworkBBTestFunction
>>>
>>> Thanks for addressing this issue.
>>>
>>>>
>>>> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
>>>
>>> %s/Cc:/Reported-by:/
>>>
>>>> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
>>>> Cc: Eric Jin <eric.jin@intel.com>
>>>>
>>>> Signed-off-by: xianhui liu <xianhuix.liu@intel.com>
>>>> ---
>>>>    .../BlackBoxTest/SimpleNetworkBBTestFunction.c     | 64 +++++++++++-
>> --
>>> --------
>>>>    1 file changed, 33 insertions(+), 31 deletions(-)
>>>>
>>>> diff --git
>>>> a/uefi-
>>> sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTes
>>>> t/SimpleNetworkBBTestFunction.c
>>>> b/uefi-
>>> sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTes
>>>> t/SimpleNetworkBBTestFunction.c
>>>> index b4c7b5ee..8559e894 100644
>>>> ---
>>>> a/uefi-
>>> sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTes
>>>> t/SimpleNetworkBBTestFunction.c
>>>> +++ b/uefi-
>>> sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBo
>>>> +++ xTest/SimpleNetworkBBTestFunction.c
>>>> @@ -1888,38 +1888,40 @@ BBTestGetStatusFunctionTest (
>>>>      Status = SnpInterface->GetStatus (SnpInterface, 
>>>> &InterruptStatus,
>>> &TxBuf);
>>>>      Status1 = SnpInterface->GetStatus (SnpInterface, 
>>>> &InterruptStatus, &TxBuf);
>>>>
>>>> -  if (SnpInterface->Mode->MediaPresent == FALSE) {
>>>> -    if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS) &&
>>> (InterruptStatus == 0)) {
>>>> -      AssertionType = EFI_TEST_ASSERTION_PASSED;
>>>> -    } else {
>>>> -      AssertionType = EFI_TEST_ASSERTION_FAILED;
>>>> -    }
>>>> -  } else {
>>>> -    if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS)) {
>>>> -      AssertionType = 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 = EFI_TEST_ASSERTION_FAILED;
>>>> -      }
>>>> -    } else {
>>>> -      AssertionType = EFI_TEST_ASSERTION_FAILED;
>>>> -    }
>>>> +  if (SnpInterface->Mode-> MediaPresentSupported == TRUE) {
>>>> +     if (SnpInterface->Mode->MediaPresent == FALSE) {
>>>
>>>
>>> If MediaPresentSupported == FALSE shouldn't we assume that Media is 
>>> present.
>>>
>>> So isn't a single 'if' enough:
>>>
>>> if (SnpInterface->Mode-> MediaPresentSupported == TRUE &&
>>>       SnpInterface->Mode->MediaPresent == FALSE) {
>>>
>>> Best regards
>>>
>>> Heinrich Schuchardt
>>
>> Hi Heinrich,
>> We will skip the checkpoint if MediaPresentSupported == FALSE. Thanks.
>>
>> Hi Eric,
>> Please help correct me if any mistake here. Thanks.
>>
>> Best Regards
>> Xianhui Liu
>>
>>
>>>
>>>> +       if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS) &&
>>> (InterruptStatus == 0)) {
>>>> +         AssertionType = EFI_TEST_ASSERTION_PASSED;
>>>> +       } else {
>>>> +         AssertionType = EFI_TEST_ASSERTION_FAILED;
>>>> +       }
>>>> +     } else {
>>>> +       if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS)) {
>>>> +         AssertionType = 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 = EFI_TEST_ASSERTION_FAILED;
>>>> +         }
>>>> +       } else {
>>>> +         AssertionType = EFI_TEST_ASSERTION_FAILED;
>>>> +       }
>>>> +     }
>>>> +     StandardLib->RecordAssertion (
>>>> +                    StandardLib,
>>>> +                    AssertionType,
>>>> +                    gSimpleNetworkBBTestFunctionAssertionGuid022,
>>>> +                    L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus - 
>>>> + Invoke
>>> GetStatus() 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
>>> GetStatus() 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
>>>>
>>>
>>>
>>>
>>
>>
>> 
>





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

end of thread, other threads:[~2019-09-29  3:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-24  8:50 [edk2-test][Patch] uefi-sct/SctPkg: Add MediaPresentSupported check xianhui liu
2019-09-24 19:05 ` Heinrich Schuchardt
2019-09-25  2:18   ` [edk2-devel] " xianhui liu
     [not found]   ` <15C78CE54FBDEE07.4626@groups.io>
2019-09-27  2:01     ` xianhui liu
2019-09-27  6:00       ` Heinrich Schuchardt
2019-09-27  6:36         ` Eric Jin
     [not found]         ` <15C83824ED461154.3061@groups.io>
2019-09-29  3:37           ` Eric Jin
  -- strict thread matches above, loose matches on Subject: below --
2019-09-23  1:42 xianhuix.liu

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