test_rt_tests.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import os
  2. import infra.basetest
  3. class TestRtTests(infra.basetest.BRTest):
  4. config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
  5. """
  6. BR2_PACKAGE_RT_TESTS=y
  7. BR2_TARGET_ROOTFS_CPIO=y
  8. # BR2_TARGET_ROOTFS_TAR is not set
  9. """
  10. def test_run(self):
  11. cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
  12. self.emulator.boot(arch="armv5",
  13. kernel="builtin",
  14. options=["-initrd", cpio_file])
  15. self.emulator.login()
  16. # We cannot easily test realtime properties in a CI/emulator
  17. # environment. Instead, this test runs few rt-tests programs
  18. # in small scenario configurations (to make sure the execution
  19. # will remain short). It just makes sure the execution returns
  20. # a success code. Also, to avoid making the logs too big, we
  21. # generally pass the "--quiet" option to have a summary at the
  22. # end of the execution.
  23. test_cmds = [
  24. "cyclictest --quiet --loops=200",
  25. "hackbench --fds=2 --groups=3 --loops=5",
  26. "pi_stress --inversions=100",
  27. "ptsematest --quiet --loops=100",
  28. "rt-migrate-test --quiet --loops=5",
  29. "signaltest --quiet --loops=200",
  30. "sigwaittest --quiet --loops=100"
  31. ]
  32. for cmd in test_cmds:
  33. self.assertRunOk(cmd)