test_openrc.py 1.5 KB

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