Skip to content

Commit

Permalink
test: add microvm helper for printing console data
Browse files Browse the repository at this point in the history
Add a property in microvm class for printing console data. If console is
disabled this will print an empty string.

Signed-off-by: Babis Chalios <[email protected]>
  • Loading branch information
bchalios committed Feb 16, 2024
1 parent 1990d78 commit 4c33fb5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/framework/microvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,13 @@ def log_data(self):
return ""
return self.log_file.read_text()

@property
def console_data(self):
"""Return the output of microVM's console"""
if self.screen_log is None:
return ""
return Path(self.screen_log).read_text(encoding="utf-8")

@property
def state(self):
"""Get the InstanceInfo property and return the state field."""
Expand Down

0 comments on commit 4c33fb5

Please sign in to comment.