[elbe-devel] [PATCH] tests: simple-validation-image-test: validate log.txt

Thomas Weißschuh thomas.weissschuh at linutronix.de
Mon Aug 12 09:51:00 CEST 2024


Add some basic tests for the contents of log.txt.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 tests/simple-validation-image-test.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/simple-validation-image-test.py b/tests/simple-validation-image-test.py
index d95ac0e0f5fe..cb8844f5619e 100755
--- a/tests/simple-validation-image-test.py
+++ b/tests/simple-validation-image-test.py
@@ -119,6 +119,17 @@ def test_elbe_report_txt(build_dir):
     assert '\n|+/usr/bin/mount+|mount\n' in elbe_report
 
 
+def test_elbe_log_txt(build_dir):
+    log = build_dir.joinpath('log.txt').read_text()
+
+    assert log.startswith('[INFO]Build started\n')
+
+    assert 'I: Extracting util-linux...' in log
+    assert '[CMD] cat /etc/hosts | cat -n > /etc/hosts4' in log
+
+    assert log.endswith('[INFO]Build finished successfully\n')
+
+
 def _test_generated_elbe_files(build_dir, root):
     elbe_version = root.joinpath('etc', 'elbe_version').read_text()
     assert elbe_version.startswith('simple-validation-image 1.0\nthis RFS was generated by elbe')

---
base-commit: 9813ac89336a3fb5059c806c406371651e6bb19b
change-id: 20240812-report-3609a8b68c6a

Best regards,
-- 
Thomas Weißschuh <thomas.weissschuh at linutronix.de>



More information about the elbe-devel mailing list