test_openrc.py 1.5 KB

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