Skip to content

Commit

Permalink
Add a param to force use serial session in case of failure
Browse files Browse the repository at this point in the history
Currently, we do have a logic in wait_for_login to
return serial session incase of failure if provided
by the user through function param, this patch extends
that functionality by adding a param which can be use set,
so that serial session is returned in case of failure,
this will be helpful as we most of the testcases using
wait_for_login with default params and we do not need
to modify the testcases, this can be useful during certain
env issues if we want to force use serial logins for the same test.

Signed-off-by: Satheesh Rajendran <[email protected]>
  • Loading branch information
Satheesh Rajendran committed Feb 14, 2019
1 parent 6c9f12a commit 9f986ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions shared/cfg/base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ q35, arm64-pci, arm64-mmio:
# serials = "S1 S2 S3"
serials = "serial0"

# Enable this to "yes" if you want to force wait_for_login
# to give serial session incase of failure
force_use_serial_login = "no"

# virtio_serialport and virtio_console ports
# virtio_ports = "vs1 vs2 vc1"
# Port types
Expand Down
2 changes: 2 additions & 0 deletions virttest/virt_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,8 @@ def print_guest_network_info():
session.close()

error = None
if not serial:
serial = self.params.get("force_use_serial_login", "no") == "yes"
logging.debug("Attempting to log into '%s' (timeout %ds)",
self.name, timeout)
start_time = time.time()
Expand Down

0 comments on commit 9f986ff

Please sign in to comment.