2020-03-01 16:17:47 +01:00
|
|
|
from tests.init.base import InitSystemBase as InitSystemBase
|
|
|
|
|
|
|
|
|
|
|
|
class InitSystemOpenrcBase(InitSystemBase):
|
|
|
|
config = \
|
|
|
|
"""
|
|
|
|
BR2_arm=y
|
2021-09-12 16:11:29 +02:00
|
|
|
BR2_cortex_a9=y
|
|
|
|
BR2_ARM_ENABLE_VFP=y
|
2020-03-01 16:17:47 +01:00
|
|
|
BR2_TOOLCHAIN_EXTERNAL=y
|
|
|
|
BR2_INIT_OPENRC=y
|
|
|
|
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
|
|
|
|
# BR2_TARGET_ROOTFS_TAR is not set
|
|
|
|
"""
|
|
|
|
|
|
|
|
def check_init(self):
|
|
|
|
super(InitSystemOpenrcBase, self).check_init('/sbin/openrc-init')
|
|
|
|
|
|
|
|
# Test all services are OK
|
|
|
|
output, _ = self.emulator.run("rc-status -c")
|
|
|
|
self.assertEqual(len(output), 0)
|
|
|
|
|
|
|
|
|
|
|
|
class TestInitSystemOpenrcRoFull(InitSystemOpenrcBase):
|
|
|
|
config = InitSystemOpenrcBase.config + \
|
|
|
|
"""
|
|
|
|
BR2_SYSTEM_DHCP="eth0"
|
|
|
|
# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
|
|
|
|
BR2_TARGET_ROOTFS_SQUASHFS=y
|
|
|
|
"""
|
|
|
|
|
|
|
|
def test_run(self):
|
2021-09-12 16:11:29 +02:00
|
|
|
self.start_emulator("squashfs")
|
2020-03-01 16:17:47 +01:00
|
|
|
self.check_init()
|
|
|
|
|
|
|
|
|
|
|
|
class TestInitSystemOpenrcRwFull(InitSystemOpenrcBase):
|
|
|
|
config = InitSystemOpenrcBase.config + \
|
|
|
|
"""
|
|
|
|
BR2_SYSTEM_DHCP="eth0"
|
|
|
|
BR2_TARGET_ROOTFS_EXT2=y
|
|
|
|
"""
|
|
|
|
|
|
|
|
def test_run(self):
|
2021-09-12 16:11:29 +02:00
|
|
|
self.start_emulator("ext2")
|
2020-03-01 16:17:47 +01:00
|
|
|
self.check_init()
|