[v2,3/4] testsuite: add installer build test for rootfs-add-files

Message ID 20261026101018.276241-3-clara.kowalsky@siemens.com
State New
Headers show
Series [v2,1/4] rootfs-add-files: correctly remove files in ROOTFSDIR | expand

Commit Message

Clara Kowalsky Oct. 26, 2026, 10:10 a.m. UTC
Install a dpkg-raw test package with a file in /install while building
the installer image. This executes rootfs_add_files with its destination
directory already present.

Signed-off-by: Clara Kowalsky <clara.kowalsky@siemens.com>
---
 .../test-rootfs-add-files/test-rootfs-add-files.bb       | 9 +++++++++
 testsuite/citest.py                                      | 1 +
 2 files changed, 10 insertions(+)
 create mode 100644 meta-test/recipes-app/test-rootfs-add-files/test-rootfs-add-files.bb

Patch

diff --git a/meta-test/recipes-app/test-rootfs-add-files/test-rootfs-add-files.bb b/meta-test/recipes-app/test-rootfs-add-files/test-rootfs-add-files.bb
new file mode 100644
index 00000000..ee013e8f
--- /dev/null
+++ b/meta-test/recipes-app/test-rootfs-add-files/test-rootfs-add-files.bb
@@ -0,0 +1,9 @@ 
+# Test package using dpkg-raw to install a file into /install.
+
+inherit dpkg-raw
+
+do_install[cleandirs] += "${D}/install"
+
+do_install() {
+    printf '%s\n' 'test payload' > "${D}/install/test-rootfs-add-files"
+}
diff --git a/testsuite/citest.py b/testsuite/citest.py
index 0cedcc2c..245a4305 100644
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -301,6 +301,7 @@  class InstallerTest(CIBaseTest):
                                 installer_device="/dev/sda",
                                 lines=[
                                     "BBMULTICONFIG:append = ' qemuamd64-bookworm'",
+                                    "IMAGE_INSTALL:append = ' test-rootfs-add-files'",
                                 ])
 
     def test_installer_run(self):