test_busybox.py 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 checkInit(self):
  9. super(InitSystemBusyboxBase, self).checkInit("/bin/busybox")
  10. #-------------------------------------------------------------------------------
  11. class TestInitSystemBusyboxRo(InitSystemBusyboxBase):
  12. config = InitSystemBusyboxBase.config + \
  13. """
  14. # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
  15. BR2_TARGET_ROOTFS_SQUASHFS=y
  16. """
  17. def test_run(self):
  18. self.startEmulator("squashfs")
  19. self.checkInit()
  20. self.checkNetwork("eth0", 1)
  21. #-------------------------------------------------------------------------------
  22. class TestInitSystemBusyboxRw(InitSystemBusyboxBase):
  23. config = InitSystemBusyboxBase.config + \
  24. """
  25. BR2_TARGET_ROOTFS_EXT2=y
  26. """
  27. def test_run(self):
  28. self.startEmulator("ext2")
  29. self.checkInit()
  30. self.checkNetwork("eth0", 1)
  31. #-------------------------------------------------------------------------------
  32. class TestInitSystemBusyboxRoNet(InitSystemBusyboxBase):
  33. config = InitSystemBusyboxBase.config + \
  34. """
  35. BR2_SYSTEM_DHCP="eth0"
  36. # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
  37. BR2_TARGET_ROOTFS_SQUASHFS=y
  38. """
  39. def test_run(self):
  40. self.startEmulator("squashfs")
  41. self.checkInit()
  42. self.checkNetwork("eth0")
  43. #-------------------------------------------------------------------------------
  44. class TestInitSystemBusyboxRwNet(InitSystemBusyboxBase):
  45. config = InitSystemBusyboxBase.config + \
  46. """
  47. BR2_SYSTEM_DHCP="eth0"
  48. BR2_TARGET_ROOTFS_EXT2=y
  49. """
  50. def test_run(self):
  51. self.startEmulator("ext2")
  52. self.checkInit()
  53. self.checkNetwork("eth0")