@@ -1737,6 +1737,7 @@ F: support/testing/tests/package/sample_python_pyalsa.py
F: support/testing/tests/package/sample_python_spake2.py
F: support/testing/tests/package/test_ddrescue.py
F: support/testing/tests/package/test_ddrescue/
+F: support/testing/tests/package/test_dieharder.py
F: support/testing/tests/package/test_gnupg2.py
F: support/testing/tests/package/test_highway.py
F: support/testing/tests/package/test_hwloc.py
new file mode 100644
@@ -0,0 +1,40 @@
+import os
+
+import infra.basetest
+
+
+class TestDieharder(infra.basetest.BRTest):
+ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+ """
+ BR2_PACKAGE_DIEHARDER=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()
+
+ # Check the program can run (by showing its version)
+ self.assertRunOk("dieharder -V")
+
+ # The birthdays test on small number (1) of sample is expected to fail
+ cmd = "dieharder -g /dev/urandom -d diehard_birthdays -t 1"
+ output, exit_code = self.emulator.run(cmd)
+ self.assertEqual(exit_code, 0)
+ self.assertIn("FAILED", '\n'.join(output))
+
+ # The birthdays test on higher number (25) of sample is expected to succeed
+ cmd = "dieharder -g mt19937 -d diehard_birthdays -t 25"
+ output, exit_code = self.emulator.run(cmd, timeout=10)
+ self.assertEqual(exit_code, 0)
+ self.assertIn("PASSED", '\n'.join(output))
+
+ # The birthdays test on file /dev/zero is expected to fail
+ cmd = "dieharder -g file_input_raw -f /dev/zero -d diehard_birthdays -t 25"
+ output, exit_code = self.emulator.run(cmd, timeout=40)
+ self.assertEqual(exit_code, 0)
+ self.assertIn("FAILED", '\n'.join(output))
Signed-off-by: Julien Olivain <ju.o@free.fr> --- DEVELOPERS | 1 + .../testing/tests/package/test_dieharder.py | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 support/testing/tests/package/test_dieharder.py