public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Aliaksei Karpovich <akarpovich@ilbers.de>
To: isar-users@googlegroups.com
Cc: Aliaksei Karpovich <akarpovich@ilbers.de>
Subject: [PATCH v2 2/2] testsuite: add test for rootfs sstate
Date: Tue, 27 Oct 2026 17:15:17 +0100	[thread overview]
Message-ID: <20261027161524.129118-2-akarpovich@ilbers.de> (raw)
In-Reply-To: <20261027161524.129118-1-akarpovich@ilbers.de>

This test should catch the bug when user builds the same image
multiple times, adds and removes some package in image, but this
package is stayed on rootfs after removing.
The root cause is in sstate for rootfs.

Test conatins 3 build steps:
 1. Build the target
 2. Add some package in image and build the same target
 3. Remove package from image (return back to state in step 1) and
build the target again.

After each step, the test checks for the presence or absence of
the package on the rootfs.
---
 testsuite/citest.py | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/testsuite/citest.py b/testsuite/citest.py
index 0cedcc2c..b701ed13 100644
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -1563,6 +1563,42 @@ class SstateTest(CIBaseTest):
         self.perform_sstate_test(image_target, package_target)
 
 
+class RootfsSstateTest(CIBaseTest):
+    """
+    Test for correct behavior of sstate for rootfs.
+    Contains 3 steps:
+     - Step 1: build isar-image-base without any package.
+     - Step 2: build isar-image-base with hello-isar package only.
+     - Step 3: build again isar-image-base without any package.
+
+    :avocado: tags=sstate,fast
+    """
+
+    def test_rootfs_sstate(self):
+        import glob
+
+        image = 'isar-image-base'
+        arch = 'amd64'
+        distro = 'trixie'
+
+        self.init()
+
+        image_target = f'mc:qemu{arch}-{distro}:{image}'
+        hello_bin_file = f'{self.build_dir}/tmp/work/*-{distro}-{arch}/{image}-qemu{arch}/*/rootfs/usr/bin/hello-isar'
+
+        self.perform_build_test(image_target, image_install='', sstate=True)
+        if glob.glob(hello_bin_file):
+            self.fail("Step 1: hello-isar shouldn't be on rootfs")
+
+        self.perform_build_test(image_target, image_install='hello-isar', sstate=True)
+        if not glob.glob(hello_bin_file):
+            self.fail("Step 2: hello-isar should be on rootfs")
+
+        self.perform_build_test(image_target, image_install='', sstate=True)
+        if glob.glob(hello_bin_file):
+            self.fail("Step 3: hello-isar shouldn't be on rootfs")
+
+
 class SingleTest(CIBaseTest):
 
     """
-- 
2.53.0

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20261027161524.129118-2-akarpovich%40ilbers.de.

  reply	other threads:[~2026-10-27 16:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 16:15 [PATCH v2 1/2] rootfs: clean rootfs dir before unpack from sstate Aliaksei Karpovich
2026-10-27 16:15 ` Aliaksei Karpovich [this message]
2026-10-29 14:22 ` Zhihang Wei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261027161524.129118-2-akarpovich@ilbers.de \
    --to=akarpovich@ilbers.de \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox