Skip to content

Commit

Permalink
feat: Add the qemu_system_time function
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
oleorhagen committed Dec 7, 2022
1 parent e356d38 commit 7d3649d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/utils/common/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,14 @@ def cleanup_mender_state(request, connection):
put_no_sftp(bootstrap, connection, remote="/data/mender/bootstrap.mender")


def qemu_system_time(connection):
"""Returns an integer representing the number of seconds since the epoch on
the QEMU host behind the :connection
"""
return int(connection.run("date +%s").stdout)


def bootenv_tools(connection):
"""Returns a tuple containing the print and set tools of the current bootloader."""

Expand Down

0 comments on commit 7d3649d

Please sign in to comment.