[elbe-devel] [PATCH 7/7] tests: add test for archivedir

Thomas Weißschuh thomas.weissschuh at linutronix.de
Wed Jul 24 10:01:35 CEST 2024


Make sure the archivedir functionality keeps working.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 .../opt/archive-file                                 |  1 +
 tests/simple-validation-image-test.py                | 20 +++++++++++++++++++-
 tests/simple-validation-image.xml                    |  2 ++
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/tests/simple-validation-image-archive1/opt/archive-file b/tests/simple-validation-image-archive1/opt/archive-file
new file mode 100644
index 000000000000..a1a9bd0994a0
--- /dev/null
+++ b/tests/simple-validation-image-archive1/opt/archive-file
@@ -0,0 +1 @@
+archive1
diff --git a/tests/simple-validation-image-test.py b/tests/simple-validation-image-test.py
index d8880caaed23..d95ac0e0f5fe 100755
--- a/tests/simple-validation-image-test.py
+++ b/tests/simple-validation-image-test.py
@@ -38,6 +38,9 @@ def test_validation_txt(build_dir):
             -----------------------
 
             No Errors found
+
+            Archive validation
+            ------------------
         """).strip(),
 
         textwrap.dedent("""
@@ -48,9 +51,13 @@ def test_validation_txt(build_dir):
             -----------------------
 
             No Errors found
+
+            Archive validation
+            ------------------
+
             Binary CD
             Source CD
-        """).strip(),
+        """).strip()
     ]
 
 
@@ -172,6 +179,16 @@ def _test_finetuning(root):
     assert root.joinpath('etc', 'hosts5').read_text().startswith('127.0.0.1\tlocalhost\n')
 
 
+def _test_archive(root):
+    archive_file = root.joinpath('opt', 'archive-file')
+    assert archive_file.is_file()
+
+    archive_file_stat = archive_file.stat()
+    assert archive_file_stat.st_mode & 0o777 == 0o644
+    assert archive_file_stat.st_uid == 0
+    assert archive_file_stat.st_gid == 0
+
+
 def _test_rfs_partition(build_dir, part):
     assert part.number == 1
     assert part.start == 1 * 1024 * 1024
@@ -220,6 +237,7 @@ def _test_rfs_partition(build_dir, part):
 
         _test_generated_elbe_files(build_dir, root)
         _test_finetuning(root)
+        _test_archive(root)
 
 
 def test_image(build_dir):
diff --git a/tests/simple-validation-image.xml b/tests/simple-validation-image.xml
index 2764749d5ff1..6281d3cb70a0 100644
--- a/tests/simple-validation-image.xml
+++ b/tests/simple-validation-image.xml
@@ -25,6 +25,8 @@ SPDX-FileCopyrightText: Linutronix GmbH
 
 	</project>
 
+	<archivedir>simple-validation-image-archive1</archivedir>
+
 	<target>
 		<hostname>validation-image</hostname>
 		<domain>elbe-ci</domain>

-- 
2.45.2



More information about the elbe-devel mailing list