test_atop.py 1.3 KB

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