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.g...@linaro.org>
---
Changes since rfc: None

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

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()
-- 
2.34.1

Reply via email to