All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pytest:Shutdown power-supply to board after the pytest execution
@ 2021-05-27  8:33 opensource.kab
  2021-05-27 21:42 ` Stephen Warren
  0 siblings, 1 reply; 3+ messages in thread
From: opensource.kab @ 2021-05-27  8:33 UTC (permalink / raw)
  To: u-boot
  Cc: wd, Adarsh Babu Kalepalli, Heinrich Schuchardt, Marek Behún,
	Simon Glass, Stephen Warren

From: Adarsh Babu Kalepalli <opensource.kab@gmail.com>

After executing the test-cases from pytest ,the board
is still powered.Shutting down the board power supply at
this point ,would keep the board safe.

Signed-off-by: Adarsh Babu Kalepalli <opensource.kab@gmail.com>
---

 test/py/conftest.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/test/py/conftest.py b/test/py/conftest.py
index 11a3f307ea..077358a37f 100644
--- a/test/py/conftest.py
+++ b/test/py/conftest.py
@@ -406,6 +406,13 @@ def cleanup():
     """
 
     if console:
+        if ((console.config.board_type != "sandbox") and (console.config.board_type != "sandbox64")):
+            args = [console.config.board_type, console.config.board_identity]
+            console.log.action('Powering Down the board')
+            cmd = ['u-boot-test-power-off'] + args
+            runner = console.log.get_runner(cmd[0], sys.stdout)
+            runner.run(cmd)
+            runner.close()
         console.close()
     if log:
         with log.section('Status Report', 'status_report'):
-- 
2.17.1


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

* Re: [PATCH] pytest:Shutdown power-supply to board after the pytest execution
  2021-05-27  8:33 [PATCH] pytest:Shutdown power-supply to board after the pytest execution opensource.kab
@ 2021-05-27 21:42 ` Stephen Warren
  2021-05-29 13:09   ` Adarsh Babu Kalepalli
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Warren @ 2021-05-27 21:42 UTC (permalink / raw)
  To: opensource.kab, u-boot
  Cc: wd, Heinrich Schuchardt, Marek Behún, Simon Glass

On 5/27/21 2:33 AM, opensource.kab@gmail.com wrote:
> From: Adarsh Babu Kalepalli <opensource.kab@gmail.com>
> 
> After executing the test-cases from pytest ,the board
> is still powered.Shutting down the board power supply at
> this point ,would keep the board safe.

FWIW, this violates the original design of the test system. Turning the 
board off at the end of the test is a policy decision that not all 
use-cases will want, and hence not something that the test system should 
mandate. Instead, the intention is for the user to invoke the test 
system using a script that does something like:

1) Power on board.
2) Run test.
3) Power off board.

See ./doc/develop/py_testing.rst in the U-Boot source for more 
background info, or the following URL for an example script:

https://github.com/swarren/u-boot-ci-scripts/blob/master/test.sh

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

* Re: [PATCH] pytest:Shutdown power-supply to board after the pytest execution
  2021-05-27 21:42 ` Stephen Warren
@ 2021-05-29 13:09   ` Adarsh Babu Kalepalli
  0 siblings, 0 replies; 3+ messages in thread
From: Adarsh Babu Kalepalli @ 2021-05-29 13:09 UTC (permalink / raw)
  To: Stephen Warren
  Cc: u-boot, wd, Heinrich Schuchardt, Marek Behún, Simon Glass

Hi Stephen,

> FWIW, this violates the original design of the test system. Turning the
> board off at the end of the test is a policy decision that not all
> use-cases will want,

Wasn't aware that powering OFF the board would not be a preferred choice
for certain test cases.
Executing python test cases on sandbox or Beaglebone Black with this
power-off feature, did  not
cause me any issues.So,thought this would be a 'good to use' feature in the
python test framework.Hence,this patch.

As recommended , will use this power-off outside the pytest environment.

Thanks ,
Adarsh

On Fri, 28 May 2021 at 03:12, Stephen Warren <swarren@wwwdotorg.org> wrote:

> On 5/27/21 2:33 AM, opensource.kab@gmail.com wrote:
> > From: Adarsh Babu Kalepalli <opensource.kab@gmail.com>
> >
> > After executing the test-cases from pytest ,the board
> > is still powered.Shutting down the board power supply at
> > this point ,would keep the board safe.
>
> FWIW, this violates the original design of the test system. Turning the
> board off at the end of the test is a policy decision that not all
> use-cases will want, and hence not something that the test system should
> mandate. Instead, the intention is for the user to invoke the test
> system using a script that does something like:
>
> 1) Power on board.
> 2) Run test.
> 3) Power off board.
>
> See ./doc/develop/py_testing.rst in the U-Boot source for more
> background info, or the following URL for an example script:
>
> https://github.com/swarren/u-boot-ci-scripts/blob/master/test.sh
>

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

end of thread, other threads:[~2021-05-29 13:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-27  8:33 [PATCH] pytest:Shutdown power-supply to board after the pytest execution opensource.kab
2021-05-27 21:42 ` Stephen Warren
2021-05-29 13:09   ` Adarsh Babu Kalepalli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.