-
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 * SATA 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 ttysclp0 is the standard on s390x. 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. On s390x, the VM will stop if no bootable medium - such as missing cdrom file - is found. Some tests were written assuming the VM would use the //os/boot element instead of the per-device element by trying to remove only that element. Instead just remove all present boot elements in these cases, no matter where, the test will define the new one that's relevant for the test case. In some boot tests also enable boot for VMs without Secure Boot, where there's no firmware. Add test case that attaches same bootable device twice, this had a bug on s390x recently. s390x currently doesn't have secure boot. Use the first VM and don't set os attributes that relate to secure boot on other archs. Signed-off-by: Sebastian Mitterle <[email protected]>
- Loading branch information
Showing
15 changed files
with
89 additions
and
19 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
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
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,20 @@ 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) | ||
session.close() | ||
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