[Buildroot] [RFC PATCH] support/testing: make time setting portable

Arnout Vandecappelle arnout at rnout.be
Wed Apr 16 21:08:56 UTC 2025


On 24/03/2025 12:52, Alex Bennée wrote:
> The busybox date applet accepts the following:
>
>    date @1234567
>
> but this confuses the coreutils version which doesn't implicitly set
> time. As some tests might need coreutils binaries we should ensure the
> emulator login will work with both. Fix this by passing the -s (set)
> option to the command.
>
> Signed-off-by: Alex Bennée <alex.bennee at linaro.org>

  Applied to 2025.02.x, thanks.

  Regards,
  Arnout

> ---
>   support/testing/infra/emulator.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/support/testing/infra/emulator.py b/support/testing/infra/emulator.py
> index 7f41e52a44..a6fe9613b7 100644
> --- a/support/testing/infra/emulator.py
> +++ b/support/testing/infra/emulator.py
> @@ -155,7 +155,7 @@ class Emulator(object):
>   
>           self.connect_shell()
>   
> -        output, exit_code = self.run(f"date @{int(time.time())}")
> +        output, exit_code = self.run(f"date -s @{int(time.time())}")
>           if exit_code:
>               raise SystemError("Cannot set date in virtual machine")
>   


More information about the buildroot mailing list