Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] support/testing: use host entropy for ARMv7 emulation
@ 2026-10-19 15:39 Alexis Lothoré via buildroot
  2026-10-19 16:59 ` Thomas Petazzoni via buildroot
  2026-10-30 15:27 ` Raphaël Mélotte via buildroot
  0 siblings, 2 replies; 3+ messages in thread
From: Alexis Lothoré via buildroot @ 2026-10-19 15:39 UTC (permalink / raw)
  To: buildroot; +Cc: Thomas Petazzoni, Ricardo Martincoski, Alexis Lothoré

When running tests depending on entropy pool being ready on armv7 (eg:
test_openscap.py, which runs the 'oscap' binary, which tries to get
random bytes, even with simple commands), the test may fail on timeout
due to the entropy pool not being ready; this is confirmed by the test
being blocked until "crng init done" line appears in the kernel logs.

A solution could be to just increase the test timeout to a value large
enough to make sure that the entropy pool will be ready in most cases,
but it may be hard to find a value that fits all use cases, and all
tests depending on entropy being ready would deserve the same fix.

Another solution is to replicate what commit 7acb32dabb80
("support/testing: add builtin armv5 kernel 4.19 with entropy") did: it
added the virtio-rng-pci argument to allow the guest machine to use host
entropy. The armv7 kernel used for testing seems to be built with the
relevant virtio configuration to allow a similar pass-through, so pass
virtio-rng-device to armv7 kernel when running tests.

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
The issue is observed systematically on the current master branch when I
try to run openscap tests:
  $ ./support/testing/run-tests -d ~/src/buildroot_dl -o test_openscap \
    -k tests.package.test_openscap
---
 support/testing/infra/emulator.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/support/testing/infra/emulator.py b/support/testing/infra/emulator.py
index 3702ee2d480d..d69094912047 100644
--- a/support/testing/infra/emulator.py
+++ b/support/testing/infra/emulator.py
@@ -98,6 +98,7 @@ class Emulator(object):
                                          "vexpress-v2p-ca9-5.10.202.dtb")
                     qemu_cmd += ["-dtb", dtb]
                     qemu_cmd += ["-M", "vexpress-a9"]
+                    qemu_cmd += ["-device", "virtio-rng-device"]
                 elif arch == "armv5":
                     kernel = infra.download(self.downloaddir,
                                             "kernel-versatile-5.10.202")

---
base-commit: 05dc49017ccdf1be2519460c736432b2a426c968
change-id: 20261019-fix_crng_init_slow-3b0e363c7f3f

Best regards,
--  
Alexis Lothoré <alexis.lothore@bootlin.com>

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH] support/testing: use host entropy for ARMv7 emulation
  2026-10-19 15:39 [Buildroot] [PATCH] support/testing: use host entropy for ARMv7 emulation Alexis Lothoré via buildroot
@ 2026-10-19 16:59 ` Thomas Petazzoni via buildroot
  2026-10-30 15:27 ` Raphaël Mélotte via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-10-19 16:59 UTC (permalink / raw)
  To: Alexis Lothoré; +Cc: buildroot, Ricardo Martincoski

On Mon, Oct 19, 2026 at 05:39:54PM +0200, Alexis Lothoré via buildroot wrote:
> When running tests depending on entropy pool being ready on armv7 (eg:
> test_openscap.py, which runs the 'oscap' binary, which tries to get
> random bytes, even with simple commands), the test may fail on timeout
> due to the entropy pool not being ready; this is confirmed by the test
> being blocked until "crng init done" line appears in the kernel logs.
> 
> A solution could be to just increase the test timeout to a value large
> enough to make sure that the entropy pool will be ready in most cases,
> but it may be hard to find a value that fits all use cases, and all
> tests depending on entropy being ready would deserve the same fix.
> 
> Another solution is to replicate what commit 7acb32dabb80
> ("support/testing: add builtin armv5 kernel 4.19 with entropy") did: it
> added the virtio-rng-pci argument to allow the guest machine to use host
> entropy. The armv7 kernel used for testing seems to be built with the
> relevant virtio configuration to allow a similar pass-through, so pass
> virtio-rng-device to armv7 kernel when running tests.
> 
> Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>

Applied to master, thanks!

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH] support/testing: use host entropy for ARMv7 emulation
  2026-10-19 15:39 [Buildroot] [PATCH] support/testing: use host entropy for ARMv7 emulation Alexis Lothoré via buildroot
  2026-10-19 16:59 ` Thomas Petazzoni via buildroot
@ 2026-10-30 15:27 ` Raphaël Mélotte via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Raphaël Mélotte via buildroot @ 2026-10-30 15:27 UTC (permalink / raw)
  To: buildroot, Alexis Lothoré; +Cc: Raphaël Mélotte

In reply of:
> When running tests depending on entropy pool being ready on armv7 (eg:
> test_openscap.py, which runs the 'oscap' binary, which tries to get
> random bytes, even with simple commands), the test may fail on timeout
> due to the entropy pool not being ready; this is confirmed by the test
> being blocked until "crng init done" line appears in the kernel logs.
> 
> A solution could be to just increase the test timeout to a value large
> enough to make sure that the entropy pool will be ready in most cases,
> but it may be hard to find a value that fits all use cases, and all
> tests depending on entropy being ready would deserve the same fix.
> 
> Another solution is to replicate what commit 7acb32dabb80
> ("support/testing: add builtin armv5 kernel 4.19 with entropy") did: it
> added the virtio-rng-pci argument to allow the guest machine to use host
> entropy. The armv7 kernel used for testing seems to be built with the
> relevant virtio configuration to allow a similar pass-through, so pass
> virtio-rng-device to armv7 kernel when running tests.
> 
> Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>

Applied to 2025.02.x, 2026.08.x. Thanks

> ---
> The issue is observed systematically on the current master branch when I
> try to run openscap tests:
>   $ ./support/testing/run-tests -d ~/src/buildroot_dl -o test_openscap \
>     -k tests.package.test_openscap
> ---
>  support/testing/infra/emulator.py | 1 +
>  1 file changed, 1 insertion(+)
> 
> 
> ---
> base-commit: 05dc49017ccdf1be2519460c736432b2a426c968
> change-id: 20261019-fix_crng_init_slow-3b0e363c7f3f
> 
> Best regards,
> --  
> Alexis Lothoré <alexis.lothore@bootlin.com>
> 
> diff --git a/support/testing/infra/emulator.py b/support/testing/infra/emulator.py
> index 3702ee2d480d..d69094912047 100644
> --- a/support/testing/infra/emulator.py
> +++ b/support/testing/infra/emulator.py
> @@ -98,6 +98,7 @@ class Emulator(object):
>                                           "vexpress-v2p-ca9-5.10.202.dtb")
>                      qemu_cmd += ["-dtb", dtb]
>                      qemu_cmd += ["-M", "vexpress-a9"]
> +                    qemu_cmd += ["-device", "virtio-rng-device"]
>                  elif arch == "armv5":
>                      kernel = infra.download(self.downloaddir,
>                                              "kernel-versatile-5.10.202")
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-30 15:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-19 15:39 [Buildroot] [PATCH] support/testing: use host entropy for ARMv7 emulation Alexis Lothoré via buildroot
2026-10-19 16:59 ` Thomas Petazzoni via buildroot
2026-10-30 15:27 ` Raphaël Mélotte via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox