xref: /OK3568_Linux_fs/buildroot/support/testing/tests/package/test_atop.py (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1import os
2
3import infra.basetest
4
5BASIC_TOOLCHAIN_CONFIG_HEADERS_AT_LEAST_3_14 = \
6    """
7    BR2_arm=y
8    BR2_TOOLCHAIN_EXTERNAL=y
9    BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
10    BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
11    BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2019.05.1.tar.bz2"
12    BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y
13    BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_14=y
14    BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
15    # BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
16    BR2_TOOLCHAIN_EXTERNAL_CXX=y
17    """
18
19
20class TestAtop(infra.basetest.BRTest):
21    config = BASIC_TOOLCHAIN_CONFIG_HEADERS_AT_LEAST_3_14 + \
22        """
23        BR2_PACKAGE_ATOP=y
24        BR2_TARGET_ROOTFS_CPIO=y
25        # BR2_TARGET_ROOTFS_TAR is not set
26        """
27
28    def test_run(self):
29        cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
30        self.emulator.boot(arch="armv5",
31                           kernel="builtin",
32                           options=["-initrd", cpio_file])
33        self.emulator.login()
34
35        cmd = "atop -V | grep '^Version'"
36        self.assertRunOk(cmd)
37
38        cmd = "atop -a 1 2 | grep '% *atop *$'"
39        self.assertRunOk(cmd)
40