Browse Source

support/testing: make time setting portable

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@linaro.org>
Signed-off-by: Julien Olivain <ju.o@free.fr>
(cherry picked from commit bfb490799e72406cc4831e440f5536da3620850d)
Alex Bennée 4 months ago
parent
commit
d11ef1e7a4
1 changed files with 1 additions and 1 deletions
  1. 1 1
      support/testing/infra/emulator.py

+ 1 - 1
support/testing/infra/emulator.py

@@ -153,7 +153,7 @@ class Emulator(object):
 
 
         self.connect_shell()
         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:
         if exit_code:
             raise SystemError("Cannot set date in virtual machine")
             raise SystemError("Cannot set date in virtual machine")