Re: [edk2-devel] [edk2-test][Patch 1/1] uefi-sct/SctPkg: Eliminate 2nd execution of ExitBootServices Test

2019-08-23 Thread Supreeth Venkatesh
On Thu, 2019-08-22 at 22:37 -0500, Jin, Eric wrote:
> Hi Supreeth,
> 
> > -Original Message-
> > From: Supreeth Venkatesh [mailto:supreeth.venkat...@arm.com]
> > Sent: Friday, August 23, 2019 2:43 AM
> > To: devel@edk2.groups.io; Jin, Eric 
> > Subject: Re: [edk2-devel] [edk2-test][Patch 1/1] uefi-sct/SctPkg:
> > Eliminate
> > 2nd execution of ExitBootServices Test
> > 
> > On Wed, 2019-08-21 at 20:50 -0500, Eric Jin via Groups.Io wrote:
> > > Hij Supreeth,
> > 
> > Hi Eric,
> > 
> > > 
> > > > -Original Message-
> > > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On
> > > > Behalf
> > > > Of Supreeth Venkatesh
> > > > Sent: Thursday, August 22, 2019 12:43 AM
> > > > To: Jin, Eric ; devel@edk2.groups.io
> > > > Subject: Re: [edk2-devel] [edk2-test][Patch 1/1] uefi-
> > > > sct/SctPkg:
> > > > Eliminate
> > > > 2nd execution of ExitBootServices Test
> > > > 
> > > > On Wed, 2019-08-21 at 01:24 -0500, Eric Jin wrote:
> > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2098
> > > > 
> > > > Please add the details of the patch to the commit message.
> > > > "In the ExitBootServices() test, after ExitBootServices() call,
> > > > all
> > > > boot services are forbidden. The original design is to save the
> > > > return status value of
> > > > ExitBootServices() in variable using variable service and
> > > > reset, but
> > > > this needs multiple execution of the test to retrieve the value
> > > > from
> > > > variable and this design was not straightforward from end user
> > > > perspective.
> > > > 
> > > 
> > > I would like to change "multiple execution" to "one additional
> > > execution"
> > > 
> > > > This patch enhances the test by leveraging RecoveryLib to
> > > > restore
> > > > execution
> > > > after reset automatically, thus requiring only one execution"
> > > > 
> > > 
> > > I am ok with this suggestion when I push the code to repo
> > 
> > Thanks.
> > 
> > > 
> > > > More comments inline...
> > > > 
> > > > > 
> > > > > Cc: Supreeth Venkatesh 
> > > > > Signed-off-by: Eric Jin 
> > > > > ---
> > > > >  uefi-
> > > > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/Black
> > > > > BoxT
> > > > > est/
> > > > > ImageBBTest.inf  |  3 ++-
> > > > >  uefi-
> > > > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/Black
> > > > > BoxT
> > > > > est/
> > > > > ImageBBTest.h|  9 -
> > > > >  uefi-
> > > > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/Black
> > > > > BoxT
> > > > > est/
> > > > > ImageBBTestConformance.c | 98
> > > > > 
> > > > 
> > > > 
> > 
> > ++
> > > > +++
> > > > > ++---
> > > > >  3 files changed, 93 insertions(+), 17 deletions(-)
> > > > > 
> > > > > diff --git a/uefi-
> > > > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/Black
> > > > > BoxT
> > > > > est/
> > > > > ImageBBTest.inf b/uefi-
> > > > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/Black
> > > > > BoxT
> > > > > est/
> > > > > ImageBBTest.inf
> > > > > index 49ad79915934..3de43a20e8a4 100644
> > > > > --- a/uefi-
> > > > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/Black
> > > > > BoxT
> > > > > est/
> > > > > ImageBBTest.inf
> > > > > +++ b/uefi-
> > > > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/Black
> > > > > BoxT
> > > > > est/
> > > > > ImageBBTest.inf
> > > > > @@ -1,7 +1,7 @@
> > > > >  ## @file
> > > > >  #
> > > > >  #  Copyright 2006 - 2012 Unified EFI, Inc. -#  Copyright
> > > > > (c)
> > > > > 2

Re: [edk2-devel] [edk2-test][Patch 1/1] uefi-sct/SctPkg: Eliminate 2nd execution of ExitBootServices Test

2019-08-22 Thread Eric Jin
Hi Supreeth,

> -Original Message-
> From: Supreeth Venkatesh [mailto:supreeth.venkat...@arm.com]
> Sent: Friday, August 23, 2019 2:43 AM
> To: devel@edk2.groups.io; Jin, Eric 
> Subject: Re: [edk2-devel] [edk2-test][Patch 1/1] uefi-sct/SctPkg: Eliminate
> 2nd execution of ExitBootServices Test
> 
> On Wed, 2019-08-21 at 20:50 -0500, Eric Jin via Groups.Io wrote:
> > Hij Supreeth,
> Hi Eric,
> 
> >
> > > -Original Message-
> > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf
> > > Of Supreeth Venkatesh
> > > Sent: Thursday, August 22, 2019 12:43 AM
> > > To: Jin, Eric ; devel@edk2.groups.io
> > > Subject: Re: [edk2-devel] [edk2-test][Patch 1/1] uefi-sct/SctPkg:
> > > Eliminate
> > > 2nd execution of ExitBootServices Test
> > >
> > > On Wed, 2019-08-21 at 01:24 -0500, Eric Jin wrote:
> > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2098
> > >
> > > Please add the details of the patch to the commit message.
> > > "In the ExitBootServices() test, after ExitBootServices() call, all
> > > boot services are forbidden. The original design is to save the
> > > return status value of
> > > ExitBootServices() in variable using variable service and reset, but
> > > this needs multiple execution of the test to retrieve the value from
> > > variable and this design was not straightforward from end user
> > > perspective.
> > >
> >
> > I would like to change "multiple execution" to "one additional
> > execution"
> >
> > > This patch enhances the test by leveraging RecoveryLib to restore
> > > execution
> > > after reset automatically, thus requiring only one execution"
> > >
> >
> > I am ok with this suggestion when I push the code to repo
> Thanks.
> 
> >
> > > More comments inline...
> > >
> > > >
> > > > Cc: Supreeth Venkatesh 
> > > > Signed-off-by: Eric Jin 
> > > > ---
> > > >  uefi-
> > > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > > est/
> > > > ImageBBTest.inf  |  3 ++-
> > > >  uefi-
> > > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > > est/
> > > > ImageBBTest.h|  9 -
> > > >  uefi-
> > > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > > est/
> > > > ImageBBTestConformance.c | 98
> > > >
> > >
> > >
> ++
> > > +++
> > > > ++---
> > > >  3 files changed, 93 insertions(+), 17 deletions(-)
> > > >
> > > > diff --git a/uefi-
> > > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > > est/
> > > > ImageBBTest.inf b/uefi-
> > > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > > est/
> > > > ImageBBTest.inf
> > > > index 49ad79915934..3de43a20e8a4 100644
> > > > --- a/uefi-
> > > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > > est/
> > > > ImageBBTest.inf
> > > > +++ b/uefi-
> > > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > > est/
> > > > ImageBBTest.inf
> > > > @@ -1,7 +1,7 @@
> > > >  ## @file
> > > >  #
> > > >  #  Copyright 2006 - 2012 Unified EFI, Inc. -#  Copyright (c)
> > > > 2010
> > > > - 2012, Intel Corporation. All rights reserved.
> > > > +#  Copyright (c) 2010 - 2019, Intel Corporation. All rights
> > > > reserved.
> > > >  #
> > > >  #  This program and the accompanying materials  #  are licensed
> > > > and
> > > > made available under the terms and conditions of the BSD License
> > > > @@
> > > > -53,4 +53,5 @@
> > > >
> > > >  [Protocols]
> > > >gEfiTestProfileLibraryGuid
> > > > +  gEfiTestRecoveryLibraryGuid
> > > >gBlackBoxEfiHIIPackageListProtocolGuid
> > > > diff --git a/uefi-
> > > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > > est/
> > > > ImageBBTest.h b/uefi-
> > > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/I

Re: [edk2-devel] [edk2-test][Patch 1/1] uefi-sct/SctPkg: Eliminate 2nd execution of ExitBootServices Test

2019-08-22 Thread Supreeth Venkatesh
On Wed, 2019-08-21 at 20:50 -0500, Eric Jin via Groups.Io wrote:
> Hij Supreeth,
Hi Eric,

> 
> > -Original Message-
> > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf
> > Of
> > Supreeth Venkatesh
> > Sent: Thursday, August 22, 2019 12:43 AM
> > To: Jin, Eric ; devel@edk2.groups.io
> > Subject: Re: [edk2-devel] [edk2-test][Patch 1/1] uefi-sct/SctPkg:
> > Eliminate
> > 2nd execution of ExitBootServices Test
> > 
> > On Wed, 2019-08-21 at 01:24 -0500, Eric Jin wrote:
> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2098
> > 
> > Please add the details of the patch to the commit message.
> > "In the ExitBootServices() test, after ExitBootServices() call, all
> > boot services
> > are forbidden. The original design is to save the return status
> > value of
> > ExitBootServices() in variable using variable service and reset,
> > but this needs
> > multiple execution of the test to retrieve the value from variable
> > and this
> > design was not straightforward from end user perspective.
> > 
> 
> I would like to change "multiple execution" to "one additional
> execution" 
> 
> > This patch enhances the test by leveraging RecoveryLib to restore
> > execution
> > after reset automatically, thus requiring only one execution"
> > 
> 
> I am ok with this suggestion when I push the code to repo
Thanks.

> 
> > More comments inline...
> > 
> > > 
> > > Cc: Supreeth Venkatesh 
> > > Signed-off-by: Eric Jin 
> > > ---
> > >  uefi-
> > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > est/
> > > ImageBBTest.inf  |  3 ++-
> > >  uefi-
> > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > est/
> > > ImageBBTest.h|  9 -
> > >  uefi-
> > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > est/
> > > ImageBBTestConformance.c | 98
> > > 
> > 
> > ++
> > +++
> > > ++---
> > >  3 files changed, 93 insertions(+), 17 deletions(-)
> > > 
> > > diff --git a/uefi-
> > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > est/
> > > ImageBBTest.inf b/uefi-
> > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > est/
> > > ImageBBTest.inf
> > > index 49ad79915934..3de43a20e8a4 100644
> > > --- a/uefi-
> > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > est/
> > > ImageBBTest.inf
> > > +++ b/uefi-
> > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > est/
> > > ImageBBTest.inf
> > > @@ -1,7 +1,7 @@
> > >  ## @file
> > >  #
> > >  #  Copyright 2006 - 2012 Unified EFI, Inc. -#  Copyright (c)
> > > 2010
> > > - 2012, Intel Corporation. All rights reserved.
> > > +#  Copyright (c) 2010 - 2019, Intel Corporation. All rights
> > > reserved.
> > >  #
> > >  #  This program and the accompanying materials  #  are licensed
> > > and
> > > made available under the terms and conditions of the BSD License
> > > @@
> > > -53,4 +53,5 @@
> > > 
> > >  [Protocols]
> > >gEfiTestProfileLibraryGuid
> > > +  gEfiTestRecoveryLibraryGuid
> > >gBlackBoxEfiHIIPackageListProtocolGuid
> > > diff --git a/uefi-
> > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > est/
> > > ImageBBTest.h b/uefi-
> > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > est/
> > > ImageBBTest.h
> > > index b1c35fee7435..008584577ed1 100644
> > > --- a/uefi-
> > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > est/
> > > ImageBBTest.h
> > > +++ b/uefi-
> > > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxT
> > > est/
> > > ImageBBTest.h
> > > @@ -1,7 +1,7 @@
> > >  /** @file
> > > 
> > >Copyright 2006 - 2017 Unified EFI, Inc.
> > > -  Copyright (c) 2010 - 2017, Intel Corporation. All rights
> > > reserved.
> > > +  Copyright (c) 2010 - 2019, Intel Corporation. All rights
> > > reserved.
> > > 
> > >Th

Re: [edk2-devel] [edk2-test][Patch 1/1] uefi-sct/SctPkg: Eliminate 2nd execution of ExitBootServices Test

2019-08-21 Thread Eric Jin
Hij Supreeth,

> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Supreeth Venkatesh
> Sent: Thursday, August 22, 2019 12:43 AM
> To: Jin, Eric ; devel@edk2.groups.io
> Subject: Re: [edk2-devel] [edk2-test][Patch 1/1] uefi-sct/SctPkg: Eliminate
> 2nd execution of ExitBootServices Test
> 
> On Wed, 2019-08-21 at 01:24 -0500, Eric Jin wrote:
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2098
> Please add the details of the patch to the commit message.
> "In the ExitBootServices() test, after ExitBootServices() call, all boot 
> services
> are forbidden. The original design is to save the return status value of
> ExitBootServices() in variable using variable service and reset, but this 
> needs
> multiple execution of the test to retrieve the value from variable and this
> design was not straightforward from end user perspective.
> 
I would like to change "multiple execution" to "one additional execution" 

> This patch enhances the test by leveraging RecoveryLib to restore execution
> after reset automatically, thus requiring only one execution"
> 
I am ok with this suggestion when I push the code to repo

> More comments inline...
> 
> >
> > Cc: Supreeth Venkatesh 
> > Signed-off-by: Eric Jin 
> > ---
> >  uefi-
> > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> > ImageBBTest.inf  |  3 ++-
> >  uefi-
> > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> > ImageBBTest.h|  9 -
> >  uefi-
> > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> > ImageBBTestConformance.c | 98
> >
> ++
> +++
> > ++---
> >  3 files changed, 93 insertions(+), 17 deletions(-)
> >
> > diff --git a/uefi-
> > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> > ImageBBTest.inf b/uefi-
> > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> > ImageBBTest.inf
> > index 49ad79915934..3de43a20e8a4 100644
> > --- a/uefi-
> > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> > ImageBBTest.inf
> > +++ b/uefi-
> > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> > ImageBBTest.inf
> > @@ -1,7 +1,7 @@
> >  ## @file
> >  #
> >  #  Copyright 2006 - 2012 Unified EFI, Inc. -#  Copyright (c) 2010
> > - 2012, Intel Corporation. All rights reserved.
> > +#  Copyright (c) 2010 - 2019, Intel Corporation. All rights
> > reserved.
> >  #
> >  #  This program and the accompanying materials  #  are licensed and
> > made available under the terms and conditions of the BSD License @@
> > -53,4 +53,5 @@
> >
> >  [Protocols]
> >gEfiTestProfileLibraryGuid
> > +  gEfiTestRecoveryLibraryGuid
> >gBlackBoxEfiHIIPackageListProtocolGuid
> > diff --git a/uefi-
> > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> > ImageBBTest.h b/uefi-
> > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> > ImageBBTest.h
> > index b1c35fee7435..008584577ed1 100644
> > --- a/uefi-
> > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> > ImageBBTest.h
> > +++ b/uefi-
> > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> > ImageBBTest.h
> > @@ -1,7 +1,7 @@
> >  /** @file
> >
> >Copyright 2006 - 2017 Unified EFI, Inc.
> > -  Copyright (c) 2010 - 2017, Intel Corporation. All rights
> > reserved.
> > +  Copyright (c) 2010 - 2019, Intel Corporation. All rights
> > reserved.
> >
> >This program and the accompanying materials
> >are licensed and made available under the terms and conditions of
> > the BSD License @@ -35,6 +35,13 @@ Abstract:
> >  #include EFI_PROTOCOL_DEFINITION (LoadFile)
> >
> >  #include EFI_TEST_PROTOCOL_DEFINITION (TestProfileLibrary)
> > +#include EFI_TEST_PROTOCOL_DEFINITION (TestRecoveryLibrary)
> > +
> > +typedef struct _RESET_DATA {
> > +  UINTN   Step;
> > +  UINTN   TplIndex;
> > +  UINT32  RepeatTimes;
> > +} RESET_DATA;
> >
> >  #if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
> >
> > diff --git a/uefi-
> > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> > ImageBBTestConformance.c b/uefi-
> > sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> &

Re: [edk2-devel] [edk2-test][Patch 1/1] uefi-sct/SctPkg: Eliminate 2nd execution of ExitBootServices Test

2019-08-21 Thread Supreeth Venkatesh
On Wed, 2019-08-21 at 01:24 -0500, Eric Jin wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2098
Please add the details of the patch to the commit message.
"In the ExitBootServices() test, after ExitBootServices() call, all
boot services are forbidden. The original design is to save the return
status value of ExitBootServices() in variable using variable service
and reset, but this needs multiple execution of the test to retrieve
the value from variable and this design was not straightforward from
end user perspective.

This patch enhances the test by leveraging RecoveryLib to restore
execution after reset automatically, thus requiring only one execution"

More comments inline...

> 
> Cc: Supreeth Venkatesh 
> Signed-off-by: Eric Jin 
> ---
>  uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> ImageBBTest.inf  |  3 ++-
>  uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> ImageBBTest.h|  9 -
>  uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> ImageBBTestConformance.c | 98
> +
> ++---
>  3 files changed, 93 insertions(+), 17 deletions(-)
> 
> diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> ImageBBTest.inf b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> ImageBBTest.inf
> index 49ad79915934..3de43a20e8a4 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> ImageBBTest.inf
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> ImageBBTest.inf
> @@ -1,7 +1,7 @@
>  ## @file
>  #
>  #  Copyright 2006 - 2012 Unified EFI, Inc.
> -#  Copyright (c) 2010 - 2012, Intel Corporation. All rights
> reserved.
> +#  Copyright (c) 2010 - 2019, Intel Corporation. All rights
> reserved.
>  #
>  #  This program and the accompanying materials
>  #  are licensed and made available under the terms and conditions of
> the BSD License
> @@ -53,4 +53,5 @@
>  
>  [Protocols]
>gEfiTestProfileLibraryGuid
> +  gEfiTestRecoveryLibraryGuid
>gBlackBoxEfiHIIPackageListProtocolGuid
> diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> ImageBBTest.h b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> ImageBBTest.h
> index b1c35fee7435..008584577ed1 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> ImageBBTest.h
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> ImageBBTest.h
> @@ -1,7 +1,7 @@
>  /** @file
>  
>Copyright 2006 - 2017 Unified EFI, Inc.
> -  Copyright (c) 2010 - 2017, Intel Corporation. All rights
> reserved.
> +  Copyright (c) 2010 - 2019, Intel Corporation. All rights
> reserved.
>  
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of
> the BSD License
> @@ -35,6 +35,13 @@ Abstract:
>  #include EFI_PROTOCOL_DEFINITION (LoadFile)
>  
>  #include EFI_TEST_PROTOCOL_DEFINITION (TestProfileLibrary)
> +#include EFI_TEST_PROTOCOL_DEFINITION (TestRecoveryLibrary)
> +
> +typedef struct _RESET_DATA {
> +  UINTN   Step;
> +  UINTN   TplIndex;
> +  UINT32  RepeatTimes;
> +} RESET_DATA;
>  
>  #if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
>  
> diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> ImageBBTestConformance.c b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> ImageBBTestConformance.c
> index 0a26d46847da..e90afe7ecae0 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> ImageBBTestConformance.c
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/
> ImageBBTestConformance.c
> @@ -1,7 +1,7 @@
>  /** @file
>  
>Copyright 2006 - 2016 Unified EFI, Inc.
> -  Copyright (c) 2010 - 2016, Intel Corporation. All rights
> reserved.
> +  Copyright (c) 2010 - 2019, Intel Corporation. All rights
> reserved.
>  
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of
> the BSD License
> @@ -30,7 +30,8 @@ Abstract:
>  #define TEST_VENDOR1_GUID \
>{ 0xF6FAB04F, 0xACAF, 0x4af3, { 0xB9, 0xFA, 0xDC, 0xF9, 0x7F,
> 0xB4, 0x42, 0x6F } }
>  
> -#define MAX_BUFFER_SIZE  10
> +#define STATUS_BUFFER_SIZE   8
Why is the size being reduced by 2 bytes?
Was the earlier size not optimal?

> +#define RECOVER_BUFFER_SIZE  1024
>  
>  EFI_GUID gTestVendor1Guid = TEST_VENDOR1_GUID;
>  
> @@ -778,19 +779,23 @@ BBTestExitBootServicesConsistencyTest (
>)
>  {
>EFI_STANDARD_TEST_LIBRARY_PROTOCOL   *StandardLib;
> +  EFI_TEST_RECOVERY_LIBRARY_PROTOCOL   *RecoveryLib;
>EFI_STATUS   

[edk2-devel] [edk2-test][Patch 1/1] uefi-sct/SctPkg: Eliminate 2nd execution of ExitBootServices Test

2019-08-21 Thread Eric Jin
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2098

Cc: Supreeth Venkatesh 
Signed-off-by: Eric Jin 
---
 
uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/ImageBBTest.inf
  |  3 ++-
 
uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/ImageBBTest.h
|  9 -
 
uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/ImageBBTestConformance.c
 | 98 
+++---
 3 files changed, 93 insertions(+), 17 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/ImageBBTest.inf
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/ImageBBTest.inf
index 49ad79915934..3de43a20e8a4 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/ImageBBTest.inf
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/ImageBBTest.inf
@@ -1,7 +1,7 @@
 ## @file
 #
 #  Copyright 2006 - 2012 Unified EFI, Inc.
-#  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
+#  Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -53,4 +53,5 @@
 
 [Protocols]
   gEfiTestProfileLibraryGuid
+  gEfiTestRecoveryLibraryGuid
   gBlackBoxEfiHIIPackageListProtocolGuid
diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/ImageBBTest.h
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/ImageBBTest.h
index b1c35fee7435..008584577ed1 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/ImageBBTest.h
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/ImageBBTest.h
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2017 Unified EFI, Inc.
-  Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
@@ -35,6 +35,13 @@ Abstract:
 #include EFI_PROTOCOL_DEFINITION (LoadFile)
 
 #include EFI_TEST_PROTOCOL_DEFINITION (TestProfileLibrary)
+#include EFI_TEST_PROTOCOL_DEFINITION (TestRecoveryLibrary)
+
+typedef struct _RESET_DATA {
+  UINTN   Step;
+  UINTN   TplIndex;
+  UINT32  RepeatTimes;
+} RESET_DATA;
 
 #if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
 
diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/ImageBBTestConformance.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/ImageBBTestConformance.c
index 0a26d46847da..e90afe7ecae0 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/ImageBBTestConformance.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ImageServices/BlackBoxTest/ImageBBTestConformance.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2016 Unified EFI, Inc.
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
@@ -30,7 +30,8 @@ Abstract:
 #define TEST_VENDOR1_GUID \
   { 0xF6FAB04F, 0xACAF, 0x4af3, { 0xB9, 0xFA, 0xDC, 0xF9, 0x7F, 0xB4, 0x42, 
0x6F } }
 
-#define MAX_BUFFER_SIZE  10
+#define STATUS_BUFFER_SIZE   8
+#define RECOVER_BUFFER_SIZE  1024
 
 EFI_GUID gTestVendor1Guid = TEST_VENDOR1_GUID;
 
@@ -778,19 +779,23 @@ BBTestExitBootServicesConsistencyTest (
   )
 {
   EFI_STANDARD_TEST_LIBRARY_PROTOCOL   *StandardLib;
+  EFI_TEST_RECOVERY_LIBRARY_PROTOCOL   *RecoveryLib;
   EFI_STATUS   Status;
   EFI_TEST_ASSERTION   AssertionType;
   UINTNMapKey;
-
+  UINTNSize;
   UINTNNumbers;
   UINTNDataSize;
-  UINT8Data[MAX_BUFFER_SIZE];
+  RESET_DATA   *ResetData;
+  UINT8Data[STATUS_BUFFER_SIZE];
+  UINT8Buffer[RECOVER_BUFFER_SIZE];
   EFI_STATUS   ReturnStatus;
 
   //
   // Init
   //
   StandardLib = NULL;
+  RecoveryLib = NULL;
 
   //
   // Get the Standard Library Interface
@@ -803,6 +808,14 @@ BBTestExitBootServicesConsistencyTest (
 return Status;
   }
 
+  Status = gtBS->HandleProtocol (
+   SupportHandle,
+   ,
+   (VOID **) );
+  if (EFI_ERROR(Status)) {
+return Status;
+  }
+
   Status =