diff mbox series

[37/40] test: lmb: invoke the LMB unit tests from a separate script

Message ID 20240724060224.3071065-38-sughosh.ganu@linaro.org
State New
Headers show
Series Make LMB memory map global and persistent | expand

Commit Message

Sughosh Ganu July 24, 2024, 6:02 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 rfc: None

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