test_openrc.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. from tests.init.base import InitSystemBase as InitSystemBase
  2. class InitSystemOpenrcBase(InitSystemBase):
  3. config = \
  4. """
  5. BR2_arm=y
  6. BR2_cortex_a9=y
  7. BR2_ARM_ENABLE_VFP=y
  8. BR2_TOOLCHAIN_EXTERNAL=y
  9. BR2_INIT_OPENRC=y
  10. BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
  11. # BR2_TARGET_ROOTFS_TAR is not set
  12. """
  13. def check_init(self):
  14. super(InitSystemOpenrcBase, self).check_init('/sbin/openrc-init')
  15. # Test all services are OK
  16. output, _ = self.emulator.run("rc-status -c")
  17. self.assertEqual(len(output), 0)
  18. class TestInitSystemOpenrcRoFull(InitSystemOpenrcBase):
  19. config = InitSystemOpenrcBase.config + \
  20. """
  21. BR2_SYSTEM_DHCP="eth0"
  22. # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
  23. BR2_TARGET_ROOTFS_SQUASHFS=y
  24. """
  25. def test_run(self):
  26. self.start_emulator("squashfs")
  27. self.check_init()
  28. class TestInitSystemOpenrcRwFull(InitSystemOpenrcBase):
  29. config = InitSystemOpenrcBase.config + \
  30. """
  31. BR2_SYSTEM_DHCP="eth0"
  32. BR2_TARGET_ROOTFS_EXT2=y
  33. """
  34. def test_run(self):
  35. self.start_emulator("ext2")
  36. self.check_init()