xref: /OK3568_Linux_fs/buildroot/support/testing/tests/init/test_busybox.py (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1import infra.basetest
2from tests.init.base import InitSystemBase as InitSystemBase
3
4
5class InitSystemBusyboxBase(InitSystemBase):
6    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
7        """
8        # BR2_TARGET_ROOTFS_TAR is not set
9        """
10
11    def check_init(self):
12        super(InitSystemBusyboxBase, self).check_init("/bin/busybox")
13
14
15class TestInitSystemBusyboxRo(InitSystemBusyboxBase):
16    config = InitSystemBusyboxBase.config + \
17        """
18        # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
19        BR2_TARGET_ROOTFS_SQUASHFS=y
20        """
21
22    def test_run(self):
23        self.start_emulator("squashfs")
24        self.check_init()
25        self.check_network("eth0", 1)
26
27
28class TestInitSystemBusyboxRw(InitSystemBusyboxBase):
29    config = InitSystemBusyboxBase.config + \
30        """
31        BR2_TARGET_ROOTFS_EXT2=y
32        """
33
34    def test_run(self):
35        self.start_emulator("ext2")
36        self.check_init()
37        self.check_network("eth0", 1)
38
39
40class TestInitSystemBusyboxRoNet(InitSystemBusyboxBase):
41    config = InitSystemBusyboxBase.config + \
42        """
43        BR2_SYSTEM_DHCP="eth0"
44        # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
45        BR2_TARGET_ROOTFS_SQUASHFS=y
46        """
47
48    def test_run(self):
49        self.start_emulator("squashfs")
50        self.check_init()
51        self.check_network("eth0")
52
53
54class TestInitSystemBusyboxRwNet(InitSystemBusyboxBase):
55    config = InitSystemBusyboxBase.config + \
56        """
57        BR2_SYSTEM_DHCP="eth0"
58        BR2_TARGET_ROOTFS_EXT2=y
59        """
60
61    def test_run(self):
62        self.start_emulator("ext2")
63        self.check_init()
64        self.check_network("eth0")
65