[elbe-devel] [PATCH 2/2] simple-validation-image: validate contents of elbe-report.txt

Thomas Weißschuh thomas.weissschuh at linutronix.de
Fri Jun 14 14:37:26 CEST 2024


Ensure the presence of some textblocks we expect to exist.

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

diff --git a/tests/simple-validation-image-test.py b/tests/simple-validation-image-test.py
index 40189eb8a1bc..0de3a13749f1 100755
--- a/tests/simple-validation-image-test.py
+++ b/tests/simple-validation-image-test.py
@@ -36,6 +36,58 @@ def test_validation_txt(build_dir):
         """).strip()
 
 
+def test_elbe_report_txt(build_dir):
+    elbe_report = build_dir.joinpath('elbe-report.txt').read_text()
+
+    assert elbe_report.startswith('ELBE Report for Project simple-validation-image')
+
+    assert textwrap.dedent("""
+        Apt Sources dump
+        ----------------
+
+        deb [arch=amd64] http://deb.debian.org/debian bookworm main
+
+
+        Apt Preferences dump
+        --------------------
+    """) in elbe_report
+
+    assert textwrap.dedent("""
+        Apt Preferences dump
+        --------------------
+
+
+
+
+
+        Installed Packages List
+        -----------------------
+    """) in elbe_report
+
+    assert textwrap.dedent("""
+        Installed Packages List
+        -----------------------
+
+        Debian
+        ~~~~~~
+
+        |adduser|
+    """.rstrip()) in elbe_report
+
+    assert textwrap.dedent("""
+        File List
+        ---------
+
+        |+//testfile+|added in finetuning
+        |+/run/adduser+|postinst generated
+        |+/root/.bashrc+|postinst generated
+        |+/root/.profile+|postinst generated
+        |+/usr/libexec/coreutils/libstdbuf.so+|coreutils
+    """) in elbe_report
+
+    assert '\n|+/usr/bin/mount+|mount\n' in elbe_report
+
+
 def _test_finetuning(root):
     # <rm>var/cache/apt/archives/*.deb</rm>
     for f in root.joinpath('var', 'cache', 'apt', 'archives').iterdir():

-- 
2.45.2



More information about the elbe-devel mailing list