test_openrc.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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()
  37. class TestInitSystemOpenrcMergedUsrFull(InitSystemOpenrcBase):
  38. config = InitSystemOpenrcBase.config + \
  39. """
  40. BR2_ROOTFS_MERGED_USR=y
  41. BR2_SYSTEM_DHCP="eth0"
  42. BR2_TARGET_ROOTFS_EXT2=y
  43. """
  44. def test_run(self):
  45. self.start_emulator("ext2")
  46. self.check_init()