From 3ebc7c69d56430c34eba4c869d1d4fe4d1e8de55 Mon Sep 17 00:00:00 2001 From: Julien Olivain Date: Tue, 2 Jul 2024 15:19:25 +0200 Subject: [PATCH] support/testing: new rt-tests runtime test Signed-off-by: Julien Olivain Signed-off-by: Romain Naour --- DEVELOPERS | 1 + .../testing/tests/package/test_rt_tests.py | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 support/testing/tests/package/test_rt_tests.py diff --git a/DEVELOPERS b/DEVELOPERS index 6d9fcd97df..90d1a111ab 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1893,6 +1893,7 @@ F: support/testing/tests/package/test_python_spake2.py F: support/testing/tests/package/test_python_sympy.py F: support/testing/tests/package/test_rdma_core.py F: support/testing/tests/package/test_rdma_core/ +F: support/testing/tests/package/test_rt_tests.py F: support/testing/tests/package/test_screen.py F: support/testing/tests/package/test_sed.py F: support/testing/tests/package/test_socat.py diff --git a/support/testing/tests/package/test_rt_tests.py b/support/testing/tests/package/test_rt_tests.py new file mode 100644 index 0000000000..0795d7afd2 --- /dev/null +++ b/support/testing/tests/package/test_rt_tests.py @@ -0,0 +1,39 @@ +import os + +import infra.basetest + + +class TestRtTests(infra.basetest.BRTest): + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ + """ + BR2_PACKAGE_RT_TESTS=y + BR2_TARGET_ROOTFS_CPIO=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + + def test_run(self): + cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv5", + kernel="builtin", + options=["-initrd", cpio_file]) + self.emulator.login() + + # We cannot easily test realtime properties in a CI/emulator + # environment. Instead, this test runs few rt-tests programs + # in small scenario configurations (to make sure the execution + # will remain short). It just makes sure the execution returns + # a success code. Also, to avoid making the logs too big, we + # generally pass the "--quiet" option to have a summary at the + # end of the execution. + test_cmds = [ + "cyclictest --quiet --loops=200", + "hackbench --fds=2 --groups=3 --loops=5", + "pi_stress --inversions=100", + "ptsematest --quiet --loops=100", + "rt-migrate-test --quiet --loops=5", + "signaltest --quiet --loops=200", + "sigwaittest --quiet --loops=100" + ] + + for cmd in test_cmds: + self.assertRunOk(cmd)