소스 검색

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>
Julien Olivain 1 년 전
부모
커밋
3ebc7c69d5
2개의 변경된 파일40개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      DEVELOPERS
  2. 39 0
      support/testing/tests/package/test_rt_tests.py

+ 1 - 0
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

+ 39 - 0
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)