Skip to content

Commit 7d3649d

Browse files
committed
feat: Add the qemu_system_time function
This simply accepts a connection to a running QEMU host adn returns the local system time using the date command. Ticket: QA-483 Changelog: None Signed-off-by: Ole Petter <[email protected]>
1 parent e356d38 commit 7d3649d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/utils/common/common.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,14 @@ def cleanup_mender_state(request, connection):
711711
put_no_sftp(bootstrap, connection, remote="/data/mender/bootstrap.mender")
712712

713713

714+
def qemu_system_time(connection):
715+
"""Returns an integer representing the number of seconds since the epoch on
716+
the QEMU host behind the :connection
717+
718+
"""
719+
return int(connection.run("date +%s").stdout)
720+
721+
714722
def bootenv_tools(connection):
715723
"""Returns a tuple containing the print and set tools of the current bootloader."""
716724

0 commit comments

Comments
 (0)