[PATCH] pytest:Shutdown power-supply to board after the pytest execution

opensource.kab at gmail.com opensource.kab at gmail.com
Thu May 27 10:33:05 CEST 2021


From: Adarsh Babu Kalepalli <opensource.kab at 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 at 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



More information about the U-Boot mailing list