Skip to contentSkip to conversation

selftests: add test_minidebuginfo_qemu

PATCH Superseded [email protected] 2 participants 3 messages Jun 5, 2024 – Jun 6, 2024

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 selftests: add test_minidebuginfo_qemu

From: Etienne Cordonnier <[email protected]>

test_systemd_coredump_minidebuginfo was getting skipped in CI, because the minidebuginfo feature isn't enabled per default in any image at the moment.

Add this selftest so that test_systemd_coredump_minidebuginfo gets executed in CI.

---
 meta/lib/oeqa/selftest/cases/minidebuginfo.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
meta/lib/oeqa/selftest/cases/minidebuginfo.py +18 -0
index 2919f07939..a64b334d77 100644
@@ -8,6 +8,7 @@ import subprocess
 import tempfile
 import shutil
 
+from oeqa.core.decorator import OETestTag
 from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runCmd
 
@@ -42,3 +43,20 @@ IMAGE_FSTYPES = "tar.bz2"
                     native_sysroot = native_sysroot, target_sys = target_sys)
             self.assertIn(".gnu_debugdata", r.output)
 
+    @OETestTag("runqemu")
+    def test_minidebuginfo_qemu(self):
+        """
+        Test minidebuginfo inside a qemu.
+        This runs test_systemd_coredump_minidebuginfo and other minidebuginfo runtime tests which may be added in the future.
+        """
+
+        self.write_config("""
+DISTRO_FEATURES:append = " minidebuginfo usrmerge systemd"
+DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
+IMAGE_CLASSES += "testimage"
+TEST_SUITES = "ping ssh systemd"
+VIRTUAL-RUNTIME_init_manager = "systemd"
+VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"
+        """)
+        bitbake('core-image-minimal')
+        bitbake('-c testimage core-image-minimal')
Signature · 1 line
2.36.1.vfs.0.0
#1 lore raw

v2 of the patch: fixed the commit message which was referencing the wrong test-name.

Quoted 54 lines · On Wed, Jun 5, 2024 at 3:17 PM <[email protected]> wrote:

From: Etienne Cordonnier <[email protected]>

test_systemd_coredump_minidebuginfo was getting skipped in CI, because the minidebuginfo feature isn't enabled per default in any image at the moment.

Add this selftest so that test_systemd_coredump_minidebuginfo gets executed in
CI.

---
 meta/lib/oeqa/selftest/cases/minidebuginfo.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
meta/lib/oeqa/selftest/cases/minidebuginfo.py +6 -0
index 2919f07939..a64b334d77 100644
@@ -8,6 +8,7 @@ import subprocess
 import tempfile
 import shutil
 
+from oeqa.core.decorator import OETestTag
 from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runCmd
 
@@ -42,3 +43,20 @@ IMAGE_FSTYPES = "tar.bz2"
                     native_sysroot = native_sysroot, target_sys =
 target_sys)
             self.assertIn(".gnu_debugdata", r.output)
 
+    @OETestTag("runqemu")
+    def test_minidebuginfo_qemu(self):
+        """
+        Test minidebuginfo inside a qemu.
+        This runs test_systemd_coredump_minidebuginfo and other

minidebuginfo runtime tests which may be added in the future.

meta/lib/oeqa/selftest/cases/minidebuginfo.py +12 -1
+        """
+
+        self.write_config("""
+DISTRO_FEATURES:append = " minidebuginfo usrmerge systemd"
+DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
+IMAGE_CLASSES += "testimage"
+TEST_SUITES = "ping ssh systemd"
+VIRTUAL-RUNTIME_init_manager = "systemd"
+VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"
+        """)
+        bitbake('core-image-minimal')
+        bitbake('-c testimage core-image-minimal')
--

2.36.1.vfs.0.0

#2 lore raw
In reply to [email protected]

meta/lib/oeqa/selftest/cases/minidebuginfo.py IMAGE_FSTYPES = "tar.bz2" · line 59

Quoted 10 lines · Etienne Cordonnier via lists.openembedded.org
meta/lib/oeqa/selftest/cases/minidebuginfo.py +7 -0
+        self.write_config("""
+DISTRO_FEATURES:append = " minidebuginfo usrmerge systemd"
+DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
+IMAGE_CLASSES += "testimage"
+TEST_SUITES = "ping ssh systemd"
+VIRTUAL-RUNTIME_init_manager = "systemd"
+VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"

You can remove most of those lines by just setting INIT_MANAGER=“systemd”, which will read init-manager-systemd.inc.

Ross