[1/2] testsuite: add support to run testsuite against specific SDE

Message ID 20261117120300.374231-2-felix.moessbauer@siemens.com
State Under Review
Headers show
Series Isolate test classes, make them reproducible | expand

Commit Message

Felix Moessbauer Nov. 17, 2026, 12:02 p.m. UTC
The testsuite currently runs most tests against the upstream mirrors. By
that, it is executed against a moving baseline. This further is
problematic if an substantially older sstate cache is used during
bootstrapping, as then the referenced .debs are no longer available on
the mirrors.

We now add support to run the testsuite against a specific timestamp.
This can be used both for reproducing sporadic issues, as well as for
test speedup when running with an sstate cache. As some Ubuntu targets
do not have a working and stable snapshot mirror, we skip these in this
case.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 testsuite/README.md    |  2 ++
 testsuite/cibuilder.py |  7 +++++++
 testsuite/citest.py    | 33 ++++++++++++++++++++++++++++-----
 3 files changed, 37 insertions(+), 5 deletions(-)

Patch

diff --git a/testsuite/README.md b/testsuite/README.md
index bd9e998a..07bcfaf2 100644
--- a/testsuite/README.md
+++ b/testsuite/README.md
@@ -36,6 +36,8 @@  To generate a kas configuration for manual debugging, add `-p kasconfig=1`.
 The configuration is written when the test starts to
 `{build_dir}/kas-{testname}.yaml`.
 
+To build against a specific Debian snapshot date, add `-p sde=<SOURCE_DATE_EPOCH>`.
+
 ## Fast build test
 
 ```
diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index 0565f158..e810910a 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -55,6 +55,8 @@  class CanBeFinished(Exception):
 class CIBuilder(Test):
     def setUp(self):
         super(CIBuilder, self).setUp()
+        self.sde = int(self.params.get('sde', default=0))
+        self.use_apt_snapshot = self.sde != 0
         job_log = os.path.join(os.path.dirname(self.logdir), '..', 'job.log')
         self._file_handler = logging.FileHandler(filename=job_log)
         self._file_handler.setLevel(logging.ERROR)
@@ -156,6 +158,11 @@  class CIBuilder(Test):
         if not rootless:
             rootless = bool(int(self.params.get('rootless', default=0)))
 
+        if not source_date_epoch and self.sde:
+            source_date_epoch = self.sde
+            use_apt_snapshot = True
+        self.use_apt_snapshot = use_apt_snapshot
+
         # set those to "" to not set dir value but use system default
         if dl_dir is None:
             dl_dir = os.getenv('DL_DIR')
diff --git a/testsuite/citest.py b/testsuite/citest.py
index 5918a5a4..db907e17 100644
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -348,10 +348,13 @@  class CrossTest(CIBaseTest):
             'mc:qemuarm-bookworm:isar-image-ci',
             'mc:qemuamd64-trixie:isar-image-base',
             'mc:qemuarm64-trixie:isar-image-base',
-            'mc:qemuarm64-focal:isar-image-base',
             'mc:nanopi-neo-efi-bookworm:isar-image-base',
             'mc:qemuamd64-resolute:isar-image-base',
         ]
+        if not self.use_apt_snapshot:
+            targets += [
+                'mc:qemuarm64-focal:isar-image-base',
+            ]
 
         self.init()
         self.perform_build_test(targets)
@@ -470,6 +473,9 @@  class CrossTest(CIBaseTest):
         """
         :avocado: tags=startvm
         """
+        if self.use_apt_snapshot:
+            self.cancel('arm64 focal not supported with apt snapshot')
+
         self.init()
         self.vm_start('arm64', 'focal')
 
@@ -528,10 +534,13 @@  class CrossTest(CIBaseTest):
             'mc:stm32mp15x-bullseye:kselftest',
             'mc:qemuarm-bookworm:kselftest',
             'mc:qemuarm64-bookworm:kselftest',
-            'mc:qemuarm64-focal:kselftest',
             'mc:nanopi-neo-efi-trixie:kselftest',
             'mc:phyboard-mira-trixie:kselftest',
         ]
+        if not self.use_apt_snapshot:
+            targets += [
+                'mc:qemuarm64-focal:kselftest',
+            ]
 
         self.init()
         self.perform_build_test(targets)
@@ -596,8 +605,11 @@  class CrossTest(CIBaseTest):
         """
         targets = [
             'mc:qemuriscv64-trixie:isar-image-ci',
-            'mc:qemuriscv64-resolute:isar-image-ci',
         ]
+        if not self.use_apt_snapshot:
+            targets += [
+                'mc:qemuriscv64-resolute:isar-image-ci',
+            ]
 
         self.init()
         try:
@@ -619,6 +631,8 @@  class CrossTest(CIBaseTest):
         """
         :avocado: tags=startvm,riscv64
         """
+        if self.use_apt_snapshot:
+            self.cancel('riscv64 resolute not supported with apt snapshot')
         self.init()
         try:
             self.vm_start('riscv64', 'resolute', image='isar-image-ci')
@@ -696,6 +710,8 @@  class UbuntuTest(CIBaseTest):
         return machine in ('qemuamd64', 'qemuarm64')
 
     def test_ubuntu_bootstrap_mirror(self):
+        if self.use_apt_snapshot:
+            self.cancel('snapshots enabled, but explicit no-snapshot test')
         self.init()
         self.perform_build_test(self.bootstrap_targets())
 
@@ -1105,12 +1121,15 @@  class NoCrossTest(CIBaseTest):
             'mc:hikey-bookworm:isar-image-base',
             'mc:hikey-trixie:isar-image-base',
             'mc:beagleplay-bookworm:isar-image-base',
-            'mc:qemuarm64-noble:isar-image-base',
             'mc:qemuamd64-noble:isar-image-base',
             'mc:qemuamd64-jammy:isar-image-base',
-            'mc:qemuarm64-jammy:isar-image-base',
             'mc:x86-pc-bookworm:isar-image-base',
         ]
+        if not self.use_apt_snapshot:
+            targets += [
+                'mc:qemuarm64-noble:isar-image-base',
+                'mc:qemuarm64-jammy:isar-image-base',
+            ]
 
         self.init()
         self.perform_build_test(targets, cross=False)
@@ -1333,6 +1352,8 @@  class NoCrossTest(CIBaseTest):
         """
         :avocado: tags=startvm
         """
+        if self.use_apt_snapshot:
+            self.cancel('arm64 noble not supported with apt snapshot')
         self.init()
         self.vm_start('arm64', 'noble')
 
@@ -1354,6 +1375,8 @@  class NoCrossTest(CIBaseTest):
         """
         :avocado: tags=startvm
         """
+        if self.use_apt_snapshot:
+            self.cancel('arm64 jammy not supported with apt snapshot')
         self.init()
         self.vm_start('arm64', 'jammy')