diff mbox series

[RFC,v2,32/48] test: lmb: invoke the LMB unit tests from a separate script

Message ID 20240704073544.670249-33-sughosh.ganu@linaro.org
State Superseded
Headers show
Series Make U-Boot memory reservations coherent | expand

Commit Message

Sughosh Ganu July 4, 2024, 7:35 a.m. UTC
With the LMB tests moved under a separate class of unit tests, invoke
these from a separate script which would allow for a system reset once
the tests have been run. This enables clearing up the LMB memory map
after having run the tests.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
---
Changes since V1: New patch

 test/py/tests/test_lmb.py | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 test/py/tests/test_lmb.py
diff mbox series

Patch

diff --git a/test/py/tests/test_lmb.py b/test/py/tests/test_lmb.py
new file mode 100644
index 0000000000..b6f9ff9c6a
--- /dev/null
+++ b/test/py/tests/test_lmb.py
@@ -0,0 +1,24 @@ 
+# SPDX-License-Identifier: GPL-2.0+
+# Copyright 2024 Linaro Ltd
+#
+# Run the LMB tests
+
+import pytest
+
+base_script = '''
+ut lmb -f
+'''
+
+@pytest.mark.boardspec('sandbox')
+def test_lmb(u_boot_console):
+    cons = u_boot_console
+    cmd = base_script
+
+    with cons.log.section('LMB Unit Test'):
+        output = cons.run_command_list(cmd.splitlines())
+
+    assert 'Failures: 0' in output[-1]
+
+    # Restart so that the LMB memory map starts with
+    # a clean slate for the next set of tests.
+    u_boot_console.restart_uboot()