oeqa/selftest/runtime_test: split systemd and sysvinit tests out

This should help debug which part of this selftest is failing.
We can not tell which outloop is failing so split the tests into
systemd and sysvinit.

[YOCTO #13650]

(From OE-Core rev: 5f49ac73ca38ae711e093b35ae0feb5a0674198a)

Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Armin Kuster
2019-12-07 17:55:48 -08:00
committed by Richard Purdie
parent cf872ba730
commit d486fe88c1

View File

@@ -10,6 +10,7 @@ import re
import tempfile
import shutil
import oe.lsb
from oeqa.core.decorator.data import skipIfNotQemu
class TestExport(OESelftestTestCase):
@@ -243,24 +244,8 @@ class TestImage(OESelftestTestCase):
bitbake('-c testimage core-image-minimal')
class Postinst(OESelftestTestCase):
def test_postinst_rootfs_and_boot(self):
"""
Summary: The purpose of this test case is to verify Post-installation
scripts are called when rootfs is created and also test
that script can be delayed to run at first boot.
Dependencies: NA
Steps: 1. Add proper configuration to local.conf file
2. Build a "core-image-minimal" image
3. Verify that file created by postinst_rootfs recipe is
present on rootfs dir.
4. Boot the image created on qemu and verify that the file
created by postinst_boot recipe is present on image.
Expected: The files are successfully created during rootfs and boot
time for 3 different package managers: rpm,ipk,deb and
for initialization managers: sysvinit and systemd.
"""
def init_manager_loop(self, init_manager):
import oe.path
vars = get_bb_vars(("IMAGE_ROOTFS", "sysconfdir"), "core-image-minimal")
@@ -272,7 +257,6 @@ class Postinst(OESelftestTestCase):
hosttestdir = oe.path.join(rootfs, sysconfdir, "postinst-test")
targettestdir = os.path.join(sysconfdir, "postinst-test")
for init_manager in ("sysvinit", "systemd"):
for classes in ("package_rpm", "package_deb", "package_ipk"):
with self.subTest(init_manager=init_manager, package_class=classes):
features = 'CORE_IMAGE_EXTRA_INSTALL = "postinst-delayed-b"\n'
@@ -299,6 +283,49 @@ class Postinst(OESelftestTestCase):
@skipIfNotQemu('qemuall', 'Test only runs in qemu')
def test_postinst_rootfs_and_boot_sysvinit(self):
"""
Summary: The purpose of this test case is to verify Post-installation
scripts are called when rootfs is created and also test
that script can be delayed to run at first boot.
Dependencies: NA
Steps: 1. Add proper configuration to local.conf file
2. Build a "core-image-minimal" image
3. Verify that file created by postinst_rootfs recipe is
present on rootfs dir.
4. Boot the image created on qemu and verify that the file
created by postinst_boot recipe is present on image.
Expected: The files are successfully created during rootfs and boot
time for 3 different package managers: rpm,ipk,deb and
for initialization managers: sysvinit.
"""
self.init_manager_loop("sysvinit")
@skipIfNotQemu('qemuall', 'Test only runs in qemu')
def test_postinst_rootfs_and_boot_systemd(self):
"""
Summary: The purpose of this test case is to verify Post-installation
scripts are called when rootfs is created and also test
that script can be delayed to run at first boot.
Dependencies: NA
Steps: 1. Add proper configuration to local.conf file
2. Build a "core-image-minimal" image
3. Verify that file created by postinst_rootfs recipe is
present on rootfs dir.
4. Boot the image created on qemu and verify that the file
created by postinst_boot recipe is present on image.
Expected: The files are successfully created during rootfs and boot
time for 3 different package managers: rpm,ipk,deb and
for initialization managers: systemd.
"""
self.init_manager_loop("systemd")
def test_failing_postinst(self):
"""
Summary: The purpose of this test case is to verify that post-installation