test_busybox.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import infra.basetest
  2. from tests.init.base import InitSystemBase as InitSystemBase
  3. class InitSystemBusyboxBase(InitSystemBase):
  4. config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
  5. """
  6. # BR2_TARGET_ROOTFS_TAR is not set
  7. """
  8. def check_init(self):
  9. super(InitSystemBusyboxBase, self).check_init("/bin/busybox")
  10. class TestInitSystemBusyboxRo(InitSystemBusyboxBase):
  11. config = InitSystemBusyboxBase.config + \
  12. """
  13. # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
  14. BR2_TARGET_ROOTFS_SQUASHFS=y
  15. """
  16. def test_run(self):
  17. self.start_emulator("squashfs")
  18. self.check_init()
  19. self.check_network("eth0", 1)
  20. class TestInitSystemBusyboxRw(InitSystemBusyboxBase):
  21. config = InitSystemBusyboxBase.config + \
  22. """
  23. BR2_TARGET_ROOTFS_EXT2=y
  24. """
  25. def test_run(self):
  26. self.start_emulator("ext2")
  27. self.check_init()
  28. self.check_network("eth0", 1)
  29. class TestInitSystemBusyboxRoNet(InitSystemBusyboxBase):
  30. config = InitSystemBusyboxBase.config + \
  31. """
  32. BR2_SYSTEM_DHCP="eth0"
  33. # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
  34. BR2_TARGET_ROOTFS_SQUASHFS=y
  35. """
  36. def test_run(self):
  37. self.start_emulator("squashfs")
  38. self.check_init()
  39. self.check_network("eth0")
  40. class TestInitSystemBusyboxRwNet(InitSystemBusyboxBase):
  41. config = InitSystemBusyboxBase.config + \
  42. """
  43. BR2_SYSTEM_DHCP="eth0"
  44. BR2_TARGET_ROOTFS_EXT2=y
  45. """
  46. def test_run(self):
  47. self.start_emulator("ext2")
  48. self.check_init()
  49. self.check_network("eth0")