-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
guest_os_booting: update tests for s390x
The following features are not available on s390x: * SMBIOS * ACPI * fw_cfg * USB * <boot dev.../> * firmware settings For direct kernel boot, don't use hard coded kernel filename. In our setup we'll use kernel.img, so just use the filename from the download url. Don't use ttyS0, it's the line mode console which is not useful. Using no specific setting works well. Cover also s390x-specific parameter @loadparm by allowing generically to run a test command in the booted VM whose output should match an expected regular expression. Signed-off-by: Sebastian Mitterle <[email protected]>
- Loading branch information
Showing
11 changed files
with
54 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
libvirt/tests/cfg/guest_os_booting/firmware_configuration/smbios_mode.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
# Author: Meina Li <[email protected]> | ||
|
||
import os | ||
import re | ||
|
||
from avocado.utils import process | ||
|
||
|
@@ -74,10 +75,13 @@ def run(test, params, env): | |
check_prompt = eval(params.get("check_prompt", "[]")) | ||
bootable_device = params.get("bootable_device") | ||
os_dict = eval(params.get("os_dict")) | ||
test_cmd = params.get("test_cmd", None) | ||
expected_output = params.get("expected_output", None) | ||
|
||
vm = env.get_vm(vm_name) | ||
vmxml = vm_xml.VMXML.new_from_inactive_dumpxml(vm.name) | ||
bkxml = vmxml.copy() | ||
session = None | ||
|
||
try: | ||
test.log.info("TEST_SETUP: prepare a guest with necessary attributes.") | ||
|
@@ -89,12 +93,19 @@ def run(test, params, env): | |
test.log.debug(f"The current guest xml is: {vmxml}") | ||
test.log.info("TEST_STEP2: check the guest boot from expected device.") | ||
if bootable_device == "hd_bootable": | ||
vm.wait_for_login(timeout=360).close() | ||
session = vm.wait_for_login(timeout=360) | ||
test.log.debug("Succeed to boot %s", vm_name) | ||
if test_cmd is not None: | ||
output = session.cmd(test_cmd) | ||
if not re.search(expected_output, output): | ||
test.fail(f"Couldn't get {expected_output}, got instead {output}") | ||
test.log.debug("Succeed to set %s", expected_output) | ||
else: | ||
vm.serial_console.read_until_output_matches(check_prompt, timeout=300, | ||
internal_timeout=0.5) | ||
finally: | ||
if session: | ||
session.close() | ||
bkxml.sync() | ||
for file in file_list: | ||
if os.path.exists(file): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters