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 used
to set, So serial session is returned in case of failure,
as 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 May 4, 2020
1 parent 1b6c5c9 commit fe4e1dc
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 @@ -165,6 +165,10 @@ q35, arm64-pci, arm64-mmio:
serials = "serial0"
serial_type = "isa-serial"

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

# Emulated machine type, run following command to see supported machine type.
# qemu-kvm -M ?
# machine_type = pc
Expand Down
2 changes: 2 additions & 0 deletions virttest/virt_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,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 fe4e1dc

Please sign in to comment.