[8/8] CI: Resolve sourceTest failure

Message ID 20250410105025.47019-9-amikan@ilbers.de
State New
Headers show
Series Testsuite coverage update | expand

Commit Message

Anton Mikanovich April 10, 2025, 10:50 a.m. UTC
From: Maria Selvam <mariasm@ilbers.de>

On "3.0 native" format deb package, by default the VCS related
files are removed. There is NO need to add DPKG_SOURCE_EXTRA_ARGS
parameter explicitly.

Signed-off-by: Maria Selvam <mariasm@ilbers.de>
---
 testsuite/cibase.py | 14 +++++++++++++-
 testsuite/citest.py |  2 +-
 2 files changed, 14 insertions(+), 2 deletions(-)

Patch

diff --git a/testsuite/cibase.py b/testsuite/cibase.py
index 075535b1..6ffedcea 100755
--- a/testsuite/cibase.py
+++ b/testsuite/cibase.py
@@ -5,6 +5,7 @@  import os
 import re
 import shutil
 import tempfile
+import tarfile
 
 from cibuilder import CIBuilder, isar_root
 from utils import CIUtils
@@ -305,6 +306,16 @@  class CIBaseTest(CIBuilder):
             self.fail("Failed rebuild package and image")
 
     def perform_source_test(self, targets, **kwargs):
+        def is_deb_quilt_package(tar_path):
+            with tarfile.open(tar_path) as tar:
+                 is_quilt_package = True
+                 for member in tar.getnames():
+                     if '/debian/source/format' in member:
+                        file_data = tar.extractfile(member).read()
+                        if b'3.0 (native)' in file_data:
+                           is_quilt_package = False
+            return is_quilt_package
+
         def get_source_content(targets):
             sfiles = dict()
             for target in targets:
@@ -316,7 +327,8 @@  class CIBaseTest(CIBuilder):
                 if len(targz) < 1:
                     self.fail("No source packages found")
                 for fname in targz:
-                    sfiles[target][fname] = CIUtils.get_tar_content(fname)
+                    if is_deb_quilt_package(fname):
+                       sfiles[target][fname]  = CIUtils.get_tar_content(fname)
             return sfiles
 
         self.configure(**kwargs)
diff --git a/testsuite/citest.py b/testsuite/citest.py
index e2ce45d1..56ac1f52 100755
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -473,7 +473,7 @@  class SourceTest(CIBaseTest):
     """
     Source contents test
 
-    :avocado: tags=source
+    :avocado: tags=source,full
     """
 
     def test_source(self):