Pre- and post S3/S4 functions

Colin Ian King colin.king at canonical.com
Wed Dec 19 12:51:32 UTC 2012


On 17/12/12 09:53, Alex Hung wrote:
> Hi,
>
> I am wondering there is a need to implement a feature to provide a hook
> for executing a script (or just an application) before and after S3 and
> S4 stress tests.
>
> The function may be handy at various some scenario. For example, we can
> play a video or a song if it is suspected a system has such as bug; or
> we can write a value to hardware register to check whether that will fix
> a specific problems.
>
> Some concerns may be related to this topic:
>
> 1. The may extend fwts to be more than a firmware test suite (like a
> generic test suite) and that may or may not be desirable.
>
> 2. security issue: if we allow any script to be executed, this may
> create a security hole.
>
> 3. alternative solution: instead of running a script by fwts, can we
> simply use script to run fwts and do the pre/post functions?
>
> Any comments?
>
> Cheers,
> Alex Hung
>

So the options are:

1. Add in hooks to fwts to call external scripts before and after each 
S3 or S4 tests.
   Pros: Ease of use, generic solution for all kinds of use-cases
	Could grab the script output and integrate that into fwts

   Cons: Can be abused to call any script with root privileges
         Even more bloat to s3 + s4 options
         Makes S3/S4 tests into something not firmware specific. Out of 
scope for fwts?

2. Write generic tests with a script and call fwts s3 or s4 to do just a 
single suspend/hibernate iteration.  Script will have to do multiple 
iterations if required.

   Pros: Can do this without any modifications to fwts
         fwts does append to the log, so repeated invocations do keep
         a record of any failures
         Keeps fwts focused on doing just firmware testing

   Cons: Not well integrated with fwts
         We have multiple pass/fail logged summaries for each iteration

My feeling is that because the custom scripts need writing anyway, you 
may as well make them invoke fwts for each S3 or S4 iteration. Fwts does 
return a non-zero status if errors are detected so it has been designed 
to be wrapped in a script.

Colin



More information about the fwts-devel mailing list