support/testing: new rt-tests runtime test

Signed-off-by: Julien Olivain <ju.o@free.fr>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
This commit is contained in:
Julien Olivain
2024-07-02 15:19:25 +02:00
committed by Romain Naour
parent 99423ee495
commit 3ebc7c69d5
2 changed files with 40 additions and 0 deletions

View File

@@ -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

View File

@@ -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)